@angular/cli 18.0.3 → 18.1.0-next.1
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/lib/cli/index.js +1 -1
- package/lib/config/schema.json +26 -0
- package/package.json +15 -15
- package/src/analytics/analytics.js +6 -6
- package/src/command-builder/command-runner.js +1 -2
- package/src/command-builder/utilities/command.js +2 -2
- package/src/command-builder/utilities/json-help.js +1 -2
- package/src/command-builder/utilities/json-schema.js +1 -2
- package/src/command-builder/utilities/normalize-options-middleware.js +1 -2
- package/src/command-builder/utilities/schematic-workflow.js +1 -2
- package/src/commands/cache/utilities.js +2 -3
- package/src/commands/update/schematic/index.js +2 -3
- package/src/utilities/color.js +2 -2
- package/src/utilities/completion.js +3 -4
- package/src/utilities/config.js +8 -8
- package/src/utilities/eol.js +1 -2
- package/src/utilities/error.js +1 -2
- package/src/utilities/find-up.js +1 -2
- package/src/utilities/json-file.js +3 -3
- package/src/utilities/load-esm.d.ts +0 -1
- package/src/utilities/load-esm.js +1 -2
- package/src/utilities/log-file.js +1 -2
- package/src/utilities/memoize.js +1 -2
- package/src/utilities/package-metadata.js +3 -4
- package/src/utilities/package-tree.js +3 -4
- package/src/utilities/project.js +1 -2
- package/src/utilities/prompt.js +3 -4
- package/src/utilities/tty.js +1 -2
- package/src/utilities/version.js +1 -1
package/lib/cli/index.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.VERSION = void 0;
|
|
11
|
+
exports.default = default_1;
|
|
11
12
|
const core_1 = require("@angular-devkit/core");
|
|
12
13
|
const util_1 = require("util");
|
|
13
14
|
const command_module_1 = require("../../src/command-builder/command-module");
|
|
@@ -104,4 +105,3 @@ async function default_1(options) {
|
|
|
104
105
|
await loggerFinished;
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
|
-
exports.default = default_1;
|
package/lib/config/schema.json
CHANGED
|
@@ -3683,6 +3683,19 @@
|
|
|
3683
3683
|
"type": "number",
|
|
3684
3684
|
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
3685
3685
|
},
|
|
3686
|
+
"inspect": {
|
|
3687
|
+
"default": false,
|
|
3688
|
+
"description": "Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are enabled.",
|
|
3689
|
+
"oneOf": [
|
|
3690
|
+
{
|
|
3691
|
+
"type": "string",
|
|
3692
|
+
"description": "Activate the inspector on host and port in the format of `[[host:]port]`. See the security warning in https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure regarding the host parameter usage."
|
|
3693
|
+
},
|
|
3694
|
+
{
|
|
3695
|
+
"type": "boolean"
|
|
3696
|
+
}
|
|
3697
|
+
]
|
|
3698
|
+
},
|
|
3686
3699
|
"prebundle": {
|
|
3687
3700
|
"description": "Enable and control the Vite-based development server's prebundling capabilities. To enable prebundling, the Angular CLI cache must also be enabled.",
|
|
3688
3701
|
"default": true,
|
|
@@ -3811,6 +3824,19 @@
|
|
|
3811
3824
|
"type": "number",
|
|
3812
3825
|
"description": "Enable and define the file watching poll time period in milliseconds."
|
|
3813
3826
|
},
|
|
3827
|
+
"inspect": {
|
|
3828
|
+
"default": false,
|
|
3829
|
+
"description": "Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are enabled.",
|
|
3830
|
+
"oneOf": [
|
|
3831
|
+
{
|
|
3832
|
+
"type": "string",
|
|
3833
|
+
"description": "Activate the inspector on host and port in the format of `[[host:]port]`. See the security warning in https://nodejs.org/docs/latest-v22.x/api/cli.html#warning-binding-inspector-to-a-public-ipport-combination-is-insecure regarding the host parameter usage."
|
|
3834
|
+
},
|
|
3835
|
+
{
|
|
3836
|
+
"type": "boolean"
|
|
3837
|
+
}
|
|
3838
|
+
]
|
|
3839
|
+
},
|
|
3814
3840
|
"forceEsbuild": {
|
|
3815
3841
|
"type": "boolean",
|
|
3816
3842
|
"description": "Force the development server to use the 'browser-esbuild' builder when building. This is a developer preview option for the esbuild-based build system.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "18.0.
|
|
3
|
+
"version": "18.1.0-next.1",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.
|
|
29
|
-
"@angular-devkit/core": "18.0.
|
|
30
|
-
"@angular-devkit/schematics": "18.0.
|
|
31
|
-
"@schematics/angular": "18.0.
|
|
28
|
+
"@angular-devkit/architect": "0.1801.0-next.1",
|
|
29
|
+
"@angular-devkit/core": "18.1.0-next.1",
|
|
30
|
+
"@angular-devkit/schematics": "18.1.0-next.1",
|
|
31
|
+
"@schematics/angular": "18.1.0-next.1",
|
|
32
32
|
"@yarnpkg/lockfile": "1.1.0",
|
|
33
33
|
"ansi-colors": "4.1.3",
|
|
34
|
-
"ini": "4.1.
|
|
35
|
-
"inquirer": "9.2.
|
|
34
|
+
"ini": "4.1.3",
|
|
35
|
+
"inquirer": "9.2.23",
|
|
36
36
|
"jsonc-parser": "3.2.1",
|
|
37
37
|
"npm-package-arg": "11.0.2",
|
|
38
38
|
"npm-pick-manifest": "9.0.1",
|
|
@@ -46,14 +46,14 @@
|
|
|
46
46
|
"ng-update": {
|
|
47
47
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
48
48
|
"packageGroup": {
|
|
49
|
-
"@angular/cli": "18.0.
|
|
50
|
-
"@angular/build": "18.0.
|
|
51
|
-
"@angular/ssr": "18.0.
|
|
52
|
-
"@angular-devkit/architect": "0.
|
|
53
|
-
"@angular-devkit/build-angular": "18.0.
|
|
54
|
-
"@angular-devkit/build-webpack": "0.
|
|
55
|
-
"@angular-devkit/core": "18.0.
|
|
56
|
-
"@angular-devkit/schematics": "18.0.
|
|
49
|
+
"@angular/cli": "18.1.0-next.1",
|
|
50
|
+
"@angular/build": "18.1.0-next.1",
|
|
51
|
+
"@angular/ssr": "18.1.0-next.1",
|
|
52
|
+
"@angular-devkit/architect": "0.1801.0-next.1",
|
|
53
|
+
"@angular-devkit/build-angular": "18.1.0-next.1",
|
|
54
|
+
"@angular-devkit/build-webpack": "0.1801.0-next.1",
|
|
55
|
+
"@angular-devkit/core": "18.1.0-next.1",
|
|
56
|
+
"@angular-devkit/schematics": "18.1.0-next.1"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
@@ -7,7 +7,12 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.analyticsPackageSafelist = void 0;
|
|
11
|
+
exports.isPackageNameSafeForAnalytics = isPackageNameSafeForAnalytics;
|
|
12
|
+
exports.setAnalyticsConfig = setAnalyticsConfig;
|
|
13
|
+
exports.promptAnalytics = promptAnalytics;
|
|
14
|
+
exports.getAnalyticsUserId = getAnalyticsUserId;
|
|
15
|
+
exports.getAnalyticsInfoString = getAnalyticsInfoString;
|
|
11
16
|
const core_1 = require("@angular-devkit/core");
|
|
12
17
|
const crypto_1 = require("crypto");
|
|
13
18
|
const color_1 = require("../utilities/color");
|
|
@@ -35,7 +40,6 @@ function isPackageNameSafeForAnalytics(name) {
|
|
|
35
40
|
}
|
|
36
41
|
});
|
|
37
42
|
}
|
|
38
|
-
exports.isPackageNameSafeForAnalytics = isPackageNameSafeForAnalytics;
|
|
39
43
|
/**
|
|
40
44
|
* Set analytics settings. This does not work if the user is not inside a project.
|
|
41
45
|
* @param global Which config to use. "global" for user-level, and "local" for project-level.
|
|
@@ -54,7 +58,6 @@ async function setAnalyticsConfig(global, value) {
|
|
|
54
58
|
cli.analytics = value === true ? (0, crypto_1.randomUUID)() : value;
|
|
55
59
|
await workspace.save();
|
|
56
60
|
}
|
|
57
|
-
exports.setAnalyticsConfig = setAnalyticsConfig;
|
|
58
61
|
/**
|
|
59
62
|
* Prompt the user for usage gathering permission.
|
|
60
63
|
* @param force Whether to ask regardless of whether or not the user is using an interactive shell.
|
|
@@ -89,7 +92,6 @@ details and how to change this setting, see https://angular.dev/cli/analytics.
|
|
|
89
92
|
}
|
|
90
93
|
return false;
|
|
91
94
|
}
|
|
92
|
-
exports.promptAnalytics = promptAnalytics;
|
|
93
95
|
/**
|
|
94
96
|
* Get the analytics user id.
|
|
95
97
|
*
|
|
@@ -154,7 +156,6 @@ async function getAnalyticsUserId(context, skipPrompt = false) {
|
|
|
154
156
|
}
|
|
155
157
|
return globalConfig;
|
|
156
158
|
}
|
|
157
|
-
exports.getAnalyticsUserId = getAnalyticsUserId;
|
|
158
159
|
function analyticsConfigValueToHumanFormat(value) {
|
|
159
160
|
if (value === false) {
|
|
160
161
|
return 'disabled';
|
|
@@ -179,4 +180,3 @@ async function getAnalyticsInfoString(context) {
|
|
|
179
180
|
Effective status: ${analyticsInstance ? 'enabled' : 'disabled'}
|
|
180
181
|
` + '\n');
|
|
181
182
|
}
|
|
182
|
-
exports.getAnalyticsInfoString = getAnalyticsInfoString;
|
|
@@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.runCommand =
|
|
13
|
+
exports.runCommand = runCommand;
|
|
14
14
|
const yargs_1 = __importDefault(require("yargs"));
|
|
15
15
|
const helpers_1 = require("yargs/helpers");
|
|
16
16
|
const command_config_1 = require("../commands/command-config");
|
|
@@ -119,7 +119,6 @@ async function runCommand(args, logger) {
|
|
|
119
119
|
.parseAsync();
|
|
120
120
|
return process.exitCode ?? 0;
|
|
121
121
|
}
|
|
122
|
-
exports.runCommand = runCommand;
|
|
123
122
|
/**
|
|
124
123
|
* Get the commands that need to be registered.
|
|
125
124
|
* @returns One or more command factories that needs to be registered.
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.demandCommandFailureMessage = void 0;
|
|
11
|
+
exports.addCommandModuleToYargs = addCommandModuleToYargs;
|
|
11
12
|
const command_module_1 = require("../command-module");
|
|
12
13
|
exports.demandCommandFailureMessage = `You need to specify a command before moving on. Use '--help' to view the available commands.`;
|
|
13
14
|
function addCommandModuleToYargs(localYargs, commandModule, context) {
|
|
@@ -35,4 +36,3 @@ function addCommandModuleToYargs(localYargs, commandModule, context) {
|
|
|
35
36
|
handler: (args) => cmd.handler(args),
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
|
-
exports.addCommandModuleToYargs = addCommandModuleToYargs;
|
|
@@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.jsonHelpUsage =
|
|
13
|
+
exports.jsonHelpUsage = jsonHelpUsage;
|
|
14
14
|
const yargs_1 = __importDefault(require("yargs"));
|
|
15
15
|
const yargsDefaultCommandRegExp = /^\$0|\*/;
|
|
16
16
|
function jsonHelpUsage() {
|
|
@@ -75,7 +75,6 @@ function jsonHelpUsage() {
|
|
|
75
75
|
};
|
|
76
76
|
return JSON.stringify(output, undefined, 2);
|
|
77
77
|
}
|
|
78
|
-
exports.jsonHelpUsage = jsonHelpUsage;
|
|
79
78
|
function parseDescription(rawDescription) {
|
|
80
79
|
try {
|
|
81
80
|
const { longDescription, describe: shortDescription, longDescriptionRelativePath, } = JSON.parse(rawDescription);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.parseJsonSchemaToOptions =
|
|
10
|
+
exports.parseJsonSchemaToOptions = parseJsonSchemaToOptions;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
|
|
13
13
|
const options = [];
|
|
@@ -141,4 +141,3 @@ async function parseJsonSchemaToOptions(registry, schema, interactive = true) {
|
|
|
141
141
|
return a.name.localeCompare(b.name);
|
|
142
142
|
});
|
|
143
143
|
}
|
|
144
|
-
exports.parseJsonSchemaToOptions = parseJsonSchemaToOptions;
|
|
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.normalizeOptionsMiddleware =
|
|
33
|
+
exports.normalizeOptionsMiddleware = normalizeOptionsMiddleware;
|
|
34
34
|
const yargs = __importStar(require("yargs"));
|
|
35
35
|
/**
|
|
36
36
|
* A Yargs middleware that normalizes non Array options when the argument has been provided multiple times.
|
|
@@ -56,4 +56,3 @@ function normalizeOptionsMiddleware(args) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
exports.normalizeOptionsMiddleware = normalizeOptionsMiddleware;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.subscribeToWorkflow =
|
|
10
|
+
exports.subscribeToWorkflow = subscribeToWorkflow;
|
|
11
11
|
const color_1 = require("../../utilities/color");
|
|
12
12
|
function subscribeToWorkflow(workflow, logger) {
|
|
13
13
|
const files = new Set();
|
|
@@ -60,4 +60,3 @@ function subscribeToWorkflow(workflow, logger) {
|
|
|
60
60
|
},
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
-
exports.subscribeToWorkflow = subscribeToWorkflow;
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.updateCacheConfig = updateCacheConfig;
|
|
11
|
+
exports.getCacheConfig = getCacheConfig;
|
|
11
12
|
const core_1 = require("@angular-devkit/core");
|
|
12
13
|
const path_1 = require("path");
|
|
13
14
|
const workspace_schema_1 = require("../../../lib/config/workspace-schema");
|
|
@@ -17,7 +18,6 @@ function updateCacheConfig(workspace, key, value) {
|
|
|
17
18
|
cache[key] = value;
|
|
18
19
|
return workspace.save();
|
|
19
20
|
}
|
|
20
|
-
exports.updateCacheConfig = updateCacheConfig;
|
|
21
21
|
function getCacheConfig(workspace) {
|
|
22
22
|
if (!workspace) {
|
|
23
23
|
throw new Error(`Cannot retrieve cache configuration as workspace is not defined.`);
|
|
@@ -44,4 +44,3 @@ function getCacheConfig(workspace) {
|
|
|
44
44
|
enabled,
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
exports.getCacheConfig = getCacheConfig;
|
|
@@ -30,7 +30,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.angularMajorCompatGuarantee =
|
|
33
|
+
exports.angularMajorCompatGuarantee = angularMajorCompatGuarantee;
|
|
34
|
+
exports.default = default_1;
|
|
34
35
|
const core_1 = require("@angular-devkit/core");
|
|
35
36
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
36
37
|
const npa = __importStar(require("npm-package-arg"));
|
|
@@ -64,7 +65,6 @@ function angularMajorCompatGuarantee(range) {
|
|
|
64
65
|
}
|
|
65
66
|
return semver.validRange(newRange) || range;
|
|
66
67
|
}
|
|
67
|
-
exports.angularMajorCompatGuarantee = angularMajorCompatGuarantee;
|
|
68
68
|
// This is a map of packageGroupName to range extending function. If it isn't found, the range is
|
|
69
69
|
// kept the same.
|
|
70
70
|
const knownPeerCompatibleList = {
|
|
@@ -703,4 +703,3 @@ function default_1(options) {
|
|
|
703
703
|
}
|
|
704
704
|
};
|
|
705
705
|
}
|
|
706
|
-
exports.default = default_1;
|
package/src/utilities/color.js
CHANGED
|
@@ -30,7 +30,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.colors =
|
|
33
|
+
exports.colors = void 0;
|
|
34
|
+
exports.removeColor = removeColor;
|
|
34
35
|
const ansiColors = __importStar(require("ansi-colors"));
|
|
35
36
|
const tty_1 = require("tty");
|
|
36
37
|
function supportColor() {
|
|
@@ -62,7 +63,6 @@ function removeColor(text) {
|
|
|
62
63
|
// see: https://github.com/doowb/ansi-colors/blob/a4794363369d7b4d1872d248fc43a12761640d8e/index.js#L38
|
|
63
64
|
return text.replace(ansiColors.ansiRegex, '');
|
|
64
65
|
}
|
|
65
|
-
exports.removeColor = removeColor;
|
|
66
66
|
// Create a separate instance to prevent unintended global changes to the color configuration
|
|
67
67
|
const colors = ansiColors.create();
|
|
68
68
|
exports.colors = colors;
|
|
@@ -30,7 +30,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
33
|
+
exports.considerSettingUpAutocompletion = considerSettingUpAutocompletion;
|
|
34
|
+
exports.initializeAutocomplete = initializeAutocomplete;
|
|
35
|
+
exports.hasGlobalCliInstall = hasGlobalCliInstall;
|
|
34
36
|
const core_1 = require("@angular-devkit/core");
|
|
35
37
|
const child_process_1 = require("child_process");
|
|
36
38
|
const fs_1 = require("fs");
|
|
@@ -95,7 +97,6 @@ Appended \`source <(ng completion script)\` to \`${rcFile}\`. Restart your termi
|
|
|
95
97
|
await setCompletionConfig({ ...completionConfig, prompted: true });
|
|
96
98
|
return undefined;
|
|
97
99
|
}
|
|
98
|
-
exports.considerSettingUpAutocompletion = considerSettingUpAutocompletion;
|
|
99
100
|
async function getCompletionConfig() {
|
|
100
101
|
const wksp = await (0, config_1.getWorkspace)('global');
|
|
101
102
|
return wksp?.getCli()?.['completion'];
|
|
@@ -207,7 +208,6 @@ async function initializeAutocomplete() {
|
|
|
207
208
|
}
|
|
208
209
|
return rcFile;
|
|
209
210
|
}
|
|
210
|
-
exports.initializeAutocomplete = initializeAutocomplete;
|
|
211
211
|
/** Returns an ordered list of possible candidates of RC files used by the given shell. */
|
|
212
212
|
function getShellRunCommandCandidates(shell, home) {
|
|
213
213
|
if (shell.toLowerCase().includes('bash')) {
|
|
@@ -257,4 +257,3 @@ function hasGlobalCliInstall() {
|
|
|
257
257
|
});
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
exports.hasGlobalCliInstall = hasGlobalCliInstall;
|
package/src/utilities/config.js
CHANGED
|
@@ -30,7 +30,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
33
|
+
exports.AngularWorkspace = exports.workspaceSchemaPath = void 0;
|
|
34
|
+
exports.getWorkspace = getWorkspace;
|
|
35
|
+
exports.getWorkspaceRaw = getWorkspaceRaw;
|
|
36
|
+
exports.validateWorkspace = validateWorkspace;
|
|
37
|
+
exports.getProjectByCwd = getProjectByCwd;
|
|
38
|
+
exports.getConfiguredPackageManager = getConfiguredPackageManager;
|
|
39
|
+
exports.getSchematicDefaults = getSchematicDefaults;
|
|
40
|
+
exports.isWarningEnabled = isWarningEnabled;
|
|
34
41
|
const core_1 = require("@angular-devkit/core");
|
|
35
42
|
const fs_1 = require("fs");
|
|
36
43
|
const os = __importStar(require("os"));
|
|
@@ -180,7 +187,6 @@ async function getWorkspace(level) {
|
|
|
180
187
|
`\n${error instanceof Error ? error.message : error}`);
|
|
181
188
|
}
|
|
182
189
|
}
|
|
183
|
-
exports.getWorkspace = getWorkspace;
|
|
184
190
|
/**
|
|
185
191
|
* This method will load the workspace configuration in raw JSON format.
|
|
186
192
|
* When `level` is `global` and file doesn't exists, it will be created.
|
|
@@ -202,7 +208,6 @@ async function getWorkspaceRaw(level = 'local') {
|
|
|
202
208
|
}
|
|
203
209
|
return [new json_file_1.JSONFile(configPath), configPath];
|
|
204
210
|
}
|
|
205
|
-
exports.getWorkspaceRaw = getWorkspaceRaw;
|
|
206
211
|
async function validateWorkspace(data, isGlobal) {
|
|
207
212
|
const schema = (0, json_file_1.readAndParseJson)(exports.workspaceSchemaPath);
|
|
208
213
|
// We should eventually have a dedicated global config schema and use that to validate.
|
|
@@ -220,7 +225,6 @@ async function validateWorkspace(data, isGlobal) {
|
|
|
220
225
|
throw new core_1.json.schema.SchemaValidationException(errors);
|
|
221
226
|
}
|
|
222
227
|
}
|
|
223
|
-
exports.validateWorkspace = validateWorkspace;
|
|
224
228
|
function findProjectByPath(workspace, location) {
|
|
225
229
|
const isInside = (base, potential) => {
|
|
226
230
|
const absoluteBase = path.resolve(workspace.basePath, base);
|
|
@@ -268,7 +272,6 @@ function getProjectByCwd(workspace) {
|
|
|
268
272
|
}
|
|
269
273
|
return null;
|
|
270
274
|
}
|
|
271
|
-
exports.getProjectByCwd = getProjectByCwd;
|
|
272
275
|
async function getConfiguredPackageManager() {
|
|
273
276
|
const getPackageManager = (source) => {
|
|
274
277
|
if (isJsonObject(source)) {
|
|
@@ -294,7 +297,6 @@ async function getConfiguredPackageManager() {
|
|
|
294
297
|
}
|
|
295
298
|
return result;
|
|
296
299
|
}
|
|
297
|
-
exports.getConfiguredPackageManager = getConfiguredPackageManager;
|
|
298
300
|
async function getSchematicDefaults(collection, schematic, project) {
|
|
299
301
|
const result = {};
|
|
300
302
|
const mergeOptions = (source) => {
|
|
@@ -323,7 +325,6 @@ async function getSchematicDefaults(collection, schematic, project) {
|
|
|
323
325
|
}
|
|
324
326
|
return result;
|
|
325
327
|
}
|
|
326
|
-
exports.getSchematicDefaults = getSchematicDefaults;
|
|
327
328
|
async function isWarningEnabled(warning) {
|
|
328
329
|
const getWarning = (source) => {
|
|
329
330
|
if (isJsonObject(source)) {
|
|
@@ -352,4 +353,3 @@ async function isWarningEnabled(warning) {
|
|
|
352
353
|
// All warnings are enabled by default
|
|
353
354
|
return result ?? true;
|
|
354
355
|
}
|
|
355
|
-
exports.isWarningEnabled = isWarningEnabled;
|
package/src/utilities/eol.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.getEOL =
|
|
10
|
+
exports.getEOL = getEOL;
|
|
11
11
|
const node_os_1 = require("node:os");
|
|
12
12
|
const CRLF = '\r\n';
|
|
13
13
|
const LF = '\n';
|
|
@@ -20,4 +20,3 @@ function getEOL(content) {
|
|
|
20
20
|
}
|
|
21
21
|
return node_os_1.EOL;
|
|
22
22
|
}
|
|
23
|
-
exports.getEOL = getEOL;
|
package/src/utilities/error.js
CHANGED
|
@@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.assertIsError =
|
|
13
|
+
exports.assertIsError = assertIsError;
|
|
14
14
|
const assert_1 = __importDefault(require("assert"));
|
|
15
15
|
function assertIsError(value) {
|
|
16
16
|
const isError = value instanceof Error ||
|
|
@@ -18,4 +18,3 @@ function assertIsError(value) {
|
|
|
18
18
|
(typeof value === 'object' && value && 'name' in value && 'message' in value);
|
|
19
19
|
(0, assert_1.default)(isError, 'catch clause variable is not an Error instance');
|
|
20
20
|
}
|
|
21
|
-
exports.assertIsError = assertIsError;
|
package/src/utilities/find-up.js
CHANGED
|
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.findUp =
|
|
33
|
+
exports.findUp = findUp;
|
|
34
34
|
const fs_1 = require("fs");
|
|
35
35
|
const path = __importStar(require("path"));
|
|
36
36
|
function findUp(names, from) {
|
|
@@ -50,4 +50,3 @@ function findUp(names, from) {
|
|
|
50
50
|
}
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
|
-
exports.findUp = findUp;
|
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.JSONFile = void 0;
|
|
11
|
+
exports.readAndParseJson = readAndParseJson;
|
|
12
|
+
exports.parseJson = parseJson;
|
|
11
13
|
const fs_1 = require("fs");
|
|
12
14
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
13
15
|
const eol_1 = require("./eol");
|
|
@@ -93,7 +95,6 @@ function readAndParseJson(path) {
|
|
|
93
95
|
}
|
|
94
96
|
return content;
|
|
95
97
|
}
|
|
96
|
-
exports.readAndParseJson = readAndParseJson;
|
|
97
98
|
function formatError(path, errors) {
|
|
98
99
|
const { error, offset } = errors[0];
|
|
99
100
|
throw new Error(`Failed to parse "${path}" as JSON AST Object. ${(0, jsonc_parser_1.printParseErrorCode)(error)} at location: ${offset}.`);
|
|
@@ -102,4 +103,3 @@ function formatError(path, errors) {
|
|
|
102
103
|
function parseJson(content) {
|
|
103
104
|
return (0, jsonc_parser_1.parse)(content, undefined, { allowTrailingComma: true });
|
|
104
105
|
}
|
|
105
|
-
exports.parseJson = parseJson;
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
|
-
/// <reference types="node" />
|
|
9
8
|
/**
|
|
10
9
|
* This uses a dynamic import to load a module which may be ESM.
|
|
11
10
|
* CommonJS code can load ESM code via a dynamic import. Unfortunately, TypeScript
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.loadEsmModule =
|
|
10
|
+
exports.loadEsmModule = loadEsmModule;
|
|
11
11
|
/**
|
|
12
12
|
* Lazily compiled dynamic import loader function.
|
|
13
13
|
*/
|
|
@@ -28,4 +28,3 @@ function loadEsmModule(modulePath) {
|
|
|
28
28
|
load ??= new Function('modulePath', `return import(modulePath);`);
|
|
29
29
|
return load(modulePath);
|
|
30
30
|
}
|
|
31
|
-
exports.loadEsmModule = loadEsmModule;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.writeErrorToLogFile =
|
|
10
|
+
exports.writeErrorToLogFile = writeErrorToLogFile;
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
12
|
const os_1 = require("os");
|
|
13
13
|
const path_1 = require("path");
|
|
@@ -25,4 +25,3 @@ function writeErrorToLogFile(error) {
|
|
|
25
25
|
(0, fs_1.appendFileSync)(logPath, '[error] ' + (error.stack || error) + '\n\n');
|
|
26
26
|
return logPath;
|
|
27
27
|
}
|
|
28
|
-
exports.writeErrorToLogFile = writeErrorToLogFile;
|
package/src/utilities/memoize.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.memoize =
|
|
10
|
+
exports.memoize = memoize;
|
|
11
11
|
/**
|
|
12
12
|
* A decorator that memoizes methods and getters.
|
|
13
13
|
*
|
|
@@ -40,7 +40,6 @@ function memoize(target, propertyKey, descriptor) {
|
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
exports.memoize = memoize;
|
|
44
43
|
/** Method to check if value is a non primitive. */
|
|
45
44
|
function isNonPrimitive(value) {
|
|
46
45
|
return ((value !== null && typeof value === 'object') ||
|
|
@@ -30,7 +30,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
33
|
+
exports.fetchPackageMetadata = fetchPackageMetadata;
|
|
34
|
+
exports.fetchPackageManifest = fetchPackageManifest;
|
|
35
|
+
exports.getNpmPackageJson = getNpmPackageJson;
|
|
34
36
|
const lockfile = __importStar(require("@yarnpkg/lockfile"));
|
|
35
37
|
const fs_1 = require("fs");
|
|
36
38
|
const ini = __importStar(require("ini"));
|
|
@@ -217,7 +219,6 @@ async function fetchPackageMetadata(name, logger, options) {
|
|
|
217
219
|
}
|
|
218
220
|
return metadata;
|
|
219
221
|
}
|
|
220
|
-
exports.fetchPackageMetadata = fetchPackageMetadata;
|
|
221
222
|
async function fetchPackageManifest(name, logger, options = {}) {
|
|
222
223
|
const { usingYarn = false, verbose = false, registry } = options;
|
|
223
224
|
ensureNpmrc(logger, usingYarn, verbose);
|
|
@@ -229,7 +230,6 @@ async function fetchPackageManifest(name, logger, options = {}) {
|
|
|
229
230
|
});
|
|
230
231
|
return response;
|
|
231
232
|
}
|
|
232
|
-
exports.fetchPackageManifest = fetchPackageManifest;
|
|
233
233
|
async function getNpmPackageJson(packageName, logger, options = {}) {
|
|
234
234
|
const cachedResponse = npmPackageJsonCache.get(packageName);
|
|
235
235
|
if (cachedResponse) {
|
|
@@ -252,4 +252,3 @@ async function getNpmPackageJson(packageName, logger, options = {}) {
|
|
|
252
252
|
npmPackageJsonCache.set(packageName, response);
|
|
253
253
|
return response;
|
|
254
254
|
}
|
|
255
|
-
exports.getNpmPackageJson = getNpmPackageJson;
|
|
@@ -30,7 +30,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
33
|
+
exports.readPackageJson = readPackageJson;
|
|
34
|
+
exports.findPackageJson = findPackageJson;
|
|
35
|
+
exports.getProjectDependencies = getProjectDependencies;
|
|
34
36
|
const fs = __importStar(require("fs"));
|
|
35
37
|
const path_1 = require("path");
|
|
36
38
|
const resolve = __importStar(require("resolve"));
|
|
@@ -50,7 +52,6 @@ async function readPackageJson(packageJsonPath) {
|
|
|
50
52
|
return undefined;
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
|
-
exports.readPackageJson = readPackageJson;
|
|
54
55
|
function findPackageJson(workspaceDir, packageName) {
|
|
55
56
|
try {
|
|
56
57
|
// avoid require.resolve here, see: https://github.com/angular/angular-cli/pull/18610#issuecomment-681980185
|
|
@@ -61,7 +62,6 @@ function findPackageJson(workspaceDir, packageName) {
|
|
|
61
62
|
return undefined;
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
exports.findPackageJson = findPackageJson;
|
|
65
65
|
async function getProjectDependencies(dir) {
|
|
66
66
|
const pkg = await readPackageJson((0, path_1.join)(dir, 'package.json'));
|
|
67
67
|
if (!pkg) {
|
|
@@ -82,4 +82,3 @@ async function getProjectDependencies(dir) {
|
|
|
82
82
|
}
|
|
83
83
|
return results;
|
|
84
84
|
}
|
|
85
|
-
exports.getProjectDependencies = getProjectDependencies;
|
package/src/utilities/project.js
CHANGED
|
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.findWorkspaceFile =
|
|
33
|
+
exports.findWorkspaceFile = findWorkspaceFile;
|
|
34
34
|
const core_1 = require("@angular-devkit/core");
|
|
35
35
|
const fs = __importStar(require("fs"));
|
|
36
36
|
const os = __importStar(require("os"));
|
|
@@ -61,7 +61,6 @@ function findWorkspaceFile(currentDirectory = process.cwd()) {
|
|
|
61
61
|
}
|
|
62
62
|
return configFilePath;
|
|
63
63
|
}
|
|
64
|
-
exports.findWorkspaceFile = findWorkspaceFile;
|
|
65
64
|
function containsCliDep(obj) {
|
|
66
65
|
const pkgName = '@angular/cli';
|
|
67
66
|
if (!obj) {
|
package/src/utilities/prompt.js
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.askConfirmation = askConfirmation;
|
|
11
|
+
exports.askQuestion = askQuestion;
|
|
12
|
+
exports.askChoices = askChoices;
|
|
11
13
|
const load_esm_1 = require("./load-esm");
|
|
12
14
|
const tty_1 = require("./tty");
|
|
13
15
|
async function askConfirmation(message, defaultResponse, noTTYResponse) {
|
|
@@ -25,7 +27,6 @@ async function askConfirmation(message, defaultResponse, noTTYResponse) {
|
|
|
25
27
|
const answers = await inquirer.prompt([question]);
|
|
26
28
|
return answers['confirmation'];
|
|
27
29
|
}
|
|
28
|
-
exports.askConfirmation = askConfirmation;
|
|
29
30
|
async function askQuestion(message, choices, defaultResponseIndex, noTTYResponse) {
|
|
30
31
|
if (!(0, tty_1.isTTY)()) {
|
|
31
32
|
return noTTYResponse;
|
|
@@ -42,7 +43,6 @@ async function askQuestion(message, choices, defaultResponseIndex, noTTYResponse
|
|
|
42
43
|
const answers = await inquirer.prompt([question]);
|
|
43
44
|
return answers['answer'];
|
|
44
45
|
}
|
|
45
|
-
exports.askQuestion = askQuestion;
|
|
46
46
|
async function askChoices(message, choices, noTTYResponse) {
|
|
47
47
|
if (!(0, tty_1.isTTY)()) {
|
|
48
48
|
return noTTYResponse;
|
|
@@ -58,4 +58,3 @@ async function askChoices(message, choices, noTTYResponse) {
|
|
|
58
58
|
const answers = await inquirer.prompt([question]);
|
|
59
59
|
return answers['answer'];
|
|
60
60
|
}
|
|
61
|
-
exports.askChoices = askChoices;
|
package/src/utilities/tty.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.isTTY =
|
|
10
|
+
exports.isTTY = isTTY;
|
|
11
11
|
function _isTruthy(value) {
|
|
12
12
|
// Returns true if value is a string that is anything but 0 or false.
|
|
13
13
|
return value !== undefined && value !== '0' && value.toUpperCase() !== 'FALSE';
|
|
@@ -20,4 +20,3 @@ function isTTY() {
|
|
|
20
20
|
}
|
|
21
21
|
return !!process.stdout.isTTY && !_isTruthy(process.env['CI']);
|
|
22
22
|
}
|
|
23
|
-
exports.isTTY = isTTY;
|
package/src/utilities/version.js
CHANGED
|
@@ -25,5 +25,5 @@ class Version {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
// TODO(bazel): Convert this to use build-time version stamping after flipping the build script to use bazel
|
|
28
|
-
// export const VERSION = new Version('18.0.
|
|
28
|
+
// export const VERSION = new Version('18.1.0-next.1');
|
|
29
29
|
exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);
|