Skip to content
This repository was archived by the owner on Nov 21, 2024. It is now read-only.

Commit 6569968

Browse files
committed
fix: Add new type "all" in all generators
1 parent 6a3c0c5 commit 6569968

6 files changed

Lines changed: 29 additions & 29 deletions

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ OPTIONS
9292
-a, --author=author Author name (it is recommended to use Github user for better integration).
9393
-e, --email=email Author email name.
9494
-h, --help show CLI help
95-
-t, --type=web|ionic|nestjs Type(s) of applications.
95+
-t, --type=web|ionic|nestjs|all Type(s) of applications.
9696
-w, --workspace=workspace The workspace directory name.
9797
9898
--api=api [default: /api] The backend api address (/api, http://host.com/api,
@@ -124,7 +124,7 @@ USAGE
124124
125125
OPTIONS
126126
-h, --help show CLI help
127-
-t, --type=web|ionic|nestjs Type(s) of entities.
127+
-t, --type=web|ionic|nestjs|all Type(s) of entities.
128128
-w, --workspace=workspace The workspace directory name.
129129
--coreLib=coreLib The name of the core library.
130130
--coreTemplate=coreTemplate [default: @rucken/schematics:rucken-entity] Model generator and frontend application
@@ -164,7 +164,7 @@ USAGE
164164
165165
OPTIONS
166166
-h, --help show CLI help
167-
-t, --type=web|ionic Type(s) of applications.
167+
-t, --type=web|ionic|all Type(s) of applications.
168168
-w, --workspace=workspace The workspace directory name.
169169
--coreLib=coreLib The name of the core library with entity.
170170
--ionicApp=ionicApp The name of the ionic application.
@@ -201,7 +201,7 @@ OPTIONS
201201
-e, --email=email Author email name.
202202
-h, --help show CLI help
203203
-o, --org=org The name of organization.
204-
-t, --type=frontend|nestjs Type(s) of library.
204+
-t, --type=frontend|nestjs|all Type(s) of library.
205205
-w, --workspace=workspace The workspace directory name.
206206
--frontendTemplate=frontendTemplate [default: @rucken/schematics:rucken-lib] Frontend library generator
207207
@@ -225,7 +225,7 @@ USAGE
225225
226226
OPTIONS
227227
-h, --help show CLI help
228-
-t, --type=frontend|nestjs Type(s) of applications.
228+
-t, --type=frontend|nestjs|all Type(s) of applications.
229229
-w, --workspace=workspace The workspace directory name.
230230
--frontendApp=frontendApp The name of the frontend frontend application.
231231
--frontendLib=frontendLib The name of the frontend library.

src/commands/generator-application.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class Application extends Command {
99
static aliases = ['application', 'app'];
1010
static description = 'Application generator, based on the Rucken template';
1111
static flags = {
12-
type: flags.string({ char: 't', description: 'Type(s) of applications.', multiple: true, options: ['web', 'ionic', 'nestjs'] }),
12+
type: flags.string({ char: 't', description: 'Type(s) of applications.', multiple: true, options: ['web', 'ionic', 'nestjs', 'all'] }),
1313
author: flags.string({ char: 'a', description: 'Author name (it is recommended to use Github user for better integration).' }),
1414
email: flags.string({ char: 'e', description: 'Author email name.' }),
1515
api: flags.string({ description: 'The backend api address (/api, http://host.com/api, https://api.host.com).', default: '/api' }),
@@ -51,7 +51,7 @@ export class Application extends Command {
5151
name: 'type',
5252
message: 'What type(s) would you like to create for the application(s)?',
5353
type: 'checkbox',
54-
choices: ['web', 'ionic', 'nestjs'],
54+
choices: ['web', 'ionic', 'nestjs', 'all'],
5555
validate: (value: string) => value.length > 0
5656
}] : []
5757
),
@@ -90,15 +90,15 @@ export class Application extends Command {
9090
const nestjsTemplate = flags.nestjsTemplate;
9191
const ionicTemplate = flags.ionicTemplate;
9292
// web
93-
if (type.indexOf('web') !== -1) {
93+
if (type.indexOf('web') !== -1 || type.indexOf('all') !== -1) {
9494
await this.prepareWeb(angularJson, name, nxJson, webTemplate, author, email, api, workspace);
9595
}
9696
// ionic
97-
if (type.indexOf('ionic') !== -1) {
97+
if (type.indexOf('ionic') !== -1 || type.indexOf('all') !== -1) {
9898
await this.prepareIonic(angularJson, name, nxJson, ionicTemplate, author, email, api, workspace);
9999
}
100100
// nestjs
101-
if (type.indexOf('nestjs') !== -1) {
101+
if (type.indexOf('nestjs') !== -1 || type.indexOf('all') !== -1) {
102102
await this.prepareNestjs(angularJson, name, nxJson, nestjsTemplate, author, email, api, workspace);
103103
}
104104
} catch (error) {

src/commands/generator-entity-to-application.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class EntityToApplication extends Command {
99
static aliases = ['entity-to-application', 'entity-to-app', 'entity2app'];
1010
static description = 'Linking the entity to the application, based on the Rucken template';
1111
static flags = {
12-
type: flags.string({ char: 't', description: 'Type(s) of applications.', multiple: true, options: ['web', 'ionic'] }),
12+
type: flags.string({ char: 't', description: 'Type(s) of applications.', multiple: true, options: ['web', 'ionic', 'all'] }),
1313
coreLib: flags.string({ description: 'The name of the core library with entity.' }),
1414
webLib: flags.string({ description: 'The name of the web library with entity.' }),
1515
ionicLib: flags.string({ description: 'The name of the ionic library with entity.' }),
@@ -52,7 +52,7 @@ export class EntityToApplication extends Command {
5252
name: 'type',
5353
message: 'What type(s) of entity would you like to link for the application(s)?',
5454
type: 'checkbox',
55-
choices: ['web', 'ionic'],
55+
choices: ['web', 'ionic', 'all'],
5656
validate: (value: string) => value.length > 0
5757
}] : []
5858
)
@@ -75,16 +75,16 @@ export class EntityToApplication extends Command {
7575
const webTemplate = flags.webTemplate;
7676
const ionicTemplate = flags.ionicTemplate;
7777
// core
78-
if (type.indexOf('web') !== -1 || type.indexOf('ionic') !== -1) {
78+
if (type.indexOf('web') !== -1 || type.indexOf('ionic') !== -1 || type.indexOf('all') !== -1) {
7979
({ coreLib, result, coreLibOrg } = await this.prepareCore(name, coreLib, angularJson, nxJson, result, coreLibOrg));
8080
}
8181
// web
82-
if (type.indexOf('web') !== -1) {
82+
if (type.indexOf('web') !== -1 || type.indexOf('all') !== -1) {
8383
({ webLib, webApp, result, webLibOrg } = await this.prepareWeb(name, webLib, webApp, angularJson, nxJson, result, webLibOrg, webTemplate, coreLib, coreLibOrg, workspace));
8484
({ webLib, webApp, result, webLibOrg } = await this.prepareWebApp(name, webLib, webApp, angularJson, nxJson, result, webLibOrg, webTemplate, coreLib, coreLibOrg, workspace));
8585
}
8686
// ionic
87-
if (type.indexOf('ionic') !== -1) {
87+
if (type.indexOf('ionic') !== -1 || type.indexOf('all') !== -1) {
8888
({ ionicLib, ionicApp, result, ionicLibOrg } = await this.prepareIonic(name, ionicLib, ionicApp, angularJson, nxJson, result, ionicLibOrg, ionicTemplate, coreLib, coreLibOrg, workspace));
8989
({ ionicLib, ionicApp, result, ionicLibOrg } = await this.prepareIonicApp(name, ionicLib, ionicApp, angularJson, nxJson, result, ionicLibOrg, ionicTemplate, coreLib, coreLibOrg, workspace));
9090
}

src/commands/generator-entity.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class Entity extends Command {
99
static aliases = ['entity'];
1010
static description = 'The generator of the entity, based on the Rucken template';
1111
static flags = {
12-
type: flags.string({ char: 't', description: 'Type(s) of entities.', multiple: true, options: ['web', 'ionic', 'nestjs'] }),
12+
type: flags.string({ char: 't', description: 'Type(s) of entities.', multiple: true, options: ['web', 'ionic', 'nestjs', 'all'] }),
1313
coreLib: flags.string({ description: 'The name of the core library.' }),
1414
webLib: flags.string({ description: 'The name of the web library.' }),
1515
ionicLib: flags.string({ description: 'The name of the ionic library.' }),
@@ -52,7 +52,7 @@ export class Entity extends Command {
5252
name: 'type',
5353
message: 'What type(s) would you like to create for the entity?',
5454
type: 'checkbox',
55-
choices: ['web', 'ionic', 'nestjs'],
55+
choices: ['web', 'ionic', 'nestjs', 'all'],
5656
validate: (value: string) => value.length > 0
5757
}] : []
5858
)
@@ -75,19 +75,19 @@ export class Entity extends Command {
7575
const ionicTemplate = flags.ionicTemplate;
7676
const nestjsTemplate = flags.nestjsTemplate;
7777
// core
78-
if (type.indexOf('web') !== -1 || type.indexOf('ionic') !== -1) {
78+
if (type.indexOf('web') !== -1 || type.indexOf('ionic') !== -1 || type.indexOf('all') !== -1) {
7979
({ coreLib, result, coreLibOrg } = await this.corePrepare(coreLib, angularJson, nxJson, result, coreLibOrg, coreTemplate, name, workspace));
8080
}
8181
// web
82-
if (type.indexOf('web') !== -1) {
82+
if (type.indexOf('web') !== -1 || type.indexOf('all') !== -1) {
8383
({ webLib, result, webLibOrg } = await this.webPrepare(webLib, angularJson, nxJson, result, webLibOrg, webTemplate, name, coreLib, coreLibOrg, workspace));
8484
}
8585
// ionic
86-
if (type.indexOf('ionic') !== -1) {
86+
if (type.indexOf('ionic') !== -1 || type.indexOf('all') !== -1) {
8787
({ ionicLib, result, ionicLibOrg } = await this.ionicPrepare(ionicLib, angularJson, nxJson, result, ionicLibOrg, ionicTemplate, name, coreLib, coreLibOrg, workspace));
8888
}
8989
// nestjs
90-
if (type.indexOf('nestjs') !== -1) {
90+
if (type.indexOf('nestjs') !== -1 || type.indexOf('all') !== -1) {
9191
({ nestjsLib, result, nestjsLibOrg } = await this.prepareNestjs(nestjsLib, angularJson, nxJson, result, nestjsLibOrg, nestjsTemplate, name, timestamp, workspace));
9292
}
9393
} catch (error) {

src/commands/generator-library-to-application.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class LibraryToApplication extends Command {
99
static aliases = ['library-to-application', 'lib-to-app', 'lib2app'];
1010
static description = 'Linking the library to the application, based on the Rucken template';
1111
static flags = {
12-
type: flags.string({ char: 't', description: 'Type(s) of applications.', multiple: true, options: ['frontend', 'nestjs'] }),
12+
type: flags.string({ char: 't', description: 'Type(s) of applications.', multiple: true, options: ['frontend', 'nestjs', 'all'] }),
1313
frontendLib: flags.string({ description: 'The name of the frontend library.' }),
1414
nestjsLib: flags.string({ description: 'The name of the nestjs library.' }),
1515

@@ -41,7 +41,7 @@ export class LibraryToApplication extends Command {
4141
name: 'type',
4242
message: 'What type(s) of library would you like to link for the application(s)?',
4343
type: 'checkbox',
44-
choices: ['frontend', 'nestjs'],
44+
choices: ['frontend', 'nestjs', 'all'],
4545
validate: (value: string) => value.length > 0
4646
}] : []
4747
)
@@ -62,12 +62,12 @@ export class LibraryToApplication extends Command {
6262
const nestjsTemplate = flags.nestjsTemplate;
6363

6464
// frontend
65-
if (type.indexOf('frontend') !== -1) {
65+
if (type.indexOf('frontend') !== -1 || type.indexOf('all') !== -1) {
6666
({ frontendLib, frontendApp, result, frontendLibOrg } = await this.prepareFrontend(frontendLib, frontendApp, angularJson, nxJson, result, frontendLibOrg, frontendTemplate, workspace));
6767
({ frontendLib, frontendApp, result, frontendLibOrg } = await this.prepareFrontendApp(frontendLib, frontendApp, angularJson, nxJson, result, frontendLibOrg, frontendTemplate, workspace));
6868
}
6969
// nestjs
70-
if (type.indexOf('nestjs') !== -1) {
70+
if (type.indexOf('nestjs') !== -1 || type.indexOf('all') !== -1) {
7171
({ nestjsLib, nestjsApp, result, nestjsLibOrg } = await this.prepareNestjs(nestjsLib, nestjsApp, angularJson, nxJson, result, nestjsLibOrg, nestjsTemplate, workspace));
7272
({ nestjsLib, nestjsApp, result, nestjsLibOrg } = await this.prepareNestjsApp(nestjsLib, nestjsApp, angularJson, nxJson, result, nestjsLibOrg, nestjsTemplate, workspace));
7373
}

src/commands/generator-library.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export class Library extends Command {
88
static aliases = ['library', 'lib'];
99
static description = 'Library generator, based on the Rucken template';
1010
static flags = {
11-
type: flags.string({ char: 't', description: 'Type(s) of library.', multiple: true, options: ['frontend', 'nestjs'] }),
11+
type: flags.string({ char: 't', description: 'Type(s) of library.', multiple: true, options: ['frontend', 'nestjs', 'all'] }),
1212
author: flags.string({ char: 'a', description: 'Author name (it is recommended to use Github user for better integration).' }),
1313
email: flags.string({ char: 'e', description: 'Author email name.' }),
1414
org: flags.string({ char: 'o', description: 'The name of organization.' }),
@@ -49,7 +49,7 @@ export class Library extends Command {
4949
name: 'type',
5050
message: 'What type(s) would you like to create for the library?',
5151
type: 'checkbox',
52-
choices: ['frontend', 'nestjs'],
52+
choices: ['frontend', 'nestjs', 'all'],
5353
validate: (value: string) => value.length > 0
5454
}] : []
5555
),
@@ -86,11 +86,11 @@ export class Library extends Command {
8686
const frontendTemplate = flags.frontendTemplate;
8787
const nestjsTemplate = flags.nestjsTemplate;
8888
// frontend
89-
if (type.indexOf('frontend') !== -1) {
89+
if (type.indexOf('frontend') !== -1 || type.indexOf('all') !== -1) {
9090
await this.prepareFrontend(angularJson, name, nxJson, frontendTemplate, author, email, org, workspace);
9191
}
9292
// nestjs
93-
if (type.indexOf('nestjs') !== -1) {
93+
if (type.indexOf('nestjs') !== -1 || type.indexOf('all') !== -1) {
9494
await this.prepareNestjs(angularJson, name, nxJson, nestjsTemplate, author, email, org, workspace);
9595
}
9696
} catch (error) {

0 commit comments

Comments
 (0)