@o3r/schematics 11.6.0-prerelease.7 → 11.6.0-prerelease.9
Sign up to get free protection for your applications and to get access to all the features.
- package/cli/environment.js +1 -0
- package/package.json +19 -14
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +6 -6
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/src/interfaces/angular-workspace.d.ts.map +1 -1
- package/src/interfaces/index.d.ts +1 -1
- package/src/interfaces/index.d.ts.map +1 -1
- package/src/interfaces/index.js +1 -1
- package/src/interfaces/index.js.map +1 -1
- package/src/interfaces/rule-factories.d.ts.map +1 -1
- package/src/interfaces/schematic-option.d.ts.map +1 -1
- package/src/modules/index.d.ts +1 -1
- package/src/modules/index.d.ts.map +1 -1
- package/src/modules/index.js +1 -1
- package/src/modules/index.js.map +1 -1
- package/src/modules/modules.constants.d.ts.map +1 -1
- package/src/modules/modules.constants.js.map +1 -1
- package/src/modules/modules.display.rule.d.ts.map +1 -1
- package/src/modules/modules.display.rule.js +1 -2
- package/src/modules/modules.display.rule.js.map +1 -1
- package/src/modules/modules.helpers.d.ts +1 -1
- package/src/modules/modules.helpers.d.ts.map +1 -1
- package/src/modules/modules.helpers.js +5 -6
- package/src/modules/modules.helpers.js.map +1 -1
- package/src/public_api.d.ts +1 -1
- package/src/public_api.d.ts.map +1 -1
- package/src/public_api.js +1 -1
- package/src/public_api.js.map +1 -1
- package/src/rule-factories/add-imports/index.d.ts.map +1 -1
- package/src/rule-factories/add-imports/index.js +9 -5
- package/src/rule-factories/add-imports/index.js.map +1 -1
- package/src/rule-factories/check-packages-peers/index.d.ts.map +1 -1
- package/src/rule-factories/check-packages-peers/index.js +13 -12
- package/src/rule-factories/check-packages-peers/index.js.map +1 -1
- package/src/rule-factories/dev-tools/devtools-registration.d.ts +0 -2
- package/src/rule-factories/dev-tools/devtools-registration.d.ts.map +1 -1
- package/src/rule-factories/dev-tools/devtools-registration.js +34 -19
- package/src/rule-factories/dev-tools/devtools-registration.js.map +1 -1
- package/src/rule-factories/eslint-fix/index.d.ts +1 -2
- package/src/rule-factories/eslint-fix/index.d.ts.map +1 -1
- package/src/rule-factories/eslint-fix/index.js +17 -18
- package/src/rule-factories/eslint-fix/index.js.map +1 -1
- package/src/rule-factories/get-test-frameworks/index.d.ts.map +1 -1
- package/src/rule-factories/get-test-frameworks/index.js +2 -2
- package/src/rule-factories/get-test-frameworks/index.js.map +1 -1
- package/src/rule-factories/index.d.ts +2 -3
- package/src/rule-factories/index.d.ts.map +1 -1
- package/src/rule-factories/index.js +2 -3
- package/src/rule-factories/index.js.map +1 -1
- package/src/rule-factories/ng-add/dependencies.d.ts +1 -1
- package/src/rule-factories/ng-add/dependencies.d.ts.map +1 -1
- package/src/rule-factories/ng-add/dependencies.js +19 -16
- package/src/rule-factories/ng-add/dependencies.js.map +1 -1
- package/src/rule-factories/ng-add/index.d.ts +1 -1
- package/src/rule-factories/ng-add/index.d.ts.map +1 -1
- package/src/rule-factories/ng-add/index.js +1 -1
- package/src/rule-factories/ng-add/index.js.map +1 -1
- package/src/rule-factories/ng-add/ng-add.helpers.d.ts.map +1 -1
- package/src/rule-factories/ng-add/ng-add.helpers.js +21 -21
- package/src/rule-factories/ng-add/ng-add.helpers.js.map +1 -1
- package/src/rule-factories/ng-add/schematics-register.d.ts.map +1 -1
- package/src/rule-factories/ng-add/schematics-register.js +36 -28
- package/src/rule-factories/ng-add/schematics-register.js.map +1 -1
- package/src/rule-factories/remove-packages/index.d.ts.map +1 -1
- package/src/rule-factories/remove-packages/index.js +9 -9
- package/src/rule-factories/remove-packages/index.js.map +1 -1
- package/src/rule-factories/update-imports/list-of-vars.js.map +1 -1
- package/src/rule-factories/update-imports/update-imports-with-scope.d.ts.map +1 -1
- package/src/rule-factories/update-imports/update-imports-with-scope.js +3 -2
- package/src/rule-factories/update-imports/update-imports-with-scope.js.map +1 -1
- package/src/rule-factories/update-imports/update-ts-imports.d.ts.map +1 -1
- package/src/rule-factories/update-imports/update-ts-imports.js +3 -3
- package/src/rule-factories/update-imports/update-ts-imports.js.map +1 -1
- package/src/rule-factories/vscode-extensions/index.d.ts.map +1 -1
- package/src/rule-factories/vscode-extensions/index.js +5 -5
- package/src/rule-factories/vscode-extensions/index.js.map +1 -1
- package/src/tasks/eslint/index.d.ts +1 -1
- package/src/tasks/eslint/index.d.ts.map +1 -1
- package/src/tasks/eslint/index.js +2 -2
- package/src/tasks/eslint/index.js.map +1 -1
- package/src/tasks/link/index.d.ts.map +1 -1
- package/src/tasks/link/index.js.map +1 -1
- package/src/tasks/ng-add/index.d.ts.map +1 -1
- package/src/tasks/package-manager/interfaces.d.ts.map +1 -1
- package/src/tasks/package-manager/npm-exec.d.ts.map +1 -1
- package/src/tasks/package-manager/npm-exec.js.map +1 -1
- package/src/tasks/package-manager/npm-install.d.ts.map +1 -1
- package/src/tasks/package-manager/npm-install.js +1 -1
- package/src/tasks/package-manager/npm-install.js.map +1 -1
- package/src/tasks/package-manager/npm-run.d.ts.map +1 -1
- package/src/tasks/package-manager/npm-run.js.map +1 -1
- package/src/utility/ast.d.ts.map +1 -1
- package/src/utility/ast.js +12 -15
- package/src/utility/ast.js.map +1 -1
- package/src/utility/builder.d.ts.map +1 -1
- package/src/utility/builder.js.map +1 -1
- package/src/utility/collection.d.ts.map +1 -1
- package/src/utility/collection.js +2 -3
- package/src/utility/collection.js.map +1 -1
- package/src/utility/component.d.ts.map +1 -1
- package/src/utility/component.js +2 -2
- package/src/utility/component.js.map +1 -1
- package/src/utility/dependencies.d.ts +1 -1
- package/src/utility/dependencies.d.ts.map +1 -1
- package/src/utility/dependencies.js +4 -5
- package/src/utility/dependencies.js.map +1 -1
- package/src/utility/environment.d.ts.map +1 -1
- package/src/utility/environment.js.map +1 -1
- package/src/utility/error.d.ts.map +1 -1
- package/src/utility/error.js.map +1 -1
- package/src/utility/file-info.d.ts +1 -1
- package/src/utility/file-info.d.ts.map +1 -1
- package/src/utility/file-info.js +1 -1
- package/src/utility/file-info.js.map +1 -1
- package/src/utility/generation.d.ts.map +1 -1
- package/src/utility/generation.js +2 -15
- package/src/utility/generation.js.map +1 -1
- package/src/utility/gitignore.d.ts.map +1 -1
- package/src/utility/gitignore.js +2 -2
- package/src/utility/gitignore.js.map +1 -1
- package/src/utility/index.d.ts +2 -2
- package/src/utility/index.d.ts.map +1 -1
- package/src/utility/index.js +2 -2
- package/src/utility/index.js.map +1 -1
- package/src/utility/loaders.d.ts +1 -1
- package/src/utility/loaders.d.ts.map +1 -1
- package/src/utility/loaders.js +6 -6
- package/src/utility/loaders.js.map +1 -1
- package/src/utility/logo.d.ts.map +1 -1
- package/src/utility/logo.js.map +1 -1
- package/src/utility/matching-peers.d.ts.map +1 -1
- package/src/utility/matching-peers.js +3 -3
- package/src/utility/matching-peers.js.map +1 -1
- package/src/utility/migration/migration.d.ts.map +1 -1
- package/src/utility/migration/migration.js +3 -3
- package/src/utility/migration/migration.js.map +1 -1
- package/src/utility/modules.d.ts +1 -1
- package/src/utility/modules.d.ts.map +1 -1
- package/src/utility/modules.js +16 -16
- package/src/utility/modules.js.map +1 -1
- package/src/utility/monorepo.d.ts +0 -1
- package/src/utility/monorepo.d.ts.map +1 -1
- package/src/utility/monorepo.js +0 -2
- package/src/utility/monorepo.js.map +1 -1
- package/src/utility/package-manager-runner.d.ts +2 -3
- package/src/utility/package-manager-runner.d.ts.map +1 -1
- package/src/utility/package-manager-runner.js +1 -4
- package/src/utility/package-manager-runner.js.map +1 -1
- package/src/utility/package-version.d.ts +0 -1
- package/src/utility/package-version.d.ts.map +1 -1
- package/src/utility/package-version.js +3 -4
- package/src/utility/package-version.js.map +1 -1
- package/src/utility/question.d.ts.map +1 -1
- package/src/utility/question.js.map +1 -1
- package/src/utility/routes.d.ts.map +1 -1
- package/src/utility/routes.js +6 -6
- package/src/utility/routes.js.map +1 -1
- package/src/utility/sub-entry.d.ts.map +1 -1
- package/src/utility/sub-entry.js.map +1 -1
- package/src/utility/template-property.helper.d.ts.map +1 -1
- package/src/utility/template-property.helper.js +2 -2
- package/src/utility/template-property.helper.js.map +1 -1
- package/src/utility/update-imports.d.ts +1 -1
- package/src/utility/update-imports.d.ts.map +1 -1
- package/src/utility/update-imports.js +10 -14
- package/src/utility/update-imports.js.map +1 -1
- package/src/utility/update-pipes.d.ts.map +1 -1
- package/src/utility/update-pipes.js +5 -5
- package/src/utility/update-pipes.js.map +1 -1
- package/src/utility/wrapper.d.ts.map +1 -1
- package/src/utility/wrapper.js +12 -11
- package/src/utility/wrapper.js.map +1 -1
package/src/utility/modules.js
CHANGED
@@ -7,13 +7,13 @@ exports.addImportToModuleFile = addImportToModuleFile;
|
|
7
7
|
exports.insertImportToModuleFile = insertImportToModuleFile;
|
8
8
|
exports.addProviderToModuleFile = addProviderToModuleFile;
|
9
9
|
exports.insertBeforeModule = insertBeforeModule;
|
10
|
+
const fs = require("node:fs");
|
11
|
+
const path = require("node:path");
|
10
12
|
const schematics_1 = require("@angular-devkit/schematics");
|
11
|
-
const ts = require("typescript");
|
12
13
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
13
14
|
const change_1 = require("@schematics/angular/utility/change");
|
14
|
-
const fs = require("node:fs");
|
15
15
|
const globby_1 = require("globby");
|
16
|
-
const
|
16
|
+
const ts = require("typescript");
|
17
17
|
const ast_1 = require("./ast");
|
18
18
|
const loaders_1 = require("./loaders");
|
19
19
|
/**
|
@@ -32,7 +32,7 @@ function getAppModuleFilePath(tree, context, projectName) {
|
|
32
32
|
}
|
33
33
|
const mainFilePath = workspaceProject.architect.build.options.main ?? workspaceProject.architect.build.options.browser;
|
34
34
|
const mainFile = tree.read(mainFilePath).toString();
|
35
|
-
const bootstrapModuleRegexpResult = mainFile.match(/(?:bootstrapModule|bootstrapApplication)\((?:[
|
35
|
+
const bootstrapModuleRegexpResult = mainFile.match(/(?:bootstrapModule|bootstrapApplication)\((?:[^),]*,)*\s*([^ ),]*)\s*\)/m);
|
36
36
|
if (!bootstrapModuleRegexpResult || !bootstrapModuleRegexpResult[1]) {
|
37
37
|
throw new schematics_1.SchematicsException('Could not find bootstrap module or appConfig');
|
38
38
|
}
|
@@ -44,26 +44,26 @@ function getAppModuleFilePath(tree, context, projectName) {
|
|
44
44
|
}
|
45
45
|
/** Path to the main module file */
|
46
46
|
const moduleFilePath = path.join(path.dirname(mainFilePath), bootstrapModuleFileRegExpResult[1] + '.ts');
|
47
|
-
const exportAppModuleClassRegExp = new RegExp(`(?:class|const)\\s+${bootstrapModule}`, '
|
48
|
-
if (tree.exists(moduleFilePath) && tree.read(moduleFilePath).toString()
|
47
|
+
const exportAppModuleClassRegExp = new RegExp(`(?:class|const)\\s+${bootstrapModule}`, 'm');
|
48
|
+
if (tree.exists(moduleFilePath) && exportAppModuleClassRegExp.test(tree.read(moduleFilePath).toString())) {
|
49
49
|
return moduleFilePath;
|
50
50
|
}
|
51
51
|
const possibleAppModule = path.join(path.dirname(mainFilePath), path.dirname(bootstrapModuleFileRegExpResult[1]), 'app.module.ts');
|
52
|
-
if (tree.exists(possibleAppModule) && tree.read(possibleAppModule).toString()
|
52
|
+
if (tree.exists(possibleAppModule) && exportAppModuleClassRegExp.test(tree.read(possibleAppModule).toString())) {
|
53
53
|
return possibleAppModule;
|
54
54
|
}
|
55
55
|
// search app module source file in tree
|
56
56
|
const normalizedFilePath = moduleFilePath.split(path.sep).join(path.posix.sep);
|
57
57
|
const prog = ts.createProgram([normalizedFilePath], {});
|
58
58
|
const symbols = (0, ast_1.getExportedSymbolsFromFile)(prog, normalizedFilePath);
|
59
|
-
const bootstrapModuleSymbol = symbols.find(s => s.name === bootstrapModule);
|
59
|
+
const bootstrapModuleSymbol = symbols.find((s) => s.name === bootstrapModule);
|
60
60
|
const checker = prog.getTypeChecker();
|
61
61
|
if (bootstrapModuleSymbol) {
|
62
62
|
const pathPlusModuleString = checker.getFullyQualifiedName(bootstrapModuleSymbol);
|
63
|
-
const filePath = pathPlusModuleString?.replace(new RegExp(`.${bootstrapModule}`), '').replace(/['
|
63
|
+
const filePath = pathPlusModuleString?.replace(new RegExp(`.${bootstrapModule}`), '').replace(/["']/g, '');
|
64
64
|
const relativeFilePath = filePath ? path.relative(path.dirname(mainFilePath), `${filePath}.ts`) : undefined;
|
65
65
|
const filePathInTree = relativeFilePath ? path.join(path.dirname(mainFilePath), relativeFilePath) : undefined;
|
66
|
-
if (filePathInTree && tree.exists(filePathInTree) && tree.read(filePathInTree).toString()
|
66
|
+
if (filePathInTree && tree.exists(filePathInTree) && exportAppModuleClassRegExp.test(tree.read(filePathInTree).toString())) {
|
67
67
|
return filePathInTree;
|
68
68
|
}
|
69
69
|
}
|
@@ -94,10 +94,10 @@ function getMainFilePath(tree, context, projectName) {
|
|
94
94
|
*/
|
95
95
|
function isApplicationThatUsesRouterModule(tree, options) {
|
96
96
|
const workspaceProject = options.projectName ? (0, loaders_1.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
97
|
-
const cwd = process.cwd().replace(/[
|
98
|
-
const root = (workspaceProject?.root && cwd.endsWith(workspaceProject.root)) ? workspaceProject.root.replace(/[
|
99
|
-
return workspaceProject?.sourceRoot
|
100
|
-
(0, globby_1.sync)(path.posix.join(root, workspaceProject.sourceRoot, '**', '*.ts')).some((filePath) => {
|
97
|
+
const cwd = process.cwd().replace(/[/\\]+/g, '/');
|
98
|
+
const root = (workspaceProject?.root && cwd.endsWith(workspaceProject.root)) ? workspaceProject.root.replace(/[^/\\]+/g, '..') : '.';
|
99
|
+
return workspaceProject?.sourceRoot
|
100
|
+
&& (0, globby_1.sync)(path.posix.join(root, workspaceProject.sourceRoot, '**', '*.ts')).some((filePath) => {
|
101
101
|
const fileContent = fs.readFileSync(filePath).toString();
|
102
102
|
if (!/RouterModule/.test(fileContent)) {
|
103
103
|
return false;
|
@@ -117,9 +117,9 @@ function isApplicationThatUsesRouterModule(tree, options) {
|
|
117
117
|
* @param sourceFile
|
118
118
|
* @param sourceFileContent
|
119
119
|
* @param context
|
120
|
+
* @param recorder
|
120
121
|
* @param moduleFilePath
|
121
122
|
* @param moduleIndex
|
122
|
-
* @param recorder
|
123
123
|
* @param moduleFunction
|
124
124
|
* @param override
|
125
125
|
*/
|
@@ -196,7 +196,7 @@ function addProviderToModuleFile(name, file, sourceFile, sourceFileContent, cont
|
|
196
196
|
* @param moduleIndex
|
197
197
|
*/
|
198
198
|
function insertBeforeModule(line, file, recorder, moduleIndex) {
|
199
|
-
if (file.
|
199
|
+
if (!file.includes(line.replace(/\s*/g, ''))) {
|
200
200
|
return recorder.insertLeft(moduleIndex - 1, `${line}\n\n`);
|
201
201
|
}
|
202
202
|
return recorder;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../../src/utility/modules.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"modules.js","sourceRoot":"","sources":["../../../src/utility/modules.ts"],"names":[],"mappings":";;AAoCA,oDAyDC;AAQD,0CAUC;AASD,8EAgBC;AAeD,sDA+BC;AAWD,4DAMC;AAcD,0DAaC;AASD,gDAKC;AAhPD,8BAA8B;AAC9B,kCAAkC;AAClC,2DAKoC;AACpC,qEAM+C;AAC/C,+DAE4C;AAC5C,mCAEgB;AAChB,iCAAiC;AACjC,+BAEe;AACf,uCAEmB;AAEnB;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,IAAU,EAAE,OAAyB,EAAE,WAA2B;IACrG,MAAM,gBAAgB,GAAG,WAAW,CAAC,CAAC,CAAC,IAAA,4BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnG,6BAA6B;IAC7B,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,CAAC,WAAW,KAAK,aAAa,EAAE,CAAC;QACxE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,6EAA6E,CAAC,CAAC;QACpG,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,YAAY,GAAW,gBAAgB,CAAC,SAAU,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,IAAI,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C,CAAC,MAAM,EAAE,EAAE;QAClB,IAAI,MAAM,YAAY,qBAAY,EAAE,CAAC;YACnC,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,cAAc,IAAI,MAAM,CAAC,GAAG,GAAG,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACrJ,CAAC;IACH,CAAC,CAAC,CAAC;IACL,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kBAAkB,CAAC,IAAY,EAAE,IAAY,EAAE,QAAwB,EAAE,WAAmB;IAC1G,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;QAC7C,OAAO,QAAQ,CAAC,UAAU,CAAC,WAAW,GAAG,CAAC,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC;IAC7D,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
@@ -5,7 +5,6 @@ import type { WorkspaceLayout, WorkspaceProject, WorkspaceSchema } from '../inte
|
|
5
5
|
* @param tree
|
6
6
|
* @param files List of files to look for, the first of the list will be used
|
7
7
|
* @param originPath Path from where to calculate the relative path
|
8
|
-
* @returns
|
9
8
|
*/
|
10
9
|
export declare function findConfigFileRelativePath(tree: Tree, files: string[], originPath: string): string;
|
11
10
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"monorepo.d.ts","sourceRoot":"","sources":["../../../src/utility/monorepo.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"monorepo.d.ts","sourceRoot":"","sources":["../../../src/utility/monorepo.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,gBAAgB,EAChB,IAAI,EACL,MAAM,4BAA4B,CAAC;AAIpC,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAQ7B;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,UAAU,EAAE,MAAM,UAOzF;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,WAErC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,kBAGhD;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,IAAI,WAEhD;AAED,mFAAmF;AACnF,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAC5C,sFAAsF;AACtF,eAAO,MAAM,wBAAwB,SAAS,CAAC;AAE/C,oEAAoE;AACpE,eAAO,MAAM,oBAAoB,EAAE,eAGlC,CAAC;AAEF,uDAAuD;AACvD,eAAO,MAAM,qBAAqB,EAAE,MAAM,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,MAAM,eAAe,CAGhG,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,eAAe,EAAE,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,OAOtJ"}
|
package/src/utility/monorepo.js
CHANGED
@@ -14,7 +14,6 @@ const loaders_1 = require("./loaders");
|
|
14
14
|
* @param tree
|
15
15
|
* @param files List of files to look for, the first of the list will be used
|
16
16
|
* @param originPath Path from where to calculate the relative path
|
17
|
-
* @returns
|
18
17
|
*/
|
19
18
|
function findConfigFileRelativePath(tree, files, originPath) {
|
20
19
|
const foundFile = files.find((file) => tree.exists(`/${file}`));
|
@@ -73,7 +72,6 @@ function getPackagesBaseRootFolder(tree, context, config, projectType) {
|
|
73
72
|
const configName = projectType && exports.BASE_ROOT_FOLDERS_MAP[projectType];
|
74
73
|
const nxExplicitDir = configName && isNxContext(tree) && tree.readJson('/nx.json')?.workspaceLayout[configName];
|
75
74
|
const schematicConfigDir = configName && (0, collection_1.getSchematicOptions)(config, context)?.[configName];
|
76
|
-
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
77
75
|
return schematicConfigDir || nxExplicitDir || ((projectType && configName) ? exports.DEFAULT_ROOT_FOLDERS[configName] : '.');
|
78
76
|
}
|
79
77
|
//# sourceMappingURL=monorepo.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"monorepo.js","sourceRoot":"","sources":["../../../src/utility/monorepo.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"monorepo.js","sourceRoot":"","sources":["../../../src/utility/monorepo.ts"],"names":[],"mappings":";;;AA0BA,gEAOC;AAMD,kCAEC;AAOD,wDAGC;AAMD,wDAEC;AA4BD,8DAOC;AA9FD,kCAAkC;AAalC,6CAEsB;AACtB,uCAEmB;AAEnB;;;;;GAKG;AACH,SAAgB,0BAA0B,CAAC,IAAU,EAAE,KAAe,EAAE,UAAkB;IACxF,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAChE,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,EAAE,IAAI,SAAS,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,SAAgB,WAAW,CAAC,IAAU;IACpC,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,IAAU;IAC/C,MAAM,eAAe,GAAG,IAAA,4BAAkB,EAAC,IAAI,CAAC,CAAC;IACjD,OAAO,eAA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AC,CAAC;AACvH,CAAC"}
|
@@ -31,17 +31,16 @@ export declare function getPackageManager(options?: PackageManagerOptions): Supp
|
|
31
31
|
* @param workspaceConfig Workspace configuration
|
32
32
|
* @param packageName Name of the package of the workspace to run the script (name from package.json)
|
33
33
|
*/
|
34
|
-
export declare function getPackageManagerRunner(workspaceConfig?: WorkspaceSchema | string | null, packageName?: string
|
34
|
+
export declare function getPackageManagerRunner(workspaceConfig?: WorkspaceSchema | string | null, packageName?: string): string;
|
35
35
|
/**
|
36
36
|
* Get command to execute bin command with your package manager
|
37
37
|
* @param workspaceConfig Workspace configuration
|
38
38
|
* @param packageName Name of the package of the workspace to execute the command
|
39
39
|
*/
|
40
|
-
export declare function getPackageManagerExecutor(workspaceConfig?: WorkspaceSchema | string | null, packageName?: string
|
40
|
+
export declare function getPackageManagerExecutor(workspaceConfig?: WorkspaceSchema | string | null, packageName?: string): string;
|
41
41
|
/**
|
42
42
|
* Determine if the given package is installed
|
43
43
|
* @param packageName name of the package to check
|
44
|
-
* @returns
|
45
44
|
*/
|
46
45
|
export declare function isPackageInstalled(packageName: string): boolean;
|
47
46
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"package-manager-runner.d.ts","sourceRoot":"","sources":["../../../src/utility/package-manager-runner.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"package-manager-runner.d.ts","sourceRoot":"","sources":["../../../src/utility/package-manager-runner.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAEzC,mCAAmC;AACnC,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,MAAM,CAAC;AAEtD,mCAAmC;AACnC,MAAM,MAAM,8BAA8B,GAAG,GAAG,wBAAwB,MAAM,GAAG,MAAM,CAAC;AAExF,mCAAmC;AACnC,MAAM,MAAM,gCAAgC,GAAG,GAAG,wBAAwB,OAAO,GAAG,MAAM,GAAG,KAAK,CAAC;AAOnG,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,8BAA8B;IAC9B,eAAe,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,CAAC;IAElD,4DAA4D;IAC5D,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC,8DAA8D;IAC9D,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI,IAAI,wBAAwB,CAEtF;AAYD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE,qBAAqB,4BAWhE;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAMvH;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,eAAe,CAAC,EAAE,eAAe,GAAG,MAAM,GAAG,IAAI,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzH;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,WAMrD;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,MAAM,GAAG,SAAS,CAe5F;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,qBAAqB;;;EAKpE"}
|
@@ -7,8 +7,8 @@ exports.getPackageManagerExecutor = getPackageManagerExecutor;
|
|
7
7
|
exports.isPackageInstalled = isPackageInstalled;
|
8
8
|
exports.getPackageManagerVersion = getPackageManagerVersion;
|
9
9
|
exports.getPackageManagerInfo = getPackageManagerInfo;
|
10
|
-
const node_path_1 = require("node:path");
|
11
10
|
const node_child_process_1 = require("node:child_process");
|
11
|
+
const node_path_1 = require("node:path");
|
12
12
|
const PACKAGE_MANAGER_WORKSPACE_MAPPING = {
|
13
13
|
npm: '--workspace',
|
14
14
|
yarn: 'workspace'
|
@@ -73,7 +73,6 @@ function getPackageManagerExecutor(workspaceConfig, packageName) {
|
|
73
73
|
/**
|
74
74
|
* Determine if the given package is installed
|
75
75
|
* @param packageName name of the package to check
|
76
|
-
* @returns
|
77
76
|
*/
|
78
77
|
function isPackageInstalled(packageName) {
|
79
78
|
try {
|
@@ -95,9 +94,7 @@ function getPackageManagerVersion(options) {
|
|
95
94
|
env: {
|
96
95
|
...process.env,
|
97
96
|
// NPM updater notifier will prevents the child process from closing until it timeout after 3 minutes.
|
98
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
99
97
|
NO_UPDATE_NOTIFIER: '1',
|
100
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
101
98
|
NPM_CONFIG_UPDATE_NOTIFIER: 'false'
|
102
99
|
}
|
103
100
|
}).trim();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"package-manager-runner.js","sourceRoot":"","sources":["../../../src/utility/package-manager-runner.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"package-manager-runner.js","sourceRoot":"","sources":["../../../src/utility/package-manager-runner.ts"],"names":[],"mappings":";;AA2CA,8DAEC;AAiBD,8CAWC;AAOD,0DAMC;AAOD,8DAMC;AAMD,gDAMC;AAMD,4DAeC;AAMD,sDAKC;AA/ID,2DAE4B;AAC5B,yCAEmB;AAiBnB,MAAM,iCAAiC,GAA6C;IAClF,GAAG,EAAE,aAAa;IAClB,IAAI,EAAE,WAAW;CAClB,CAAC;AAcF;;;GAGG;AACH,SAAgB,yBAAyB,CAAC,IAAU;IAClD,OAAO,IAAI,KAAK,MAAM,IAAI,IAAI,KAAK,KAAK,CAAC;AAC3C,CAAC;AAED;;;GAGG;AACH,SAAS,qBAAqB,CAAC,kBAA6C;IAC1E,MAAM,uBAAuB,GAAG,yBAAyB,CA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AE,iBAAiB,CAAC,OAAO,CAAC;QAChC,OAAO,EAAE,wBAAwB,CAAC,OAAO,CAAC;KAC3C,CAAC;AACJ,CAAC"}
|
@@ -9,7 +9,6 @@ export declare function getPackageVersion(packageJsonPath: string): string | und
|
|
9
9
|
* Note: It is using file system if no tree provided
|
10
10
|
* @param currentPath current path to inspect
|
11
11
|
* @param tree current path to inspect
|
12
|
-
* @returns
|
13
12
|
*/
|
14
13
|
export declare const findClosestPackageJson: (currentPath: string, tree?: Tree) => string | undefined;
|
15
14
|
//# sourceMappingURL=package-version.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"package-version.d.ts","sourceRoot":"","sources":["../../../src/utility/package-version.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"package-version.d.ts","sourceRoot":"","sources":["../../../src/utility/package-version.ts"],"names":[],"mappings":"AASA,OAAO,EACL,IAAI,EACL,MAAM,4BAA4B,CAAC;AAKpC;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,MAAM,sBAGxD;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,gBAAiB,MAAM,SAAS,IAAI,KAAG,MAAM,GAAG,SAQlF,CAAC"}
|
@@ -18,15 +18,14 @@ function getPackageVersion(packageJsonPath) {
|
|
18
18
|
* Note: It is using file system if no tree provided
|
19
19
|
* @param currentPath current path to inspect
|
20
20
|
* @param tree current path to inspect
|
21
|
-
* @returns
|
22
21
|
*/
|
23
22
|
const findClosestPackageJson = (currentPath, tree) => {
|
24
|
-
const dir = (tree ? node_path_1.posix.dirname : node_path_1.dirname)(currentPath);
|
23
|
+
const dir = (tree ? node_path_1.posix.dirname.bind(node_path_1.posix) : node_path_1.dirname)(currentPath);
|
25
24
|
if (dir === currentPath || currentPath === '/') {
|
26
25
|
return undefined;
|
27
26
|
}
|
28
|
-
const packageJsonPath = (tree ? node_path_1.posix.join : node_path_1.join)(dir, 'package.json');
|
29
|
-
return (tree ? tree.exists : node_fs_1.existsSync)(packageJsonPath) ? packageJsonPath : (0, exports.findClosestPackageJson)(dir, tree);
|
27
|
+
const packageJsonPath = (tree ? node_path_1.posix.join.bind(node_path_1.posix) : node_path_1.join)(dir, 'package.json');
|
28
|
+
return (tree ? tree.exists.bind(tree) : node_fs_1.existsSync)(packageJsonPath) ? packageJsonPath : (0, exports.findClosestPackageJson)(dir, tree);
|
30
29
|
};
|
31
30
|
exports.findClosestPackageJson = findClosestPackageJson;
|
32
31
|
//# sourceMappingURL=package-version.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"package-version.js","sourceRoot":"","sources":["../../../src/utility/package-version.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"package-version.js","sourceRoot":"","sources":["../../../src/utility/package-version.ts"],"names":[],"mappings":";;;AAoBA,8CAGC;AAvBD,8BAA8B;AAC9B,qCAEiB;AACjB,yCAImB;AAQnB;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,eAAuB;IACvD,MAAM,kBAAkB,GAAgB,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;IAC3G,OAAO,kBAAkB,CAAC,OAAO,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACI,MAAM,sBAAsB,GAAG,CAAC,WAAmB,EAAE,IAAW,EAAsB,EAAE;IAC7F,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAK,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAK,CAAC,CAAC,CAAC,CAAC,mBAAO,CAAC,CAAC,WAAW,CAAC,CAAC;IACtE,IAAI,GAAG,KAAK,WAAW,IAAI,WAAW,KAAK,GAAG,EAAE,CAAC;QAC/C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,eAAe,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,iBAAK,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAK,CAAC,CAAC,CAAC,CAAC,gBAAI,CAAC,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IACpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,oBAAU,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,IAAA,8BAAsB,EAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC7H,CAAC,CAAC;AARW,QAAA,sBAAsB,0BAQjC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/utility/question.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"question.d.ts","sourceRoot":"","sources":["../../../src/utility/question.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,YAAY,aAAoB,MAAM,KAAG,OAAO,CAAC,MAAM,CAYnE,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"question.js","sourceRoot":"","sources":["../../../src/utility/question.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"question.js","sourceRoot":"","sources":["../../../src/utility/question.ts"],"names":[],"mappings":";;;AAAA,iDAEuB;AAEvB;;;;GAIG;AACI,MAAM,YAAY,GAAG,KAAK,EAAE,QAAgB,EAAmB,EAAE;IACtE,MAAM,QAAQ,GAAG,IAAA,+BAAe,EAAC;QAC/B,QAAQ,EAAE,IAAI;QACd,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,EAAE;QACxD,QAAQ,CAAC,QAAQ,CAAC,GAAG,QAAQ,GAAG,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,MAAM,WAAW,EAAE,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjB,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAZW,QAAA,YAAY,gBAYvB"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/utility/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"routes.d.ts","sourceRoot":"","sources":["../../../src/utility/routes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,IAAI,EACL,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IAEb,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IAEf,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAiCD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,GAAG,EAAE,CAAC,mBAAmB,GAAG,IAAI,CAuBvI;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,GAAG,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAuBvJ;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,UAAQ,gEAehI"}
|
package/src/utility/routes.js
CHANGED
@@ -10,9 +10,9 @@ const ts = require("typescript");
|
|
10
10
|
* @param path Path to test
|
11
11
|
*/
|
12
12
|
function hasRoutePath(route, path) {
|
13
|
-
return route.properties.some((property) => property.kind === ts.SyntaxKind.PropertyAssignment
|
14
|
-
property.name.text === 'path'
|
15
|
-
property.initializer.text === path);
|
13
|
+
return route.properties.some((property) => property.kind === ts.SyntaxKind.PropertyAssignment
|
14
|
+
&& property.name.text === 'path'
|
15
|
+
&& property.initializer.text === path);
|
16
16
|
}
|
17
17
|
/**
|
18
18
|
* Indicates if the given variable declaration is a Routes declaration.
|
@@ -45,7 +45,7 @@ function getRoutesDeclaration(tree, context, appRoutingModulePath) {
|
|
45
45
|
return sourceFile.statements
|
46
46
|
.filter((statement) => statement.kind === ts.SyntaxKind.VariableStatement)
|
47
47
|
.map((statement) => statement.declarationList.declarations)
|
48
|
-
.map((declarations) => declarations.filter(isRoutesDeclaration))
|
48
|
+
.map((declarations) => declarations.filter((route) => isRoutesDeclaration(route)))
|
49
49
|
.reduce((declaration, declarations) => declarations.length > 0 ? declarations[0] : declaration, null);
|
50
50
|
}
|
51
51
|
/**
|
@@ -85,9 +85,9 @@ function insertRoute(tree, context, appRoutingModulePath, route, standalone = fa
|
|
85
85
|
const routes = getRoutesNodeArray(tree, context, appRoutingModulePath);
|
86
86
|
if (routes) {
|
87
87
|
const noStarRoutes = routes.filter((r) => !hasRoutePath(r, '**'));
|
88
|
-
const index = noStarRoutes.length
|
88
|
+
const index = noStarRoutes.length > 0 ? noStarRoutes.at(-1).end : routes.end;
|
89
89
|
const routeString = `{path: '${route.path}', load${standalone ? 'Component' : 'Children'}: () => import('${route.import}').then((m) => m.${route.module})}`;
|
90
|
-
const content = noStarRoutes.length
|
90
|
+
const content = noStarRoutes.length > 0 ? `,\n${routeString}` : routeString;
|
91
91
|
const recorder = tree.beginUpdate(appRoutingModulePath);
|
92
92
|
recorder.insertLeft(index, content);
|
93
93
|
tree.commitUpdate(recorder);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../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AK,CAAC,MAAM,IAAI,CAAC;QAC5J,MAAM,OAAO,GAAG,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,WAAW,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;QAE5E,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;QACxD,QAAQ,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sub-entry.d.ts","sourceRoot":"","sources":["../../../src/utility/sub-entry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"sub-entry.d.ts","sourceRoot":"","sources":["../../../src/utility/sub-entry.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AAEpC;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,WAEtE;AACD;;;;;;GAMG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QA2BhG"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sub-entry.js","sourceRoot":"","sources":["../../../src/utility/sub-entry.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"sub-entry.js","sourceRoot":"","sources":["../../../src/utility/sub-entry.ts"],"names":[],"mappings":";;AAUA,0DAEC;AAQD,sEA2BC;AA/CD,kCAAkC;AAKlC;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,IAAU,EAAE,WAAmB;IACrE,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAChE,CAAC;AACD;;;;;;GAMG;AACH,SAAgB,6BAA6B,CAAC,IAAU,EAAE,WAAmB,EAAE,UAAkB;IAC/F,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC;QACzD,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;QACjE,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEvG,MAAM,YAAY,GAAG,aAAa,EAAE,GAAG,EAAE,YAAY,IAAI;YACvD,aAAa,EAAE,YAAY;YAC3B,eAAe,EAAE,cAAc;YAC/B,WAAW,EAAE,UAAU;YACvB,gBAAgB,EAAE,eAAe;YACjC,aAAa,EAAE,YAAY;YAC3B,eAAe,EAAE,cAAc;YAC/B,cAAc,EAAE,aAAa;YAC7B,oBAAoB,EAAE,mBAAmB;YACzC,mBAAmB,EAAE,kBAAkB;SACxC,CAAC;QACF,MAAM,WAAW,GAAG;YAClB,SAAS,EAAE;gBACT,IAAI,EAAE,IAAI;gBACV,GAAG,EAAE;oBACH,SAAS,EAAE,UAAU;oBACrB,YAAY;iBACb;aACF;SACF,CAAC;QACF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,EAAE,cAAc,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACxG,CAAC;AACH,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"template-property.helper.d.ts","sourceRoot":"","sources":["../../../src/utility/template-property.helper.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"template-property.helper.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,wBAAgB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,qBAAqB,EAAE,MAAM,UAGzF;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,iBAMrE"}
|
@@ -29,7 +29,7 @@ function getComponentModuleItems(componentName) {
|
|
29
29
|
*/
|
30
30
|
function getInputComponentName(componentName) {
|
31
31
|
const componentModuleItems = getComponentModuleItems(componentName);
|
32
|
-
return componentModuleItems
|
32
|
+
return componentModuleItems.at(-1);
|
33
33
|
}
|
34
34
|
/**
|
35
35
|
* returns the component folder name
|
@@ -152,7 +152,7 @@ function getLibraryNameFromPath(path) {
|
|
152
152
|
if (!path) {
|
153
153
|
return null;
|
154
154
|
}
|
155
|
-
const libNameRes = /@[
|
155
|
+
const libNameRes = /@[^/@]+\/[^/]+/.exec(path.replace(/\\/g, '/'));
|
156
156
|
return libNameRes && libNameRes[0];
|
157
157
|
}
|
158
158
|
//# sourceMappingURL=template-property.helper.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"template-property.helper.js","sourceRoot":"","sources":["../../../src/utility/template-property.helper.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"template-property.helper.js","sourceRoot":"","sources":["../../../src/utility/template-property.helper.ts"],"names":[],"mappings":";;AAgBA,sDAGC;AAMD,wDAGC;AAOD,oDAGC;AAOD,8EAGC;AAOD,wDAGC;AAOD,8DAGC;AAOD,4CAGC;AAMD,sDAGC;AAMD,sDAEC;AAOD,wDAGC;AAOD,kEAGC;AAOD,0DAGC;AAOD,0DAGC;AAOD,sDAGC;AAMD,wDAMC;AA7JD,+CAE8B;AAE9B;;;GAGG;AACH,SAAS,uBAAuB,CAAC,aAAqB;IACpD,OAAO,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,aAAqB;I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C,aAAqB,EAAE,qBAA6B;IAC1F,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAChE,OAAO,GAAG,cAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,cAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,SAAS,CAAC;AACpG,CAAC;AAED;;;;GAIG;AACH,SAAgB,uBAAuB,CAAC,aAAqB,EAAE,qBAA6B;IAC1F,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAChE,OAAO,GAAG,cAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,cAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,SAAS,CAAC;AACpG,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,aAAqB,EAAE,qBAA6B;IACxF,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;IACrF,OAAO,GAAG,cAAO,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;AAClE,CAAC;AAED;;;GAGG;AACH,SAAgB,sBAAsB,CAAC,IAA+B;IACpE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC;IACnE,OAAO,UAAU,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import * as ts from 'typescript';
|
2
1
|
import { logging } from '@angular-devkit/core';
|
3
2
|
import type { Tree } from '@angular-devkit/schematics';
|
3
|
+
import * as ts from 'typescript';
|
4
4
|
/** Map containing all import changes in otter packages */
|
5
5
|
export interface ImportsMapping {
|
6
6
|
[packageName: string]: {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-imports.d.ts","sourceRoot":"","sources":["../../../src/utility/update-imports.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"update-imports.d.ts","sourceRoot":"","sources":["../../../src/utility/update-imports.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,IAAI,EACL,MAAM,4BAA4B,CAAC;AAIpC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAgBjC,0DAA0D;AAC1D,MAAM,WAAW,cAAc;IAC7B,CAAC,WAAW,EAAE,MAAM,GAAG;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CAC5F;AAID;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,OAAO,CAAC,SAAS,EACzB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,aAAa,EAAE,MAAM,EACrB,oBAAoB,EAAE,MAAM,EAC5B,UAAU,GAAE,cAAmB,EAC/B,eAAe,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,UA8F7C"}
|
@@ -1,8 +1,9 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.updateImportsInFile = updateImportsInFile;
|
4
|
-
const ts = require("typescript");
|
5
4
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
5
|
+
const ts = require("typescript");
|
6
|
+
const escapeRegExp = (str) => str.replace(/[$()*+./?[\\\]^{|}-]/g, '\\$&');
|
6
7
|
/**
|
7
8
|
* Update the imports of a given file according to replace mapping
|
8
9
|
* @param logger Logger to report messages
|
@@ -20,7 +21,7 @@ function updateImportsInFile(logger, tree, sourceFile, importsRegexp, renamePack
|
|
20
21
|
// First we look for all imports lines targeting an Otter package for which we know a mapping
|
21
22
|
(0, ast_utils_1.findNodes)(sourceFile, ts.SyntaxKind.ImportDeclaration).map((nodeImp) => {
|
22
23
|
const imp = nodeImp;
|
23
|
-
const importFrom = imp.moduleSpecifier.getText().replace(/['
|
24
|
+
const importFrom = imp.moduleSpecifier.getText().replace(/["']/g, '');
|
24
25
|
const renamePackageMatch = importFrom.match(renamePackagesRegexp);
|
25
26
|
const otterPackage = renamePackageMatch?.[0] || importFrom.match(importsRegexp)?.[0];
|
26
27
|
// If the import matched an Otter package
|
@@ -33,9 +34,9 @@ function updateImportsInFile(logger, tree, sourceFile, importsRegexp, renamePack
|
|
33
34
|
// We retrieve all the symbols listed in the import statement
|
34
35
|
const namedImport = imp.importClause?.namedBindings;
|
35
36
|
const isTypeOnlyImport = !!imp.importClause && ts.isTypeOnlyImportDeclaration(imp.importClause);
|
36
|
-
const imports = namedImport && ts.isNamedImports(namedImport)
|
37
|
-
namedImport.elements.map((element) => ({ symbol: element.getText(), isTypeOnlyImport, location: importFrom }))
|
38
|
-
[];
|
37
|
+
const imports = namedImport && ts.isNamedImports(namedImport)
|
38
|
+
? namedImport.elements.map((element) => ({ symbol: element.getText(), isTypeOnlyImport, location: importFrom }))
|
39
|
+
: [];
|
39
40
|
// And associate them to the Otter package
|
40
41
|
oldImportedSymbolsPerPackage[otterPackage].push(...imports);
|
41
42
|
}
|
@@ -48,13 +49,9 @@ function updateImportsInFile(logger, tree, sourceFile, importsRegexp, renamePack
|
|
48
49
|
// If no mapping is found, we keep the original import location
|
49
50
|
const resolvedImports = Object.entries(oldImportedSymbolsPerPackage).reduce((acc, [oldPackageName, importsFromOldPackage]) => {
|
50
51
|
importsFromOldPackage.forEach((importSymbol) => {
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
}
|
55
|
-
else {
|
56
|
-
newPackageNameImport = mapImports[oldPackageName]?.[importSymbol.symbol]?.newPackage;
|
57
|
-
}
|
52
|
+
const newPackageNameImport = renamedPackages[oldPackageName]
|
53
|
+
? importSymbol.location.replace(oldPackageName, renamedPackages[oldPackageName])
|
54
|
+
: mapImports[oldPackageName]?.[importSymbol.symbol]?.newPackage;
|
58
55
|
const importFrom = newPackageNameImport || importSymbol.location;
|
59
56
|
if (!newPackageNameImport) {
|
60
57
|
unResolvedImports.push(importSymbol);
|
@@ -68,14 +65,13 @@ function updateImportsInFile(logger, tree, sourceFile, importsRegexp, renamePack
|
|
68
65
|
return acc;
|
69
66
|
}, {});
|
70
67
|
let fileContent = tree.readText(sourceFile.fileName);
|
71
|
-
const escapeRegExp = (str) => str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&');
|
72
68
|
// Remove captured imports
|
73
69
|
fileContent = fileContent.replace(new RegExp(`(${importNodes.map((node) => escapeRegExp(node.getText())).join('|')})[\\n\\r]*`, 'g'), '');
|
74
70
|
// Replace imported values
|
75
71
|
const valuesToReplace = Object.fromEntries(Object.values(mapImports).flatMap((mapImport) => Object.entries(mapImport)
|
76
72
|
.filter(([_, value]) => value.newValue)
|
77
73
|
.map(([key, value]) => [key, value.newValue])));
|
78
|
-
if (Object.keys(valuesToReplace).length) {
|
74
|
+
if (Object.keys(valuesToReplace).length > 0) {
|
79
75
|
const matcher = new RegExp(Object.keys(valuesToReplace).map((oldValue) => `\\b${escapeRegExp(oldValue)}\\b`).join('|'), 'g');
|
80
76
|
const replacer = (match) => valuesToReplace[match];
|
81
77
|
fileContent = fileContent.replace(matcher, replacer);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"update-imports.js","sourceRoot":"","sources":["../../../src/utility/update-imports.ts"],"names":[],"mappings":";;
|
1
|
+
{"version":3,"file":"update-imports.js","sourceRoot":"","sources":["../../../src/utility/update-imports.ts"],"names":[],"mappings":";;AA0CA,kDAqGC;AAzID,qEAE+C;AAC/C,iCAAiC;AAqBjC,MAAM,YAAY,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,uBAAuB,E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"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"update-pipes.d.ts","sourceRoot":"","sources":["../../../src/utility/update-pipes.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAepC,wCAAwC;AACxC,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAmD7G;;;GAGG;AACH,eAAO,MAAM,WAAW,wBAAyB,mBAAmB,KAAG,IAoDtE,CAAC"}
|
@@ -44,7 +44,7 @@ const updatePipes = (pipeReplacementInfo) => (tree, context) => {
|
|
44
44
|
const files = (0, loaders_1.findFilesInTree)(tree.root, (file) => file.endsWith('.html'));
|
45
45
|
files.forEach((file) => {
|
46
46
|
const matchers = Array.from(file.content.toString().matchAll(pipeRegex)).filter((matcher) => !!pipeReplacementInfo[matcher[1]]);
|
47
|
-
if (matchers.length) {
|
47
|
+
if (matchers.length > 0) {
|
48
48
|
const directory = (0, node_path_1.dirname)(file.path);
|
49
49
|
const baseFileName = (0, node_path_1.basename)((0, node_path_1.basename)(file.path, '.html'), '.template');
|
50
50
|
const componentFile = (0, node_path_1.join)(directory, `${baseFileName}.component.ts`);
|
@@ -59,9 +59,9 @@ const updatePipes = (pipeReplacementInfo) => (tree, context) => {
|
|
59
59
|
}
|
60
60
|
if (standalone) {
|
61
61
|
const componentSourceFile = ts.createSourceFile(componentFile, tree.readText(componentFile), ts.ScriptTarget.ES2020, true);
|
62
|
-
const
|
62
|
+
const ngClass = componentSourceFile.statements.find((statement) => ts.isClassDeclaration(statement)
|
63
63
|
&& (0, component_1.isNgClassComponent)(statement));
|
64
|
-
const
|
64
|
+
const ngDecorator = ((ngClass && ts.getDecorators(ngClass)) || []).find((decorator) => (0, component_1.isNgClassDecorator)(decorator));
|
65
65
|
if (ngDecorator) {
|
66
66
|
applyChanges(pipeReplacementInfo, ngDecorator, matchers, componentFile, file.path, tree, context);
|
67
67
|
}
|
@@ -69,8 +69,8 @@ const updatePipes = (pipeReplacementInfo) => (tree, context) => {
|
|
69
69
|
else if (tree.exists(moduleFile)) {
|
70
70
|
const moduleSourceFile = ts.createSourceFile(moduleFile, tree.readText(moduleFile), ts.ScriptTarget.ES2020, true);
|
71
71
|
const ngModuleClass = moduleSourceFile.statements.find((statement) => ts.isClassDeclaration(statement)
|
72
|
-
&&
|
73
|
-
const ngDecorator = ((ngModuleClass && ts.getDecorators(ngModuleClass)) || []).find(isNgModuleDecorator);
|
72
|
+
&& (ts.getDecorators(statement) || []).some((decorator) => isNgModuleDecorator(decorator)));
|
73
|
+
const ngDecorator = ((ngModuleClass && ts.getDecorators(ngModuleClass)) || []).find((decorator) => isNgModuleDecorator(decorator));
|
74
74
|
if (ngDecorator && (0, ast_1.isDecoratorWithArg)(ngDecorator)) {
|
75
75
|
applyChanges(pipeReplacementInfo, ngDecorator, matchers, moduleFile, file.path, tree, context);
|
76
76
|
}
|