@schematics/angular 18.0.3 → 18.1.0-next.1
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/app-shell/index.js +1 -1
- package/application/index.js +1 -1
- package/class/index.js +1 -1
- package/component/index.js +1 -1
- package/config/index.js +1 -1
- package/directive/index.js +1 -1
- package/e2e/index.js +1 -1
- package/enum/index.js +1 -1
- package/environments/index.js +1 -1
- package/guard/index.js +1 -1
- package/interceptor/index.js +1 -1
- package/interface/index.js +1 -1
- package/library/index.js +1 -1
- package/migrations/use-application-builder/css-import-lexer.js +1 -2
- package/migrations/use-application-builder/migration.js +1 -1
- package/module/index.js +1 -1
- package/ng-new/index.js +1 -1
- package/package.json +3 -3
- package/pipe/index.js +1 -1
- package/resolver/index.js +1 -1
- package/server/index.js +1 -1
- package/service/index.js +1 -1
- package/service-worker/index.js +1 -1
- package/ssr/index.js +1 -1
- package/third_party/github.com/Microsoft/TypeScript/lib/typescript.d.ts +860 -1340
- package/third_party/github.com/Microsoft/TypeScript/lib/typescript.js +183192 -179327
- package/utility/add-declaration-to-ng-module.js +1 -2
- package/utility/ast-utils.js +17 -18
- package/utility/change.js +2 -2
- package/utility/dependencies.js +4 -4
- package/utility/dependency.js +2 -2
- package/utility/eol.js +1 -2
- package/utility/find-module.js +4 -4
- package/utility/generate-from-files.js +1 -2
- package/utility/latest-versions/package.json +1 -1
- package/utility/latest-versions.js +2 -2
- package/utility/ng-ast-utils.js +3 -4
- package/utility/parse-name.js +1 -2
- package/utility/paths.js +1 -2
- package/utility/project-targets.js +1 -2
- package/utility/standalone/app_config.js +1 -2
- package/utility/standalone/rules.js +2 -3
- package/utility/standalone/util.js +6 -7
- package/utility/validation.js +3 -3
- package/utility/workspace.js +8 -8
- package/web-worker/index.js +1 -1
- package/workspace/files/tsconfig.json.template +0 -1
- package/workspace/index.js +1 -1
|
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.addDeclarationToNgModule =
|
|
33
|
+
exports.addDeclarationToNgModule = addDeclarationToNgModule;
|
|
34
34
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
35
35
|
const ts = __importStar(require("../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
36
36
|
const ast_utils_1 = require("./ast-utils");
|
|
@@ -65,4 +65,3 @@ function addDeclarationToNgModule(options) {
|
|
|
65
65
|
return host;
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
|
-
exports.addDeclarationToNgModule = addDeclarationToNgModule;
|
package/utility/ast-utils.js
CHANGED
|
@@ -30,7 +30,23 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
33
|
+
exports.insertImport = insertImport;
|
|
34
|
+
exports.findNodes = findNodes;
|
|
35
|
+
exports.getSourceNodes = getSourceNodes;
|
|
36
|
+
exports.findNode = findNode;
|
|
37
|
+
exports.insertAfterLastOccurrence = insertAfterLastOccurrence;
|
|
38
|
+
exports.getDecoratorMetadata = getDecoratorMetadata;
|
|
39
|
+
exports.getMetadataField = getMetadataField;
|
|
40
|
+
exports.addSymbolToNgModuleMetadata = addSymbolToNgModuleMetadata;
|
|
41
|
+
exports.addDeclarationToModule = addDeclarationToModule;
|
|
42
|
+
exports.addImportToModule = addImportToModule;
|
|
43
|
+
exports.addProviderToModule = addProviderToModule;
|
|
44
|
+
exports.addExportToModule = addExportToModule;
|
|
45
|
+
exports.addBootstrapToModule = addBootstrapToModule;
|
|
46
|
+
exports.isImported = isImported;
|
|
47
|
+
exports.getRouterModuleDeclaration = getRouterModuleDeclaration;
|
|
48
|
+
exports.addRouteDeclarationToModule = addRouteDeclarationToModule;
|
|
49
|
+
exports.hasTopLevelIdentifier = hasTopLevelIdentifier;
|
|
34
50
|
const core_1 = require("@angular-devkit/core");
|
|
35
51
|
const ts = __importStar(require("../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
36
52
|
const change_1 = require("./change");
|
|
@@ -90,7 +106,6 @@ function insertImport(source, fileToEdit, symbolName, fileName, isDefault = fals
|
|
|
90
106
|
` from '${fileName}'${insertAtBeginning ? `;${eol}` : ''}`;
|
|
91
107
|
return insertAfterLastOccurrence(allImports, toInsert, fileToEdit, fallbackPos, ts.SyntaxKind.StringLiteral);
|
|
92
108
|
}
|
|
93
|
-
exports.insertImport = insertImport;
|
|
94
109
|
function findNodes(node, kindOrGuard, max = Infinity, recursive = false) {
|
|
95
110
|
if (!node || max == 0) {
|
|
96
111
|
return [];
|
|
@@ -118,7 +133,6 @@ function findNodes(node, kindOrGuard, max = Infinity, recursive = false) {
|
|
|
118
133
|
}
|
|
119
134
|
return arr;
|
|
120
135
|
}
|
|
121
|
-
exports.findNodes = findNodes;
|
|
122
136
|
/**
|
|
123
137
|
* Get all the nodes from a source.
|
|
124
138
|
* @param sourceFile The source file object.
|
|
@@ -138,7 +152,6 @@ function getSourceNodes(sourceFile) {
|
|
|
138
152
|
}
|
|
139
153
|
return result;
|
|
140
154
|
}
|
|
141
|
-
exports.getSourceNodes = getSourceNodes;
|
|
142
155
|
function findNode(node, kind, text) {
|
|
143
156
|
if (node.kind === kind && node.getText() === text) {
|
|
144
157
|
return node;
|
|
@@ -149,7 +162,6 @@ function findNode(node, kind, text) {
|
|
|
149
162
|
});
|
|
150
163
|
return foundNode;
|
|
151
164
|
}
|
|
152
|
-
exports.findNode = findNode;
|
|
153
165
|
/**
|
|
154
166
|
* Helper for sorting nodes.
|
|
155
167
|
* @return function to sort nodes in increasing order of position in sourceFile
|
|
@@ -186,7 +198,6 @@ function insertAfterLastOccurrence(nodes, toInsert, file, fallbackPos, syntaxKin
|
|
|
186
198
|
const lastItemPosition = lastItem ? lastItem.getEnd() : fallbackPos;
|
|
187
199
|
return new change_1.InsertChange(file, lastItemPosition, toInsert);
|
|
188
200
|
}
|
|
189
|
-
exports.insertAfterLastOccurrence = insertAfterLastOccurrence;
|
|
190
201
|
function _angularImportsFromNode(node) {
|
|
191
202
|
const ms = node.moduleSpecifier;
|
|
192
203
|
let modulePath;
|
|
@@ -267,7 +278,6 @@ function getDecoratorMetadata(source, identifier, module) {
|
|
|
267
278
|
.filter((expr) => expr.arguments[0] && expr.arguments[0].kind == ts.SyntaxKind.ObjectLiteralExpression)
|
|
268
279
|
.map((expr) => expr.arguments[0]);
|
|
269
280
|
}
|
|
270
|
-
exports.getDecoratorMetadata = getDecoratorMetadata;
|
|
271
281
|
function getMetadataField(node, metadataField) {
|
|
272
282
|
return (node.properties
|
|
273
283
|
.filter(ts.isPropertyAssignment)
|
|
@@ -277,7 +287,6 @@ function getMetadataField(node, metadataField) {
|
|
|
277
287
|
return (ts.isIdentifier(name) || ts.isStringLiteral(name)) && name.text === metadataField;
|
|
278
288
|
}));
|
|
279
289
|
}
|
|
280
|
-
exports.getMetadataField = getMetadataField;
|
|
281
290
|
function addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, symbolName, importPath = null) {
|
|
282
291
|
const nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core');
|
|
283
292
|
const node = nodes[0];
|
|
@@ -365,7 +374,6 @@ function addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, symbol
|
|
|
365
374
|
}
|
|
366
375
|
return [new change_1.InsertChange(ngModulePath, position, toInsert)];
|
|
367
376
|
}
|
|
368
|
-
exports.addSymbolToNgModuleMetadata = addSymbolToNgModuleMetadata;
|
|
369
377
|
/**
|
|
370
378
|
* Custom function to insert a declaration (component, pipe, directive)
|
|
371
379
|
* into NgModule declarations. It also imports the component.
|
|
@@ -373,35 +381,30 @@ exports.addSymbolToNgModuleMetadata = addSymbolToNgModuleMetadata;
|
|
|
373
381
|
function addDeclarationToModule(source, modulePath, classifiedName, importPath) {
|
|
374
382
|
return addSymbolToNgModuleMetadata(source, modulePath, 'declarations', classifiedName, importPath);
|
|
375
383
|
}
|
|
376
|
-
exports.addDeclarationToModule = addDeclarationToModule;
|
|
377
384
|
/**
|
|
378
385
|
* Custom function to insert an NgModule into NgModule imports. It also imports the module.
|
|
379
386
|
*/
|
|
380
387
|
function addImportToModule(source, modulePath, classifiedName, importPath) {
|
|
381
388
|
return addSymbolToNgModuleMetadata(source, modulePath, 'imports', classifiedName, importPath);
|
|
382
389
|
}
|
|
383
|
-
exports.addImportToModule = addImportToModule;
|
|
384
390
|
/**
|
|
385
391
|
* Custom function to insert a provider into NgModule. It also imports it.
|
|
386
392
|
*/
|
|
387
393
|
function addProviderToModule(source, modulePath, classifiedName, importPath) {
|
|
388
394
|
return addSymbolToNgModuleMetadata(source, modulePath, 'providers', classifiedName, importPath);
|
|
389
395
|
}
|
|
390
|
-
exports.addProviderToModule = addProviderToModule;
|
|
391
396
|
/**
|
|
392
397
|
* Custom function to insert an export into NgModule. It also imports it.
|
|
393
398
|
*/
|
|
394
399
|
function addExportToModule(source, modulePath, classifiedName, importPath) {
|
|
395
400
|
return addSymbolToNgModuleMetadata(source, modulePath, 'exports', classifiedName, importPath);
|
|
396
401
|
}
|
|
397
|
-
exports.addExportToModule = addExportToModule;
|
|
398
402
|
/**
|
|
399
403
|
* Custom function to insert an export into NgModule. It also imports it.
|
|
400
404
|
*/
|
|
401
405
|
function addBootstrapToModule(source, modulePath, classifiedName, importPath) {
|
|
402
406
|
return addSymbolToNgModuleMetadata(source, modulePath, 'bootstrap', classifiedName, importPath);
|
|
403
407
|
}
|
|
404
|
-
exports.addBootstrapToModule = addBootstrapToModule;
|
|
405
408
|
/**
|
|
406
409
|
* Determine if an import already exists.
|
|
407
410
|
*/
|
|
@@ -419,7 +422,6 @@ function isImported(source, classifiedName, importPath) {
|
|
|
419
422
|
});
|
|
420
423
|
return matchingNodes.length > 0;
|
|
421
424
|
}
|
|
422
|
-
exports.isImported = isImported;
|
|
423
425
|
/**
|
|
424
426
|
* Returns the RouterModule declaration from NgModule metadata, if any.
|
|
425
427
|
*/
|
|
@@ -442,7 +444,6 @@ function getRouterModuleDeclaration(source) {
|
|
|
442
444
|
.filter((el) => el.kind === ts.SyntaxKind.CallExpression)
|
|
443
445
|
.find((el) => el.getText().startsWith('RouterModule'));
|
|
444
446
|
}
|
|
445
|
-
exports.getRouterModuleDeclaration = getRouterModuleDeclaration;
|
|
446
447
|
/**
|
|
447
448
|
* Adds a new route declaration to a router module (i.e. has a RouterModule declaration)
|
|
448
449
|
*/
|
|
@@ -506,7 +507,6 @@ function addRouteDeclarationToModule(source, fileToAdd, routeLiteral) {
|
|
|
506
507
|
}
|
|
507
508
|
return new change_1.InsertChange(fileToAdd, insertPos, route);
|
|
508
509
|
}
|
|
509
|
-
exports.addRouteDeclarationToModule = addRouteDeclarationToModule;
|
|
510
510
|
/** Asserts if the specified node is a named declaration (e.g. class, interface). */
|
|
511
511
|
function isNamedNode(node) {
|
|
512
512
|
return !!node.name && ts.isIdentifier(node.name);
|
|
@@ -541,4 +541,3 @@ function hasTopLevelIdentifier(sourceFile, symbolName, skipModule = null) {
|
|
|
541
541
|
}
|
|
542
542
|
return false;
|
|
543
543
|
}
|
|
544
|
-
exports.hasTopLevelIdentifier = hasTopLevelIdentifier;
|
package/utility/change.js
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.ReplaceChange = exports.RemoveChange = exports.InsertChange = exports.NoopChange = void 0;
|
|
11
|
+
exports.applyToUpdateRecorder = applyToUpdateRecorder;
|
|
11
12
|
/**
|
|
12
13
|
* An operation that does nothing.
|
|
13
14
|
*/
|
|
@@ -132,4 +133,3 @@ function applyToUpdateRecorder(recorder, changes) {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
|
-
exports.applyToUpdateRecorder = applyToUpdateRecorder;
|
package/utility/dependencies.js
CHANGED
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.NodeDependencyType = void 0;
|
|
11
|
+
exports.addPackageJsonDependency = addPackageJsonDependency;
|
|
12
|
+
exports.removePackageJsonDependency = removePackageJsonDependency;
|
|
13
|
+
exports.getPackageJsonDependency = getPackageJsonDependency;
|
|
11
14
|
const json_file_1 = require("./json-file");
|
|
12
15
|
const PKG_JSON_PATH = '/package.json';
|
|
13
16
|
var NodeDependencyType;
|
|
@@ -31,14 +34,12 @@ function addPackageJsonDependency(tree, dependency, pkgJsonPath = PKG_JSON_PATH)
|
|
|
31
34
|
json.modify(path, version);
|
|
32
35
|
}
|
|
33
36
|
}
|
|
34
|
-
exports.addPackageJsonDependency = addPackageJsonDependency;
|
|
35
37
|
function removePackageJsonDependency(tree, name, pkgJsonPath = PKG_JSON_PATH) {
|
|
36
38
|
const json = new json_file_1.JSONFile(tree, pkgJsonPath);
|
|
37
39
|
for (const depType of ALL_DEPENDENCY_TYPE) {
|
|
38
40
|
json.remove([depType, name]);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
|
-
exports.removePackageJsonDependency = removePackageJsonDependency;
|
|
42
43
|
function getPackageJsonDependency(tree, name, pkgJsonPath = PKG_JSON_PATH) {
|
|
43
44
|
const json = new json_file_1.JSONFile(tree, pkgJsonPath);
|
|
44
45
|
for (const depType of ALL_DEPENDENCY_TYPE) {
|
|
@@ -53,4 +54,3 @@ function getPackageJsonDependency(tree, name, pkgJsonPath = PKG_JSON_PATH) {
|
|
|
53
54
|
}
|
|
54
55
|
return null;
|
|
55
56
|
}
|
|
56
|
-
exports.getPackageJsonDependency = getPackageJsonDependency;
|
package/utility/dependency.js
CHANGED
|
@@ -30,7 +30,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
33
|
+
exports.ExistingBehavior = exports.InstallBehavior = exports.DependencyType = void 0;
|
|
34
|
+
exports.addDependency = addDependency;
|
|
34
35
|
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
|
35
36
|
const path = __importStar(require("path"));
|
|
36
37
|
const installTasks = new WeakMap();
|
|
@@ -142,4 +143,3 @@ function addDependency(name, specifier, options = {}) {
|
|
|
142
143
|
}
|
|
143
144
|
};
|
|
144
145
|
}
|
|
145
|
-
exports.addDependency = addDependency;
|
package/utility/eol.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.getEOL =
|
|
10
|
+
exports.getEOL = getEOL;
|
|
11
11
|
const node_os_1 = require("node:os");
|
|
12
12
|
const CRLF = '\r\n';
|
|
13
13
|
const LF = '\n';
|
|
@@ -20,4 +20,3 @@ function getEOL(content) {
|
|
|
20
20
|
}
|
|
21
21
|
return node_os_1.EOL;
|
|
22
22
|
}
|
|
23
|
-
exports.getEOL = getEOL;
|
package/utility/find-module.js
CHANGED
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.ROUTING_MODULE_EXT = exports.MODULE_EXT = void 0;
|
|
11
|
+
exports.findModuleFromOptions = findModuleFromOptions;
|
|
12
|
+
exports.findModule = findModule;
|
|
13
|
+
exports.buildRelativePath = buildRelativePath;
|
|
11
14
|
const core_1 = require("@angular-devkit/core");
|
|
12
15
|
exports.MODULE_EXT = '.module.ts';
|
|
13
16
|
exports.ROUTING_MODULE_EXT = '-routing.module.ts';
|
|
@@ -48,7 +51,6 @@ function findModuleFromOptions(host, options) {
|
|
|
48
51
|
`Looked in the following directories:\n ${candidatesDirs.join('\n ')}`);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
|
-
exports.findModuleFromOptions = findModuleFromOptions;
|
|
52
54
|
/**
|
|
53
55
|
* Function to find the "closest" module to a generated file's path.
|
|
54
56
|
*/
|
|
@@ -75,7 +77,6 @@ function findModule(host, generateDir, moduleExt = exports.MODULE_EXT, routingMo
|
|
|
75
77
|
: `Could not find an NgModule. Use the '--skip-import' option to skip importing in NgModule.`;
|
|
76
78
|
throw new Error(errorMsg);
|
|
77
79
|
}
|
|
78
|
-
exports.findModule = findModule;
|
|
79
80
|
/**
|
|
80
81
|
* Build a relative path from one file path to another file path.
|
|
81
82
|
*/
|
|
@@ -102,4 +103,3 @@ function buildRelativePath(from, to) {
|
|
|
102
103
|
}
|
|
103
104
|
return pathPrefix + (relativePath ? relativePath + '/' : '') + toFileName;
|
|
104
105
|
}
|
|
105
|
-
exports.buildRelativePath = buildRelativePath;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.generateFromFiles =
|
|
10
|
+
exports.generateFromFiles = generateFromFiles;
|
|
11
11
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
12
|
const parse_name_1 = require("./parse-name");
|
|
13
13
|
const validation_1 = require("./validation");
|
|
@@ -34,4 +34,3 @@ function generateFromFiles(options, extraTemplateValues = {}) {
|
|
|
34
34
|
return (0, schematics_1.chain)([(0, schematics_1.mergeWith)(templateSource)]);
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
exports.generateFromFiles = generateFromFiles;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"comment": "This file is needed so that dependencies are synced by Renovate.",
|
|
4
4
|
"private": true,
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@angular/core": "^18.0.0",
|
|
6
|
+
"@angular/core": "^18.1.0-next.0",
|
|
7
7
|
"@types/express": "^4.17.17",
|
|
8
8
|
"@types/jasmine": "~5.1.0",
|
|
9
9
|
"@types/node": "^18.18.0",
|
|
@@ -15,6 +15,6 @@ exports.latestVersions = {
|
|
|
15
15
|
...dependencies,
|
|
16
16
|
// As Angular CLI works with same minor versions of Angular Framework, a tilde match for the current
|
|
17
17
|
Angular: dependencies['@angular/core'],
|
|
18
|
-
DevkitBuildAngular: '^18.0.
|
|
19
|
-
AngularSSR: '^18.0.
|
|
18
|
+
DevkitBuildAngular: '^18.1.0-next.1',
|
|
19
|
+
AngularSSR: '^18.1.0-next.1',
|
|
20
20
|
};
|
package/utility/ng-ast-utils.js
CHANGED
|
@@ -30,7 +30,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.
|
|
33
|
+
exports.findBootstrapModuleCall = findBootstrapModuleCall;
|
|
34
|
+
exports.getAppModulePath = getAppModulePath;
|
|
35
|
+
exports.isStandaloneApp = isStandaloneApp;
|
|
34
36
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
35
37
|
const posix_1 = require("node:path/posix");
|
|
36
38
|
const ts = __importStar(require("../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
@@ -59,7 +61,6 @@ function findBootstrapModuleCall(host, mainPath) {
|
|
|
59
61
|
}
|
|
60
62
|
return bootstrapCall;
|
|
61
63
|
}
|
|
62
|
-
exports.findBootstrapModuleCall = findBootstrapModuleCall;
|
|
63
64
|
function findBootstrapModulePath(host, mainPath) {
|
|
64
65
|
const bootstrapCall = findBootstrapModuleCall(host, mainPath);
|
|
65
66
|
if (!bootstrapCall) {
|
|
@@ -86,7 +87,6 @@ function getAppModulePath(host, mainPath) {
|
|
|
86
87
|
const modulePath = (0, posix_1.join)(mainDir, `${moduleRelativePath}.ts`);
|
|
87
88
|
return modulePath;
|
|
88
89
|
}
|
|
89
|
-
exports.getAppModulePath = getAppModulePath;
|
|
90
90
|
function isStandaloneApp(host, mainPath) {
|
|
91
91
|
try {
|
|
92
92
|
(0, util_1.findBootstrapApplicationCall)(host, mainPath);
|
|
@@ -99,4 +99,3 @@ function isStandaloneApp(host, mainPath) {
|
|
|
99
99
|
throw error;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
exports.isStandaloneApp = isStandaloneApp;
|
package/utility/parse-name.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.parseName =
|
|
10
|
+
exports.parseName = parseName;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
function parseName(path, name) {
|
|
13
13
|
const nameWithoutPath = (0, core_1.basename)((0, core_1.normalize)(name));
|
|
@@ -17,4 +17,3 @@ function parseName(path, name) {
|
|
|
17
17
|
path: (0, core_1.normalize)('/' + namePath),
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.parseName = parseName;
|
package/utility/paths.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.relativePathToWorkspaceRoot =
|
|
10
|
+
exports.relativePathToWorkspaceRoot = relativePathToWorkspaceRoot;
|
|
11
11
|
const posix_1 = require("node:path/posix");
|
|
12
12
|
function relativePathToWorkspaceRoot(projectRoot) {
|
|
13
13
|
if (!projectRoot) {
|
|
@@ -15,4 +15,3 @@ function relativePathToWorkspaceRoot(projectRoot) {
|
|
|
15
15
|
}
|
|
16
16
|
return (0, posix_1.relative)((0, posix_1.join)('/', projectRoot), '/') || '.';
|
|
17
17
|
}
|
|
18
|
-
exports.relativePathToWorkspaceRoot = relativePathToWorkspaceRoot;
|
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.targetBuildNotFoundError =
|
|
10
|
+
exports.targetBuildNotFoundError = targetBuildNotFoundError;
|
|
11
11
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
12
|
function targetBuildNotFoundError() {
|
|
13
13
|
return new schematics_1.SchematicsException(`Project target "build" not found.`);
|
|
14
14
|
}
|
|
15
|
-
exports.targetBuildNotFoundError = targetBuildNotFoundError;
|
|
@@ -10,7 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.findAppConfig =
|
|
13
|
+
exports.findAppConfig = findAppConfig;
|
|
14
14
|
const path_1 = require("path");
|
|
15
15
|
const typescript_1 = __importDefault(require("../../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
16
16
|
const util_1 = require("./util");
|
|
@@ -32,7 +32,6 @@ function findAppConfig(bootstrapCall, tree, filePath) {
|
|
|
32
32
|
}
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
exports.findAppConfig = findAppConfig;
|
|
36
35
|
/**
|
|
37
36
|
* Resolves the app config from an identifier referring to it.
|
|
38
37
|
* @param identifier Identifier referring to the app config.
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.addRootImport = addRootImport;
|
|
11
|
+
exports.addRootProvider = addRootProvider;
|
|
11
12
|
const core_1 = require("@angular-devkit/core");
|
|
12
13
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
14
|
const ast_utils_1 = require("../ast-utils");
|
|
@@ -39,7 +40,6 @@ function addRootImport(project, callback) {
|
|
|
39
40
|
module: '@angular/core',
|
|
40
41
|
});
|
|
41
42
|
}
|
|
42
|
-
exports.addRootImport = addRootImport;
|
|
43
43
|
/**
|
|
44
44
|
* Adds a provider to the root of the project.
|
|
45
45
|
* @param project Name of the project to which to add the import.
|
|
@@ -60,7 +60,6 @@ exports.addRootImport = addRootImport;
|
|
|
60
60
|
function addRootProvider(project, callback) {
|
|
61
61
|
return getRootInsertionRule(project, callback, 'providers');
|
|
62
62
|
}
|
|
63
|
-
exports.addRootProvider = addRootProvider;
|
|
64
63
|
/**
|
|
65
64
|
* Creates a rule that inserts code at the root of either a standalone or NgModule-based project.
|
|
66
65
|
* @param project Name of the project into which to inser tthe code.
|
|
@@ -10,7 +10,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.getMainFilePath = getMainFilePath;
|
|
14
|
+
exports.getSourceFile = getSourceFile;
|
|
15
|
+
exports.findBootstrapApplicationCall = findBootstrapApplicationCall;
|
|
16
|
+
exports.applyChangesToFile = applyChangesToFile;
|
|
17
|
+
exports.isMergeAppConfigCall = isMergeAppConfigCall;
|
|
18
|
+
exports.findProvidersLiteral = findProvidersLiteral;
|
|
14
19
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
15
20
|
const typescript_1 = __importDefault(require("../../third_party/github.com/Microsoft/TypeScript/lib/typescript"));
|
|
16
21
|
const change_1 = require("../change");
|
|
@@ -35,7 +40,6 @@ async function getMainFilePath(tree, projectName) {
|
|
|
35
40
|
? options.browser
|
|
36
41
|
: options.main;
|
|
37
42
|
}
|
|
38
|
-
exports.getMainFilePath = getMainFilePath;
|
|
39
43
|
/**
|
|
40
44
|
* Gets a TypeScript source file at a specific path.
|
|
41
45
|
* @param tree File tree of a project.
|
|
@@ -46,7 +50,6 @@ function getSourceFile(tree, path) {
|
|
|
46
50
|
const source = typescript_1.default.createSourceFile(path, content, typescript_1.default.ScriptTarget.Latest, true);
|
|
47
51
|
return source;
|
|
48
52
|
}
|
|
49
|
-
exports.getSourceFile = getSourceFile;
|
|
50
53
|
/** Finds the call to `bootstrapApplication` within a file. */
|
|
51
54
|
function findBootstrapApplicationCall(tree, mainFilePath) {
|
|
52
55
|
const sourceFile = getSourceFile(tree, mainFilePath);
|
|
@@ -69,7 +72,6 @@ function findBootstrapApplicationCall(tree, mainFilePath) {
|
|
|
69
72
|
}
|
|
70
73
|
throw new schematics_1.SchematicsException(`Could not find bootstrapApplication call in ${mainFilePath}`);
|
|
71
74
|
}
|
|
72
|
-
exports.findBootstrapApplicationCall = findBootstrapApplicationCall;
|
|
73
75
|
/**
|
|
74
76
|
* Finds the local name of an imported symbol. Could be the symbol name itself or its alias.
|
|
75
77
|
* @param sourceFile File within which to search for the import.
|
|
@@ -113,7 +115,6 @@ function applyChangesToFile(tree, path, changes) {
|
|
|
113
115
|
tree.commitUpdate(recorder);
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
|
-
exports.applyChangesToFile = applyChangesToFile;
|
|
117
118
|
/** Checks whether a node is a call to `mergeApplicationConfig`. */
|
|
118
119
|
function isMergeAppConfigCall(node) {
|
|
119
120
|
if (!typescript_1.default.isCallExpression(node)) {
|
|
@@ -122,7 +123,6 @@ function isMergeAppConfigCall(node) {
|
|
|
122
123
|
const localName = findImportLocalName(node.getSourceFile(), 'mergeApplicationConfig', '@angular/core');
|
|
123
124
|
return !!localName && typescript_1.default.isIdentifier(node.expression) && node.expression.text === localName;
|
|
124
125
|
}
|
|
125
|
-
exports.isMergeAppConfigCall = isMergeAppConfigCall;
|
|
126
126
|
/** Finds the `providers` array literal within an application config. */
|
|
127
127
|
function findProvidersLiteral(config) {
|
|
128
128
|
for (const prop of config.properties) {
|
|
@@ -135,4 +135,3 @@ function findProvidersLiteral(config) {
|
|
|
135
135
|
}
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
-
exports.findProvidersLiteral = findProvidersLiteral;
|
package/utility/validation.js
CHANGED
|
@@ -7,7 +7,9 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.htmlSelectorRe = void 0;
|
|
11
|
+
exports.validateHtmlSelector = validateHtmlSelector;
|
|
12
|
+
exports.validateClassName = validateClassName;
|
|
11
13
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
14
|
// Must start with a letter, and must contain only alphanumeric characters or dashes.
|
|
13
15
|
// When adding a dash the segment after the dash must also start with a letter.
|
|
@@ -19,10 +21,8 @@ function validateHtmlSelector(selector) {
|
|
|
19
21
|
throw new schematics_1.SchematicsException(`Selector "${selector}" is invalid.`);
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
|
-
exports.validateHtmlSelector = validateHtmlSelector;
|
|
23
24
|
function validateClassName(className) {
|
|
24
25
|
if (!ecmaIdentifierNameRegExp.test(className)) {
|
|
25
26
|
throw new schematics_1.SchematicsException(`Class name "${className}" is invalid.`);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
exports.validateClassName = validateClassName;
|
package/utility/workspace.js
CHANGED
|
@@ -7,7 +7,14 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.TreeWorkspaceHost = void 0;
|
|
11
|
+
exports.updateWorkspace = updateWorkspace;
|
|
12
|
+
exports.getWorkspace = getWorkspace;
|
|
13
|
+
exports.writeWorkspace = writeWorkspace;
|
|
14
|
+
exports.buildDefaultPath = buildDefaultPath;
|
|
15
|
+
exports.createDefaultPath = createDefaultPath;
|
|
16
|
+
exports.allWorkspaceTargets = allWorkspaceTargets;
|
|
17
|
+
exports.allTargetOptions = allTargetOptions;
|
|
11
18
|
const core_1 = require("@angular-devkit/core");
|
|
12
19
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
20
|
const workspace_models_1 = require("./workspace-models");
|
|
@@ -58,7 +65,6 @@ function updateWorkspace(updater) {
|
|
|
58
65
|
return result || schematics_1.noop;
|
|
59
66
|
};
|
|
60
67
|
}
|
|
61
|
-
exports.updateWorkspace = updateWorkspace;
|
|
62
68
|
// TODO: This should be renamed `readWorkspace` once deep imports are restricted (already exported from `utility` with that name)
|
|
63
69
|
/**
|
|
64
70
|
* Reads a workspace file (`angular.json`) from the provided {@link Tree} instance.
|
|
@@ -74,7 +80,6 @@ async function getWorkspace(tree, path = DEFAULT_WORKSPACE_PATH) {
|
|
|
74
80
|
const { workspace } = await core_1.workspaces.readWorkspace(path, host);
|
|
75
81
|
return workspace;
|
|
76
82
|
}
|
|
77
|
-
exports.getWorkspace = getWorkspace;
|
|
78
83
|
/**
|
|
79
84
|
* Writes a workspace file (`angular.json`) to the provided {@link Tree} instance.
|
|
80
85
|
* The spacing and overall layout of an exisitng file (including comments) will be maintained where
|
|
@@ -90,7 +95,6 @@ async function writeWorkspace(tree, workspace, path) {
|
|
|
90
95
|
const host = new TreeWorkspaceHost(tree);
|
|
91
96
|
return core_1.workspaces.writeWorkspace(workspace, host, path);
|
|
92
97
|
}
|
|
93
|
-
exports.writeWorkspace = writeWorkspace;
|
|
94
98
|
/**
|
|
95
99
|
* Build a default project path for generating.
|
|
96
100
|
* @param project The project which will have its default path generated.
|
|
@@ -100,7 +104,6 @@ function buildDefaultPath(project) {
|
|
|
100
104
|
const projectDirName = project.extensions['projectType'] === workspace_models_1.ProjectType.Application ? 'app' : 'lib';
|
|
101
105
|
return `${root}${projectDirName}`;
|
|
102
106
|
}
|
|
103
|
-
exports.buildDefaultPath = buildDefaultPath;
|
|
104
107
|
async function createDefaultPath(tree, projectName) {
|
|
105
108
|
const workspace = await getWorkspace(tree);
|
|
106
109
|
const project = workspace.projects.get(projectName);
|
|
@@ -109,7 +112,6 @@ async function createDefaultPath(tree, projectName) {
|
|
|
109
112
|
}
|
|
110
113
|
return buildDefaultPath(project);
|
|
111
114
|
}
|
|
112
|
-
exports.createDefaultPath = createDefaultPath;
|
|
113
115
|
function* allWorkspaceTargets(workspace) {
|
|
114
116
|
for (const [projectName, project] of workspace.projects) {
|
|
115
117
|
for (const [targetName, target] of project.targets) {
|
|
@@ -117,7 +119,6 @@ function* allWorkspaceTargets(workspace) {
|
|
|
117
119
|
}
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
|
-
exports.allWorkspaceTargets = allWorkspaceTargets;
|
|
121
122
|
function* allTargetOptions(target, skipBaseOptions = false) {
|
|
122
123
|
if (!skipBaseOptions && target.options) {
|
|
123
124
|
yield [undefined, target.options];
|
|
@@ -131,4 +132,3 @@ function* allTargetOptions(target, skipBaseOptions = false) {
|
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
|
-
exports.allTargetOptions = allTargetOptions;
|
package/web-worker/index.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = default_1;
|
|
10
11
|
const core_1 = require("@angular-devkit/core");
|
|
11
12
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
13
|
const parse_name_1 = require("../utility/parse-name");
|
|
@@ -107,4 +108,3 @@ function default_1(options) {
|
|
|
107
108
|
]);
|
|
108
109
|
};
|
|
109
110
|
}
|
|
110
|
-
exports.default = default_1;
|
package/workspace/index.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.default = default_1;
|
|
10
11
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
11
12
|
const latest_versions_1 = require("../utility/latest-versions");
|
|
12
13
|
function default_1(options) {
|
|
@@ -20,4 +21,3 @@ function default_1(options) {
|
|
|
20
21
|
}),
|
|
21
22
|
]));
|
|
22
23
|
}
|
|
23
|
-
exports.default = default_1;
|