@abp/ng.schematics 9.2.0-rc.2 → 9.2.0-rc.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/commands/change-theme/index.d.ts +7 -3
- package/commands/change-theme/index.js +264 -70
- package/commands/change-theme/index.js.map +1 -1
- package/commands/change-theme/style-map.d.ts +1 -0
- package/commands/change-theme/style-map.js +90 -9
- package/commands/change-theme/style-map.js.map +1 -1
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/.eslintrc.json.template +44 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/ng-package.json.template +7 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/enums/index.ts.template +1 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/enums/route-names.ts.template +3 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/providers/index.ts.template +1 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/providers/route.provider.ts.template +30 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/config/src/public-api.ts.template +2 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/karma.conf.js.template +44 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/ng-package.json.template +7 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/package.json.template +11 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/lib/__libraryName@kebab__.component.ts.template +11 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/lib/__libraryName@kebab__.routes.ts.template +9 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/lib/index.ts.template +1 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/public-api.ts.template +4 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/src/test.ts.template +26 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/tsconfig.lib.json.template +20 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/tsconfig.lib.prod.json.template +10 -0
- package/commands/create-lib/files-package-standalone/__libraryName@kebab__/tsconfig.spec.json.template +17 -0
- package/commands/create-lib/files-secondary-entrypoint-standalone/__libraryName@kebab__/ng-package.json.template +6 -0
- package/commands/create-lib/files-secondary-entrypoint-standalone/__libraryName@kebab__/src/lib/__target@kebab__-__libraryName@kebab__.ts.template +7 -0
- package/commands/create-lib/files-secondary-entrypoint-standalone/__libraryName@kebab__/src/lib/index.ts.template +1 -0
- package/commands/create-lib/files-secondary-entrypoint-standalone/__libraryName@kebab__/src/public-api.ts.template +1 -0
- package/commands/create-lib/index.d.ts +7 -3
- package/commands/create-lib/index.js +161 -58
- package/commands/create-lib/index.js.map +1 -1
- package/commands/create-lib/models/generate-lib-schema.d.ts +8 -1
- package/commands/create-lib/models/generate-lib-schema.js +6 -0
- package/commands/create-lib/models/generate-lib-schema.js.map +1 -1
- package/commands/create-lib/schema.json +13 -9
- package/package.json +1 -1
- package/utils/angular/add-declaration-to-ng-module.d.ts +2 -1
- package/utils/angular/add-declaration-to-ng-module.js +4 -4
- package/utils/angular/add-declaration-to-ng-module.js.map +1 -1
- package/utils/angular/ast-utils.d.ts +18 -8
- package/utils/angular/ast-utils.js +70 -41
- package/utils/angular/ast-utils.js.map +1 -1
- package/utils/angular/change.d.ts +1 -1
- package/utils/angular/change.js +4 -4
- package/utils/angular/change.js.map +1 -1
- package/utils/angular/dependencies.d.ts +1 -1
- package/utils/angular/dependencies.js +1 -1
- package/utils/angular/dependency.d.ts +1 -1
- package/utils/angular/dependency.js +2 -2
- package/utils/angular/dependency.js.map +1 -1
- package/utils/angular/eol.d.ts +8 -0
- package/utils/angular/eol.js +24 -0
- package/utils/angular/eol.js.map +1 -0
- package/utils/angular/find-module.d.ts +1 -1
- package/utils/angular/find-module.js +5 -5
- package/utils/angular/find-module.js.map +1 -1
- package/utils/angular/generate-from-files.d.ts +3 -1
- package/utils/angular/generate-from-files.js +15 -2
- package/utils/angular/generate-from-files.js.map +1 -1
- package/utils/angular/index.d.ts +1 -0
- package/utils/angular/index.js +1 -0
- package/utils/angular/index.js.map +1 -1
- package/utils/angular/json-file.d.ts +3 -2
- package/utils/angular/json-file.js +6 -3
- package/utils/angular/json-file.js.map +1 -1
- package/utils/angular/ng-ast-utils.d.ts +2 -2
- package/utils/angular/ng-ast-utils.js +19 -7
- package/utils/angular/ng-ast-utils.js.map +1 -1
- package/utils/angular/parse-name.d.ts +1 -1
- package/utils/angular/parse-name.js +1 -1
- package/utils/angular/paths.d.ts +1 -1
- package/utils/angular/paths.js +4 -7
- package/utils/angular/paths.js.map +1 -1
- package/utils/angular/project-targets.d.ts +3 -1
- package/utils/angular/project-targets.js +9 -2
- package/utils/angular/project-targets.js.map +1 -1
- package/utils/angular/standalone/app_component.d.ts +29 -0
- package/utils/angular/standalone/app_component.js +108 -0
- package/utils/angular/standalone/app_component.js.map +1 -0
- package/utils/angular/standalone/app_config.d.ts +23 -0
- package/utils/angular/standalone/app_config.js +90 -0
- package/utils/angular/standalone/app_config.js.map +1 -0
- package/utils/angular/standalone/code_block.d.ts +53 -0
- package/utils/angular/standalone/code_block.js +80 -0
- package/utils/angular/standalone/code_block.js.map +1 -0
- package/utils/angular/standalone/index.d.ts +9 -0
- package/utils/angular/standalone/index.js +14 -0
- package/utils/angular/standalone/index.js.map +1 -0
- package/utils/angular/standalone/rules.d.ts +45 -0
- package/utils/angular/standalone/rules.js +189 -0
- package/utils/angular/standalone/rules.js.map +1 -0
- package/utils/angular/standalone/util.d.ts +35 -0
- package/utils/angular/standalone/util.js +136 -0
- package/utils/angular/standalone/util.js.map +1 -0
- package/utils/angular/validation.d.ts +1 -1
- package/utils/angular/validation.js +2 -2
- package/utils/angular/validation.js.map +1 -1
- package/utils/angular/workspace-models.d.ts +12 -6
- package/utils/angular/workspace-models.js +11 -3
- package/utils/angular/workspace-models.js.map +1 -1
- package/utils/angular/workspace.d.ts +12 -1
- package/utils/angular/workspace.js +6 -6
- package/utils/angular/workspace.js.map +1 -1
- package/utils/ast.d.ts +1 -0
- package/utils/ast.js +6 -1
- package/utils/ast.js.map +1 -1
- package/utils/index.d.ts +2 -0
- package/utils/index.js +2 -0
- package/utils/index.js.map +1 -1
- package/utils/ng-module.d.ts +46 -0
- package/utils/ng-module.js +126 -0
- package/utils/ng-module.js.map +1 -0
- package/utils/standalone.d.ts +59 -0
- package/utils/standalone.js +146 -0
- package/utils/standalone.js.map +1 -0
- package/utils/workspace.js +1 -1
- package/utils/workspace.js.map +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
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.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.findProvidersLiteral = exports.isMergeAppConfigCall = exports.applyChangesToFile = exports.findBootstrapApplicationCall = exports.getSourceFile = exports.getMainFilePath = void 0;
|
|
11
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
|
+
const ts = require("typescript");
|
|
13
|
+
const change_1 = require("../change");
|
|
14
|
+
const project_targets_1 = require("../project-targets");
|
|
15
|
+
const workspace_1 = require("../workspace");
|
|
16
|
+
const workspace_models_1 = require("../workspace-models");
|
|
17
|
+
/**
|
|
18
|
+
* Finds the main file of a project.
|
|
19
|
+
* @param tree File tree for the project.
|
|
20
|
+
* @param projectName Name of the project in which to search.
|
|
21
|
+
*/
|
|
22
|
+
async function getMainFilePath(tree, projectName) {
|
|
23
|
+
const workspace = await (0, workspace_1.getWorkspace)(tree);
|
|
24
|
+
const project = workspace.projects.get(projectName);
|
|
25
|
+
const buildTarget = project?.targets.get('build');
|
|
26
|
+
if (!buildTarget) {
|
|
27
|
+
throw (0, project_targets_1.targetBuildNotFoundError)();
|
|
28
|
+
}
|
|
29
|
+
const options = buildTarget.options;
|
|
30
|
+
return buildTarget.builder === workspace_models_1.Builders.Application ||
|
|
31
|
+
buildTarget.builder === workspace_models_1.Builders.BuildApplication
|
|
32
|
+
? options.browser
|
|
33
|
+
: options.main;
|
|
34
|
+
}
|
|
35
|
+
exports.getMainFilePath = getMainFilePath;
|
|
36
|
+
/**
|
|
37
|
+
* Gets a TypeScript source file at a specific path.
|
|
38
|
+
* @param tree File tree of a project.
|
|
39
|
+
* @param path Path to the file.
|
|
40
|
+
*/
|
|
41
|
+
function getSourceFile(tree, path) {
|
|
42
|
+
const content = tree.readText(path);
|
|
43
|
+
const source = ts.createSourceFile(path, content, ts.ScriptTarget.Latest, true);
|
|
44
|
+
return source;
|
|
45
|
+
}
|
|
46
|
+
exports.getSourceFile = getSourceFile;
|
|
47
|
+
/** Finds the call to `bootstrapApplication` within a file. */
|
|
48
|
+
function findBootstrapApplicationCall(tree, mainFilePath) {
|
|
49
|
+
const sourceFile = getSourceFile(tree, mainFilePath);
|
|
50
|
+
const localName = findImportLocalName(sourceFile, 'bootstrapApplication', '@angular/platform-browser');
|
|
51
|
+
if (localName) {
|
|
52
|
+
let result = null;
|
|
53
|
+
sourceFile.forEachChild(function walk(node) {
|
|
54
|
+
if (ts.isCallExpression(node) &&
|
|
55
|
+
ts.isIdentifier(node.expression) &&
|
|
56
|
+
node.expression.text === localName) {
|
|
57
|
+
result = node;
|
|
58
|
+
}
|
|
59
|
+
if (!result) {
|
|
60
|
+
node.forEachChild(walk);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
if (result) {
|
|
64
|
+
return result;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
throw new schematics_1.SchematicsException(`Could not find bootstrapApplication call in ${mainFilePath}`);
|
|
68
|
+
}
|
|
69
|
+
exports.findBootstrapApplicationCall = findBootstrapApplicationCall;
|
|
70
|
+
/**
|
|
71
|
+
* Finds the local name of an imported symbol. Could be the symbol name itself or its alias.
|
|
72
|
+
* @param sourceFile File within which to search for the import.
|
|
73
|
+
* @param name Actual name of the import, not its local alias.
|
|
74
|
+
* @param moduleName Name of the module from which the symbol is imported.
|
|
75
|
+
*/
|
|
76
|
+
function findImportLocalName(sourceFile, name, moduleName) {
|
|
77
|
+
for (const node of sourceFile.statements) {
|
|
78
|
+
// Only look for top-level imports.
|
|
79
|
+
if (!ts.isImportDeclaration(node) ||
|
|
80
|
+
!ts.isStringLiteral(node.moduleSpecifier) ||
|
|
81
|
+
node.moduleSpecifier.text !== moduleName) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
// Filter out imports that don't have the right shape.
|
|
85
|
+
if (!node.importClause ||
|
|
86
|
+
!node.importClause.namedBindings ||
|
|
87
|
+
!ts.isNamedImports(node.importClause.namedBindings)) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
// Look through the elements of the declaration for the specific import.
|
|
91
|
+
for (const element of node.importClause.namedBindings.elements) {
|
|
92
|
+
if ((element.propertyName || element.name).text === name) {
|
|
93
|
+
// The local name is always in `name`.
|
|
94
|
+
return element.name.text;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Applies a set of changes to a file.
|
|
102
|
+
* @param tree File tree of the project.
|
|
103
|
+
* @param path Path to the file that is being changed.
|
|
104
|
+
* @param changes Changes that should be applied to the file.
|
|
105
|
+
*/
|
|
106
|
+
function applyChangesToFile(tree, path, changes) {
|
|
107
|
+
if (changes.length > 0) {
|
|
108
|
+
const recorder = tree.beginUpdate(path);
|
|
109
|
+
(0, change_1.applyToUpdateRecorder)(recorder, changes);
|
|
110
|
+
tree.commitUpdate(recorder);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.applyChangesToFile = applyChangesToFile;
|
|
114
|
+
/** Checks whether a node is a call to `mergeApplicationConfig`. */
|
|
115
|
+
function isMergeAppConfigCall(node) {
|
|
116
|
+
if (!ts.isCallExpression(node)) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
const localName = findImportLocalName(node.getSourceFile(), 'mergeApplicationConfig', '@angular/core');
|
|
120
|
+
return !!localName && ts.isIdentifier(node.expression) && node.expression.text === localName;
|
|
121
|
+
}
|
|
122
|
+
exports.isMergeAppConfigCall = isMergeAppConfigCall;
|
|
123
|
+
/** Finds the `providers` array literal within an application config. */
|
|
124
|
+
function findProvidersLiteral(config) {
|
|
125
|
+
for (const prop of config.properties) {
|
|
126
|
+
if (ts.isPropertyAssignment(prop) &&
|
|
127
|
+
ts.isIdentifier(prop.name) &&
|
|
128
|
+
prop.name.text === 'providers' &&
|
|
129
|
+
ts.isArrayLiteralExpression(prop.initializer)) {
|
|
130
|
+
return prop.initializer;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
exports.findProvidersLiteral = findProvidersLiteral;
|
|
136
|
+
//# sourceMappingURL=util.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../../../../packages/schematics/src/utils/angular/standalone/util.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2DAAuE;AACvE,iCAAiC;AACjC,sCAA0D;AAC1D,wDAA8D;AAC9D,4CAA4C;AAC5C,0DAA+C;AAE/C;;;;GAIG;AACI,KAAK,UAAU,eAAe,CAAC,IAAU,EAAE,WAAmB;IACnE,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,EAAC,IAAI,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACpD,MAAM,WAAW,GAAG,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAElD,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAA,0CAAwB,GAAE,CAAC;KAClC;IAED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AACH,CAAC;AAND,gDAMC;AAED,mEAAmE;AACnE,SAAgB,oBAAoB,CAAC,IAAa;IAChD,IAAI,CAAC,EAAE,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE;QAC9B,OAAO,KAAK,CAAC;KACd;IAED,MAAM,SAAS,GAAG,mBAAmB,CACnC,IAAI,CAAC,aAAa,EAAE,EACpB,wBAAwB,EACxB,eAAe,CAChB,CAAC;IAEF,OAAO,CAAC,CAAC,SAAS,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,KAAK,SAAS,CAAC;AAC/F,CAAC;AAZD,oDAYC;AAED,wEAAwE;AACxE,SAAgB,oBAAoB,CAClC,MAAkC;IAElC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,UAAU,EAAE;QACpC,IACE,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC;YAC7B,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;YAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,WAAW;YAC9B,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,EAC7C;YACA,OAAO,IAAI,CAAC,WAAW,CAAC;SACzB;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAfD,oDAeC"}
|
|
@@ -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 htmlSelectorRe: RegExp;
|
|
9
9
|
export declare function validateHtmlSelector(selector: string): void;
|
|
@@ -4,14 +4,14 @@
|
|
|
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.validateClassName = exports.validateHtmlSelector = exports.htmlSelectorRe = void 0;
|
|
11
11
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
12
12
|
// Must start with a letter, and must contain only alphanumeric characters or dashes.
|
|
13
13
|
// When adding a dash the segment after the dash must also start with a letter.
|
|
14
|
-
exports.htmlSelectorRe = /^[a-zA-Z][.0-9a-zA-Z]*(:?-[a-zA-Z][.0-9a-zA-Z]*)
|
|
14
|
+
exports.htmlSelectorRe = /^[a-zA-Z][.0-9a-zA-Z]*((:?-[0-9]+)*|(:?-[a-zA-Z][.0-9a-zA-Z]*(:?-[0-9]+)*)*)$/;
|
|
15
15
|
// See: https://github.com/tc39/proposal-regexp-unicode-property-escapes/blob/fe6d07fad74cd0192d154966baa1e95e7cda78a1/README.md#other-examples
|
|
16
16
|
const ecmaIdentifierNameRegExp = /^(?:[$_\p{ID_Start}])(?:[$_\u200C\u200D\p{ID_Continue}])*$/u;
|
|
17
17
|
function validateHtmlSelector(selector) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/validation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2DAAiE;AAEjE,qFAAqF;AACrF,+EAA+E;AAClE,QAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/validation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2DAAiE;AAEjE,qFAAqF;AACrF,+EAA+E;AAClE,QAAA,cAAc,GACzB,+EAA+E,CAAC;AAElF,+IAA+I;AAC/I,MAAM,wBAAwB,GAAG,6DAA6D,CAAC;AAE/F,SAAgB,oBAAoB,CAAC,QAAgB;IACnD,IAAI,QAAQ,IAAI,CAAC,sBAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAC9C,MAAM,IAAI,gCAAmB,CAAC,aAAa,QAAQ,eAAe,CAAC,CAAC;KACrE;AACH,CAAC;AAJD,oDAIC;AAED,SAAgB,iBAAiB,CAAC,SAAiB;IACjD,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QAC7C,MAAM,IAAI,gCAAmB,CAAC,eAAe,SAAS,eAAe,CAAC,CAAC;KACxE;AACH,CAAC;AAJD,8CAIC"}
|
|
@@ -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 enum ProjectType {
|
|
9
9
|
Application = "application",
|
|
@@ -16,16 +16,24 @@ export declare enum ProjectType {
|
|
|
16
16
|
* `angular.json` workspace file.
|
|
17
17
|
*/
|
|
18
18
|
export declare enum Builders {
|
|
19
|
+
Application = "@angular-devkit/build-angular:application",
|
|
19
20
|
AppShell = "@angular-devkit/build-angular:app-shell",
|
|
20
21
|
Server = "@angular-devkit/build-angular:server",
|
|
21
22
|
Browser = "@angular-devkit/build-angular:browser",
|
|
23
|
+
SsrDevServer = "@angular-devkit/build-angular:ssr-dev-server",
|
|
24
|
+
Prerender = "@angular-devkit/build-angular:prerender",
|
|
25
|
+
BrowserEsbuild = "@angular-devkit/build-angular:browser-esbuild",
|
|
22
26
|
Karma = "@angular-devkit/build-angular:karma",
|
|
27
|
+
BuildKarma = "@angular/build:karma",
|
|
23
28
|
TsLint = "@angular-devkit/build-angular:tslint",
|
|
24
|
-
DeprecatedNgPackagr = "@angular-devkit/build-ng-packagr:build",
|
|
25
29
|
NgPackagr = "@angular-devkit/build-angular:ng-packagr",
|
|
30
|
+
BuildNgPackagr = "@angular/build:ng-packagr",
|
|
26
31
|
DevServer = "@angular-devkit/build-angular:dev-server",
|
|
32
|
+
BuildDevServer = "@angular/build:dev-server",
|
|
27
33
|
ExtractI18n = "@angular-devkit/build-angular:extract-i18n",
|
|
28
|
-
|
|
34
|
+
BuildExtractI18n = "@angular/build:extract-i18n",
|
|
35
|
+
Protractor = "@angular-devkit/build-angular:private-protractor",
|
|
36
|
+
BuildApplication = "@angular/build:application"
|
|
29
37
|
}
|
|
30
38
|
export interface FileReplacements {
|
|
31
39
|
replace: string;
|
|
@@ -63,7 +71,7 @@ export interface BrowserBuilderOptions extends BrowserBuilderBaseOptions {
|
|
|
63
71
|
webWorkerTsConfig?: string;
|
|
64
72
|
}
|
|
65
73
|
export interface ServeBuilderOptions {
|
|
66
|
-
|
|
74
|
+
buildTarget: string;
|
|
67
75
|
}
|
|
68
76
|
export interface LibraryBuilderOptions {
|
|
69
77
|
tsConfig: string;
|
|
@@ -119,11 +127,9 @@ export declare type E2EBuilderTarget = BuilderTarget<Builders.Protractor, E2EOpt
|
|
|
119
127
|
interface WorkspaceCLISchema {
|
|
120
128
|
warnings?: Record<string, boolean>;
|
|
121
129
|
schematicCollections?: string[];
|
|
122
|
-
defaultCollection?: string;
|
|
123
130
|
}
|
|
124
131
|
export interface WorkspaceSchema {
|
|
125
132
|
version: 1;
|
|
126
|
-
defaultProject?: string;
|
|
127
133
|
cli?: WorkspaceCLISchema;
|
|
128
134
|
projects: {
|
|
129
135
|
[key: string]: WorkspaceProject<ProjectType.Application | ProjectType.Library>;
|
|
@@ -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.Builders = exports.ProjectType = void 0;
|
|
@@ -21,15 +21,23 @@ var ProjectType;
|
|
|
21
21
|
*/
|
|
22
22
|
var Builders;
|
|
23
23
|
(function (Builders) {
|
|
24
|
+
Builders["Application"] = "@angular-devkit/build-angular:application";
|
|
24
25
|
Builders["AppShell"] = "@angular-devkit/build-angular:app-shell";
|
|
25
26
|
Builders["Server"] = "@angular-devkit/build-angular:server";
|
|
26
27
|
Builders["Browser"] = "@angular-devkit/build-angular:browser";
|
|
28
|
+
Builders["SsrDevServer"] = "@angular-devkit/build-angular:ssr-dev-server";
|
|
29
|
+
Builders["Prerender"] = "@angular-devkit/build-angular:prerender";
|
|
30
|
+
Builders["BrowserEsbuild"] = "@angular-devkit/build-angular:browser-esbuild";
|
|
27
31
|
Builders["Karma"] = "@angular-devkit/build-angular:karma";
|
|
32
|
+
Builders["BuildKarma"] = "@angular/build:karma";
|
|
28
33
|
Builders["TsLint"] = "@angular-devkit/build-angular:tslint";
|
|
29
|
-
Builders["DeprecatedNgPackagr"] = "@angular-devkit/build-ng-packagr:build";
|
|
30
34
|
Builders["NgPackagr"] = "@angular-devkit/build-angular:ng-packagr";
|
|
35
|
+
Builders["BuildNgPackagr"] = "@angular/build:ng-packagr";
|
|
31
36
|
Builders["DevServer"] = "@angular-devkit/build-angular:dev-server";
|
|
37
|
+
Builders["BuildDevServer"] = "@angular/build:dev-server";
|
|
32
38
|
Builders["ExtractI18n"] = "@angular-devkit/build-angular:extract-i18n";
|
|
33
|
-
Builders["
|
|
39
|
+
Builders["BuildExtractI18n"] = "@angular/build:extract-i18n";
|
|
40
|
+
Builders["Protractor"] = "@angular-devkit/build-angular:private-protractor";
|
|
41
|
+
Builders["BuildApplication"] = "@angular/build:application";
|
|
34
42
|
})(Builders = exports.Builders || (exports.Builders = {}));
|
|
35
43
|
//# sourceMappingURL=workspace-models.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-models.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/workspace-models.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;AACrB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAED;;;;;GAKG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"workspace-models.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/workspace-models.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;AACrB,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB;AAED;;;;;GAKG;AACH,IAAY,QAmBX;AAnBD,WAAY,QAAQ;IAClB,qEAAyD,CAAA;IACzD,gEAAoD,CAAA;IACpD,2DAA+C,CAAA;IAC/C,6DAAiD,CAAA;IACjD,yEAA6D,CAAA;IAC7D,iEAAqD,CAAA;IACrD,4EAAgE,CAAA;IAChE,yDAA6C,CAAA;IAC7C,+CAAmC,CAAA;IACnC,2DAA+C,CAAA;IAC/C,kEAAsD,CAAA;IACtD,wDAA4C,CAAA;IAC5C,kEAAsD,CAAA;IACtD,wDAA4C,CAAA;IAC5C,sEAA0D,CAAA;IAC1D,4DAAgD,CAAA;IAChD,2EAA+D,CAAA;IAC/D,2DAA+C,CAAA;AACjD,CAAC,EAnBW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAmBnB"}
|
|
@@ -3,13 +3,24 @@
|
|
|
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 { Rule, Tree } from '@angular-devkit/schematics';
|
|
10
10
|
export declare type WorkspaceDefinition = workspaces.WorkspaceDefinition;
|
|
11
11
|
export declare type ProjectDefinition = workspaces.ProjectDefinition;
|
|
12
12
|
export declare type TargetDefinition = workspaces.TargetDefinition;
|
|
13
|
+
/**
|
|
14
|
+
* A {@link workspaces.WorkspaceHost} backed by a Schematics {@link Tree} instance.
|
|
15
|
+
*/
|
|
16
|
+
export declare class TreeWorkspaceHost implements workspaces.WorkspaceHost {
|
|
17
|
+
private readonly tree;
|
|
18
|
+
constructor(tree: Tree);
|
|
19
|
+
readFile(path: string): Promise<string>;
|
|
20
|
+
writeFile(path: string, data: string): Promise<void>;
|
|
21
|
+
isDirectory(path: string): Promise<boolean>;
|
|
22
|
+
isFile(path: string): Promise<boolean>;
|
|
23
|
+
}
|
|
13
24
|
/**
|
|
14
25
|
* Updates the workspace file (`angular.json`) found within the root of the schematic's tree.
|
|
15
26
|
* The workspace object model can be directly modified within the provided updater function
|
|
@@ -4,10 +4,10 @@
|
|
|
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
|
-
exports.allTargetOptions = exports.allWorkspaceTargets = exports.createDefaultPath = exports.buildDefaultPath = exports.writeWorkspace = exports.getWorkspace = exports.updateWorkspace = void 0;
|
|
10
|
+
exports.allTargetOptions = exports.allWorkspaceTargets = exports.createDefaultPath = exports.buildDefaultPath = exports.writeWorkspace = exports.getWorkspace = exports.updateWorkspace = exports.TreeWorkspaceHost = void 0;
|
|
11
11
|
const core_1 = require("@angular-devkit/core");
|
|
12
12
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
13
13
|
const workspace_models_1 = require("./workspace-models");
|
|
@@ -38,6 +38,7 @@ class TreeWorkspaceHost {
|
|
|
38
38
|
return this.tree.exists(path);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
exports.TreeWorkspaceHost = TreeWorkspaceHost;
|
|
41
42
|
/**
|
|
42
43
|
* Updates the workspace file (`angular.json`) found within the root of the schematic's tree.
|
|
43
44
|
* The workspace object model can be directly modified within the provided updater function
|
|
@@ -49,11 +50,10 @@ class TreeWorkspaceHost {
|
|
|
49
50
|
* workspace. A {@link WorkspaceDefinition} is provided as the first argument to the function.
|
|
50
51
|
*/
|
|
51
52
|
function updateWorkspace(updater) {
|
|
52
|
-
return async (
|
|
53
|
-
const
|
|
54
|
-
const { workspace } = await core_1.workspaces.readWorkspace(DEFAULT_WORKSPACE_PATH, host);
|
|
53
|
+
return async (host) => {
|
|
54
|
+
const workspace = await getWorkspace(host);
|
|
55
55
|
const result = await updater(workspace);
|
|
56
|
-
await core_1.workspaces.writeWorkspace(workspace, host);
|
|
56
|
+
await core_1.workspaces.writeWorkspace(workspace, new TreeWorkspaceHost(host));
|
|
57
57
|
return result || schematics_1.noop;
|
|
58
58
|
};
|
|
59
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/workspace.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,+CAAwD;AACxD,2DAA8D;AAC9D,yDAAiD;AAEjD,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAO/C;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../packages/schematics/src/utils/angular/workspace.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,+CAAwD;AACxD,2DAA8D;AAC9D,yDAAiD;AAEjD,MAAM,sBAAsB,GAAG,eAAe,CAAC;AAO/C;;GAEG;AACH,MAAa,iBAAiB;IAC5B,YAA6B,IAAU;QAAV,SAAI,GAAJ,IAAI,CAAM;IAAG,CAAC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C;AARD,8CAQC;AAED,QAAe,CAAC,CAAC,mBAAmB,CAClC,SAAyC;IAEzC,KAAK,MAAM,CAAC,WAAW,EAAE,OAAO,CAAC,IAAI,SAAS,CAAC,QAAQ,EAAE;QACvD,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,OAAO,CAAC,OAAO,EAAE;YAClD,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;SAClD;KACF;AACH,CAAC;AARD,kDAQC;AAED,QAAe,CAAC,CAAC,gBAAgB,CAC/B,MAAmC,EACnC,eAAe,GAAG,KAAK;IAEvB,IAAI,CAAC,eAAe,IAAI,MAAM,CAAC,OAAO,EAAE;QACtC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;KACnC;IAED,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;QAC1B,OAAO;KACR;IAED,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;QACnE,IAAI,OAAO,KAAK,SAAS,EAAE;YACzB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SACvB;KACF;AACH,CAAC;AAjBD,4CAiBC"}
|
package/utils/ast.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import * as ts from 'typescript';
|
|
|
2
2
|
export declare function findEnvironmentExpression(source: ts.SourceFile): ts.ObjectLiteralExpression | undefined;
|
|
3
3
|
export declare function getAssignedPropertyFromObjectliteral(expression: ts.ObjectLiteralExpression, variableSelector: string[]): string | undefined;
|
|
4
4
|
export declare function isBooleanStringOrNumberLiteral(node: ts.Node): node is ts.StringLiteral | ts.NumericLiteral | ts.BooleanLiteral;
|
|
5
|
+
export declare function removeEmptyElementsFromArrayLiteral(array: ts.ArrayLiteralExpression): ts.ArrayLiteralExpression;
|
package/utils/ast.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isBooleanStringOrNumberLiteral = exports.getAssignedPropertyFromObjectliteral = exports.findEnvironmentExpression = void 0;
|
|
3
|
+
exports.removeEmptyElementsFromArrayLiteral = exports.isBooleanStringOrNumberLiteral = exports.getAssignedPropertyFromObjectliteral = exports.findEnvironmentExpression = void 0;
|
|
4
4
|
const ts = require("typescript");
|
|
5
5
|
const ast_utils_1 = require("./angular/ast-utils");
|
|
6
6
|
function findEnvironmentExpression(source) {
|
|
@@ -21,4 +21,9 @@ function isBooleanStringOrNumberLiteral(node) {
|
|
|
21
21
|
node.kind === ts.SyntaxKind.FalseKeyword);
|
|
22
22
|
}
|
|
23
23
|
exports.isBooleanStringOrNumberLiteral = isBooleanStringOrNumberLiteral;
|
|
24
|
+
function removeEmptyElementsFromArrayLiteral(array) {
|
|
25
|
+
const cleaned = array.elements.filter(el => el.kind !== ts.SyntaxKind.OmittedExpression);
|
|
26
|
+
return ts.factory.updateArrayLiteralExpression(array, ts.factory.createNodeArray(cleaned));
|
|
27
|
+
}
|
|
28
|
+
exports.removeEmptyElementsFromArrayLiteral = removeEmptyElementsFromArrayLiteral;
|
|
24
29
|
//# sourceMappingURL=ast.js.map
|
package/utils/ast.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ast.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/ast.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,mDAAgD;AAEhD,SAAgB,yBAAyB,CAAC,MAAqB;IAC7D,MAAM,WAAW,GAAG,IAAA,qBAAS,EAAC,MAAM,EAAE,EAAE,CAAC,yBAAyB,CAAC,CAAC;IACpE,OAAO,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;AACzE,CAAC;AAHD,8DAG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GED
package/utils/index.js
CHANGED
|
@@ -34,4 +34,6 @@ __exportStar(require("./text"), exports);
|
|
|
34
34
|
__exportStar(require("./tree"), exports);
|
|
35
35
|
__exportStar(require("./type"), exports);
|
|
36
36
|
__exportStar(require("./workspace"), exports);
|
|
37
|
+
__exportStar(require("./standalone"), exports);
|
|
38
|
+
__exportStar(require("./ng-module"), exports);
|
|
37
39
|
//# sourceMappingURL=index.js.map
|
package/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,wCAAsB;AACtB,wCAAsB;AACtB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,wCAAsB;AACtB,wCAAsB;AACtB,2CAAyB;AACzB,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,4CAA0B;AAC1B,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB;AACvB,yCAAuB;AACvB,4CAA0B;AAC1B,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B;AAC5B,+CAA6B;AAC7B,8CAA4B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Tree, UpdateRecorder } from '@angular-devkit/schematics';
|
|
2
|
+
import * as ts from 'typescript';
|
|
3
|
+
import { Path } from '@angular-devkit/core';
|
|
4
|
+
/**
|
|
5
|
+
* Checks whether a specific import or provider exists in the specified metadata
|
|
6
|
+
* array (`imports`, `providers`, etc.) of the `NgModule` decorator in the AppModule.
|
|
7
|
+
*
|
|
8
|
+
* This function locates the AppModule file of the given Angular project,
|
|
9
|
+
* parses its AST, and inspects the specified metadata array to determine
|
|
10
|
+
* if it includes an element matching the provided string (e.g., `CommonModule`, `HttpClientModule`).
|
|
11
|
+
*
|
|
12
|
+
* @param host - The virtual file system tree used by Angular schematics.
|
|
13
|
+
* @param projectName - The name of the Angular project.
|
|
14
|
+
* @param metadataFn - The name (string) to match against the elements of the metadata array.
|
|
15
|
+
* @param metadataName - The metadata field to search in (e.g., 'imports', 'providers'). Defaults to 'imports'.
|
|
16
|
+
* @returns A promise that resolves to `true` if the metadata function is found, or `false` otherwise.
|
|
17
|
+
* @throws SchematicsException if the AppModule file or expected metadata is not found or malformed.
|
|
18
|
+
*/
|
|
19
|
+
export declare const hasImportInNgModule: (host: Tree, projectName: string, metadataFn: string, metadataName?: string) => Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Attempts to locate the path of the `AppRoutingModule` file that is imported
|
|
22
|
+
* within the root AppModule file of an Angular application.
|
|
23
|
+
*
|
|
24
|
+
* This function reads the AppModule file (resolved from the main file path),
|
|
25
|
+
* parses its AST, and searches for an import declaration that imports
|
|
26
|
+
* `AppRoutingModule`. Once found, it resolves the import path to a normalized
|
|
27
|
+
* file path relative to the workspace root.
|
|
28
|
+
*
|
|
29
|
+
* @param tree - The virtual file system tree used by Angular schematics.
|
|
30
|
+
* @param mainFilePath - The path to the main entry file of the Angular application (typically `main.ts`).
|
|
31
|
+
* @returns A normalized workspace-relative path to the AppRoutingModule file if found, or `null` otherwise.
|
|
32
|
+
* @throws If the route file path is resolved but the file does not exist in the tree.
|
|
33
|
+
*/
|
|
34
|
+
export declare function findAppRoutesModulePath(tree: Tree, mainFilePath: string): Promise<Path | null>;
|
|
35
|
+
/**
|
|
36
|
+
* Cleans up empty or invalid expressions (e.g., extra commas) from the `imports` and `providers`
|
|
37
|
+
* arrays in the NgModule decorator of an Angular module file.
|
|
38
|
+
*
|
|
39
|
+
* This function parses the source file's AST, locates the `NgModule` decorator, and processes
|
|
40
|
+
* the `imports` and `providers` metadata fields. If these fields contain array literals with
|
|
41
|
+
* empty slots (such as trailing or double commas), they are removed and the array is rewritten.
|
|
42
|
+
*
|
|
43
|
+
* @param source - The TypeScript source file containing the Angular module.
|
|
44
|
+
* @param recorder - The recorder used to apply changes to the source file.
|
|
45
|
+
*/
|
|
46
|
+
export declare function cleanEmptyExprFromModule(source: ts.SourceFile, recorder: UpdateRecorder): void;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cleanEmptyExprFromModule = exports.findAppRoutesModulePath = exports.hasImportInNgModule = void 0;
|
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
|
+
const util_1 = require("./angular/standalone/util");
|
|
6
|
+
const ts = require("typescript");
|
|
7
|
+
const angular_1 = require("./angular");
|
|
8
|
+
const index_1 = require("../commands/change-theme/index");
|
|
9
|
+
const core_1 = require("@angular-devkit/core");
|
|
10
|
+
const path = require("path");
|
|
11
|
+
const ast_1 = require("./ast");
|
|
12
|
+
/**
|
|
13
|
+
* Checks whether a specific import or provider exists in the specified metadata
|
|
14
|
+
* array (`imports`, `providers`, etc.) of the `NgModule` decorator in the AppModule.
|
|
15
|
+
*
|
|
16
|
+
* This function locates the AppModule file of the given Angular project,
|
|
17
|
+
* parses its AST, and inspects the specified metadata array to determine
|
|
18
|
+
* if it includes an element matching the provided string (e.g., `CommonModule`, `HttpClientModule`).
|
|
19
|
+
*
|
|
20
|
+
* @param host - The virtual file system tree used by Angular schematics.
|
|
21
|
+
* @param projectName - The name of the Angular project.
|
|
22
|
+
* @param metadataFn - The name (string) to match against the elements of the metadata array.
|
|
23
|
+
* @param metadataName - The metadata field to search in (e.g., 'imports', 'providers'). Defaults to 'imports'.
|
|
24
|
+
* @returns A promise that resolves to `true` if the metadata function is found, or `false` otherwise.
|
|
25
|
+
* @throws SchematicsException if the AppModule file or expected metadata is not found or malformed.
|
|
26
|
+
*/
|
|
27
|
+
const hasImportInNgModule = async (host, projectName, metadataFn, metadataName = 'imports') => {
|
|
28
|
+
const mainFilePath = await (0, util_1.getMainFilePath)(host, projectName);
|
|
29
|
+
const appModulePath = (0, angular_1.getAppModulePath)(host, mainFilePath);
|
|
30
|
+
const buffer = host.read(appModulePath);
|
|
31
|
+
if (!buffer) {
|
|
32
|
+
throw new schematics_1.SchematicsException(`Could not read file: ${appModulePath}`);
|
|
33
|
+
}
|
|
34
|
+
const source = (0, index_1.createSourceFile)(host, appModulePath);
|
|
35
|
+
// Get the NgModule decorator metadata
|
|
36
|
+
const ngModuleDecorator = (0, angular_1.getDecoratorMetadata)(source, 'NgModule', '@angular/core')[0];
|
|
37
|
+
if (!ngModuleDecorator) {
|
|
38
|
+
throw new schematics_1.SchematicsException('The app module does not found');
|
|
39
|
+
}
|
|
40
|
+
const matchingProperties = (0, angular_1.getMetadataField)(ngModuleDecorator, metadataName);
|
|
41
|
+
const assignment = matchingProperties[0];
|
|
42
|
+
const assignmentInit = assignment.initializer;
|
|
43
|
+
const elements = assignmentInit.elements;
|
|
44
|
+
if (!elements || elements.length < 1) {
|
|
45
|
+
throw new schematics_1.SchematicsException(`Elements could not found: ${elements}`);
|
|
46
|
+
}
|
|
47
|
+
return elements.some(f => f.getText().match(metadataFn));
|
|
48
|
+
};
|
|
49
|
+
exports.hasImportInNgModule = hasImportInNgModule;
|
|
50
|
+
/**
|
|
51
|
+
* Attempts to locate the path of the `AppRoutingModule` file that is imported
|
|
52
|
+
* within the root AppModule file of an Angular application.
|
|
53
|
+
*
|
|
54
|
+
* This function reads the AppModule file (resolved from the main file path),
|
|
55
|
+
* parses its AST, and searches for an import declaration that imports
|
|
56
|
+
* `AppRoutingModule`. Once found, it resolves the import path to a normalized
|
|
57
|
+
* file path relative to the workspace root.
|
|
58
|
+
*
|
|
59
|
+
* @param tree - The virtual file system tree used by Angular schematics.
|
|
60
|
+
* @param mainFilePath - The path to the main entry file of the Angular application (typically `main.ts`).
|
|
61
|
+
* @returns A normalized workspace-relative path to the AppRoutingModule file if found, or `null` otherwise.
|
|
62
|
+
* @throws If the route file path is resolved but the file does not exist in the tree.
|
|
63
|
+
*/
|
|
64
|
+
async function findAppRoutesModulePath(tree, mainFilePath) {
|
|
65
|
+
const appModulePath = (0, angular_1.getAppModulePath)(tree, mainFilePath);
|
|
66
|
+
if (!appModulePath || !tree.exists(appModulePath))
|
|
67
|
+
return null;
|
|
68
|
+
const buffer = tree.read(appModulePath);
|
|
69
|
+
if (!buffer)
|
|
70
|
+
return null;
|
|
71
|
+
const source = ts.createSourceFile(appModulePath, buffer.toString('utf-8'), ts.ScriptTarget.Latest, true);
|
|
72
|
+
for (const stmt of source.statements) {
|
|
73
|
+
if (!ts.isImportDeclaration(stmt))
|
|
74
|
+
continue;
|
|
75
|
+
const importClause = stmt.importClause;
|
|
76
|
+
if (!importClause?.namedBindings || !ts.isNamedImports(importClause.namedBindings))
|
|
77
|
+
continue;
|
|
78
|
+
const isRoutesImport = importClause.namedBindings.elements.some(el => el.name.getText() === 'AppRoutingModule');
|
|
79
|
+
if (!isRoutesImport || !ts.isStringLiteral(stmt.moduleSpecifier))
|
|
80
|
+
continue;
|
|
81
|
+
let importPath = stmt.moduleSpecifier.text;
|
|
82
|
+
if (!importPath.endsWith('.ts')) {
|
|
83
|
+
importPath += '.ts';
|
|
84
|
+
}
|
|
85
|
+
const configDir = path.dirname(appModulePath);
|
|
86
|
+
const resolvedFsPath = path.resolve(configDir, importPath);
|
|
87
|
+
const workspaceRelativePath = path.relative(process.cwd(), resolvedFsPath).replace(/\\/g, '/');
|
|
88
|
+
const normalizedPath = (0, core_1.normalize)(workspaceRelativePath);
|
|
89
|
+
if (!tree.exists(normalizedPath)) {
|
|
90
|
+
throw new Error(`Cannot find routes file: ${normalizedPath}`);
|
|
91
|
+
}
|
|
92
|
+
return normalizedPath;
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
exports.findAppRoutesModulePath = findAppRoutesModulePath;
|
|
97
|
+
/**
|
|
98
|
+
* Cleans up empty or invalid expressions (e.g., extra commas) from the `imports` and `providers`
|
|
99
|
+
* arrays in the NgModule decorator of an Angular module file.
|
|
100
|
+
*
|
|
101
|
+
* This function parses the source file's AST, locates the `NgModule` decorator, and processes
|
|
102
|
+
* the `imports` and `providers` metadata fields. If these fields contain array literals with
|
|
103
|
+
* empty slots (such as trailing or double commas), they are removed and the array is rewritten.
|
|
104
|
+
*
|
|
105
|
+
* @param source - The TypeScript source file containing the Angular module.
|
|
106
|
+
* @param recorder - The recorder used to apply changes to the source file.
|
|
107
|
+
*/
|
|
108
|
+
function cleanEmptyExprFromModule(source, recorder) {
|
|
109
|
+
const ngModuleNode = (0, angular_1.getDecoratorMetadata)(source, 'NgModule', '@angular/core')[0];
|
|
110
|
+
if (!ngModuleNode)
|
|
111
|
+
return;
|
|
112
|
+
const printer = ts.createPrinter();
|
|
113
|
+
const metadataKeys = ['imports', 'providers'];
|
|
114
|
+
for (const key of metadataKeys) {
|
|
115
|
+
const metadataField = (0, angular_1.getMetadataField)(ngModuleNode, key);
|
|
116
|
+
if (!metadataField.length)
|
|
117
|
+
continue;
|
|
118
|
+
const assignment = metadataField[0];
|
|
119
|
+
const arrayLiteral = assignment.initializer;
|
|
120
|
+
const cleanedArray = (0, ast_1.removeEmptyElementsFromArrayLiteral)(arrayLiteral);
|
|
121
|
+
recorder.remove(arrayLiteral.getStart(), arrayLiteral.getWidth());
|
|
122
|
+
recorder.insertLeft(arrayLiteral.getStart(), printer.printNode(ts.EmitHint.Expression, cleanedArray, source));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
exports.cleanEmptyExprFromModule = cleanEmptyExprFromModule;
|
|
126
|
+
//# sourceMappingURL=ng-module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-module.js","sourceRoot":"","sources":["../../../../packages/schematics/src/utils/ng-module.ts"],"names":[],"mappings":";;;AAAA,2DAAuF;AACvF,oDAA4D;AAC5D,iCAAiC;AACjC,uCAAqF;AACrF,0DAAkE;AAClE,+CAAuD;AACvD,6BAA6B;AAC7B,+BAA4D;AAE5D;;;;;;;;;;;;;;GAcG;AACI,MAAM,mBAAmB,GAAG,KAAK,EACtC,IAAU,EACV,WAAmB,EACnB,UAAkB,EAClB,YAAY,GAAG,SAAS,EACN,EAAE;IACpB,MAAM,YAAY,GAAG,MAAM,IAAA,sBAAe,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAC9D,MAAM,aAAa,GAAG,IAAA,0BAAgB,EAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAExC,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,gCAAmB,CAAC,wBAAwB,aAAa,EAAE,CAAC,CAAC;KACxE;IAED,MAAM,MAAM,GAAG,IAAA,wBAAgB,EAAC,IAAI,EAAE,aAAa,CAAC,CAAC;IAErD,sCAAsC;IACtC,MAAM,iBAAiB,GAAG,IAAA,8BAAoB,EAAC,MAAM,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAEvF,IAAI,CAAC,iBAAiB,EAAE;QACtB,MAAM,IAAI,gCAAmB,CAAC,+BAA+B,CAAC,CAAC;KAChE;IAED,MAAM,kBAAkB,GAAG,IAAA,0BAAgB,EACzC,iBAA+C,EAC/C,YAAY,CACb,CAAC;IACF,MAAM,UAAU,GAAG,kBAAkB,CAAC,CAAC,CAA0B,CAAC;IAClE,MAAM,cAAc,GAAG,UAAU,CAAC,WAAwC,CAAC;IAE3E,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