@angular/cli 18.1.0-next.2 → 18.1.0-rc.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/lib/cli/index.js +5 -4
- package/package.json +18 -18
- package/src/command-builder/architect-base-command-module.js +1 -1
- package/src/command-builder/architect-command-module.js +158 -124
- package/src/command-builder/command-module.js +225 -196
- package/src/command-builder/schematics-command-module.js +308 -284
- package/src/commands/add/cli.js +193 -123
- package/src/commands/new/cli.js +1 -1
- package/src/commands/update/cli.js +62 -31
- package/src/utilities/color.d.ts +2 -3
- package/src/utilities/color.js +15 -51
- package/src/utilities/memoize.d.ts +1 -1
- package/src/utilities/memoize.js +14 -19
- package/src/utilities/package-manager.js +265 -245
- package/src/utilities/tty.d.ts +1 -1
- package/src/utilities/tty.js +2 -2
- package/src/utilities/version.js +1 -1
- package/src/utilities/spinner.d.ts +0 -20
- package/src/utilities/spinner.js +0 -55
package/src/utilities/color.js
CHANGED
|
@@ -6,58 +6,22 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
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
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
case 'true':
|
|
47
|
-
case '1':
|
|
48
|
-
case '2':
|
|
49
|
-
case '3':
|
|
50
|
-
return true;
|
|
51
|
-
default:
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
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; } });
|
|
16
|
+
function supportColor(stream = process.stdout) {
|
|
17
|
+
if (stream instanceof node_tty_1.WriteStream) {
|
|
18
|
+
return stream.hasColors();
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
// The hasColors function does not rely on any instance state and should ideally be static
|
|
22
|
+
return node_tty_1.WriteStream.prototype.hasColors();
|
|
54
23
|
}
|
|
55
|
-
|
|
56
|
-
return process.
|
|
24
|
+
catch {
|
|
25
|
+
return process.env['FORCE_COLOR'] !== undefined && process.env['FORCE_COLOR'] !== '0';
|
|
57
26
|
}
|
|
58
|
-
return false;
|
|
59
27
|
}
|
|
60
|
-
// Create a separate instance to prevent unintended global changes to the color configuration
|
|
61
|
-
const colors = ansiColors.create();
|
|
62
|
-
exports.colors = colors;
|
|
63
|
-
colors.enabled = supportColor();
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see https://en.wikipedia.org/wiki/Memoization
|
|
14
14
|
*/
|
|
15
|
-
export declare function memoize<
|
|
15
|
+
export declare function memoize<This, Args extends unknown[], Return>(target: (this: This, ...args: Args) => Return, context: ClassMemberDecoratorContext): (this: This, ...args: Args) => Return;
|
package/src/utilities/memoize.js
CHANGED
|
@@ -15,29 +15,24 @@ exports.memoize = memoize;
|
|
|
15
15
|
*
|
|
16
16
|
* @see https://en.wikipedia.org/wiki/Memoization
|
|
17
17
|
*/
|
|
18
|
-
function memoize(target,
|
|
19
|
-
|
|
20
|
-
const originalMethod = descriptor[descriptorPropertyName];
|
|
21
|
-
if (typeof originalMethod !== 'function') {
|
|
18
|
+
function memoize(target, context) {
|
|
19
|
+
if (context.kind !== 'method' && context.kind !== 'getter') {
|
|
22
20
|
throw new Error('Memoize decorator can only be used on methods or get accessors.');
|
|
23
21
|
}
|
|
24
22
|
const cache = new Map();
|
|
25
|
-
return {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
if (!isJSONSerializable(arg)) {
|
|
30
|
-
throw new Error(`Argument ${isNonPrimitive(arg) ? arg.toString() : arg} is JSON serializable.`);
|
|
31
|
-
}
|
|
23
|
+
return function (...args) {
|
|
24
|
+
for (const arg of args) {
|
|
25
|
+
if (!isJSONSerializable(arg)) {
|
|
26
|
+
throw new Error(`Argument ${isNonPrimitive(arg) ? arg.toString() : arg} is JSON serializable.`);
|
|
32
27
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
28
|
+
}
|
|
29
|
+
const key = JSON.stringify(args);
|
|
30
|
+
if (cache.has(key)) {
|
|
31
|
+
return cache.get(key);
|
|
32
|
+
}
|
|
33
|
+
const result = target.apply(this, args);
|
|
34
|
+
cache.set(key, result);
|
|
35
|
+
return result;
|
|
41
36
|
};
|
|
42
37
|
}
|
|
43
38
|
/** Method to check if value is a non primitive. */
|