Skip to content

Commit 805fc86

Browse files
alan-agius4kara
authored andcommitted
fix(bazel): update ng new schema to match the current ng new schema of @schematics/angular (#31234)
The schema used in ng-new bazel, includes several outdated options. With this update we match the current version of @schematics/angular: https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/ng-new/schema.json Relates to #31233 PR Close #31234
1 parent 23c0171 commit 805fc86

2 files changed

Lines changed: 76 additions & 79 deletions

File tree

‎packages/bazel/src/schematics/ng-new/schema.d.ts‎

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,102 +2,111 @@
22
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
33
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
44

5-
// tslint:disable:no-global-tslint-disable
65
// tslint:disable
7-
86
export interface Schema {
97
/**
10-
* Initial repository commit information.
8+
* Initial git repository commit information.
119
*/
1210
commit?: CommitUnion;
1311
/**
14-
* Flag to toggle creation of an application in the new workspace.
12+
* When true (the default), creates a new initial app project in the src folder of the new
13+
* workspace. When false, creates an empty workspace with no initial app. You can then use
14+
* the generate application command so that all apps are created in the projects folder.
1515
*/
1616
createApplication?: boolean;
1717
/**
1818
* The directory name to create the workspace in.
1919
*/
2020
directory?: string;
2121
/**
22-
* EXPERIMENTAL: Specifies whether to create a new application which uses the Ivy rendering
23-
* engine.
22+
* When true, creates a new app that uses the Ivy rendering engine.
2423
*/
25-
experimentalIvy?: boolean;
24+
enableIvy?: boolean;
2625
/**
27-
* Specifies if the style will be in the ts file.
26+
* When true, includes styles inline in the component TS file. By default, an external
27+
* styles file is created and referenced in the component TS file.
2828
*/
2929
inlineStyle?: boolean;
3030
/**
31-
* Specifies if the template will be in the ts file.
31+
* When true, includes template inline in the component TS file. By default, an external
32+
* template file is created and referenced in the component TS file.
3233
*/
3334
inlineTemplate?: boolean;
3435
/**
35-
* Link CLI to global version (internal development only).
36+
* When true, links the CLI to the global version (internal development only).
3637
*/
3738
linkCli?: boolean;
3839
/**
39-
* Create a barebones project without any testing frameworks
40+
* When true, creates a project without any testing frameworks. (Use for learning purposes
41+
* only.)
4042
*/
4143
minimal?: boolean;
4244
/**
43-
* The name of the workspace.
45+
* The name of the new workspace and initial project.
4446
*/
4547
name: string;
4648
/**
47-
* The path where new projects will be created.
49+
* The path where new projects will be created, relative to the new workspace root.
4850
*/
4951
newProjectRoot?: string;
5052
/**
51-
* The prefix to apply to generated selectors.
53+
* The prefix to apply to generated selectors for the initial project.
5254
*/
5355
prefix?: string;
5456
/**
55-
* Generates a routing module.
57+
* When true, generates a routing module for the initial project.
5658
*/
5759
routing?: boolean;
5860
/**
59-
* Skip initializing a git repository.
61+
* When true, does not initialize a git repository.
6062
*/
6163
skipGit?: boolean;
6264
/**
63-
* Skip installing dependency packages.
65+
* When true, does not install dependency packages.
6466
*/
6567
skipInstall?: boolean;
6668
/**
67-
* Skip creating spec files.
69+
* When true, does not generate "spec.ts" test files for the new project.
6870
*/
6971
skipTests?: boolean;
7072
/**
71-
* The file extension to be used for style files.
73+
* The file extension or preprocessor to use for style files.
7274
*/
73-
style?: string;
75+
style?: Style;
7476
/**
7577
* The version of the Angular CLI to use.
7678
*/
7779
version: string;
7880
/**
79-
* Specifies the view encapsulation strategy.
81+
* The view encapsulation strategy to use in the initial project.
8082
*/
8183
viewEncapsulation?: ViewEncapsulation;
8284
}
83-
8485
/**
85-
* Initial repository commit information.
86-
*/
87-
export type CommitUnion = boolean | CommitObject;
88-
86+
* Initial git repository commit information.
87+
*/
88+
export declare type CommitUnion = boolean | CommitObject;
8989
export interface CommitObject {
9090
email: string;
9191
message?: string;
9292
name: string;
9393
}
94-
9594
/**
96-
* Specifies the view encapsulation strategy.
97-
*/
98-
export enum ViewEncapsulation {
99-
Emulated = 'Emulated',
100-
Native = 'Native',
101-
None = 'None',
102-
ShadowDOM = 'ShadowDom',
95+
* The file extension or preprocessor to use for style files.
96+
*/
97+
export declare enum Style {
98+
Css = "css",
99+
Less = "less",
100+
Sass = "sass",
101+
Scss = "scss",
102+
Styl = "styl"
103+
}
104+
/**
105+
* The view encapsulation strategy to use in the initial project.
106+
*/
107+
export declare enum ViewEncapsulation {
108+
Emulated = "Emulated",
109+
Native = "Native",
110+
None = "None",
111+
ShadowDom = "ShadowDom"
103112
}

‎packages/bazel/src/schematics/ng-new/schema.json‎

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,41 @@
99
"description": "The directory name to create the workspace in."
1010
},
1111
"name": {
12-
"description": "The name of the workspace.",
12+
"description": "The name of the new workspace and initial project.",
1313
"type": "string",
1414
"format": "html-selector",
1515
"$default": {
1616
"$source": "argv",
1717
"index": 0
1818
},
19-
"x-prompt": "What name would you like to use for the project?"
19+
"x-prompt": "What name would you like to use for the new workspace and initial project?"
2020
},
21-
"experimentalIvy": {
22-
"description": "EXPERIMENTAL: Specifies whether to create a new application which uses the Ivy rendering engine.",
21+
"enableIvy": {
22+
"description": "When true, creates a new app that uses the Ivy rendering engine.",
2323
"type": "boolean",
2424
"default": false
2525
},
2626
"skipInstall": {
27-
"description": "Skip installing dependency packages.",
27+
"description": "When true, does not install dependency packages.",
2828
"type": "boolean",
2929
"default": false
3030
},
3131
"linkCli": {
32-
"description": "Link CLI to global version (internal development only).",
32+
"description": "When true, links the CLI to the global version (internal development only).",
3333
"type": "boolean",
3434
"default": false,
3535
"visible": false
3636
},
3737
"skipGit": {
38-
"description": "Skip initializing a git repository.",
38+
"description": "When true, does not initialize a git repository.",
3939
"type": "boolean",
4040
"default": false,
4141
"alias": "g"
4242
},
4343
"commit": {
44-
"description": "Initial repository commit information.",
44+
"description": "Initial git repository commit information.",
4545
"oneOf": [
46-
{
47-
"type": "boolean"
48-
},
46+
{ "type": "boolean" },
4947
{
5048
"type": "object",
5149
"properties": {
@@ -69,30 +67,25 @@
6967
"default": true
7068
},
7169
"newProjectRoot": {
72-
"description": "The path where new projects will be created.",
70+
"description": "The path where new projects will be created, relative to the new workspace root.",
7371
"type": "string",
7472
"default": "projects"
7573
},
7674
"inlineStyle": {
77-
"description": "Specifies if the style will be in the ts file.",
75+
"description": "When true, includes styles inline in the component TS file. By default, an external styles file is created and referenced in the component TS file.",
7876
"type": "boolean",
7977
"default": false,
8078
"alias": "s"
8179
},
8280
"inlineTemplate": {
83-
"description": "Specifies if the template will be in the ts file.",
81+
"description": "When true, includes template inline in the component TS file. By default, an external template file is created and referenced in the component TS file.",
8482
"type": "boolean",
8583
"default": false,
8684
"alias": "t"
8785
},
8886
"viewEncapsulation": {
89-
"description": "Specifies the view encapsulation strategy.",
90-
"enum": [
91-
"Emulated",
92-
"Native",
93-
"None",
94-
"ShadowDom"
95-
],
87+
"description": "The view encapsulation strategy to use in the initial project.",
88+
"enum": ["Emulated", "Native", "None", "ShadowDom"],
9689
"type": "string"
9790
},
9891
"version": {
@@ -105,58 +98,53 @@
10598
},
10699
"routing": {
107100
"type": "boolean",
108-
"description": "Generates a routing module.",
101+
"description": "When true, generates a routing module for the initial project.",
109102
"default": false,
110103
"x-prompt": "Would you like to add Angular routing?"
111104
},
112105
"prefix": {
113106
"type": "string",
114107
"format": "html-selector",
115-
"description": "The prefix to apply to generated selectors.",
108+
"description": "The prefix to apply to generated selectors for the initial project.",
116109
"minLength": 1,
117110
"default": "app",
118111
"alias": "p"
119112
},
120113
"style": {
121-
"description": "The file extension to be used for style files.",
114+
"description": "The file extension or preprocessor to use for style files.",
122115
"type": "string",
123116
"default": "css",
117+
"enum": [
118+
"css",
119+
"scss",
120+
"sass",
121+
"less",
122+
"styl"
123+
],
124124
"x-prompt": {
125125
"message": "Which stylesheet format would you like to use?",
126126
"type": "list",
127127
"items": [
128-
{
129-
"value": "css",
130-
"label": "CSS"
131-
},
132-
{
133-
"value": "sass",
134-
"label": "Sass [ http://sass-lang.com ]"
135-
},
136-
{
137-
"value": "less",
138-
"label": "Less [ http://lesscss.org ]"
139-
},
140-
{
141-
"value": "styl",
142-
"label": "Stylus [ http://stylus-lang.com ]"
143-
}
128+
{ "value": "css", "label": "CSS" },
129+
{ "value": "scss", "label": "SCSS [ http://sass-lang.com/documentation/file.SASS_REFERENCE.html#syntax ]" },
130+
{ "value": "sass", "label": "Sass [ http://sass-lang.com/documentation/file.INDENTED_SYNTAX.html ]" },
131+
{ "value": "less", "label": "Less [ http://lesscss.org ]" },
132+
{ "value": "styl", "label": "Stylus [ http://stylus-lang.com ] " }
144133
]
145134
}
146135
},
147136
"skipTests": {
148-
"description": "Skip creating spec files.",
137+
"description": "When true, does not generate \"spec.ts\" test files for the new project. ",
149138
"type": "boolean",
150-
"default": false,
151-
"alias": "S"
139+
"default": false
152140
},
153141
"createApplication": {
154-
"description": "Flag to toggle creation of an application in the new workspace.",
142+
"description": "When true (the default), creates a new initial app project in the src folder of the new workspace. When false, creates an empty workspace with no initial app. You can then use the generate application command so that all apps are created in the projects folder.",
155143
"type": "boolean",
156144
"default": true
157145
},
158146
"minimal": {
159-
"description": "Create a barebones project without any testing frameworks",
147+
"description": "When true, creates a project without any testing frameworks. (Use for learning purposes only.)",
160148
"type": "boolean",
161149
"default": false
162150
}

0 commit comments

Comments
 (0)