@angular/cli 18.0.0-rc.2 → 18.0.0
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/package.json +15 -15
- package/src/analytics/analytics.js +8 -16
- package/src/command-builder/command-module.js +2 -2
- package/src/command-builder/command-runner.js +3 -0
- package/src/commands/update/cli.js +10 -6
- package/src/commands/update/long-description.md +1 -1
- package/src/utilities/completion.js +8 -18
- package/src/utilities/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "18.0.0
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,35 +25,35 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.1800.0
|
|
29
|
-
"@angular-devkit/core": "18.0.0
|
|
30
|
-
"@angular-devkit/schematics": "18.0.0
|
|
31
|
-
"@schematics/angular": "18.0.0
|
|
28
|
+
"@angular-devkit/architect": "0.1800.0",
|
|
29
|
+
"@angular-devkit/core": "18.0.0",
|
|
30
|
+
"@angular-devkit/schematics": "18.0.0",
|
|
31
|
+
"@schematics/angular": "18.0.0",
|
|
32
32
|
"@yarnpkg/lockfile": "1.1.0",
|
|
33
33
|
"ansi-colors": "4.1.3",
|
|
34
34
|
"ini": "4.1.2",
|
|
35
|
-
"inquirer": "9.2.
|
|
35
|
+
"inquirer": "9.2.22",
|
|
36
36
|
"jsonc-parser": "3.2.1",
|
|
37
37
|
"npm-package-arg": "11.0.2",
|
|
38
38
|
"npm-pick-manifest": "9.0.1",
|
|
39
39
|
"ora": "5.4.1",
|
|
40
40
|
"pacote": "18.0.6",
|
|
41
41
|
"resolve": "1.22.8",
|
|
42
|
-
"semver": "7.6.
|
|
42
|
+
"semver": "7.6.2",
|
|
43
43
|
"symbol-observable": "4.0.0",
|
|
44
44
|
"yargs": "17.7.2"
|
|
45
45
|
},
|
|
46
46
|
"ng-update": {
|
|
47
47
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
48
48
|
"packageGroup": {
|
|
49
|
-
"@angular/
|
|
50
|
-
"@angular/
|
|
51
|
-
"@angular/ssr": "18.0.0
|
|
52
|
-
"@angular-devkit/architect": "0.1800.0
|
|
53
|
-
"@angular-devkit/build-angular": "18.0.0
|
|
54
|
-
"@angular-devkit/build-webpack": "0.1800.0
|
|
55
|
-
"@angular-devkit/core": "18.0.0
|
|
56
|
-
"@angular-devkit/schematics": "18.0.0
|
|
49
|
+
"@angular/cli": "18.0.0",
|
|
50
|
+
"@angular/build": "18.0.0",
|
|
51
|
+
"@angular/ssr": "18.0.0",
|
|
52
|
+
"@angular-devkit/architect": "0.1800.0",
|
|
53
|
+
"@angular-devkit/build-angular": "18.0.0",
|
|
54
|
+
"@angular-devkit/build-webpack": "0.1800.0",
|
|
55
|
+
"@angular-devkit/core": "18.0.0",
|
|
56
|
+
"@angular-devkit/schematics": "18.0.0"
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
"engines": {
|
|
@@ -13,7 +13,7 @@ const crypto_1 = require("crypto");
|
|
|
13
13
|
const color_1 = require("../utilities/color");
|
|
14
14
|
const config_1 = require("../utilities/config");
|
|
15
15
|
const environment_options_1 = require("../utilities/environment-options");
|
|
16
|
-
const
|
|
16
|
+
const prompt_1 = require("../utilities/prompt");
|
|
17
17
|
const tty_1 = require("../utilities/tty");
|
|
18
18
|
/* eslint-disable no-console */
|
|
19
19
|
/**
|
|
@@ -67,22 +67,14 @@ async function promptAnalytics(context, global, force = false) {
|
|
|
67
67
|
throw new Error(`Could not find a ${level} workspace. Are you in a project?`);
|
|
68
68
|
}
|
|
69
69
|
if (force || (0, tty_1.isTTY)()) {
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
name: 'analytics',
|
|
75
|
-
message: core_1.tags.stripIndents `
|
|
76
|
-
Would you like to share pseudonymous usage data about this project with the Angular Team
|
|
77
|
-
at Google under Google's Privacy Policy at https://policies.google.com/privacy. For more
|
|
78
|
-
details and how to change this setting, see https://angular.io/analytics.
|
|
70
|
+
const answer = await (0, prompt_1.askConfirmation)(`
|
|
71
|
+
Would you like to share pseudonymous usage data about this project with the Angular Team
|
|
72
|
+
at Google under Google's Privacy Policy at https://policies.google.com/privacy. For more
|
|
73
|
+
details and how to change this setting, see https://angular.io/analytics.
|
|
79
74
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
]);
|
|
84
|
-
await setAnalyticsConfig(global, answers.analytics);
|
|
85
|
-
if (answers.analytics) {
|
|
75
|
+
`, false);
|
|
76
|
+
await setAnalyticsConfig(global, answer);
|
|
77
|
+
if (answer) {
|
|
86
78
|
console.log('');
|
|
87
79
|
console.log(core_1.tags.stripIndent `
|
|
88
80
|
Thank you for sharing pseudonymous usage data. Should you change your mind, the following
|
|
@@ -139,8 +139,8 @@ class CommandModule {
|
|
|
139
139
|
return undefined;
|
|
140
140
|
}
|
|
141
141
|
const userId = await (0, analytics_1.getAnalyticsUserId)(this.context,
|
|
142
|
-
// Don't prompt
|
|
143
|
-
['update', 'analytics'].includes(this.commandName));
|
|
142
|
+
// Don't prompt on `ng update`, 'ng version' or `ng analytics`.
|
|
143
|
+
['version', 'update', 'analytics'].includes(this.commandName));
|
|
144
144
|
return userId ? new analytics_collector_1.AnalyticsCollector(this.context, userId) : undefined;
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
@@ -18,6 +18,7 @@ const color_1 = require("../utilities/color");
|
|
|
18
18
|
const config_1 = require("../utilities/config");
|
|
19
19
|
const error_1 = require("../utilities/error");
|
|
20
20
|
const package_manager_1 = require("../utilities/package-manager");
|
|
21
|
+
const version_1 = require("../utilities/version");
|
|
21
22
|
const command_module_1 = require("./command-module");
|
|
22
23
|
const command_1 = require("./utilities/command");
|
|
23
24
|
const json_help_1 = require("./utilities/json-help");
|
|
@@ -70,6 +71,8 @@ async function runCommand(args, logger) {
|
|
|
70
71
|
const usageInstance = localYargs.getInternalMethods().getUsageInstance();
|
|
71
72
|
usageInstance.help = () => (0, json_help_1.jsonHelpUsage)();
|
|
72
73
|
}
|
|
74
|
+
// Add default command to support version option when no subcommand is specified
|
|
75
|
+
localYargs.command('*', false, (builder) => builder.version('version', 'Show Angular CLI version.', version_1.VERSION.full));
|
|
73
76
|
await localYargs
|
|
74
77
|
.scriptName('ng')
|
|
75
78
|
// https://github.com/yargs/yargs/blob/main/docs/advanced.md#customizing-yargs-parser
|
|
@@ -62,7 +62,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
62
62
|
scope = command_module_1.CommandScope.In;
|
|
63
63
|
shouldReportAnalytics = false;
|
|
64
64
|
command = 'update [packages..]';
|
|
65
|
-
describe = 'Updates your workspace and its dependencies. See https://update.angular.
|
|
65
|
+
describe = 'Updates your workspace and its dependencies. See https://update.angular.dev/.';
|
|
66
66
|
longDescriptionPath = (0, path_1.join)(__dirname, 'long-description.md');
|
|
67
67
|
builder(localYargs) {
|
|
68
68
|
return localYargs
|
|
@@ -514,14 +514,14 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
514
514
|
// Before version 6, the major versions were not always sequential.
|
|
515
515
|
// Example @angular/core skipped version 3, @angular/cli skipped versions 2-5.
|
|
516
516
|
logger.error(`Updating multiple major versions of '${name}' at once is not supported. Please migrate each major version individually.\n` +
|
|
517
|
-
`For more information about the update process, see https://update.angular.
|
|
517
|
+
`For more information about the update process, see https://update.angular.dev/.`);
|
|
518
518
|
}
|
|
519
519
|
else {
|
|
520
520
|
const nextMajorVersionFromCurrent = currentMajorVersion + 1;
|
|
521
521
|
logger.error(`Updating multiple major versions of '${name}' at once is not supported. Please migrate each major version individually.\n` +
|
|
522
522
|
`Run 'ng update ${name}@${nextMajorVersionFromCurrent}' in your workspace directory ` +
|
|
523
523
|
`to update to latest '${nextMajorVersionFromCurrent}.x' version of '${name}'.\n\n` +
|
|
524
|
-
`For more information about the update process, see https://update.angular.
|
|
524
|
+
`For more information about the update process, see https://update.angular.dev/?v=${currentMajorVersion}.0-${nextMajorVersionFromCurrent}.0`);
|
|
525
525
|
}
|
|
526
526
|
return 1;
|
|
527
527
|
}
|
|
@@ -785,7 +785,6 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
785
785
|
const { logger } = this.context;
|
|
786
786
|
const numberOfMigrations = optionalMigrations.length;
|
|
787
787
|
logger.info(`This package has ${numberOfMigrations} optional migration${numberOfMigrations > 1 ? 's' : ''} that can be executed.`);
|
|
788
|
-
logger.info(''); // Extra trailing newline.
|
|
789
788
|
if (!(0, tty_1.isTTY)()) {
|
|
790
789
|
for (const migration of optionalMigrations) {
|
|
791
790
|
const { title } = getMigrationTitleAndDescription(migration);
|
|
@@ -795,10 +794,12 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
795
794
|
}
|
|
796
795
|
return undefined;
|
|
797
796
|
}
|
|
797
|
+
logger.info('Optional migrations may be skipped and executed after the update process, if preferred.');
|
|
798
|
+
logger.info(''); // Extra trailing newline.
|
|
798
799
|
const answer = await (0, prompt_1.askChoices)(`Select the migrations that you'd like to run`, optionalMigrations.map((migration) => {
|
|
799
|
-
const { title } = getMigrationTitleAndDescription(migration);
|
|
800
|
+
const { title, documentation } = getMigrationTitleAndDescription(migration);
|
|
800
801
|
return {
|
|
801
|
-
name: title
|
|
802
|
+
name: `[${color_1.colors.white(migration.name)}] ${title}${documentation ? ` (${documentation})` : ''}`,
|
|
802
803
|
value: migration.name,
|
|
803
804
|
};
|
|
804
805
|
}), null);
|
|
@@ -866,5 +867,8 @@ function getMigrationTitleAndDescription(migration) {
|
|
|
866
867
|
return {
|
|
867
868
|
title: title.endsWith('.') ? title : title + '.',
|
|
868
869
|
description: description.join('.\n '),
|
|
870
|
+
documentation: migration.documentation
|
|
871
|
+
? new URL(migration.documentation, 'https://angular.dev').href
|
|
872
|
+
: undefined,
|
|
869
873
|
};
|
|
870
874
|
}
|
|
@@ -19,4 +19,4 @@ For example, use the following command to take the latest 10.x.x version and use
|
|
|
19
19
|
ng update @angular/cli@^10 @angular/core@^10
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
For detailed information and guidance on updating your application, see the interactive [Angular Update Guide](https://update.angular.
|
|
22
|
+
For detailed information and guidance on updating your application, see the interactive [Angular Update Guide](https://update.angular.dev/).
|
|
@@ -41,7 +41,7 @@ const config_1 = require("../utilities/config");
|
|
|
41
41
|
const environment_options_1 = require("../utilities/environment-options");
|
|
42
42
|
const tty_1 = require("../utilities/tty");
|
|
43
43
|
const error_1 = require("./error");
|
|
44
|
-
const
|
|
44
|
+
const prompt_1 = require("./prompt");
|
|
45
45
|
/**
|
|
46
46
|
* Checks if it is appropriate to prompt the user to setup autocompletion. If not, does nothing. If
|
|
47
47
|
* so prompts and sets up autocompletion for the user. Returns an exit code if the program should
|
|
@@ -118,8 +118,8 @@ async function shouldPromptForAutocompletionSetup(command, config) {
|
|
|
118
118
|
if (environment_options_1.forceAutocomplete !== undefined) {
|
|
119
119
|
return environment_options_1.forceAutocomplete;
|
|
120
120
|
}
|
|
121
|
-
// Don't prompt on `ng update
|
|
122
|
-
if (
|
|
121
|
+
// Don't prompt on `ng update`, 'ng version' or `ng completion`.
|
|
122
|
+
if (['version', 'update', 'completion'].includes(command)) {
|
|
123
123
|
return false;
|
|
124
124
|
}
|
|
125
125
|
// Non-interactive and continuous integration systems don't care about autocompletion.
|
|
@@ -159,24 +159,14 @@ async function shouldPromptForAutocompletionSetup(command, config) {
|
|
|
159
159
|
return true;
|
|
160
160
|
}
|
|
161
161
|
async function promptForAutocompletion() {
|
|
162
|
-
|
|
163
|
-
// the 99% of builds that *don't* prompt for autocompletion.
|
|
164
|
-
const { default: inquirer } = await (0, load_esm_1.loadEsmModule)('inquirer');
|
|
165
|
-
const { autocomplete } = await inquirer.prompt([
|
|
166
|
-
{
|
|
167
|
-
name: 'autocomplete',
|
|
168
|
-
type: 'confirm',
|
|
169
|
-
message: `
|
|
162
|
+
const autocomplete = await (0, prompt_1.askConfirmation)(`
|
|
170
163
|
Would you like to enable autocompletion? This will set up your terminal so pressing TAB while typing
|
|
171
164
|
Angular CLI commands will show possible options and autocomplete arguments. (Enabling autocompletion
|
|
172
165
|
will modify configuration files in your home directory.)
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
default: true,
|
|
178
|
-
},
|
|
179
|
-
]);
|
|
166
|
+
`
|
|
167
|
+
.split('\n')
|
|
168
|
+
.join(' ')
|
|
169
|
+
.trim(), true);
|
|
180
170
|
return autocomplete;
|
|
181
171
|
}
|
|
182
172
|
/**
|
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.0
|
|
28
|
+
// export const VERSION = new Version('18.0.0');
|
|
29
29
|
exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);
|