@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
|
@@ -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
|
const crypto_1 = require("crypto");
|
|
@@ -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 { MissingTargetChoice } from '../../command-builder/architect-base-command-module';
|
|
9
9
|
import { ArchitectCommandModule } from '../../command-builder/architect-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
|
const node_path_1 = require("node:path");
|
|
@@ -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 { MissingTargetChoice } from '../../command-builder/architect-base-command-module';
|
|
9
9
|
import { ArchitectCommandModule } from '../../command-builder/architect-command-module';
|
package/src/commands/e2e/cli.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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const architect_command_module_1 = require("../../command-builder/architect-command-module");
|
|
@@ -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 { ArchitectCommandModule } from '../../command-builder/architect-command-module';
|
|
9
9
|
import { CommandModuleImplementation } from '../../command-builder/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
|
const architect_command_module_1 = require("../../command-builder/architect-command-module");
|
|
@@ -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 { CommandModuleImplementation, Options, OtherOptions } from '../../command-builder/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
|
const core_1 = require("@angular-devkit/core");
|
|
@@ -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 { MissingTargetChoice } from '../../command-builder/architect-base-command-module';
|
|
9
9
|
import { ArchitectCommandModule } from '../../command-builder/architect-command-module';
|
package/src/commands/lint/cli.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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const path_1 = require("path");
|
|
@@ -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 { CommandModule, CommandModuleImplementation } from '../../command-builder/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
|
const command_module_1 = require("../../command-builder/command-module");
|
|
@@ -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 { CommandModuleImplementation, CommandScope, Options, OtherOptions } from '../../command-builder/command-module';
|
package/src/commands/new/cli.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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const node_path_1 = require("node:path");
|
|
@@ -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 { Target } from '@angular-devkit/architect';
|
|
9
9
|
import { Argv } from 'yargs';
|
package/src/commands/run/cli.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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const path_1 = require("path");
|
|
@@ -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 { ArchitectCommandModule } from '../../command-builder/architect-command-module';
|
|
9
9
|
import { CommandModuleImplementation } from '../../command-builder/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
|
const architect_command_module_1 = require("../../command-builder/architect-command-module");
|
|
@@ -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 { ArchitectCommandModule } from '../../command-builder/architect-command-module';
|
|
9
9
|
import { CommandModuleImplementation } from '../../command-builder/command-module';
|
package/src/commands/test/cli.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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const path_1 = require("path");
|
|
@@ -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 { CommandModule, CommandScope, Options } from '../../command-builder/command-module';
|
|
@@ -22,6 +22,7 @@ interface UpdateCommandArgs {
|
|
|
22
22
|
export default class UpdateCommandModule extends CommandModule<UpdateCommandArgs> {
|
|
23
23
|
scope: CommandScope;
|
|
24
24
|
protected shouldReportAnalytics: boolean;
|
|
25
|
+
private readonly resolvePaths;
|
|
25
26
|
command: string;
|
|
26
27
|
describe: string;
|
|
27
28
|
longDescriptionPath: 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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -35,9 +35,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
37
37
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
38
|
+
const listr2_1 = require("listr2");
|
|
39
|
+
const node_child_process_1 = require("node:child_process");
|
|
40
|
+
const node_fs_1 = require("node:fs");
|
|
41
|
+
const node_module_1 = require("node:module");
|
|
41
42
|
const npm_package_arg_1 = __importDefault(require("npm-package-arg"));
|
|
42
43
|
const npm_pick_manifest_1 = __importDefault(require("npm-pick-manifest"));
|
|
43
44
|
const path = __importStar(require("path"));
|
|
@@ -56,11 +57,14 @@ const package_tree_1 = require("../../utilities/package-tree");
|
|
|
56
57
|
const prompt_1 = require("../../utilities/prompt");
|
|
57
58
|
const tty_1 = require("../../utilities/tty");
|
|
58
59
|
const version_1 = require("../../utilities/version");
|
|
60
|
+
class CommandError extends Error {
|
|
61
|
+
}
|
|
59
62
|
const ANGULAR_PACKAGES_REGEXP = /^@(?:angular|nguniversal)\//;
|
|
60
63
|
const UPDATE_SCHEMATIC_COLLECTION = path.join(__dirname, 'schematic/collection.json');
|
|
61
64
|
class UpdateCommandModule extends command_module_1.CommandModule {
|
|
62
65
|
scope = command_module_1.CommandScope.In;
|
|
63
66
|
shouldReportAnalytics = false;
|
|
67
|
+
resolvePaths = [__dirname, this.context.root];
|
|
64
68
|
command = 'update [packages..]';
|
|
65
69
|
describe = 'Updates your workspace and its dependencies. See https://update.angular.dev/.';
|
|
66
70
|
longDescriptionPath = (0, path_1.join)(__dirname, 'long-description.md');
|
|
@@ -187,7 +191,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
187
191
|
return 1;
|
|
188
192
|
}
|
|
189
193
|
}
|
|
190
|
-
logger.info(`Using package manager: ${color_1.colors.
|
|
194
|
+
logger.info(`Using package manager: ${color_1.colors.gray(packageManager.name)}`);
|
|
191
195
|
logger.info('Collecting installed dependencies...');
|
|
192
196
|
const rootDependencies = await (0, package_tree_1.getProjectDependencies)(this.context.root);
|
|
193
197
|
logger.info(`Found ${rootDependencies.size} dependencies.`);
|
|
@@ -196,7 +200,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
196
200
|
packageManagerForce: this.packageManagerForce(options.verbose),
|
|
197
201
|
// __dirname -> favor @schematics/update from this package
|
|
198
202
|
// Otherwise, use packages from the active workspace (migrations)
|
|
199
|
-
resolvePaths:
|
|
203
|
+
resolvePaths: this.resolvePaths,
|
|
200
204
|
schemaValidation: true,
|
|
201
205
|
engineHostCreator: (options) => new schematic_engine_host_1.SchematicEngineHost(options.resolvePaths),
|
|
202
206
|
});
|
|
@@ -232,12 +236,12 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
232
236
|
}
|
|
233
237
|
catch (e) {
|
|
234
238
|
if (e instanceof schematics_1.UnsuccessfulWorkflowExecution) {
|
|
235
|
-
logger.error(`${color_1.
|
|
239
|
+
logger.error(`${color_1.figures.cross} Migration failed. See above for further details.\n`);
|
|
236
240
|
}
|
|
237
241
|
else {
|
|
238
242
|
(0, error_1.assertIsError)(e);
|
|
239
243
|
const logPath = (0, log_file_1.writeErrorToLogFile)(e);
|
|
240
|
-
logger.fatal(`${color_1.
|
|
244
|
+
logger.fatal(`${color_1.figures.cross} Migration failed: ${e.message}\n` +
|
|
241
245
|
` See "${logPath}" for further details.\n`);
|
|
242
246
|
}
|
|
243
247
|
return { success: false, files: workflowSubscription.files };
|
|
@@ -307,7 +311,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
307
311
|
const { logger } = this.context;
|
|
308
312
|
for (const migration of migrations) {
|
|
309
313
|
const { title, description } = getMigrationTitleAndDescription(migration);
|
|
310
|
-
logger.info(color_1.colors.cyan(color_1.
|
|
314
|
+
logger.info(color_1.colors.cyan(color_1.figures.pointer) + ' ' + color_1.colors.bold(title));
|
|
311
315
|
if (description) {
|
|
312
316
|
logger.info(' ' + description);
|
|
313
317
|
}
|
|
@@ -389,15 +393,15 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
389
393
|
}
|
|
390
394
|
// Check if it is a package-local location
|
|
391
395
|
const localMigrations = path.join(packagePath, migrations);
|
|
392
|
-
if ((0,
|
|
396
|
+
if ((0, node_fs_1.existsSync)(localMigrations)) {
|
|
393
397
|
migrations = localMigrations;
|
|
394
398
|
}
|
|
395
399
|
else {
|
|
396
400
|
// Try to resolve from package location.
|
|
397
401
|
// This avoids issues with package hoisting.
|
|
398
402
|
try {
|
|
399
|
-
const packageRequire = (0,
|
|
400
|
-
migrations = packageRequire.resolve(migrations);
|
|
403
|
+
const packageRequire = (0, node_module_1.createRequire)(packagePath + '/');
|
|
404
|
+
migrations = packageRequire.resolve(migrations, { paths: this.resolvePaths });
|
|
401
405
|
}
|
|
402
406
|
catch (e) {
|
|
403
407
|
(0, error_1.assertIsError)(e);
|
|
@@ -539,17 +543,45 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
539
543
|
packages: packagesToUpdate,
|
|
540
544
|
});
|
|
541
545
|
if (success) {
|
|
546
|
+
const { root: commandRoot, packageManager } = this.context;
|
|
547
|
+
const installArgs = this.packageManagerForce(options.verbose) ? ['--force'] : [];
|
|
548
|
+
const tasks = new listr2_1.Listr([
|
|
549
|
+
{
|
|
550
|
+
title: 'Cleaning node modules directory',
|
|
551
|
+
async task(_, task) {
|
|
552
|
+
try {
|
|
553
|
+
await node_fs_1.promises.rm(path.join(commandRoot, 'node_modules'), {
|
|
554
|
+
force: true,
|
|
555
|
+
recursive: true,
|
|
556
|
+
maxRetries: 3,
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
catch (e) {
|
|
560
|
+
(0, error_1.assertIsError)(e);
|
|
561
|
+
if (e.code === 'ENOENT') {
|
|
562
|
+
task.skip('Cleaning not required. Node modules directory not found.');
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
title: 'Installing packages',
|
|
569
|
+
async task() {
|
|
570
|
+
const installationSuccess = await packageManager.installAll(installArgs, commandRoot);
|
|
571
|
+
if (!installationSuccess) {
|
|
572
|
+
throw new CommandError('Unable to install packages');
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
},
|
|
576
|
+
]);
|
|
542
577
|
try {
|
|
543
|
-
await
|
|
544
|
-
force: true,
|
|
545
|
-
recursive: true,
|
|
546
|
-
maxRetries: 3,
|
|
547
|
-
});
|
|
578
|
+
await tasks.run();
|
|
548
579
|
}
|
|
549
|
-
catch {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
580
|
+
catch (e) {
|
|
581
|
+
if (e instanceof CommandError) {
|
|
582
|
+
return 1;
|
|
583
|
+
}
|
|
584
|
+
throw e;
|
|
553
585
|
}
|
|
554
586
|
}
|
|
555
587
|
if (success && options.createCommits) {
|
|
@@ -561,7 +593,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
561
593
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
562
594
|
const migrations = global.externalMigrations;
|
|
563
595
|
if (success && migrations) {
|
|
564
|
-
const rootRequire = (0,
|
|
596
|
+
const rootRequire = (0, node_module_1.createRequire)(this.context.root + '/');
|
|
565
597
|
for (const migration of migrations) {
|
|
566
598
|
// Resolve the package from the workspace root, as otherwise it will be resolved from the temp
|
|
567
599
|
// installed CLI version.
|
|
@@ -599,14 +631,14 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
599
631
|
let migrations;
|
|
600
632
|
// Check if it is a package-local location
|
|
601
633
|
const localMigrations = path.join(packagePath, migration.collection);
|
|
602
|
-
if ((0,
|
|
634
|
+
if ((0, node_fs_1.existsSync)(localMigrations)) {
|
|
603
635
|
migrations = localMigrations;
|
|
604
636
|
}
|
|
605
637
|
else {
|
|
606
638
|
// Try to resolve from package location.
|
|
607
639
|
// This avoids issues with package hoisting.
|
|
608
640
|
try {
|
|
609
|
-
const packageRequire = (0,
|
|
641
|
+
const packageRequire = (0, node_module_1.createRequire)(packagePath + '/');
|
|
610
642
|
migrations = packageRequire.resolve(migration.collection);
|
|
611
643
|
}
|
|
612
644
|
catch (e) {
|
|
@@ -671,11 +703,11 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
671
703
|
}
|
|
672
704
|
checkCleanGit() {
|
|
673
705
|
try {
|
|
674
|
-
const topLevel = (0,
|
|
706
|
+
const topLevel = (0, node_child_process_1.execSync)('git rev-parse --show-toplevel', {
|
|
675
707
|
encoding: 'utf8',
|
|
676
708
|
stdio: 'pipe',
|
|
677
709
|
});
|
|
678
|
-
const result = (0,
|
|
710
|
+
const result = (0, node_child_process_1.execSync)('git status --porcelain', { encoding: 'utf8', stdio: 'pipe' });
|
|
679
711
|
if (result.trim().length === 0) {
|
|
680
712
|
return true;
|
|
681
713
|
}
|
|
@@ -735,8 +767,8 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
735
767
|
const packageJsonPath = (0, path_1.join)(pkgLocation, 'package.json');
|
|
736
768
|
// Get a binary location for this package
|
|
737
769
|
let binPath;
|
|
738
|
-
if ((0,
|
|
739
|
-
const content = await
|
|
770
|
+
if ((0, node_fs_1.existsSync)(packageJsonPath)) {
|
|
771
|
+
const content = await node_fs_1.promises.readFile(packageJsonPath, 'utf-8');
|
|
740
772
|
if (content) {
|
|
741
773
|
const { bin = {} } = JSON.parse(content);
|
|
742
774
|
const binKeys = Object.keys(bin);
|
|
@@ -748,7 +780,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
748
780
|
if (!binPath) {
|
|
749
781
|
throw new Error(`Cannot locate bin for temporary package: ${packageNameNoVersion}.`);
|
|
750
782
|
}
|
|
751
|
-
const { status, error } = (0,
|
|
783
|
+
const { status, error } = (0, node_child_process_1.spawnSync)(process.execPath, [binPath, ...args], {
|
|
752
784
|
stdio: 'inherit',
|
|
753
785
|
env: {
|
|
754
786
|
...process.env,
|
|
@@ -788,7 +820,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
788
820
|
if (!(0, tty_1.isTTY)()) {
|
|
789
821
|
for (const migration of optionalMigrations) {
|
|
790
822
|
const { title } = getMigrationTitleAndDescription(migration);
|
|
791
|
-
logger.info(color_1.colors.cyan(color_1.
|
|
823
|
+
logger.info(color_1.colors.cyan(color_1.figures.pointer) + ' ' + color_1.colors.bold(title));
|
|
792
824
|
logger.info(color_1.colors.gray(` ng update ${packageName} --name ${migration.name}`));
|
|
793
825
|
logger.info(''); // Extra trailing newline.
|
|
794
826
|
}
|
|
@@ -814,7 +846,7 @@ exports.default = UpdateCommandModule;
|
|
|
814
846
|
function hasChangesToCommit() {
|
|
815
847
|
// List all modified files not covered by .gitignore.
|
|
816
848
|
// If any files are returned, then there must be something to commit.
|
|
817
|
-
return (0,
|
|
849
|
+
return (0, node_child_process_1.execSync)('git ls-files -m -d -o --exclude-standard').toString() !== '';
|
|
818
850
|
}
|
|
819
851
|
/**
|
|
820
852
|
* Precondition: Must have pending changes to commit, they do not need to be staged.
|
|
@@ -823,16 +855,16 @@ function hasChangesToCommit() {
|
|
|
823
855
|
*/
|
|
824
856
|
function createCommit(message) {
|
|
825
857
|
// Stage entire working tree for commit.
|
|
826
|
-
(0,
|
|
858
|
+
(0, node_child_process_1.execSync)('git add -A', { encoding: 'utf8', stdio: 'pipe' });
|
|
827
859
|
// Commit with the message passed via stdin to avoid bash escaping issues.
|
|
828
|
-
(0,
|
|
860
|
+
(0, node_child_process_1.execSync)('git commit --no-verify -F -', { encoding: 'utf8', stdio: 'pipe', input: message });
|
|
829
861
|
}
|
|
830
862
|
/**
|
|
831
863
|
* @return The Git SHA hash of the HEAD commit. Returns null if unable to retrieve the hash.
|
|
832
864
|
*/
|
|
833
865
|
function findCurrentGitSha() {
|
|
834
866
|
try {
|
|
835
|
-
return (0,
|
|
867
|
+
return (0, node_child_process_1.execSync)('git rev-parse HEAD', { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
836
868
|
}
|
|
837
869
|
catch {
|
|
838
870
|
return null;
|
|
@@ -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 { Rule } from '@angular-devkit/schematics';
|
|
9
9
|
import { Schema as UpdateSchema } from './schema';
|
|
@@ -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 { CommandModule, CommandModuleImplementation } from '../../command-builder/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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
package/src/typings-bazel.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
|
|
|
9
9
|
/* eslint-disable import/no-extraneous-dependencies */
|
package/src/typings.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
|
declare module 'npm-pick-manifest' {
|
|
9
9
|
function pickManifest(metadata: import('./utilities/package-metadata').PackageMetadata, selector: string): import('./utilities/package-metadata').PackageManifest;
|
package/src/typings.js
CHANGED
package/src/utilities/color.d.ts
CHANGED
|
@@ -3,9 +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
|
-
|
|
9
|
-
export declare function
|
|
10
|
-
declare const colors: typeof ansiColors;
|
|
11
|
-
export { colors };
|
|
8
|
+
export { color as colors, figures } from 'listr2';
|
|
9
|
+
export declare function supportColor(): boolean;
|
package/src/utilities/color.js
CHANGED
|
@@ -4,36 +4,15 @@
|
|
|
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
|
-
});
|
|
25
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
26
|
-
if (mod && mod.__esModule) return mod;
|
|
27
|
-
var result = {};
|
|
28
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
29
|
-
__setModuleDefault(result, mod);
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.colors = void 0;
|
|
34
|
-
exports.
|
|
35
|
-
const
|
|
36
|
-
|
|
10
|
+
exports.figures = exports.colors = void 0;
|
|
11
|
+
exports.supportColor = supportColor;
|
|
12
|
+
const node_tty_1 = require("node:tty");
|
|
13
|
+
var listr2_1 = require("listr2");
|
|
14
|
+
Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return listr2_1.color; } });
|
|
15
|
+
Object.defineProperty(exports, "figures", { enumerable: true, get: function () { return listr2_1.figures; } });
|
|
37
16
|
function supportColor() {
|
|
38
17
|
if (process.env.FORCE_COLOR !== undefined) {
|
|
39
18
|
// 2 colors: FORCE_COLOR = 0 (Disables colors), depth 1
|
|
@@ -53,17 +32,8 @@ function supportColor() {
|
|
|
53
32
|
return false;
|
|
54
33
|
}
|
|
55
34
|
}
|
|
56
|
-
if (process.stdout instanceof
|
|
35
|
+
if (process.stdout instanceof node_tty_1.WriteStream) {
|
|
57
36
|
return process.stdout.getColorDepth() > 1;
|
|
58
37
|
}
|
|
59
38
|
return false;
|
|
60
39
|
}
|
|
61
|
-
function removeColor(text) {
|
|
62
|
-
// This has been created because when colors.enabled is false unstyle doesn't work
|
|
63
|
-
// see: https://github.com/doowb/ansi-colors/blob/a4794363369d7b4d1872d248fc43a12761640d8e/index.js#L38
|
|
64
|
-
return text.replace(ansiColors.ansiRegex, '');
|
|
65
|
-
}
|
|
66
|
-
// Create a separate instance to prevent unintended global changes to the color configuration
|
|
67
|
-
const colors = ansiColors.create();
|
|
68
|
-
exports.colors = colors;
|
|
69
|
-
colors.enabled = supportColor();
|
|
@@ -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
|
/**
|