Skip to content

Commit

Permalink
fix(core): skip-swagger-lib should be true while experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Jul 25, 2022
1 parent 1751f86 commit 92cd2d8
Show file tree
Hide file tree
Showing 29 changed files with 618 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/core/generators/application.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Generate a dotnet project under the application directory.

### skipSwaggerLib

- (): By default, if using webapi template, an additional library is scaffolded for swagger files. This skips that setup.
- (boolean): By default, if using webapi template, an additional library is scaffolded for swagger files. This skips that setup.

### pathScheme

Expand Down
2 changes: 1 addition & 1 deletion docs/core/generators/library.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Generate a dotnet project under the library directory.

### skipSwaggerLib

- (): By default, if using webapi template, an additional library is scaffolded for swagger files. This skips that setup.
- (boolean): By default, if using webapi template, an additional library is scaffolded for swagger files. This skips that setup.

### pathScheme

Expand Down
2 changes: 1 addition & 1 deletion e2e/core-e2e/tests/nx-dotnet.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ public class UnitTest1
it('should generate swagger project for webapi', async () => {
const api = uniq('api');
await runNxCommandAsync(
`generate @nx-dotnet/core:app ${api} --language="C#" --template="webapi"`,
`generate @nx-dotnet/core:app ${api} --language="C#" --template="webapi" --skipSwaggerLib=false`,
);

expect(() => checkFilesExist(`apps/${api}`)).not.toThrow();
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"@types/is-ci": "^3.0.0",
"@types/jest": "27.4.1",
"@types/node": "17.0.18",
"@types/node-fetch": "^2.6.2",
"@types/react": "18.0.8",
"@types/react-dom": "18.0.3",
"@types/rimraf": "^3.0.2",
Expand All @@ -95,6 +96,7 @@
"jsonc-eslint-parser": "^2.1.0",
"kill-port": "^1.6.1",
"lint-staged": "^12.3.4",
"node-fetch": "2.6.6",
"nx": "14.2.2",
"openapi-types": "^11.0.1",
"prettier": "2.6.2",
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/generators/app/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"aliases": ["solution", "s"]
},
"skipSwaggerLib": {
"type": "boolean",
"description": "By default, if using webapi template, an additional library is scaffolded for swagger files. This skips that setup.",
"default": true
},
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/generators/lib/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@
"aliases": ["solution", "s"]
},
"skipSwaggerLib": {
"type": "boolean",
"description": "By default, if using webapi template, an additional library is scaffolded for swagger files. This skips that setup.",
"default": false
"default": true
},
"pathScheme": {
"description": "Determines if the project should follow NX or dotnet path naming conventions",
Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/generators/utils/generate-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ export async function GenerateProject(
await manipulateXmlProjectFile(host, normalizedOptions);
}

if (normalizedOptions.projectTemplate === 'webapi') {
if (
normalizedOptions.projectTemplate === 'webapi' &&
!normalizedOptions.skipSwaggerLib
) {
await generateSwaggerSetup(host, {
project: normalizedOptions.projectName,
swaggerProject: `${normalizedOptions.projectName}-swagger`,
Expand Down
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/cs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Jazyk: 'languages',
'Krátký název': 'shortNames',
Značky: 'tags',
'Název šablony': 'templateName',
Šablony: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/de.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Sprache: 'languages',
Kurzname: 'shortNames',
Tags: 'tags',
Vorlagenname: 'templateName',
Vorlagen: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/en.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Language: 'languages',
'Short Name': 'shortNames',
Tags: 'tags',
Templates: 'templateName',
'Template Name': 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/es.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Idioma: 'languages',
'Nombre corto': 'shortNames',
Etiquetas: 'tags',
'Nombre de la plantilla': 'templateName',
Plantillas: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/fr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Langue: 'languages',
'Nom court': 'shortNames',
Balises: 'tags',
'Nom du modèle': 'templateName',
Modèles: 'templateName',
};
45 changes: 45 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

import { DotnetTemplate } from '../../models';

import { FieldNameMap as EnFieldMap } from './en';
import { FieldNameMap as CsFieldMap } from './cs';
import { FieldNameMap as DeFieldMap } from './de';
import { FieldNameMap as EsFieldMap } from './es';
import { FieldNameMap as FrFieldMap } from './fr';
import { FieldNameMap as ItFieldMap } from './it';
import { FieldNameMap as JaFieldMap } from './ja';
import { FieldNameMap as KoFieldMap } from './ko';
import { FieldNameMap as PlFieldMap } from './pl';
import { FieldNameMap as PtBRFieldMap } from './pt-BR';
import { FieldNameMap as RuFieldMap } from './ru';
import { FieldNameMap as TrFieldMap } from './tr';
import { FieldNameMap as ZhHansFieldMap } from './zh-Hans';
import { FieldNameMap as ZhHantFieldMap } from './zh-Hant';

export const CombinedFieldMap = {
...EnFieldMap,
...CsFieldMap,
...DeFieldMap,
...EsFieldMap,
...FrFieldMap,
...ItFieldMap,
...JaFieldMap,
...KoFieldMap,
...PlFieldMap,
...PtBRFieldMap,
...RuFieldMap,
...TrFieldMap,
...ZhHansFieldMap,
...ZhHantFieldMap,
} as unknown as Record<string, keyof DotnetTemplate>;
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/it.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Lingua: 'languages',
'Nome breve': 'shortNames',
Tag: 'tags',
'Nome modello': 'templateName',
Modelli: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/ja.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
言語: 'languages',
短い名前: 'shortNames',
タグ: 'tags',
テンプレート名: 'templateName',
テンプレート: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/ko.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
언어: 'languages',
'약식 이름': 'shortNames',
태그: 'tags',
'템플릿 이름': 'templateName',
템플릿: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/pl.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Język: 'languages',
'Skrócona nazwa': 'shortNames',
Tagi: 'tags',
'Nazwa szablonu': 'templateName',
Szablony: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/pt-BR.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Idioma: 'languages',
'Nome Curto': 'shortNames',
Tags: 'tags',
'Nome do modelo': 'templateName',
Modelos: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/ru.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Язык: 'languages',
'Короткое имя': 'shortNames',
Теги: 'tags',
'Имя шаблона': 'templateName',
Шаблоны: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/tr.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
Dil: 'languages',
'Kısa Ad': 'shortNames',
Etiketler: 'tags',
'Şablon Adı': 'templateName',
Şablonlar: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/zh-Hans.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
语言: 'languages',
短名称: 'shortNames',
标记: 'tags',
模板名: 'templateName',
模板: 'templateName',
};
19 changes: 19 additions & 0 deletions packages/dotnet/src/lib/utils/language-mappings/zh-Hant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀 DO NOT EDIT THIS FILE 💀⚡💀

/*////////////////////////////////////////////////////////////////////////////////////////////////
##### ##### ##### ##### | This file is autogenerated using an Nx workspace schematic.
# # # # # # | Manual changes should not be needed. After adding your feature
##### # # # ##### | to software security, simply regenerate this file by running
# # # # # | `nx workspace-schematic update-dotnet-localization-files`. If there is an issue
##### # ##### # | with the generated file, check tools/generators/update-dotnet-localization-files
////////////////////////////////////////////////////////////////////////////////////////////////*/

export const FieldNameMap = {
語言: 'languages',
簡短名稱: 'shortNames',
標記: 'tags',
範本名稱: 'templateName',
範本: 'templateName',
};
Loading

0 comments on commit 92cd2d8

Please sign in to comment.