Skip to content

Commit e2b050f

Browse files
Broccohansl
authored andcommitted
fix(@schematics/angular): Clean up schematic options
1 parent bd18678 commit e2b050f

24 files changed

Lines changed: 323 additions & 88 deletions

File tree

packages/schematics/angular/app-shell/schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
},
8181
"sourceDir": {
8282
"type": "string",
83+
"description": "The path of the source directory.",
8384
"default": "src",
8485
"alias": "sd"
8586
}

packages/schematics/angular/application/schema.d.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@ export interface Schema {
1111
* The directory name to create the app in.
1212
*/
1313
directory: string;
14+
/**
15+
* The path of the application.
16+
*/
1417
path?: string;
18+
/**
19+
* The path of the source directory.
20+
*/
1521
sourceDir?: string;
22+
/**
23+
* The name of the application.
24+
*/
1625
name: string;
1726
/**
1827
* Specifies if the style will be in the ts file.
@@ -30,7 +39,13 @@ export interface Schema {
3039
* Specifies the change detection strategy.
3140
*/
3241
changeDetection?: ('Default' | 'OnPush');
42+
/**
43+
* The version of the Angular CLI to use.
44+
*/
3345
version?: string;
46+
/**
47+
* Generates a routing module.
48+
*/
3449
routing?: boolean;
3550
/**
3651
* The prefix to apply to generated selectors.
@@ -49,11 +64,11 @@ export interface Schema {
4964
*/
5065
skipGit?: boolean;
5166
/**
52-
* Should create a minimal app.
67+
* Create a minimal app (no test structure, inline styles/templates).
5368
*/
5469
minimal?: boolean;
5570
/**
56-
* Should install the @angular/service-worker.
71+
* Installs the @angular/service-worker.
5772
*/
5873
serviceWorker?: boolean;
5974
}

packages/schematics/angular/application/schema.json

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@
1111
},
1212
"path": {
1313
"type": "string",
14-
"default": "src"
14+
"description": "The path of the application.",
15+
"default": "src",
16+
"visible": false
1517
},
1618
"sourceDir": {
1719
"type": "string",
20+
"description": "The path of the source directory.",
1821
"default": "src",
19-
"alias": "sd"
22+
"alias": "sd",
23+
"visible": false
2024
},
2125
"name": {
26+
"description": "The name of the application.",
2227
"type": "string"
2328
},
2429
"inlineStyle": {
@@ -45,10 +50,13 @@
4550
"default": "Default"
4651
},
4752
"version": {
48-
"type": "string"
53+
"type": "string",
54+
"description": "The version of the Angular CLI to use.",
55+
"visible": false
4956
},
5057
"routing": {
5158
"type": "boolean",
59+
"description": "Generates a routing module.",
5260
"default": false
5361
},
5462
"prefix": {
@@ -75,12 +83,12 @@
7583
"alias": "sg"
7684
},
7785
"minimal": {
78-
"description": "Should create a minimal app.",
86+
"description": "Create a minimal app (no test structure, inline styles/templates).",
7987
"type": "boolean",
8088
"default": false
8189
},
8290
"serviceWorker": {
83-
"description": "Should install the @angular/service-worker.",
91+
"description": "Installs the @angular/service-worker.",
8492
"type": "boolean",
8593
"default": false
8694
}

packages/schematics/angular/class/schema.d.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,22 @@
77
*/
88

99
export interface Schema {
10+
/**
11+
* The name of the class.
12+
*/
1013
name: string;
11-
appRoot?: string;
14+
/**
15+
* The path to create the class.
16+
*/
1217
path?: string;
18+
/**
19+
* The path of the source directory.
20+
*/
1321
sourceDir?: string;
22+
/**
23+
* The root of the application.
24+
*/
25+
appRoot?: string;
1426
/**
1527
* Specifies if a spec file is generated.
1628
*/

packages/schematics/angular/class/schema.json

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,25 @@
55
"type": "object",
66
"properties": {
77
"name": {
8-
"type": "string"
9-
},
10-
"appRoot": {
11-
"type": "string"
8+
"type": "string",
9+
"description": "The name of the class."
1210
},
1311
"path": {
1412
"type": "string",
15-
"default": "app"
13+
"description": "The path to create the class.",
14+
"default": "app",
15+
"visible": false
1616
},
1717
"sourceDir": {
1818
"type": "string",
19-
"default": "src"
19+
"description": "The path of the source directory.",
20+
"default": "src",
21+
"visible": false
22+
},
23+
"appRoot": {
24+
"type": "string",
25+
"description": "The root of the application.",
26+
"visible": false
2027
},
2128
"spec": {
2229
"type": "boolean",
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<% if (htmlTemplate) { %><%= htmlTemplate %><% } else { %><p>
1+
<p>
22
<%= dasherize(name) %> works!
3-
</p><% } %>
3+
</p>

packages/schematics/angular/component/index_spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ describe('Component Schematic', () => {
2424
inlineStyle: false,
2525
inlineTemplate: false,
2626
changeDetection: 'Default',
27-
routing: false,
2827
styleext: 'css',
2928
spec: true,
3029
module: undefined,

packages/schematics/angular/component/schema.d.ts

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,21 @@
77
*/
88

99
export interface Schema {
10+
/**
11+
* The path to create the component.
12+
*/
1013
path?: string;
11-
appRoot?: string;
14+
/**
15+
* The path of the source directory.
16+
*/
1217
sourceDir?: string;
18+
/**
19+
* The root of the application.
20+
*/
21+
appRoot?: string;
22+
/**
23+
* The name of the component.
24+
*/
1325
name: string;
1426
/**
1527
* Specifies if the style will be in the ts file.
@@ -27,7 +39,6 @@ export interface Schema {
2739
* Specifies the change detection strategy.
2840
*/
2941
changeDetection?: ('Default' | 'OnPush');
30-
routing?: boolean;
3142
/**
3243
* The prefix to apply to generated selectors.
3344
*/
@@ -36,13 +47,21 @@ export interface Schema {
3647
* The file extension to be used for style files.
3748
*/
3849
styleext?: string;
50+
/**
51+
* Specifies if a spec file is generated.
52+
*/
3953
spec?: boolean;
4054
/**
4155
* Flag to indicate if a dir is created.
4256
*/
4357
flat?: boolean;
44-
htmlTemplate?: string;
58+
/**
59+
* Flag to skip the module import.
60+
*/
4561
skipImport?: boolean;
62+
/**
63+
* The selector to use for the component.
64+
*/
4665
selector?: string;
4766
/**
4867
* Allows specification of the declaring module.

packages/schematics/angular/component/schema.json

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
{
22
"$schema": "http://json-schema.org/schema",
33
"id": "SchematicsAngularComponent",
4-
"title": "Angular Application Options Schema",
4+
"title": "Angular Component Options Schema",
55
"type": "object",
66
"properties": {
77
"path": {
88
"type": "string",
9-
"default": "app"
10-
},
11-
"appRoot": {
12-
"type": "string"
9+
"description": "The path to create the component.",
10+
"default": "app",
11+
"visible": false
1312
},
1413
"sourceDir": {
1514
"type": "string",
15+
"description": "The path of the source directory.",
1616
"default": "src",
17-
"alias": "sd"
17+
"alias": "sd",
18+
"visible": false
19+
},
20+
"appRoot": {
21+
"type": "string",
22+
"description": "The root of the application.",
23+
"visible": false
1824
},
1925
"name": {
20-
"type": "string"
26+
"type": "string",
27+
"description": "The name of the component."
2128
},
2229
"inlineStyle": {
2330
"description": "Specifies if the style will be in the ts file.",
@@ -44,10 +51,6 @@
4451
"default": "Default",
4552
"alias": "cd"
4653
},
47-
"routing": {
48-
"type": "boolean",
49-
"default": false
50-
},
5154
"prefix": {
5255
"type": "string",
5356
"description": "The prefix to apply to generated selectors.",
@@ -61,22 +64,22 @@
6164
},
6265
"spec": {
6366
"type": "boolean",
67+
"description": "Specifies if a spec file is generated.",
6468
"default": true
6569
},
6670
"flat": {
6771
"type": "boolean",
6872
"description": "Flag to indicate if a dir is created.",
6973
"default": false
7074
},
71-
"htmlTemplate": {
72-
"type": "string"
73-
},
7475
"skipImport": {
7576
"type": "boolean",
77+
"description": "Flag to skip the module import.",
7678
"default": false
7779
},
7880
"selector": {
79-
"type": "string"
81+
"type": "string",
82+
"description": "The selector to use for the component."
8083
},
8184
"module": {
8285
"type": "string",

packages/schematics/angular/directive/schema.d.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,37 @@
77
*/
88

99
export interface Schema {
10+
/**
11+
* The name of the directive.
12+
*/
1013
name: string;
14+
/**
15+
* The path to create the directive.
16+
*/
1117
path?: string;
18+
/**
19+
* The root of the application.
20+
*/
1221
appRoot?: string;
1322
/**
1423
* The prefix to apply to generated selectors.
1524
*/
1625
prefix?: string;
26+
/**
27+
* The path of the source directory.
28+
*/
1729
sourceDir?: string;
1830
/**
1931
* Specifies if a spec file is generated.
2032
*/
2133
spec?: boolean;
34+
/**
35+
* Flag to skip the module import.
36+
*/
2237
skipImport?: boolean;
38+
/**
39+
* The selector to use for the directive.
40+
*/
2341
selector?: string;
2442
/**
2543
* Flag to indicate if a dir is created.

0 commit comments

Comments
 (0)