@angular/cli 18.1.0-next.1 → 18.1.0-next.3
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/bootstrap.js +1 -1
- package/bin/ng.js +1 -1
- package/lib/cli/index.d.ts +1 -1
- package/lib/cli/index.js +10 -9
- package/lib/config/schema.json +1 -1
- package/lib/config/workspace-schema.d.ts +1 -1
- package/lib/init.d.ts +1 -1
- package/lib/init.js +1 -1
- package/package.json +25 -16
- package/src/analytics/analytics-collector.d.ts +1 -1
- package/src/analytics/analytics-collector.js +1 -1
- package/src/analytics/analytics-parameters.d.ts +1 -1
- package/src/analytics/analytics-parameters.js +1 -1
- package/src/analytics/analytics.d.ts +1 -1
- package/src/analytics/analytics.js +1 -1
- package/src/command-builder/architect-base-command-module.d.ts +1 -1
- package/src/command-builder/architect-base-command-module.js +1 -1
- package/src/command-builder/architect-command-module.d.ts +1 -1
- package/src/command-builder/architect-command-module.js +1 -1
- package/src/command-builder/command-module.d.ts +1 -1
- package/src/command-builder/command-module.js +1 -1
- package/src/command-builder/command-runner.d.ts +1 -1
- package/src/command-builder/command-runner.js +1 -1
- package/src/command-builder/schematics-command-module.d.ts +1 -1
- package/src/command-builder/schematics-command-module.js +88 -51
- package/src/command-builder/utilities/command.d.ts +1 -1
- package/src/command-builder/utilities/command.js +1 -1
- package/src/command-builder/utilities/json-help.d.ts +1 -1
- package/src/command-builder/utilities/json-help.js +1 -1
- package/src/command-builder/utilities/json-schema.d.ts +1 -1
- package/src/command-builder/utilities/json-schema.js +1 -1
- package/src/command-builder/utilities/normalize-options-middleware.d.ts +1 -1
- package/src/command-builder/utilities/normalize-options-middleware.js +1 -1
- package/src/command-builder/utilities/schematic-engine-host.d.ts +1 -1
- package/src/command-builder/utilities/schematic-engine-host.js +1 -1
- package/src/command-builder/utilities/schematic-workflow.d.ts +1 -1
- package/src/command-builder/utilities/schematic-workflow.js +1 -1
- package/src/commands/add/cli.d.ts +1 -1
- package/src/commands/add/cli.js +194 -124
- package/src/commands/analytics/cli.d.ts +1 -1
- package/src/commands/analytics/cli.js +1 -1
- package/src/commands/analytics/info/cli.d.ts +1 -1
- package/src/commands/analytics/info/cli.js +1 -1
- package/src/commands/analytics/settings/cli.d.ts +1 -1
- package/src/commands/analytics/settings/cli.js +1 -1
- package/src/commands/build/cli.d.ts +1 -1
- package/src/commands/build/cli.js +1 -1
- package/src/commands/cache/clean/cli.d.ts +1 -1
- package/src/commands/cache/clean/cli.js +1 -1
- package/src/commands/cache/cli.d.ts +1 -1
- package/src/commands/cache/cli.js +1 -1
- package/src/commands/cache/info/cli.d.ts +1 -1
- package/src/commands/cache/info/cli.js +1 -1
- package/src/commands/cache/settings/cli.d.ts +1 -1
- package/src/commands/cache/settings/cli.js +1 -1
- package/src/commands/cache/utilities.d.ts +1 -1
- package/src/commands/cache/utilities.js +1 -1
- package/src/commands/command-config.d.ts +1 -1
- package/src/commands/command-config.js +1 -1
- package/src/commands/completion/cli.d.ts +1 -1
- package/src/commands/completion/cli.js +1 -1
- package/src/commands/config/cli.d.ts +1 -1
- package/src/commands/config/cli.js +1 -1
- package/src/commands/deploy/cli.d.ts +1 -1
- package/src/commands/deploy/cli.js +1 -1
- package/src/commands/e2e/cli.d.ts +1 -1
- package/src/commands/e2e/cli.js +1 -1
- package/src/commands/extract-i18n/cli.d.ts +1 -1
- package/src/commands/extract-i18n/cli.js +1 -1
- package/src/commands/generate/cli.d.ts +1 -1
- package/src/commands/generate/cli.js +1 -1
- package/src/commands/lint/cli.d.ts +1 -1
- package/src/commands/lint/cli.js +1 -1
- package/src/commands/make-this-awesome/cli.d.ts +1 -1
- package/src/commands/make-this-awesome/cli.js +1 -1
- package/src/commands/new/cli.d.ts +1 -1
- package/src/commands/new/cli.js +1 -1
- package/src/commands/run/cli.d.ts +1 -1
- package/src/commands/run/cli.js +1 -1
- package/src/commands/serve/cli.d.ts +1 -1
- package/src/commands/serve/cli.js +1 -1
- package/src/commands/test/cli.d.ts +1 -1
- package/src/commands/test/cli.js +1 -1
- package/src/commands/update/cli.d.ts +2 -1
- package/src/commands/update/cli.js +66 -34
- package/src/commands/update/schematic/index.d.ts +1 -1
- package/src/commands/update/schematic/index.js +1 -1
- package/src/commands/version/cli.d.ts +1 -1
- package/src/commands/version/cli.js +1 -1
- package/src/typings-bazel.d.ts +1 -1
- package/src/typings.d.ts +1 -1
- package/src/typings.js +1 -1
- package/src/utilities/color.d.ts +3 -5
- package/src/utilities/color.js +8 -38
- package/src/utilities/completion.d.ts +1 -1
- package/src/utilities/completion.js +1 -1
- package/src/utilities/config.d.ts +1 -1
- package/src/utilities/config.js +1 -1
- package/src/utilities/environment-options.d.ts +1 -1
- package/src/utilities/environment-options.js +1 -1
- package/src/utilities/eol.d.ts +1 -1
- package/src/utilities/eol.js +1 -1
- package/src/utilities/error.d.ts +1 -1
- package/src/utilities/error.js +1 -1
- package/src/utilities/find-up.d.ts +1 -1
- package/src/utilities/find-up.js +1 -1
- package/src/utilities/json-file.d.ts +1 -1
- package/src/utilities/json-file.js +1 -1
- package/src/utilities/load-esm.d.ts +1 -1
- package/src/utilities/load-esm.js +1 -1
- package/src/utilities/log-file.d.ts +1 -1
- package/src/utilities/log-file.js +1 -1
- package/src/utilities/memoize.d.ts +1 -1
- package/src/utilities/memoize.js +1 -1
- package/src/utilities/package-manager.d.ts +1 -1
- package/src/utilities/package-manager.js +1 -7
- package/src/utilities/package-metadata.d.ts +1 -1
- package/src/utilities/package-metadata.js +1 -1
- package/src/utilities/package-tree.d.ts +1 -1
- package/src/utilities/package-tree.js +1 -1
- package/src/utilities/project.d.ts +1 -1
- package/src/utilities/project.js +1 -1
- package/src/utilities/prompt.d.ts +9 -4
- package/src/utilities/prompt.js +45 -26
- package/src/utilities/tty.d.ts +1 -1
- package/src/utilities/tty.js +1 -1
- package/src/utilities/version.d.ts +1 -1
- package/src/utilities/version.js +2 -2
- package/src/utilities/spinner.d.ts +0 -20
- package/src/utilities/spinner.js +0 -55
package/bin/bootstrap.js
CHANGED
package/bin/ng.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/* eslint-disable no-console */
|
package/lib/cli/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
export { VERSION } from '../../src/utilities/version';
|
|
9
9
|
export default function (options: {
|
package/lib/cli/index.js
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.VERSION = void 0;
|
|
11
11
|
exports.default = default_1;
|
|
12
12
|
const core_1 = require("@angular-devkit/core");
|
|
13
|
-
const
|
|
13
|
+
const node_util_1 = require("node:util");
|
|
14
14
|
const command_module_1 = require("../../src/command-builder/command-module");
|
|
15
15
|
const command_runner_1 = require("../../src/command-builder/command-runner");
|
|
16
16
|
const color_1 = require("../../src/utilities/color");
|
|
@@ -33,18 +33,19 @@ async function default_1(options) {
|
|
|
33
33
|
const colorLevels = {
|
|
34
34
|
info: (s) => s,
|
|
35
35
|
debug: (s) => s,
|
|
36
|
-
warn: (s) => color_1.colors.bold.yellow(s),
|
|
37
|
-
error: (s) => color_1.colors.bold.red(s),
|
|
38
|
-
fatal: (s) => color_1.colors.bold.red(s),
|
|
36
|
+
warn: (s) => color_1.colors.bold(color_1.colors.yellow(s)),
|
|
37
|
+
error: (s) => color_1.colors.bold(color_1.colors.red(s)),
|
|
38
|
+
fatal: (s) => color_1.colors.bold(color_1.colors.red(s)),
|
|
39
39
|
};
|
|
40
40
|
const logger = new core_1.logging.IndentLogger('cli-main-logger');
|
|
41
41
|
const logInfo = console.log;
|
|
42
42
|
const logError = console.error;
|
|
43
|
+
const useColor = (0, color_1.supportColor)();
|
|
43
44
|
const loggerFinished = logger.forEach((entry) => {
|
|
44
45
|
if (!environment_options_1.ngDebug && entry.level === 'debug') {
|
|
45
46
|
return;
|
|
46
47
|
}
|
|
47
|
-
const color =
|
|
48
|
+
const color = useColor ? colorLevels[entry.level] : node_util_1.stripVTControlCharacters;
|
|
48
49
|
const message = color(entry.message);
|
|
49
50
|
switch (entry.level) {
|
|
50
51
|
case 'warn':
|
|
@@ -59,13 +60,13 @@ async function default_1(options) {
|
|
|
59
60
|
});
|
|
60
61
|
// Redirect console to logger
|
|
61
62
|
console.info = console.log = function (...args) {
|
|
62
|
-
logger.info((0,
|
|
63
|
+
logger.info((0, node_util_1.format)(...args));
|
|
63
64
|
};
|
|
64
65
|
console.warn = function (...args) {
|
|
65
|
-
logger.warn((0,
|
|
66
|
+
logger.warn((0, node_util_1.format)(...args));
|
|
66
67
|
};
|
|
67
68
|
console.error = function (...args) {
|
|
68
|
-
logger.error((0,
|
|
69
|
+
logger.error((0, node_util_1.format)(...args));
|
|
69
70
|
};
|
|
70
71
|
try {
|
|
71
72
|
return await (0, command_runner_1.runCommand)(options.cliArgs, logger);
|
package/lib/config/schema.json
CHANGED
|
@@ -1628,7 +1628,7 @@
|
|
|
1628
1628
|
"default": false
|
|
1629
1629
|
},
|
|
1630
1630
|
"strict": {
|
|
1631
|
-
"description": "Creates a workspace with stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time. For more information, see https://angular.
|
|
1631
|
+
"description": "Creates a workspace with stricter type checking and stricter bundle budgets settings. This setting helps improve maintainability and catch bugs ahead of time. For more information, see https://angular.dev/tools/cli/template-typecheck#strict-mode",
|
|
1632
1632
|
"type": "boolean",
|
|
1633
1633
|
"default": true
|
|
1634
1634
|
},
|
|
@@ -599,7 +599,7 @@ export interface AngularNgNewOptionsSchema {
|
|
|
599
599
|
/**
|
|
600
600
|
* Creates a workspace with stricter type checking and stricter bundle budgets settings.
|
|
601
601
|
* This setting helps improve maintainability and catch bugs ahead of time. For more
|
|
602
|
-
* information, see https://angular.
|
|
602
|
+
* information, see https://angular.dev/tools/cli/template-typecheck#strict-mode
|
|
603
603
|
*/
|
|
604
604
|
strict?: boolean;
|
|
605
605
|
/**
|
package/lib/init.d.ts
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import 'symbol-observable';
|
package/lib/init.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "18.1.0-next.
|
|
3
|
+
"version": "18.1.0-next.3",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,18 +25,18 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.1801.0-next.
|
|
29
|
-
"@angular-devkit/core": "18.1.0-next.
|
|
30
|
-
"@angular-devkit/schematics": "18.1.0-next.
|
|
31
|
-
"@
|
|
28
|
+
"@angular-devkit/architect": "0.1801.0-next.3",
|
|
29
|
+
"@angular-devkit/core": "18.1.0-next.3",
|
|
30
|
+
"@angular-devkit/schematics": "18.1.0-next.3",
|
|
31
|
+
"@inquirer/prompts": "5.0.6",
|
|
32
|
+
"@listr2/prompt-adapter-inquirer": "2.0.12",
|
|
33
|
+
"@schematics/angular": "18.1.0-next.3",
|
|
32
34
|
"@yarnpkg/lockfile": "1.1.0",
|
|
33
|
-
"ansi-colors": "4.1.3",
|
|
34
35
|
"ini": "4.1.3",
|
|
35
|
-
"inquirer": "9.2.23",
|
|
36
36
|
"jsonc-parser": "3.2.1",
|
|
37
|
+
"listr2": "8.2.2",
|
|
37
38
|
"npm-package-arg": "11.0.2",
|
|
38
39
|
"npm-pick-manifest": "9.0.1",
|
|
39
|
-
"ora": "5.4.1",
|
|
40
40
|
"pacote": "18.0.6",
|
|
41
41
|
"resolve": "1.22.8",
|
|
42
42
|
"semver": "7.6.2",
|
|
@@ -46,19 +46,28 @@
|
|
|
46
46
|
"ng-update": {
|
|
47
47
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
48
48
|
"packageGroup": {
|
|
49
|
-
"@angular/cli": "18.1.0-next.
|
|
50
|
-
"@angular/build": "18.1.0-next.
|
|
51
|
-
"@angular/ssr": "18.1.0-next.
|
|
52
|
-
"@angular-devkit/architect": "0.1801.0-next.
|
|
53
|
-
"@angular-devkit/build-angular": "18.1.0-next.
|
|
54
|
-
"@angular-devkit/build-webpack": "0.1801.0-next.
|
|
55
|
-
"@angular-devkit/core": "18.1.0-next.
|
|
56
|
-
"@angular-devkit/schematics": "18.1.0-next.
|
|
49
|
+
"@angular/cli": "18.1.0-next.3",
|
|
50
|
+
"@angular/build": "18.1.0-next.3",
|
|
51
|
+
"@angular/ssr": "18.1.0-next.3",
|
|
52
|
+
"@angular-devkit/architect": "0.1801.0-next.3",
|
|
53
|
+
"@angular-devkit/build-angular": "18.1.0-next.3",
|
|
54
|
+
"@angular-devkit/build-webpack": "0.1801.0-next.3",
|
|
55
|
+
"@angular-devkit/core": "18.1.0-next.3",
|
|
56
|
+
"@angular-devkit/schematics": "18.1.0-next.3"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
+
"packageManager": "yarn@4.3.0",
|
|
59
60
|
"engines": {
|
|
60
61
|
"node": "^18.19.1 || ^20.11.1 || >=22.0.0",
|
|
61
62
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
62
63
|
"yarn": ">= 1.13.0"
|
|
64
|
+
},
|
|
65
|
+
"dependenciesMeta": {
|
|
66
|
+
"esbuild": {
|
|
67
|
+
"built": true
|
|
68
|
+
},
|
|
69
|
+
"puppeteer": {
|
|
70
|
+
"built": true
|
|
71
|
+
}
|
|
63
72
|
}
|
|
64
73
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { CommandContext } from '../command-builder/command-module';
|
|
9
9
|
import { EventCustomDimension, EventCustomMetric, PrimitiveTypes } from './analytics-parameters';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
/** Any changes in this file needs to be done in the mts version. */
|
|
9
9
|
export type PrimitiveTypes = string | number | boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.EventCustomMetric = exports.EventCustomDimension = exports.UserCustomDimension = exports.RequestParameter = void 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { CommandContext } from '../command-builder/command-module';
|
|
9
9
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.analyticsPackageSafelist = void 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { Architect, Target } from '@angular-devkit/architect';
|
|
9
9
|
import { WorkspaceNodeModulesArchitectHost } from '@angular-devkit/architect/node';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { Argv } from 'yargs';
|
|
9
9
|
import { ArchitectBaseCommandModule } from './architect-base-command-module';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
10
10
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { logging } from '@angular-devkit/core';
|
|
9
9
|
import { ArgumentsCamelCase, Argv, CamelCaseKey, CommandModule as YargsCommandModule } from 'yargs';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { logging } from '@angular-devkit/core';
|
|
9
9
|
export declare function runCommand(args: string[], logger: logging.Logger): Promise<number>;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { Collection } from '@angular-devkit/schematics';
|
|
9
9
|
import { FileSystemCollectionDescription, FileSystemSchematicDescription, NodeWorkflow } from '@angular-devkit/schematics/tools';
|
|
@@ -4,14 +4,37 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
9
25
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
10
26
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
11
27
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
12
28
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
13
29
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
30
|
};
|
|
31
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
15
38
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
16
39
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
17
40
|
};
|
|
@@ -25,7 +48,6 @@ const analytics_1 = require("../analytics/analytics");
|
|
|
25
48
|
const analytics_parameters_1 = require("../analytics/analytics-parameters");
|
|
26
49
|
const config_1 = require("../utilities/config");
|
|
27
50
|
const error_1 = require("../utilities/error");
|
|
28
|
-
const load_esm_1 = require("../utilities/load-esm");
|
|
29
51
|
const memoize_1 = require("../utilities/memoize");
|
|
30
52
|
const tty_1 = require("../utilities/tty");
|
|
31
53
|
const command_module_1 = require("./command-module");
|
|
@@ -124,70 +146,85 @@ class SchematicsCommandModule extends command_module_1.CommandModule {
|
|
|
124
146
|
});
|
|
125
147
|
if (options.interactive !== false && (0, tty_1.isTTY)()) {
|
|
126
148
|
workflow.registry.usePromptProvider(async (definitions) => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
message: definition.message,
|
|
133
|
-
default: definition.default,
|
|
134
|
-
};
|
|
135
|
-
const validator = definition.validator;
|
|
136
|
-
if (validator) {
|
|
137
|
-
question.validate = (input) => validator(input);
|
|
138
|
-
// Filter allows transformation of the value prior to validation
|
|
139
|
-
question.filter = async (input) => {
|
|
140
|
-
for (const type of definition.propertyTypes) {
|
|
141
|
-
let value;
|
|
142
|
-
switch (type) {
|
|
143
|
-
case 'string':
|
|
144
|
-
value = String(input);
|
|
145
|
-
break;
|
|
146
|
-
case 'integer':
|
|
147
|
-
case 'number':
|
|
148
|
-
value = Number(input);
|
|
149
|
-
break;
|
|
150
|
-
default:
|
|
151
|
-
value = input;
|
|
152
|
-
break;
|
|
153
|
-
}
|
|
154
|
-
// Can be a string if validation fails
|
|
155
|
-
const isValid = (await validator(value)) === true;
|
|
156
|
-
if (isValid) {
|
|
157
|
-
return value;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return input;
|
|
161
|
-
};
|
|
149
|
+
let prompts;
|
|
150
|
+
const answers = {};
|
|
151
|
+
for (const definition of definitions) {
|
|
152
|
+
if (options.defaults && definition.default !== undefined) {
|
|
153
|
+
continue;
|
|
162
154
|
}
|
|
155
|
+
// Only load prompt package if needed
|
|
156
|
+
prompts ??= await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
163
157
|
switch (definition.type) {
|
|
164
158
|
case 'confirmation':
|
|
165
|
-
|
|
159
|
+
answers[definition.id] = await prompts.confirm({
|
|
160
|
+
message: definition.message,
|
|
161
|
+
default: definition.default,
|
|
162
|
+
});
|
|
166
163
|
break;
|
|
167
164
|
case 'list':
|
|
168
|
-
|
|
169
|
-
|
|
165
|
+
if (!definition.items?.length) {
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
const choices = definition.items?.map((item) => {
|
|
170
169
|
return typeof item == 'string'
|
|
171
|
-
?
|
|
170
|
+
? {
|
|
171
|
+
name: item,
|
|
172
|
+
value: item,
|
|
173
|
+
}
|
|
172
174
|
: {
|
|
173
175
|
name: item.label,
|
|
174
176
|
value: item.value,
|
|
175
177
|
};
|
|
176
178
|
});
|
|
179
|
+
answers[definition.id] = await (definition.multiselect ? prompts.checkbox : prompts.select)({
|
|
180
|
+
message: definition.message,
|
|
181
|
+
default: definition.default,
|
|
182
|
+
choices,
|
|
183
|
+
});
|
|
177
184
|
break;
|
|
178
|
-
|
|
179
|
-
|
|
185
|
+
case 'input':
|
|
186
|
+
let finalValue;
|
|
187
|
+
answers[definition.id] = await prompts.input({
|
|
188
|
+
message: definition.message,
|
|
189
|
+
default: definition.default,
|
|
190
|
+
async validate(value) {
|
|
191
|
+
if (definition.validator === undefined) {
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
let lastValidation = false;
|
|
195
|
+
for (const type of definition.propertyTypes) {
|
|
196
|
+
let potential;
|
|
197
|
+
switch (type) {
|
|
198
|
+
case 'string':
|
|
199
|
+
potential = String(value);
|
|
200
|
+
break;
|
|
201
|
+
case 'integer':
|
|
202
|
+
case 'number':
|
|
203
|
+
potential = Number(value);
|
|
204
|
+
break;
|
|
205
|
+
default:
|
|
206
|
+
potential = value;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
lastValidation = await definition.validator(potential);
|
|
210
|
+
// Can be a string if validation fails
|
|
211
|
+
if (lastValidation === true) {
|
|
212
|
+
finalValue = potential;
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return lastValidation;
|
|
217
|
+
},
|
|
218
|
+
});
|
|
219
|
+
// Use validated value if present.
|
|
220
|
+
// This ensures the correct type is inserted into the final schema options.
|
|
221
|
+
if (finalValue !== undefined) {
|
|
222
|
+
answers[definition.id] = finalValue;
|
|
223
|
+
}
|
|
180
224
|
break;
|
|
181
225
|
}
|
|
182
|
-
return question;
|
|
183
|
-
});
|
|
184
|
-
if (questions.length) {
|
|
185
|
-
const { default: inquirer } = await (0, load_esm_1.loadEsmModule)('inquirer');
|
|
186
|
-
return inquirer.prompt(questions);
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
return {};
|
|
190
226
|
}
|
|
227
|
+
return answers;
|
|
191
228
|
});
|
|
192
229
|
}
|
|
193
230
|
return workflow;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { Argv } from 'yargs';
|
|
9
9
|
import { CommandContext, CommandModule, CommandModuleImplementation } from '../command-module';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.demandCommandFailureMessage = void 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
interface JsonHelpOption {
|
|
9
9
|
name: string;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { json } from '@angular-devkit/core';
|
|
9
9
|
import yargs from 'yargs';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.parseJsonSchemaToOptions = parseJsonSchemaToOptions;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import * as yargs from 'yargs';
|
|
9
9
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { RuleFactory } from '@angular-devkit/schematics';
|
|
9
9
|
import { FileSystemCollectionDesc, NodeModulesEngineHost } from '@angular-devkit/schematics/tools';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.SchematicEngineHost = void 0;
|