Skip to content

Commit bac6e75

Browse files
authored
docs(@angular/cli): document available options & JSON schema (#4767)
1 parent 6d5dfa0 commit bac6e75

File tree

10 files changed

+222
-65
lines changed

10 files changed

+222
-65
lines changed

docs/documentation/generate/component.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
`--spec` specifies if a spec file is generated
1818

19-
`--view-encapsulation` (`-ve`) set the view encapsulation strategy
19+
`--view-encapsulation` (`-ve`) specifies the view encapsulation strategy
2020

21-
`--change-detection` (`-cd`) set the change detection strategy
21+
`--change-detection` (`-cd`) specifies the change detection strategy
2222

2323
`--skip-import` allows for skipping the module import
2424

docs/documentation/generate/module.md

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
`ng generate module [name]` generates an NgModule
77

88
## Options
9+
10+
`--flat` flag to indicate if a dir is created
11+
912
`--spec` specifies if a spec file is generated
1013

1114
`--routing` specifies if a routing module file should be generated

packages/@angular/cli/blueprints/class/index.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ export default Blueprint.extend({
77
description: '',
88

99
availableOptions: [
10-
{ name: 'spec', type: Boolean }
10+
{
11+
name: 'spec',
12+
type: Boolean,
13+
description: 'Specifies if a spec file is generated.'
14+
}
1115
],
1216

1317
normalizeEntityName: function (entityName: string) {

packages/@angular/cli/blueprints/component/index.ts

+58-10
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,64 @@ export default Blueprint.extend({
1414
description: '',
1515

1616
availableOptions: [
17-
{ name: 'flat', type: Boolean },
18-
{ name: 'inline-template', type: Boolean, aliases: ['it'] },
19-
{ name: 'inline-style', type: Boolean, aliases: ['is'] },
20-
{ name: 'prefix', type: String, default: null },
21-
{ name: 'spec', type: Boolean },
22-
{ name: 'view-encapsulation', type: String, aliases: ['ve'] },
23-
{ name: 'change-detection', type: String, aliases: ['cd'] },
24-
{ name: 'skip-import', type: Boolean, default: false },
25-
{ name: 'module', type: String, aliases: ['m'] },
26-
{ name: 'export', type: Boolean, default: false }
17+
{
18+
name: 'flat',
19+
type: Boolean,
20+
description: 'Flag to indicate if a dir is created.'
21+
},
22+
{
23+
name: 'inline-template',
24+
type: Boolean,
25+
aliases: ['it'],
26+
description: 'Specifies if the template will be in the ts file.'
27+
},
28+
{
29+
name: 'inline-style',
30+
type: Boolean,
31+
aliases: ['is'],
32+
description: 'Specifies if the style will be in the ts file.'
33+
},
34+
{
35+
name: 'prefix',
36+
type: String,
37+
default: null,
38+
description: 'Specifies whether to use the prefix.'
39+
},
40+
{
41+
name: 'spec',
42+
type: Boolean,
43+
description: 'Specifies if a spec file is generated.'
44+
},
45+
{
46+
name: 'view-encapsulation',
47+
type: String,
48+
aliases: ['ve'],
49+
description: 'Specifies the view encapsulation strategy.'
50+
},
51+
{
52+
name: 'change-detection',
53+
type: String,
54+
aliases: ['cd'],
55+
description: 'Specifies the change detection strategy.'
56+
},
57+
{
58+
name: 'skip-import',
59+
type: Boolean,
60+
default: false,
61+
description: 'Allows for skipping the module import.'
62+
},
63+
{
64+
name: 'module',
65+
type: String,
66+
aliases: ['m'],
67+
description: 'Allows specification of the declaring module.'
68+
},
69+
{
70+
name: 'export',
71+
type: Boolean,
72+
default: false,
73+
description: 'Specifies if declaring module exports the component.'
74+
}
2775
],
2876

2977
beforeInstall: function (options: any) {

packages/@angular/cli/blueprints/directive/index.ts

+33-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,39 @@ export default Blueprint.extend({
1414
description: '',
1515

1616
availableOptions: [
17-
{ name: 'flat', type: Boolean },
18-
{ name: 'prefix', type: String, default: null },
19-
{ name: 'spec', type: Boolean },
20-
{ name: 'skip-import', type: Boolean, default: false },
21-
{ name: 'module', type: String, aliases: ['m'] },
22-
{ name: 'export', type: Boolean, default: false }
17+
{
18+
name: 'flat',
19+
type: Boolean,
20+
description: 'Flag to indicate if a dir is created.'
21+
},
22+
{
23+
name: 'prefix',
24+
type: String,
25+
default: null,
26+
description: 'Specifies whether to use the prefix.'
27+
},
28+
{
29+
name: 'spec',
30+
type: Boolean,
31+
description: 'Specifies if a spec file is generated.'
32+
},
33+
{
34+
name: 'skip-import',
35+
type: Boolean,
36+
default: false,
37+
description: 'Allows for skipping the module import.'
38+
},
39+
{
40+
name: 'module',
41+
type: String, aliases: ['m'],
42+
description: 'Allows specification of the declaring module.'
43+
},
44+
{
45+
name: 'export',
46+
type: Boolean,
47+
default: false,
48+
description: 'Specifies if declaring module exports the component.'
49+
}
2350
],
2451

2552
beforeInstall: function(options: any) {

packages/@angular/cli/blueprints/module/index.ts

+16-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,22 @@ export default Blueprint.extend({
77
description: '',
88

99
availableOptions: [
10-
{ name: 'spec', type: Boolean },
11-
{ name: 'flat', type: Boolean },
12-
{ name: 'routing', type: Boolean, default: false }
10+
{
11+
name: 'spec',
12+
type: Boolean,
13+
description: 'Specifies if a spec file is generated.'
14+
},
15+
{
16+
name: 'flat',
17+
type: Boolean,
18+
description: 'Flag to indicate if a dir is created.'
19+
},
20+
{
21+
name: 'routing',
22+
type: Boolean,
23+
default: false,
24+
description: 'Specifies if a routing module file should be generated.'
25+
}
1326
],
1427

1528
normalizeEntityName: function (entityName: string) {

packages/@angular/cli/blueprints/ng2/files/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "<%= htmlComponentName %>",
33
"version": "0.0.0",
44
"license": "MIT",
5-
"angular-cli": {},
65
"scripts": {
76
"ng": "ng",
87
"start": "ng serve",

packages/@angular/cli/blueprints/pipe/index.ts

+28-5
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,34 @@ export default Blueprint.extend({
1414
description: '',
1515

1616
availableOptions: [
17-
{ name: 'flat', type: Boolean },
18-
{ name: 'spec', type: Boolean },
19-
{ name: 'skip-import', type: Boolean, default: false },
20-
{ name: 'module', type: String, aliases: ['m'] },
21-
{ name: 'export', type: Boolean, default: false }
17+
{
18+
name: 'flat',
19+
type: Boolean,
20+
description: 'Flag to indicate if a dir is created.'
21+
},
22+
{
23+
name: 'spec',
24+
type: Boolean,
25+
description: 'Specifies if a spec file is generated.'
26+
},
27+
{
28+
name: 'skip-import',
29+
type: Boolean,
30+
default: false,
31+
description: 'Allows for skipping the module import.'
32+
},
33+
{
34+
name: 'module',
35+
type: String,
36+
aliases: ['m'],
37+
description: 'Allows specification of the declaring module.'
38+
},
39+
{
40+
name: 'export',
41+
type: Boolean,
42+
default: false,
43+
description: 'Specifies if declaring module exports the pipe.'
44+
}
2245
],
2346

2447
beforeInstall: function(options: any) {

packages/@angular/cli/blueprints/service/index.ts

+15-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,21 @@ export default Blueprint.extend({
1414
description: '',
1515

1616
availableOptions: [
17-
{ name: 'flat', type: Boolean },
18-
{ name: 'spec', type: Boolean },
19-
{ name: 'module', type: String, aliases: ['m'] }
17+
{
18+
name: 'flat',
19+
type: Boolean,
20+
description: 'Flag to indicate if a dir is created.'
21+
},
22+
{
23+
name: 'spec',
24+
type: Boolean,
25+
description: 'Specifies if a spec file is generated.'
26+
},
27+
{
28+
name: 'module',
29+
type: String, aliases: ['m'],
30+
description: 'Allows specification of the declaring module.'
31+
}
2032
],
2133

2234
beforeInstall: function(options: any) {

0 commit comments

Comments
 (0)