@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
|
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 { json, workspaces } from '@angular-devkit/core';
|
|
9
9
|
import { PackageManager } from '../../lib/config/workspace-schema';
|
package/src/utilities/config.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;
|
|
@@ -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 declare const analyticsDisabled: boolean;
|
|
9
9
|
export declare const isCI: 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.forceAutocomplete = exports.ngDebug = exports.disableVersionCheck = exports.isCI = exports.analyticsDisabled = void 0;
|
package/src/utilities/eol.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
|
export declare function getEOL(content: string): string;
|
package/src/utilities/eol.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
|
exports.getEOL = getEOL;
|
package/src/utilities/error.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 declare function assertIsError(value: unknown): asserts value is Error & {
|
|
9
9
|
code?: string;
|
package/src/utilities/error.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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -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
|
export declare function findUp(names: string | string[], from: string): string | null;
|
package/src/utilities/find-up.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;
|
|
@@ -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 type InsertionIndex = (properties: string[]) => number;
|
|
9
9
|
export type JSONPath = (string | 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
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.JSONFile = 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
|
/**
|
|
9
9
|
* This uses a dynamic import to load a module which may be ESM.
|
|
@@ -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.loadEsmModule = loadEsmModule;
|
|
@@ -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
|
* Writes an Error to a temporary log file.
|
|
@@ -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.writeErrorToLogFile = writeErrorToLogFile;
|
|
@@ -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
|
* A decorator that memoizes methods and getters.
|
package/src/utilities/memoize.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
|
exports.memoize = memoize;
|
|
@@ -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 { PackageManager } from '../../lib/config/workspace-schema';
|
|
9
9
|
import { AngularWorkspace } from './config';
|
|
@@ -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;
|
|
@@ -25,7 +25,6 @@ const path_1 = require("path");
|
|
|
25
25
|
const workspace_schema_1 = require("../../lib/config/workspace-schema");
|
|
26
26
|
const config_1 = require("./config");
|
|
27
27
|
const memoize_1 = require("./memoize");
|
|
28
|
-
const spinner_1 = require("./spinner");
|
|
29
28
|
class PackageManagerUtils {
|
|
30
29
|
context;
|
|
31
30
|
constructor(context) {
|
|
@@ -133,8 +132,6 @@ class PackageManagerUtils {
|
|
|
133
132
|
}
|
|
134
133
|
async run(args, options = {}) {
|
|
135
134
|
const { cwd = process.cwd(), silent = false } = options;
|
|
136
|
-
const spinner = new spinner_1.Spinner();
|
|
137
|
-
spinner.start('Installing packages...');
|
|
138
135
|
return new Promise((resolve) => {
|
|
139
136
|
const bufferedOutput = [];
|
|
140
137
|
const childProcess = (0, child_process_1.spawn)(this.name, args, {
|
|
@@ -144,13 +141,10 @@ class PackageManagerUtils {
|
|
|
144
141
|
cwd,
|
|
145
142
|
}).on('close', (code) => {
|
|
146
143
|
if (code === 0) {
|
|
147
|
-
spinner.succeed('Packages successfully installed.');
|
|
148
144
|
resolve(true);
|
|
149
145
|
}
|
|
150
146
|
else {
|
|
151
|
-
spinner.stop();
|
|
152
147
|
bufferedOutput.forEach(({ stream, data }) => stream.write(data));
|
|
153
|
-
spinner.fail('Packages installation failed, see above.');
|
|
154
148
|
resolve(false);
|
|
155
149
|
}
|
|
156
150
|
});
|
|
@@ -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 type { Manifest, Packument } from 'pacote';
|
|
@@ -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 { NgAddSaveDependency } from './package-metadata';
|
|
9
9
|
interface PackageJson {
|
|
@@ -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,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
|
export declare function findWorkspaceFile(currentDirectory?: string): string | null;
|
package/src/utilities/project.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;
|
|
@@ -3,9 +3,14 @@
|
|
|
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
|
-
import type { CheckboxChoiceOptions, ListChoiceOptions } from 'inquirer';
|
|
9
8
|
export declare function askConfirmation(message: string, defaultResponse: boolean, noTTYResponse?: boolean): Promise<boolean>;
|
|
10
|
-
export declare function askQuestion(message: string, choices:
|
|
11
|
-
|
|
9
|
+
export declare function askQuestion(message: string, choices: {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string | null;
|
|
12
|
+
}[], defaultResponseIndex: number, noTTYResponse: null | string): Promise<string | null>;
|
|
13
|
+
export declare function askChoices(message: string, choices: {
|
|
14
|
+
name: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}[], noTTYResponse: string[] | null): Promise<string[] | null>;
|
package/src/utilities/prompt.js
CHANGED
|
@@ -4,57 +4,76 @@
|
|
|
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
|
+
};
|
|
9
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
33
|
exports.askConfirmation = askConfirmation;
|
|
11
34
|
exports.askQuestion = askQuestion;
|
|
12
35
|
exports.askChoices = askChoices;
|
|
13
|
-
const load_esm_1 = require("./load-esm");
|
|
14
36
|
const tty_1 = require("./tty");
|
|
15
37
|
async function askConfirmation(message, defaultResponse, noTTYResponse) {
|
|
16
38
|
if (!(0, tty_1.isTTY)()) {
|
|
17
39
|
return noTTYResponse ?? defaultResponse;
|
|
18
40
|
}
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
name: 'confirmation',
|
|
22
|
-
prefix: '',
|
|
41
|
+
const { confirm } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
42
|
+
const answer = await confirm({
|
|
23
43
|
message,
|
|
24
44
|
default: defaultResponse,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
45
|
+
theme: {
|
|
46
|
+
prefix: '',
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
return answer;
|
|
29
50
|
}
|
|
30
51
|
async function askQuestion(message, choices, defaultResponseIndex, noTTYResponse) {
|
|
31
52
|
if (!(0, tty_1.isTTY)()) {
|
|
32
53
|
return noTTYResponse;
|
|
33
54
|
}
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
name: 'answer',
|
|
37
|
-
prefix: '',
|
|
55
|
+
const { select } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
56
|
+
const answer = await select({
|
|
38
57
|
message,
|
|
39
58
|
choices,
|
|
40
59
|
default: defaultResponseIndex,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
theme: {
|
|
61
|
+
prefix: '',
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
return answer;
|
|
45
65
|
}
|
|
46
66
|
async function askChoices(message, choices, noTTYResponse) {
|
|
47
67
|
if (!(0, tty_1.isTTY)()) {
|
|
48
68
|
return noTTYResponse;
|
|
49
69
|
}
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
name: 'answer',
|
|
53
|
-
prefix: '',
|
|
70
|
+
const { checkbox } = await Promise.resolve().then(() => __importStar(require('@inquirer/prompts')));
|
|
71
|
+
const answers = await checkbox({
|
|
54
72
|
message,
|
|
55
73
|
choices,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
74
|
+
theme: {
|
|
75
|
+
prefix: '',
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
return answers;
|
|
60
79
|
}
|
package/src/utilities/tty.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
|
export declare function isTTY(): boolean;
|
package/src/utilities/tty.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
|
exports.isTTY = isTTY;
|
|
@@ -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 class Version {
|
|
9
9
|
readonly full: string;
|
package/src/utilities/version.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
|
exports.VERSION = void 0;
|
|
@@ -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.1.0-next.
|
|
28
|
+
// export const VERSION = new Version('18.1.0-next.3');
|
|
29
29
|
exports.VERSION = new Version(JSON.parse((0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../package.json'), 'utf-8')).version);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
export declare class Spinner {
|
|
9
|
-
private readonly spinner;
|
|
10
|
-
/** When false, only fail messages will be displayed. */
|
|
11
|
-
enabled: boolean;
|
|
12
|
-
constructor(text?: string);
|
|
13
|
-
set text(text: string);
|
|
14
|
-
succeed(text?: string): void;
|
|
15
|
-
info(text?: string): void;
|
|
16
|
-
fail(text?: string): void;
|
|
17
|
-
warn(text?: string): void;
|
|
18
|
-
stop(): void;
|
|
19
|
-
start(text?: string): void;
|
|
20
|
-
}
|
package/src/utilities/spinner.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.Spinner = void 0;
|
|
14
|
-
const ora_1 = __importDefault(require("ora"));
|
|
15
|
-
const color_1 = require("./color");
|
|
16
|
-
class Spinner {
|
|
17
|
-
spinner;
|
|
18
|
-
/** When false, only fail messages will be displayed. */
|
|
19
|
-
enabled = true;
|
|
20
|
-
constructor(text) {
|
|
21
|
-
this.spinner = (0, ora_1.default)({
|
|
22
|
-
text,
|
|
23
|
-
// The below 2 options are needed because otherwise CTRL+C will be delayed
|
|
24
|
-
// when the underlying process is sync.
|
|
25
|
-
hideCursor: false,
|
|
26
|
-
discardStdin: false,
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
set text(text) {
|
|
30
|
-
this.spinner.text = text;
|
|
31
|
-
}
|
|
32
|
-
succeed(text) {
|
|
33
|
-
if (this.enabled) {
|
|
34
|
-
this.spinner.succeed(text);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
info(text) {
|
|
38
|
-
this.spinner.info(text);
|
|
39
|
-
}
|
|
40
|
-
fail(text) {
|
|
41
|
-
this.spinner.fail(text && color_1.colors.redBright(text));
|
|
42
|
-
}
|
|
43
|
-
warn(text) {
|
|
44
|
-
this.spinner.warn(text && color_1.colors.yellowBright(text));
|
|
45
|
-
}
|
|
46
|
-
stop() {
|
|
47
|
-
this.spinner.stop();
|
|
48
|
-
}
|
|
49
|
-
start(text) {
|
|
50
|
-
if (this.enabled) {
|
|
51
|
-
this.spinner.start(text);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
exports.Spinner = Spinner;
|