Skip to content

Commit a269d36

Browse files
committed
feat(ng-add): add x-prompts to install schematics
* Recently the Angular CLI project introduced prompt support for schematics. Even though they seem to not run when using `7.0.0-beta.2` of the CLI, we should already ship the simple prompts for the `ng add` command. * Renames the `/schematics/install` folder to `/schematics/ng-add`. (this makes it consistent with the actual schematic name and other packages that ship the `ng-add` schematic (e.g. `@angular/elements`)
1 parent 9886b1b commit a269d36

File tree

12 files changed

+9
-7
lines changed

12 files changed

+9
-7
lines changed

src/lib/schematics/collection.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
// Adds Angular Material to an application without changing any templates
66
"ng-add": {
77
"description": "Adds Angular Material to the application without affecting any templates",
8-
"factory": "./install",
9-
"schema": "./install/schema.json",
8+
"factory": "./ng-add/index",
9+
"schema": "./ng-add/schema.json",
1010
"aliases": ["material-shell", "install"]
1111
},
1212
// Create a dashboard component

src/lib/schematics/install/index.spec.ts renamed to src/lib/schematics/ng-add/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {collectionPath, createTestApp} from '../test-setup/test-app';
88
import {getWorkspace, WorkspaceProject} from '@schematics/angular/utility/config';
99
import {normalize} from '@angular-devkit/core';
1010

11-
describe('material-install-schematic', () => {
11+
describe('ng-add schematic', () => {
1212
let runner: SchematicTestRunner;
1313
let appTree: Tree;
1414

src/lib/schematics/install/schema.json renamed to src/lib/schematics/ng-add/schema.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "http://json-schema.org/schema",
3-
"id": "SchematicsMaterialInstall",
4-
"title": "Material Install Options Schema",
3+
"id": "angular-material-ng-add",
4+
"title": "Angular Material ng-add schematic",
55
"type": "object",
66
"properties": {
77
"project": {
@@ -19,12 +19,14 @@
1919
"theme": {
2020
"enum": ["indigo-pink", "deeppurple-amber", "pink-bluegrey", "purple-green", "custom"],
2121
"default": "indigo-pink",
22-
"description": "The theme to apply"
22+
"description": "The theme to apply",
23+
"x-prompt": "What theme would you like to generate?"
2324
},
2425
"gestures": {
2526
"type": "boolean",
2627
"default": true,
27-
"description": "Whether gesture support should be set up or not."
28+
"description": "Whether gesture support should be set up or not.",
29+
"x-prompt": "Would you like to set up gesture support?"
2830
}
2931
},
3032
"required": []

0 commit comments

Comments
 (0)