@angular/cli 15.0.0-next.0 → 15.0.0-next.2
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/config/schema.json
CHANGED
|
@@ -1716,7 +1716,7 @@
|
|
|
1716
1716
|
"input": {
|
|
1717
1717
|
"type": "string",
|
|
1718
1718
|
"description": "The file to include.",
|
|
1719
|
-
"pattern": "\\.(?:css|scss|sass|less
|
|
1719
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
1720
1720
|
},
|
|
1721
1721
|
"bundleName": {
|
|
1722
1722
|
"type": "string",
|
|
@@ -1734,7 +1734,7 @@
|
|
|
1734
1734
|
{
|
|
1735
1735
|
"type": "string",
|
|
1736
1736
|
"description": "The file to include.",
|
|
1737
|
-
"pattern": "\\.(?:css|scss|sass|less
|
|
1737
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
1738
1738
|
}
|
|
1739
1739
|
]
|
|
1740
1740
|
}
|
|
@@ -2269,7 +2269,7 @@
|
|
|
2269
2269
|
"input": {
|
|
2270
2270
|
"type": "string",
|
|
2271
2271
|
"description": "The file to include.",
|
|
2272
|
-
"pattern": "\\.(?:css|scss|sass|less
|
|
2272
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
2273
2273
|
},
|
|
2274
2274
|
"bundleName": {
|
|
2275
2275
|
"type": "string",
|
|
@@ -2287,7 +2287,7 @@
|
|
|
2287
2287
|
{
|
|
2288
2288
|
"type": "string",
|
|
2289
2289
|
"description": "The file to include.",
|
|
2290
|
-
"pattern": "\\.(?:css|scss|sass|less
|
|
2290
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
2291
2291
|
}
|
|
2292
2292
|
]
|
|
2293
2293
|
}
|
|
@@ -2674,36 +2674,18 @@
|
|
|
2674
2674
|
]
|
|
2675
2675
|
},
|
|
2676
2676
|
"fileReplacement": {
|
|
2677
|
-
"
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
"
|
|
2681
|
-
|
|
2682
|
-
"type": "string",
|
|
2683
|
-
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
2684
|
-
},
|
|
2685
|
-
"replaceWith": {
|
|
2686
|
-
"type": "string",
|
|
2687
|
-
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
2688
|
-
}
|
|
2689
|
-
},
|
|
2690
|
-
"additionalProperties": false
|
|
2677
|
+
"type": "object",
|
|
2678
|
+
"properties": {
|
|
2679
|
+
"replace": {
|
|
2680
|
+
"type": "string",
|
|
2681
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
2691
2682
|
},
|
|
2692
|
-
{
|
|
2693
|
-
"type": "
|
|
2694
|
-
"
|
|
2695
|
-
"replace": {
|
|
2696
|
-
"type": "string",
|
|
2697
|
-
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
2698
|
-
},
|
|
2699
|
-
"with": {
|
|
2700
|
-
"type": "string",
|
|
2701
|
-
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
2702
|
-
}
|
|
2703
|
-
},
|
|
2704
|
-
"additionalProperties": false
|
|
2683
|
+
"with": {
|
|
2684
|
+
"type": "string",
|
|
2685
|
+
"pattern": "\\.(([cm]?j|t)sx?|json)$"
|
|
2705
2686
|
}
|
|
2706
|
-
|
|
2687
|
+
},
|
|
2688
|
+
"additionalProperties": false
|
|
2707
2689
|
},
|
|
2708
2690
|
"budget": {
|
|
2709
2691
|
"type": "object",
|
|
@@ -2976,7 +2958,7 @@
|
|
|
2976
2958
|
"input": {
|
|
2977
2959
|
"type": "string",
|
|
2978
2960
|
"description": "The file to include.",
|
|
2979
|
-
"pattern": "\\.(?:css|scss|sass|less
|
|
2961
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
2980
2962
|
},
|
|
2981
2963
|
"bundleName": {
|
|
2982
2964
|
"type": "string",
|
|
@@ -2994,7 +2976,7 @@
|
|
|
2994
2976
|
{
|
|
2995
2977
|
"type": "string",
|
|
2996
2978
|
"description": "The file to include.",
|
|
2997
|
-
"pattern": "\\.(?:css|scss|sass|less
|
|
2979
|
+
"pattern": "\\.(?:css|scss|sass|less)$"
|
|
2998
2980
|
}
|
|
2999
2981
|
]
|
|
3000
2982
|
}
|
|
@@ -3434,18 +3416,7 @@
|
|
|
3434
3416
|
"bundleDependencies": {
|
|
3435
3417
|
"description": "Which external dependencies to bundle into the bundle. By default, all of node_modules will be bundled.",
|
|
3436
3418
|
"default": true,
|
|
3437
|
-
"
|
|
3438
|
-
{
|
|
3439
|
-
"type": "boolean"
|
|
3440
|
-
},
|
|
3441
|
-
{
|
|
3442
|
-
"type": "string",
|
|
3443
|
-
"enum": [
|
|
3444
|
-
"none",
|
|
3445
|
-
"all"
|
|
3446
|
-
]
|
|
3447
|
-
}
|
|
3448
|
-
]
|
|
3419
|
+
"type": "boolean"
|
|
3449
3420
|
},
|
|
3450
3421
|
"externalDependencies": {
|
|
3451
3422
|
"description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
|
package/lib/init.js
CHANGED
|
@@ -33,6 +33,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
33
|
require("symbol-observable");
|
|
34
34
|
// symbol polyfill must go first
|
|
35
35
|
const fs_1 = require("fs");
|
|
36
|
+
const module_1 = require("module");
|
|
36
37
|
const path = __importStar(require("path"));
|
|
37
38
|
const semver_1 = require("semver");
|
|
38
39
|
const color_1 = require("../src/utilities/color");
|
|
@@ -67,7 +68,8 @@ let forceExit = false;
|
|
|
67
68
|
try {
|
|
68
69
|
// No error implies a projectLocalCli, which will load whatever
|
|
69
70
|
// version of ng-cli you have installed in a local package.json
|
|
70
|
-
const
|
|
71
|
+
const cwdRequire = (0, module_1.createRequire)(process.cwd() + '/');
|
|
72
|
+
const projectLocalCli = cwdRequire.resolve('@angular/cli');
|
|
71
73
|
cli = await Promise.resolve().then(() => __importStar(require(projectLocalCli)));
|
|
72
74
|
const globalVersion = new semver_1.SemVer(version_1.VERSION.full);
|
|
73
75
|
// Older versions might not have the VERSION export
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/cli",
|
|
3
|
-
"version": "15.0.0-next.
|
|
3
|
+
"version": "15.0.0-next.2",
|
|
4
4
|
"description": "CLI tool for Angular",
|
|
5
5
|
"main": "lib/cli/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/angular/angular-cli",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@angular-devkit/architect": "0.1500.0-next.
|
|
29
|
-
"@angular-devkit/core": "15.0.0-next.
|
|
30
|
-
"@angular-devkit/schematics": "15.0.0-next.
|
|
31
|
-
"@schematics/angular": "15.0.0-next.
|
|
28
|
+
"@angular-devkit/architect": "0.1500.0-next.2",
|
|
29
|
+
"@angular-devkit/core": "15.0.0-next.2",
|
|
30
|
+
"@angular-devkit/schematics": "15.0.0-next.2",
|
|
31
|
+
"@schematics/angular": "15.0.0-next.2",
|
|
32
32
|
"@yarnpkg/lockfile": "1.1.0",
|
|
33
33
|
"ansi-colors": "4.1.3",
|
|
34
34
|
"debug": "4.3.4",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"ng-update": {
|
|
50
50
|
"migrations": "@schematics/angular/migrations/migration-collection.json",
|
|
51
51
|
"packageGroup": {
|
|
52
|
-
"@angular/cli": "15.0.0-next.
|
|
53
|
-
"@angular-devkit/architect": "0.1500.0-next.
|
|
54
|
-
"@angular-devkit/build-angular": "15.0.0-next.
|
|
55
|
-
"@angular-devkit/build-webpack": "0.1500.0-next.
|
|
56
|
-
"@angular-devkit/core": "15.0.0-next.
|
|
57
|
-
"@angular-devkit/schematics": "15.0.0-next.
|
|
52
|
+
"@angular/cli": "15.0.0-next.2",
|
|
53
|
+
"@angular-devkit/architect": "0.1500.0-next.2",
|
|
54
|
+
"@angular-devkit/build-angular": "15.0.0-next.2",
|
|
55
|
+
"@angular-devkit/build-webpack": "0.1500.0-next.2",
|
|
56
|
+
"@angular-devkit/core": "15.0.0-next.2",
|
|
57
|
+
"@angular-devkit/schematics": "15.0.0-next.2"
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
@@ -6,9 +6,6 @@
|
|
|
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.io/license
|
|
8
8
|
*/
|
|
9
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
-
};
|
|
12
9
|
var _a;
|
|
13
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
11
|
exports.SchematicEngineHost = void 0;
|
|
@@ -16,7 +13,7 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
16
13
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
17
14
|
const fs_1 = require("fs");
|
|
18
15
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
19
|
-
const module_1 =
|
|
16
|
+
const module_1 = require("module");
|
|
20
17
|
const path_1 = require("path");
|
|
21
18
|
const vm_1 = require("vm");
|
|
22
19
|
const error_1 = require("../../utilities/error");
|
|
@@ -56,7 +53,8 @@ class SchematicEngineHost extends tools_1.NodeModulesEngineHost {
|
|
|
56
53
|
const [path, name] = refString.split('#', 2);
|
|
57
54
|
// Mimic behavior of ExportStringRef class used in default behavior
|
|
58
55
|
const fullPath = path[0] === '.' ? (0, path_1.resolve)(parentPath !== null && parentPath !== void 0 ? parentPath : process.cwd(), path) : path;
|
|
59
|
-
const
|
|
56
|
+
const referenceRequire = (0, module_1.createRequire)(__filename);
|
|
57
|
+
const schematicFile = referenceRequire.resolve(fullPath, { paths: [parentPath] });
|
|
60
58
|
if (shouldWrapSchematic(schematicFile, !!(collectionDescription === null || collectionDescription === void 0 ? void 0 : collectionDescription.encapsulation))) {
|
|
61
59
|
const schematicPath = (0, path_1.dirname)(schematicFile);
|
|
62
60
|
const moduleCache = new Map();
|
|
@@ -103,8 +101,8 @@ const legacyModules = {
|
|
|
103
101
|
* @param exportName An optional name of a specific export to return. Otherwise, return all exports.
|
|
104
102
|
*/
|
|
105
103
|
function wrap(schematicFile, schematicDirectory, moduleCache, exportName) {
|
|
106
|
-
const hostRequire = module_1.
|
|
107
|
-
const schematicRequire = module_1.
|
|
104
|
+
const hostRequire = (0, module_1.createRequire)(__filename);
|
|
105
|
+
const schematicRequire = (0, module_1.createRequire)(schematicFile);
|
|
108
106
|
const customRequire = function (id) {
|
|
109
107
|
if (legacyModules[id]) {
|
|
110
108
|
// Provide compatibility modules for older versions of @angular/cdk
|
|
@@ -20,6 +20,7 @@ export declare class AddCommandModule extends SchematicsCommandModule implements
|
|
|
20
20
|
longDescriptionPath: string;
|
|
21
21
|
protected allowPrivateSchematics: boolean;
|
|
22
22
|
private readonly schematicName;
|
|
23
|
+
private rootRequire;
|
|
23
24
|
builder(argv: Argv): Promise<Argv<AddCommandArgs>>;
|
|
24
25
|
run(options: Options<AddCommandArgs> & OtherOptions): Promise<number | void>;
|
|
25
26
|
private isProjectVersionValid;
|
package/src/commands/add/cli.js
CHANGED
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
exports.AddCommandModule = void 0;
|
|
14
14
|
const core_1 = require("@angular-devkit/core");
|
|
15
15
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
16
|
+
const module_1 = require("module");
|
|
16
17
|
const npm_package_arg_1 = __importDefault(require("npm-package-arg"));
|
|
17
18
|
const path_1 = require("path");
|
|
18
19
|
const semver_1 = require("semver");
|
|
@@ -42,6 +43,7 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
42
43
|
this.longDescriptionPath = (0, path_1.join)(__dirname, 'long-description.md');
|
|
43
44
|
this.allowPrivateSchematics = true;
|
|
44
45
|
this.schematicName = 'ng-add';
|
|
46
|
+
this.rootRequire = (0, module_1.createRequire)(this.context.root + '/');
|
|
45
47
|
}
|
|
46
48
|
async builder(argv) {
|
|
47
49
|
const localYargs = (await super.builder(argv))
|
|
@@ -214,9 +216,8 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
214
216
|
// Temporary packages are located in a different directory
|
|
215
217
|
// Hence we need to resolve them using the temp path
|
|
216
218
|
const { success, tempNodeModules } = await packageManager.installTemp(packageIdentifier.raw, registry ? [`--registry="${registry}"`] : undefined);
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
});
|
|
219
|
+
const tempRequire = (0, module_1.createRequire)(tempNodeModules + '/');
|
|
220
|
+
const resolvedCollectionPath = tempRequire.resolve((0, path_1.join)(collectionName, 'package.json'));
|
|
220
221
|
if (!success) {
|
|
221
222
|
return 1;
|
|
222
223
|
}
|
|
@@ -266,7 +267,7 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
266
267
|
}
|
|
267
268
|
isPackageInstalled(name) {
|
|
268
269
|
try {
|
|
269
|
-
|
|
270
|
+
this.rootRequire.resolve((0, path_1.join)(name, 'package.json'));
|
|
270
271
|
return true;
|
|
271
272
|
}
|
|
272
273
|
catch (e) {
|
|
@@ -309,9 +310,7 @@ class AddCommandModule extends schematics_command_module_1.SchematicsCommandModu
|
|
|
309
310
|
const { logger, root } = this.context;
|
|
310
311
|
let installedPackage;
|
|
311
312
|
try {
|
|
312
|
-
installedPackage =
|
|
313
|
-
paths: [root],
|
|
314
|
-
});
|
|
313
|
+
installedPackage = this.rootRequire.resolve((0, path_1.join)(name, 'package.json'));
|
|
315
314
|
}
|
|
316
315
|
catch { }
|
|
317
316
|
if (installedPackage) {
|
|
@@ -38,6 +38,7 @@ const schematics_1 = require("@angular-devkit/schematics");
|
|
|
38
38
|
const tools_1 = require("@angular-devkit/schematics/tools");
|
|
39
39
|
const child_process_1 = require("child_process");
|
|
40
40
|
const fs_1 = require("fs");
|
|
41
|
+
const module_1 = require("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"));
|
|
@@ -366,7 +367,8 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
366
367
|
// Try to resolve from package location.
|
|
367
368
|
// This avoids issues with package hoisting.
|
|
368
369
|
try {
|
|
369
|
-
|
|
370
|
+
const packageRequire = (0, module_1.createRequire)(packagePath + '/');
|
|
371
|
+
migrations = packageRequire.resolve(migrations);
|
|
370
372
|
}
|
|
371
373
|
catch (e) {
|
|
372
374
|
(0, error_1.assertIsError)(e);
|
|
@@ -531,6 +533,7 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
531
533
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
532
534
|
const migrations = global.externalMigrations;
|
|
533
535
|
if (success && migrations) {
|
|
536
|
+
const rootRequire = (0, module_1.createRequire)(this.context.root + '/');
|
|
534
537
|
for (const migration of migrations) {
|
|
535
538
|
// Resolve the package from the workspace root, as otherwise it will be resolved from the temp
|
|
536
539
|
// installed CLI version.
|
|
@@ -540,15 +543,13 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
540
543
|
try {
|
|
541
544
|
packagePath = path.dirname(
|
|
542
545
|
// This may fail if the `package.json` is not exported as an entry point
|
|
543
|
-
|
|
544
|
-
paths: [this.context.root],
|
|
545
|
-
}));
|
|
546
|
+
rootRequire.resolve(path.join(migration.package, 'package.json')));
|
|
546
547
|
}
|
|
547
548
|
catch (e) {
|
|
548
549
|
(0, error_1.assertIsError)(e);
|
|
549
550
|
if (e.code === 'MODULE_NOT_FOUND') {
|
|
550
551
|
// Fallback to trying to resolve the package's main entry point
|
|
551
|
-
packagePath =
|
|
552
|
+
packagePath = rootRequire.resolve(migration.package);
|
|
552
553
|
}
|
|
553
554
|
else {
|
|
554
555
|
throw e;
|
|
@@ -577,7 +578,8 @@ class UpdateCommandModule extends command_module_1.CommandModule {
|
|
|
577
578
|
// Try to resolve from package location.
|
|
578
579
|
// This avoids issues with package hoisting.
|
|
579
580
|
try {
|
|
580
|
-
|
|
581
|
+
const packageRequire = (0, module_1.createRequire)(packagePath + '/');
|
|
582
|
+
migrations = packageRequire.resolve(migration.collection);
|
|
581
583
|
}
|
|
582
584
|
catch (e) {
|
|
583
585
|
(0, error_1.assertIsError)(e);
|