diff --git a/packages/schematics/src/collection/application/schema.json b/packages/schematics/src/collection/application/schema.json index 26ba30fcf7..8192080222 100644 --- a/packages/schematics/src/collection/application/schema.json +++ b/packages/schematics/src/collection/application/schema.json @@ -4,17 +4,19 @@ "title": "Nx Application Options Schema", "type": "object", "properties": { - "directory": { - "description": "The directory of the new application.", - "type": "string" - }, "name": { "description": "The name of the application.", "type": "string", "$default": { "$source": "argv", "index": 0 - } + }, + "x-prompt": "What name would you like to use for the application?" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string", + "x-prompt": "In which directory should the application be generated?" }, "inlineStyle": { "description": "Specifies if the style will be in the ts file.", @@ -36,7 +38,8 @@ "routing": { "type": "boolean", "description": "Generates a routing module.", - "default": false + "default": false, + "x-prompt": "Would you like to add Angular routing?" }, "prefix": { "type": "string", @@ -47,7 +50,18 @@ "style": { "description": "The file extension to be used for style files.", "type": "string", - "default": "css" + "default": "css", + "x-prompt": { + "message": "Which stylesheet format would you like to use?", + "type": "list", + "items": [ + { "value": "css", "label": "CSS" }, + { "value": "scss", "label": "SCSS [ http://sass-lang.com ]" }, + { "value": "sass", "label": "SASS [ http://sass-lang.com ]" }, + { "value": "less", "label": "LESS [ http://lesscss.org ]" }, + { "value": "styl", "label": "Stylus [ http://stylus-lang.com ]" } + ] + } }, "skipTests": { "description": "Skip creating spec files.", @@ -65,15 +79,26 @@ "default": false, "description": "Do not add dependencies to package.json." }, - "tags": { - "type": "string", - "description": "Add tags to the application (used for linting)" - }, "unitTestRunner": { "type": "string", "enum": ["karma", "jest", "none"], "description": "Test runner to use for unit tests", - "default": "karma" + "default": "karma", + "x-prompt": { + "message": + "Which Unit Test Runner would you like to use for the application?", + "type": "list", + "items": [ + { "value": "karma", "label": "Karma" }, + { "value": "jest", "label": "Jest (https://jestjs.io/)" } + ] + } + }, + "tags": { + "type": "string", + "description": "Add tags to the application (used for linting)", + "x-prompt": + "Which tags would you like to add to the application? (used for linting)" } }, "required": [] diff --git a/packages/schematics/src/collection/library/schema.json b/packages/schematics/src/collection/library/schema.json index 3f5a190bed..a2c9208cd7 100644 --- a/packages/schematics/src/collection/library/schema.json +++ b/packages/schematics/src/collection/library/schema.json @@ -10,11 +10,13 @@ "$default": { "$source": "argv", "index": 0 - } + }, + "x-prompt": "What name would you like to use for the library?" }, "directory": { "type": "string", - "description": "A directory where the app is placed" + "description": "A directory where the app is placed", + "x-prompt": "In which directory should the library be generated?" }, "publishable": { "type": "boolean", @@ -42,36 +44,52 @@ "default": false, "description": "Do not update tsconfig.json for development experience." }, + "parentModule": { + "type": "string", + "description": + "Update the router configuration of the parent module using loadChildren or children, depending on what `lazy` is set to.", + "x-prompt": "Which module should import the library?" + }, "routing": { "type": "boolean", "default": false, - "description": "Add router configuration. See lazy for more information." + "description": "Add router configuration. See lazy for more information.", + "x-prompt": + "Would you like to add a routing configuration to the library?" }, "lazy": { "type": "boolean", "default": false, "description": - "Add RouterModule.forChild when set to true, and a simple array of routes when set to false." + "Add RouterModule.forChild when set to true, and a simple array of routes when set to false.", + "x-prompt": "Will this library be lazy loaded?" }, "module": { "type": "boolean", "default": true, - "description": "Include an NgModule in the library." - }, - "parentModule": { - "type": "string", - "description": - "Update the router configuration of the parent module using loadChildren or children, depending on what `lazy` is set to." + "description": "Include an NgModule in the library.", + "x-prompt": "Would you like to generate an NgModule within the library?" }, "tags": { "type": "string", - "description": "Add tags to the library (used for linting)" + "description": "Add tags to the library (used for linting)", + "x-prompt": + "Which tags would you like to add to the library? (used for linting)" }, "unitTestRunner": { "type": "string", "enum": ["karma", "jest", "none"], "description": "Test runner to use for unit tests", - "default": "karma" + "default": "karma", + "x-prompt": { + "message": + "Which Unit Test Runner would you like to use for the library?", + "type": "list", + "items": [ + { "value": "karma", "label": "Karma" }, + { "value": "jest", "label": "Jest (https://jestjs.io/)" } + ] + } } }, "required": [] diff --git a/packages/schematics/src/collection/ng-add/schema.json b/packages/schematics/src/collection/ng-add/schema.json index 864d3819bf..a3831c211e 100644 --- a/packages/schematics/src/collection/ng-add/schema.json +++ b/packages/schematics/src/collection/ng-add/schema.json @@ -7,7 +7,9 @@ "properties": { "npmScope": { "type": "string", - "description": "Npm scope for importing libs." + "description": "Npm scope for importing libs.", + "x-prompt": + "What is the npm scope you would like to use for your Nx Workspace?" }, "skipInstall": { "type": "boolean", diff --git a/packages/schematics/src/collection/ng-new/schema.json b/packages/schematics/src/collection/ng-new/schema.json index cc5052f72f..90389d2856 100644 --- a/packages/schematics/src/collection/ng-new/schema.json +++ b/packages/schematics/src/collection/ng-new/schema.json @@ -4,12 +4,6 @@ "title": "Create an empty workspace", "type": "object", "properties": { - "directory": { - "type": "string", - "format": "path", - "description": "The directory name to create the workspace in.", - "default": "" - }, "name": { "description": "The name of the workspace.", "type": "string", @@ -17,11 +11,20 @@ "$default": { "$source": "argv", "index": 0 - } + }, + "x-prompt": "What name would you like to use for the workspace?" + }, + "directory": { + "type": "string", + "format": "path", + "description": "The directory name to create the workspace in.", + "default": "" }, "npmScope": { "type": "string", - "description": "Npm scope for importing libs." + "description": "Npm scope for importing libs.", + "x-prompt": + "What is the npm scope you would like to use for your Nx Workspace?" }, "skipInstall": { "description": "Skip installing dependency packages.", @@ -36,7 +39,16 @@ }, "packageManager": { "type": "string", - "description": "Package manager used in the project." + "description": "Package manager used in the project.", + "x-prompt": { + "message": + "Which Package Manager would you like to use for your workspace?", + "type": "list", + "items": [ + { "value": "npm", "label": "" }, + { "value": "yarn", "label": "Yarn (https://yarnpkg.com/)" } + ] + } }, "commit": { "description": "Initial repository commit information.", diff --git a/packages/schematics/src/collection/ngrx/schema.json b/packages/schematics/src/collection/ngrx/schema.json index 0d2c618ce6..8fa75336f6 100644 --- a/packages/schematics/src/collection/ngrx/schema.json +++ b/packages/schematics/src/collection/ngrx/schema.json @@ -11,7 +11,15 @@ "$default": { "$source": "argv", "index": 0 - } + }, + "x-prompt": "What name would you like to use for the ngrx state?" + }, + "module": { + "type": "string", + "description": + "Path to ngModule; host directory will contain the new '+state' directory (e.g., libs/comments/src/lib/comments-state.module.ts).", + "x-prompt": + "What is the path to the module where this ngrx state should be added to?" }, "directory": { "type": "string", @@ -19,22 +27,19 @@ "description": "Override the name of the folder used to contain/group the NgRx files: contains actions, effects, reducers. selectors. (e.g., +state)" }, - "module": { - "type": "string", - "description": - "Path to ngModule; host directory will contain the new '+state' directory (e.g., libs/comments/src/lib/comments-state.module.ts)." - }, "root": { "type": "boolean", "default": false, "description": - "Add StoreModule.forRoot and EffectsModule.forRoot() instead of forFeature (e.g., --root)." + "Add StoreModule.forRoot and EffectsModule.forRoot() instead of forFeature (e.g., --root).", + "x-prompt": "Is this the root state of the application?" }, "facade": { "type": "boolean", "default": false, "description": - "Create a Facade class for the the Feature (e.g., --facade)." + "Create a Facade class for the the Feature (e.g., --facade).", + "x-prompt": "Would you like to add a Facade to your ngrx state" }, "onlyAddFiles": { "type": "boolean", diff --git a/packages/schematics/src/collection/node-application/schema.json b/packages/schematics/src/collection/node-application/schema.json index 21b359dd3b..6c190ad8ca 100644 --- a/packages/schematics/src/collection/node-application/schema.json +++ b/packages/schematics/src/collection/node-application/schema.json @@ -4,17 +4,19 @@ "title": "Nx Application Options Schema", "type": "object", "properties": { - "directory": { - "description": "The directory of the new application.", - "type": "string" - }, "name": { "description": "The name of the application.", "type": "string", "$default": { "$source": "argv", "index": 0 - } + }, + "x-prompt": "What name would you like to use for the node application?" + }, + "directory": { + "description": "The directory of the new application.", + "type": "string", + "x-prompt": "In which directory should the node application be generated?" }, "framework": { "type": "string", @@ -40,7 +42,9 @@ }, "tags": { "type": "string", - "description": "Add tags to the application (used for linting)" + "description": "Add tags to the application (used for linting)", + "x-prompt": + "Which tags would you like to add to the node application? (used for linting)" } }, "required": [] diff --git a/packages/schematics/src/collection/workspace-schematic/schema.json b/packages/schematics/src/collection/workspace-schematic/schema.json index 65326057fc..788b105e12 100644 --- a/packages/schematics/src/collection/workspace-schematic/schema.json +++ b/packages/schematics/src/collection/workspace-schematic/schema.json @@ -10,7 +10,8 @@ "$default": { "$source": "argv", "index": 0 - } + }, + "x-prompt": "What name would you like to use for the workspace schematic?" }, "skipFormat": { "description": "Skip formatting files",