@angular/cli 14.0.0-next.4 → 14.0.0-next.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/ng.js +3 -5
- package/bin/postinstall/analytics-prompt.js +1 -1
- package/lib/cli/index.d.ts +1 -1
- package/lib/cli/index.js +16 -18
- package/lib/config/schema.json +4 -8
- package/lib/init.js +3 -3
- package/models/command.d.ts +14 -19
- package/models/command.js +13 -106
- package/models/interface.d.ts +3 -180
- package/models/interface.js +0 -22
- package/models/schematic-command.d.ts +6 -18
- package/models/schematic-command.js +16 -123
- package/package.json +15 -14
- package/{models → src/analytics}/analytics-collector.d.ts +0 -0
- package/{models → src/analytics}/analytics-collector.js +1 -1
- package/{models → src/analytics}/analytics.d.ts +2 -0
- package/{models → src/analytics}/analytics.js +33 -2
- package/src/command-builder/architect-base-command-module.d.ts +23 -0
- package/src/command-builder/architect-base-command-module.js +105 -0
- package/src/command-builder/architect-command-module.d.ts +22 -0
- package/src/command-builder/architect-command-module.js +110 -0
- package/src/command-builder/command-module.d.ts +85 -0
- package/src/command-builder/command-module.js +185 -0
- package/src/command-builder/command-runner.d.ts +10 -0
- package/src/command-builder/command-runner.js +146 -0
- package/src/command-builder/schematics-command-module.d.ts +31 -0
- package/src/command-builder/schematics-command-module.js +117 -0
- package/src/command-builder/utilities/json-help.d.ts +34 -0
- package/src/command-builder/utilities/json-help.js +90 -0
- package/src/command-builder/utilities/json-schema.d.ts +40 -0
- package/{utilities → src/command-builder/utilities}/json-schema.js +20 -121
- package/src/commands/add/add-impl.d.ts +22 -0
- package/{commands → src/commands/add}/add-impl.js +24 -32
- package/src/commands/add/cli.d.ts +23 -0
- package/src/commands/add/cli.js +48 -0
- package/{commands/add.md → src/commands/add/long-description.md} +0 -0
- package/src/commands/analytics/cli.d.ts +21 -0
- package/src/commands/analytics/cli.js +70 -0
- package/src/commands/analytics/long-description.md +10 -0
- package/src/commands/build/cli.d.ts +16 -0
- package/src/commands/build/cli.js +23 -0
- package/{commands/build-long.md → src/commands/build/long-description.md} +0 -0
- package/src/commands/config/cli.d.ts +21 -0
- package/src/commands/config/cli.js +46 -0
- package/{commands → src/commands/config}/config-impl.d.ts +7 -5
- package/{commands → src/commands/config}/config-impl.js +3 -7
- package/{commands/config-long.md → src/commands/config/long-description.md} +2 -2
- package/src/commands/deploy/cli.d.ts +16 -0
- package/src/commands/deploy/cli.js +35 -0
- package/{commands/deploy-long.md → src/commands/deploy/long-description.md} +0 -0
- package/src/commands/doc/cli.d.ts +23 -0
- package/{commands/doc-impl.js → src/commands/doc/cli.js} +36 -11
- package/src/commands/e2e/cli.d.ts +17 -0
- package/src/commands/e2e/cli.js +34 -0
- package/src/commands/extract-i18n/cli.d.ts +15 -0
- package/src/commands/extract-i18n/cli.js +20 -0
- package/src/commands/generate/cli.d.ts +27 -0
- package/src/commands/generate/cli.js +98 -0
- package/src/commands/generate/generate-impl.d.ts +19 -0
- package/src/commands/generate/generate-impl.js +49 -0
- package/src/commands/lint/cli.d.ts +16 -0
- package/src/commands/lint/cli.js +31 -0
- package/{commands/lint-long.md → src/commands/lint/long-description.md} +0 -0
- package/src/commands/make-this-awesome/cli.d.ts +17 -0
- package/{commands/easter-egg-impl.js → src/commands/make-this-awesome/cli.js} +17 -10
- package/src/commands/new/cli.d.ts +23 -0
- package/src/commands/new/cli.js +36 -0
- package/src/commands/new/new-impl.d.ts +18 -0
- package/{commands → src/commands/new}/new-impl.js +7 -6
- package/src/commands/run/cli.d.ts +23 -0
- package/src/commands/run/cli.js +59 -0
- package/{commands/run-long.md → src/commands/run/long-description.md} +0 -0
- package/src/commands/serve/cli.d.ts +16 -0
- package/src/commands/serve/cli.js +21 -0
- package/src/commands/test/cli.d.ts +16 -0
- package/src/commands/test/cli.js +23 -0
- package/{commands/test-long.md → src/commands/test/long-description.md} +0 -0
- package/src/commands/update/cli.d.ts +29 -0
- package/src/commands/update/cli.js +83 -0
- package/{commands/update-long.md → src/commands/update/long-description.md} +0 -0
- package/src/commands/update/schematic/index.js +1 -1
- package/{commands → src/commands/update}/update-impl.d.ts +8 -6
- package/{commands → src/commands/update}/update-impl.js +22 -31
- package/src/commands/version/cli.d.ts +19 -0
- package/{commands/version-impl.js → src/commands/version/cli.js} +44 -38
- package/src/typings.d.ts +2 -2
- package/{utilities → src/utilities}/color.d.ts +0 -0
- package/{utilities → src/utilities}/color.js +0 -0
- package/{utilities → src/utilities}/config.d.ts +1 -1
- package/{utilities → src/utilities}/config.js +2 -5
- package/{utilities → src/utilities}/find-up.d.ts +0 -0
- package/{utilities → src/utilities}/find-up.js +0 -0
- package/{utilities → src/utilities}/install-package.d.ts +2 -2
- package/{utilities → src/utilities}/install-package.js +1 -1
- package/{utilities → src/utilities}/json-file.d.ts +0 -0
- package/{utilities → src/utilities}/json-file.js +0 -0
- package/{utilities → src/utilities}/log-file.d.ts +0 -0
- package/{utilities → src/utilities}/log-file.js +0 -0
- package/{utilities → src/utilities}/package-json.d.ts +0 -0
- package/{utilities → src/utilities}/package-json.js +0 -0
- package/{utilities → src/utilities}/package-manager.d.ts +1 -1
- package/{utilities → src/utilities}/package-manager.js +1 -1
- package/{utilities → src/utilities}/package-metadata.d.ts +0 -0
- package/{utilities → src/utilities}/package-metadata.js +0 -0
- package/{utilities → src/utilities}/package-tree.d.ts +0 -0
- package/{utilities → src/utilities}/package-tree.js +0 -0
- package/{utilities → src/utilities}/project.d.ts +0 -0
- package/{utilities → src/utilities}/project.js +0 -0
- package/{utilities → src/utilities}/prompt.d.ts +0 -0
- package/{utilities → src/utilities}/prompt.js +0 -0
- package/{utilities → src/utilities}/spinner.d.ts +0 -0
- package/{utilities → src/utilities}/spinner.js +0 -0
- package/{utilities → src/utilities}/tty.d.ts +0 -0
- package/{utilities → src/utilities}/tty.js +0 -0
- package/{models → src/utilities}/version.d.ts +2 -1
- package/{models → src/utilities}/version.js +6 -6
- package/commands/add-impl.d.ts +0 -21
- package/commands/add.d.ts +0 -42
- package/commands/add.js +0 -10
- package/commands/add.json +0 -54
- package/commands/analytics-impl.d.ts +0 -13
- package/commands/analytics-impl.js +0 -80
- package/commands/analytics-long.md +0 -8
- package/commands/analytics.d.ts +0 -46
- package/commands/analytics.js +0 -31
- package/commands/analytics.json +0 -37
- package/commands/build-impl.d.ts +0 -14
- package/commands/build-impl.js +0 -21
- package/commands/build.d.ts +0 -30
- package/commands/build.js +0 -10
- package/commands/build.json +0 -16
- package/commands/config.d.ts +0 -34
- package/commands/config.js +0 -10
- package/commands/config.json +0 -43
- package/commands/definitions.json +0 -66
- package/commands/deploy-impl.d.ts +0 -15
- package/commands/deploy-impl.js +0 -36
- package/commands/deploy.d.ts +0 -30
- package/commands/deploy.js +0 -10
- package/commands/deploy.json +0 -34
- package/commands/doc-impl.d.ts +0 -13
- package/commands/doc.d.ts +0 -39
- package/commands/doc.js +0 -14
- package/commands/doc.json +0 -46
- package/commands/e2e-impl.d.ts +0 -16
- package/commands/e2e-impl.js +0 -36
- package/commands/e2e-long.md +0 -4
- package/commands/e2e.d.ts +0 -29
- package/commands/e2e.js +0 -10
- package/commands/e2e.json +0 -17
- package/commands/easter-egg-impl.d.ts +0 -12
- package/commands/easter-egg.d.ts +0 -14
- package/commands/easter-egg.js +0 -10
- package/commands/easter-egg.json +0 -12
- package/commands/extract-i18n-impl.d.ts +0 -14
- package/commands/extract-i18n-impl.js +0 -21
- package/commands/extract-i18n.d.ts +0 -29
- package/commands/extract-i18n.js +0 -10
- package/commands/extract-i18n.json +0 -15
- package/commands/generate-impl.d.ts +0 -18
- package/commands/generate-impl.js +0 -89
- package/commands/generate.d.ts +0 -37
- package/commands/generate.js +0 -10
- package/commands/generate.json +0 -31
- package/commands/help-impl.d.ts +0 -12
- package/commands/help-impl.js +0 -26
- package/commands/help-long.md +0 -7
- package/commands/help.d.ts +0 -17
- package/commands/help.js +0 -10
- package/commands/help.json +0 -13
- package/commands/lint-impl.d.ts +0 -16
- package/commands/lint-impl.js +0 -69
- package/commands/lint.d.ts +0 -29
- package/commands/lint.js +0 -10
- package/commands/lint.json +0 -36
- package/commands/new-impl.d.ts +0 -16
- package/commands/new.d.ts +0 -41
- package/commands/new.js +0 -10
- package/commands/new.json +0 -34
- package/commands/new.md +0 -16
- package/commands/run-impl.d.ts +0 -13
- package/commands/run-impl.js +0 -22
- package/commands/run.d.ts +0 -30
- package/commands/run.js +0 -10
- package/commands/run.json +0 -36
- package/commands/serve-impl.d.ts +0 -15
- package/commands/serve-impl.js +0 -24
- package/commands/serve.d.ts +0 -29
- package/commands/serve.js +0 -10
- package/commands/serve.json +0 -17
- package/commands/test-impl.d.ts +0 -15
- package/commands/test-impl.js +0 -22
- package/commands/test.d.ts +0 -29
- package/commands/test.js +0 -10
- package/commands/test.json +0 -17
- package/commands/update.d.ts +0 -61
- package/commands/update.js +0 -10
- package/commands/update.json +0 -78
- package/commands/version-impl.d.ts +0 -17
- package/commands/version.d.ts +0 -17
- package/commands/version.js +0 -10
- package/commands/version.json +0 -13
- package/commands.json +0 -20
- package/models/architect-command.d.ts +0 -35
- package/models/architect-command.js +0 -364
- package/models/command-runner.d.ts +0 -24
- package/models/command-runner.js +0 -241
- package/models/parser.d.ts +0 -39
- package/models/parser.js +0 -349
- package/utilities/json-schema.d.ts +0 -17
package/commands/e2e.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.HelpEnum = void 0;
|
|
6
|
-
var HelpEnum;
|
|
7
|
-
(function (HelpEnum) {
|
|
8
|
-
HelpEnum["HelpJson"] = "JSON";
|
|
9
|
-
HelpEnum["Json"] = "json";
|
|
10
|
-
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
package/commands/e2e.json
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "ng-cli://commands/e2e.json",
|
|
4
|
-
"description": "Builds and serves an Angular app, then runs end-to-end tests.",
|
|
5
|
-
"$longDescription": "./e2e-long.md",
|
|
6
|
-
|
|
7
|
-
"$aliases": ["e"],
|
|
8
|
-
"$scope": "in",
|
|
9
|
-
"$type": "architect",
|
|
10
|
-
"$impl": "./e2e-impl#E2eCommand",
|
|
11
|
-
|
|
12
|
-
"type": "object",
|
|
13
|
-
"allOf": [
|
|
14
|
-
{ "$ref": "./definitions.json#/definitions/architect" },
|
|
15
|
-
{ "$ref": "./definitions.json#/definitions/base" }
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Command } from '../models/command';
|
|
9
|
-
import { Schema as AwesomeCommandSchema } from './easter-egg';
|
|
10
|
-
export declare class AwesomeCommand extends Command<AwesomeCommandSchema> {
|
|
11
|
-
run(): Promise<void>;
|
|
12
|
-
}
|
package/commands/easter-egg.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface Schema {
|
|
2
|
-
/**
|
|
3
|
-
* Shows a help message for this command in the console.
|
|
4
|
-
*/
|
|
5
|
-
help?: HelpUnion;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Shows a help message for this command in the console.
|
|
9
|
-
*/
|
|
10
|
-
export declare type HelpUnion = boolean | HelpEnum;
|
|
11
|
-
export declare enum HelpEnum {
|
|
12
|
-
HelpJson = "JSON",
|
|
13
|
-
Json = "json"
|
|
14
|
-
}
|
package/commands/easter-egg.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.HelpEnum = void 0;
|
|
6
|
-
var HelpEnum;
|
|
7
|
-
(function (HelpEnum) {
|
|
8
|
-
HelpEnum["HelpJson"] = "JSON";
|
|
9
|
-
HelpEnum["Json"] = "json";
|
|
10
|
-
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
package/commands/easter-egg.json
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "ng-cli://commands/easter-egg.json",
|
|
4
|
-
"description": "",
|
|
5
|
-
"$longDescription": "",
|
|
6
|
-
"$hidden": true,
|
|
7
|
-
|
|
8
|
-
"$impl": "./easter-egg-impl#AwesomeCommand",
|
|
9
|
-
|
|
10
|
-
"type": "object",
|
|
11
|
-
"allOf": [{ "$ref": "./definitions.json#/definitions/base" }]
|
|
12
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { ArchitectCommand } from '../models/architect-command';
|
|
9
|
-
import { Arguments } from '../models/interface';
|
|
10
|
-
import { Schema as ExtractI18nCommandSchema } from './extract-i18n';
|
|
11
|
-
export declare class ExtractI18nCommand extends ArchitectCommand<ExtractI18nCommandSchema> {
|
|
12
|
-
readonly target = "extract-i18n";
|
|
13
|
-
run(options: ExtractI18nCommandSchema & Arguments): Promise<number>;
|
|
14
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.ExtractI18nCommand = void 0;
|
|
11
|
-
const architect_command_1 = require("../models/architect-command");
|
|
12
|
-
class ExtractI18nCommand extends architect_command_1.ArchitectCommand {
|
|
13
|
-
constructor() {
|
|
14
|
-
super(...arguments);
|
|
15
|
-
this.target = 'extract-i18n';
|
|
16
|
-
}
|
|
17
|
-
async run(options) {
|
|
18
|
-
return this.runArchitectTarget(options);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.ExtractI18nCommand = ExtractI18nCommand;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extracts i18n messages from source code.
|
|
3
|
-
*/
|
|
4
|
-
export interface Schema {
|
|
5
|
-
/**
|
|
6
|
-
* One or more named builder configurations as a comma-separated list as specified in the
|
|
7
|
-
* "configurations" section of angular.json.
|
|
8
|
-
* The builder uses the named configurations to run the given target.
|
|
9
|
-
* For more information, see
|
|
10
|
-
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
|
11
|
-
*/
|
|
12
|
-
configuration?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Shows a help message for this command in the console.
|
|
15
|
-
*/
|
|
16
|
-
help?: HelpUnion;
|
|
17
|
-
/**
|
|
18
|
-
* The name of the project to build. Can be an application or a library.
|
|
19
|
-
*/
|
|
20
|
-
project?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Shows a help message for this command in the console.
|
|
24
|
-
*/
|
|
25
|
-
export declare type HelpUnion = boolean | HelpEnum;
|
|
26
|
-
export declare enum HelpEnum {
|
|
27
|
-
HelpJson = "JSON",
|
|
28
|
-
Json = "json"
|
|
29
|
-
}
|
package/commands/extract-i18n.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.HelpEnum = void 0;
|
|
6
|
-
var HelpEnum;
|
|
7
|
-
(function (HelpEnum) {
|
|
8
|
-
HelpEnum["HelpJson"] = "JSON";
|
|
9
|
-
HelpEnum["Json"] = "json";
|
|
10
|
-
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "ng-cli://commands/extract-i18n.json",
|
|
4
|
-
"description": "Extracts i18n messages from source code.",
|
|
5
|
-
"$longDescription": "",
|
|
6
|
-
"$scope": "in",
|
|
7
|
-
"$type": "architect",
|
|
8
|
-
"$impl": "./extract-i18n-impl#ExtractI18nCommand",
|
|
9
|
-
|
|
10
|
-
"type": "object",
|
|
11
|
-
"allOf": [
|
|
12
|
-
{ "$ref": "./definitions.json#/definitions/architect" },
|
|
13
|
-
{ "$ref": "./definitions.json#/definitions/base" }
|
|
14
|
-
]
|
|
15
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Arguments } from '../models/interface';
|
|
9
|
-
import { SchematicCommand } from '../models/schematic-command';
|
|
10
|
-
import { Schema as GenerateCommandSchema } from './generate';
|
|
11
|
-
export declare class GenerateCommand extends SchematicCommand<GenerateCommandSchema> {
|
|
12
|
-
longSchematicName: string | undefined;
|
|
13
|
-
initialize(options: GenerateCommandSchema & Arguments): Promise<void>;
|
|
14
|
-
run(options: GenerateCommandSchema & Arguments): Promise<number | void>;
|
|
15
|
-
reportAnalytics(paths: string[], options: GenerateCommandSchema & Arguments): Promise<void>;
|
|
16
|
-
private parseSchematicInfo;
|
|
17
|
-
printHelp(): Promise<number>;
|
|
18
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.GenerateCommand = void 0;
|
|
11
|
-
const schematic_command_1 = require("../models/schematic-command");
|
|
12
|
-
const color_1 = require("../utilities/color");
|
|
13
|
-
const json_schema_1 = require("../utilities/json-schema");
|
|
14
|
-
class GenerateCommand extends schematic_command_1.SchematicCommand {
|
|
15
|
-
async initialize(options) {
|
|
16
|
-
// Fill up the schematics property of the command description.
|
|
17
|
-
const [collectionName, schematicName] = await this.parseSchematicInfo(options);
|
|
18
|
-
this.collectionName = collectionName;
|
|
19
|
-
this.schematicName = schematicName;
|
|
20
|
-
await super.initialize(options);
|
|
21
|
-
const collection = this.getCollection(collectionName);
|
|
22
|
-
const subcommands = {};
|
|
23
|
-
const schematicNames = schematicName ? [schematicName] : collection.listSchematicNames();
|
|
24
|
-
// Sort as a courtesy for the user.
|
|
25
|
-
schematicNames.sort();
|
|
26
|
-
for (const name of schematicNames) {
|
|
27
|
-
const schematic = this.getSchematic(collection, name, true);
|
|
28
|
-
this.longSchematicName = schematic.description.name;
|
|
29
|
-
let subcommand;
|
|
30
|
-
if (schematic.description.schemaJson) {
|
|
31
|
-
subcommand = await (0, json_schema_1.parseJsonSchemaToSubCommandDescription)(name, schematic.description.path, this._workflow.registry, schematic.description.schemaJson);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if ((await this.getDefaultSchematicCollection()) == collectionName) {
|
|
37
|
-
subcommands[name] = subcommand;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
subcommands[`${collectionName}:${name}`] = subcommand;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
this.description.options.forEach((option) => {
|
|
44
|
-
if (option.name == 'schematic') {
|
|
45
|
-
option.subcommands = subcommands;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
async run(options) {
|
|
50
|
-
if (!this.schematicName || !this.collectionName) {
|
|
51
|
-
return this.printHelp();
|
|
52
|
-
}
|
|
53
|
-
return this.runSchematic({
|
|
54
|
-
collectionName: this.collectionName,
|
|
55
|
-
schematicName: this.schematicName,
|
|
56
|
-
schematicOptions: options['--'] || [],
|
|
57
|
-
debug: !!options.debug || false,
|
|
58
|
-
dryRun: !!options.dryRun || false,
|
|
59
|
-
force: !!options.force || false,
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
async reportAnalytics(paths, options) {
|
|
63
|
-
if (!this.collectionName || !this.schematicName) {
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const escapedSchematicName = (this.longSchematicName || this.schematicName).replace(/\//g, '_');
|
|
67
|
-
return super.reportAnalytics(['generate', this.collectionName.replace(/\//g, '_'), escapedSchematicName], options);
|
|
68
|
-
}
|
|
69
|
-
async parseSchematicInfo(options) {
|
|
70
|
-
let collectionName = await this.getDefaultSchematicCollection();
|
|
71
|
-
let schematicName = options.schematic;
|
|
72
|
-
if (schematicName && schematicName.includes(':')) {
|
|
73
|
-
[collectionName, schematicName] = schematicName.split(':', 2);
|
|
74
|
-
}
|
|
75
|
-
return [collectionName, schematicName];
|
|
76
|
-
}
|
|
77
|
-
async printHelp() {
|
|
78
|
-
await super.printHelp();
|
|
79
|
-
this.logger.info('');
|
|
80
|
-
// Find the generate subcommand.
|
|
81
|
-
const subcommand = this.description.options.filter((x) => x.subcommands)[0];
|
|
82
|
-
if (Object.keys((subcommand && subcommand.subcommands) || {}).length == 1) {
|
|
83
|
-
this.logger.info(`\nTo see help for a schematic run:`);
|
|
84
|
-
this.logger.info(color_1.colors.cyan(` ng generate <schematic> --help`));
|
|
85
|
-
}
|
|
86
|
-
return 0;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
exports.GenerateCommand = GenerateCommand;
|
package/commands/generate.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generates and/or modifies files based on a schematic.
|
|
3
|
-
*/
|
|
4
|
-
export interface Schema {
|
|
5
|
-
/**
|
|
6
|
-
* Disable interactive input prompts for options with a default.
|
|
7
|
-
*/
|
|
8
|
-
defaults?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Run through and reports activity without writing out results.
|
|
11
|
-
*/
|
|
12
|
-
dryRun?: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Force overwriting of existing files.
|
|
15
|
-
*/
|
|
16
|
-
force?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Shows a help message for this command in the console.
|
|
19
|
-
*/
|
|
20
|
-
help?: HelpUnion;
|
|
21
|
-
/**
|
|
22
|
-
* Enable interactive input prompts.
|
|
23
|
-
*/
|
|
24
|
-
interactive?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* The schematic or collection:schematic to generate.
|
|
27
|
-
*/
|
|
28
|
-
schematic?: string;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Shows a help message for this command in the console.
|
|
32
|
-
*/
|
|
33
|
-
export declare type HelpUnion = boolean | HelpEnum;
|
|
34
|
-
export declare enum HelpEnum {
|
|
35
|
-
HelpJson = "JSON",
|
|
36
|
-
Json = "json"
|
|
37
|
-
}
|
package/commands/generate.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.HelpEnum = void 0;
|
|
6
|
-
var HelpEnum;
|
|
7
|
-
(function (HelpEnum) {
|
|
8
|
-
HelpEnum["HelpJson"] = "JSON";
|
|
9
|
-
HelpEnum["Json"] = "json";
|
|
10
|
-
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
package/commands/generate.json
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "ng-cli://commands/generate.json",
|
|
4
|
-
"description": "Generates and/or modifies files based on a schematic.",
|
|
5
|
-
"$longDescription": "",
|
|
6
|
-
|
|
7
|
-
"$aliases": ["g"],
|
|
8
|
-
"$scope": "in",
|
|
9
|
-
"$type": "schematics",
|
|
10
|
-
"$impl": "./generate-impl#GenerateCommand",
|
|
11
|
-
|
|
12
|
-
"allOf": [
|
|
13
|
-
{
|
|
14
|
-
"type": "object",
|
|
15
|
-
"properties": {
|
|
16
|
-
"schematic": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "The schematic or collection:schematic to generate.",
|
|
19
|
-
"$default": {
|
|
20
|
-
"$source": "argv",
|
|
21
|
-
"index": 0
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"required": []
|
|
26
|
-
},
|
|
27
|
-
{ "$ref": "./definitions.json#/definitions/base" },
|
|
28
|
-
{ "$ref": "./definitions.json#/definitions/schematic" },
|
|
29
|
-
{ "$ref": "./definitions.json#/definitions/interactive" }
|
|
30
|
-
]
|
|
31
|
-
}
|
package/commands/help-impl.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Command } from '../models/command';
|
|
9
|
-
import { Schema as HelpCommandSchema } from './help';
|
|
10
|
-
export declare class HelpCommand extends Command<HelpCommandSchema> {
|
|
11
|
-
run(): Promise<void>;
|
|
12
|
-
}
|
package/commands/help-impl.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.HelpCommand = void 0;
|
|
11
|
-
const command_1 = require("../models/command");
|
|
12
|
-
const color_1 = require("../utilities/color");
|
|
13
|
-
class HelpCommand extends command_1.Command {
|
|
14
|
-
async run() {
|
|
15
|
-
this.logger.info(`Available Commands:`);
|
|
16
|
-
for (const cmd of Object.values(await command_1.Command.commandMap())) {
|
|
17
|
-
if (cmd.hidden) {
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
const aliasInfo = cmd.aliases.length > 0 ? ` (${cmd.aliases.join(', ')})` : '';
|
|
21
|
-
this.logger.info(` ${color_1.colors.cyan(cmd.name)}${aliasInfo} ${cmd.description}`);
|
|
22
|
-
}
|
|
23
|
-
this.logger.info(`\nFor more detailed help run "ng [command name] --help"`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.HelpCommand = HelpCommand;
|
package/commands/help-long.md
DELETED
package/commands/help.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Lists available commands and their short descriptions.
|
|
3
|
-
*/
|
|
4
|
-
export interface Schema {
|
|
5
|
-
/**
|
|
6
|
-
* Shows a help message for this command in the console.
|
|
7
|
-
*/
|
|
8
|
-
help?: HelpUnion;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Shows a help message for this command in the console.
|
|
12
|
-
*/
|
|
13
|
-
export declare type HelpUnion = boolean | HelpEnum;
|
|
14
|
-
export declare enum HelpEnum {
|
|
15
|
-
HelpJson = "JSON",
|
|
16
|
-
Json = "json"
|
|
17
|
-
}
|
package/commands/help.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.HelpEnum = void 0;
|
|
6
|
-
var HelpEnum;
|
|
7
|
-
(function (HelpEnum) {
|
|
8
|
-
HelpEnum["HelpJson"] = "JSON";
|
|
9
|
-
HelpEnum["Json"] = "json";
|
|
10
|
-
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
package/commands/help.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "ng-cli://commands/help.json",
|
|
4
|
-
"description": "Lists available commands and their short descriptions.",
|
|
5
|
-
"$longDescription": "./help-long.md",
|
|
6
|
-
|
|
7
|
-
"$scope": "all",
|
|
8
|
-
"$aliases": [],
|
|
9
|
-
"$impl": "./help-impl#HelpCommand",
|
|
10
|
-
|
|
11
|
-
"type": "object",
|
|
12
|
-
"allOf": [{ "$ref": "./definitions.json#/definitions/base" }]
|
|
13
|
-
}
|
package/commands/lint-impl.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { ArchitectCommand } from '../models/architect-command';
|
|
9
|
-
import { Arguments } from '../models/interface';
|
|
10
|
-
import { Schema as LintCommandSchema } from './lint';
|
|
11
|
-
export declare class LintCommand extends ArchitectCommand<LintCommandSchema> {
|
|
12
|
-
readonly target = "lint";
|
|
13
|
-
readonly multiTarget = true;
|
|
14
|
-
initialize(options: LintCommandSchema & Arguments): Promise<number | void>;
|
|
15
|
-
onMissingTarget(): Promise<void | number>;
|
|
16
|
-
}
|
package/commands/lint-impl.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.LintCommand = void 0;
|
|
30
|
-
const child_process_1 = require("child_process");
|
|
31
|
-
const path = __importStar(require("path"));
|
|
32
|
-
const architect_command_1 = require("../models/architect-command");
|
|
33
|
-
const prompt_1 = require("../utilities/prompt");
|
|
34
|
-
const MissingBuilder = `
|
|
35
|
-
Cannot find "lint" target for the specified project.
|
|
36
|
-
|
|
37
|
-
You should add a package that implements linting capabilities.
|
|
38
|
-
|
|
39
|
-
For example:
|
|
40
|
-
ng add @angular-eslint/schematics
|
|
41
|
-
`;
|
|
42
|
-
class LintCommand extends architect_command_1.ArchitectCommand {
|
|
43
|
-
constructor() {
|
|
44
|
-
super(...arguments);
|
|
45
|
-
this.target = 'lint';
|
|
46
|
-
this.multiTarget = true;
|
|
47
|
-
}
|
|
48
|
-
async initialize(options) {
|
|
49
|
-
if (!options.help) {
|
|
50
|
-
return super.initialize(options);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
async onMissingTarget() {
|
|
54
|
-
this.logger.warn(MissingBuilder);
|
|
55
|
-
const shouldAdd = await (0, prompt_1.askConfirmation)('Would you like to add ESLint now?', true, false);
|
|
56
|
-
if (shouldAdd) {
|
|
57
|
-
// Run `ng add @angular-eslint/schematics`
|
|
58
|
-
const binPath = path.resolve(__dirname, '../bin/ng.js');
|
|
59
|
-
const { status, error } = (0, child_process_1.spawnSync)(process.execPath, [binPath, 'add', '@angular-eslint/schematics'], {
|
|
60
|
-
stdio: 'inherit',
|
|
61
|
-
});
|
|
62
|
-
if (error) {
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
return status !== null && status !== void 0 ? status : 0;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.LintCommand = LintCommand;
|
package/commands/lint.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Runs linting tools on Angular app code in a given project folder.
|
|
3
|
-
*/
|
|
4
|
-
export interface Schema {
|
|
5
|
-
/**
|
|
6
|
-
* One or more named builder configurations as a comma-separated list as specified in the
|
|
7
|
-
* "configurations" section of angular.json.
|
|
8
|
-
* The builder uses the named configurations to run the given target.
|
|
9
|
-
* For more information, see
|
|
10
|
-
* https://angular.io/guide/workspace-config#alternate-build-configurations.
|
|
11
|
-
*/
|
|
12
|
-
configuration?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Shows a help message for this command in the console.
|
|
15
|
-
*/
|
|
16
|
-
help?: HelpUnion;
|
|
17
|
-
/**
|
|
18
|
-
* The name of the project to lint.
|
|
19
|
-
*/
|
|
20
|
-
project?: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Shows a help message for this command in the console.
|
|
24
|
-
*/
|
|
25
|
-
export declare type HelpUnion = boolean | HelpEnum;
|
|
26
|
-
export declare enum HelpEnum {
|
|
27
|
-
HelpJson = "JSON",
|
|
28
|
-
Json = "json"
|
|
29
|
-
}
|
package/commands/lint.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// THIS FILE IS AUTOMATICALLY GENERATED. TO UPDATE THIS FILE YOU NEED TO CHANGE THE
|
|
3
|
-
// CORRESPONDING JSON SCHEMA FILE, THEN RUN devkit-admin build (or bazel build ...).
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.HelpEnum = void 0;
|
|
6
|
-
var HelpEnum;
|
|
7
|
-
(function (HelpEnum) {
|
|
8
|
-
HelpEnum["HelpJson"] = "JSON";
|
|
9
|
-
HelpEnum["Json"] = "json";
|
|
10
|
-
})(HelpEnum = exports.HelpEnum || (exports.HelpEnum = {}));
|
package/commands/lint.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "ng-cli://commands/lint.json",
|
|
4
|
-
"description": "Runs linting tools on Angular app code in a given project folder.",
|
|
5
|
-
"$longDescription": "./lint-long.md",
|
|
6
|
-
|
|
7
|
-
"$aliases": ["l"],
|
|
8
|
-
"$scope": "in",
|
|
9
|
-
"$type": "architect",
|
|
10
|
-
"$impl": "./lint-impl#LintCommand",
|
|
11
|
-
|
|
12
|
-
"type": "object",
|
|
13
|
-
"allOf": [
|
|
14
|
-
{
|
|
15
|
-
"properties": {
|
|
16
|
-
"project": {
|
|
17
|
-
"type": "string",
|
|
18
|
-
"description": "The name of the project to lint.",
|
|
19
|
-
"$default": {
|
|
20
|
-
"$source": "argv",
|
|
21
|
-
"index": 0
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"configuration": {
|
|
25
|
-
"description": "One or more named builder configurations as a comma-separated list as specified in the \"configurations\" section of angular.json.\nThe builder uses the named configurations to run the given target.\nFor more information, see https://angular.io/guide/workspace-config#alternate-build-configurations.",
|
|
26
|
-
"type": "string",
|
|
27
|
-
"aliases": ["c"]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"required": []
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"$ref": "./definitions.json#/definitions/base"
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
package/commands/new-impl.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { Arguments } from '../models/interface';
|
|
9
|
-
import { SchematicCommand } from '../models/schematic-command';
|
|
10
|
-
import { Schema as NewCommandSchema } from './new';
|
|
11
|
-
export declare class NewCommand extends SchematicCommand<NewCommandSchema> {
|
|
12
|
-
readonly allowMissingWorkspace = true;
|
|
13
|
-
schematicName: string;
|
|
14
|
-
initialize(options: NewCommandSchema & Arguments): Promise<void>;
|
|
15
|
-
run(options: NewCommandSchema & Arguments): Promise<number | void>;
|
|
16
|
-
}
|