@o3r/schematics 10.0.0-prerelease.8 → 10.0.0-prerelease.81
Sign up to get free protection for your applications and to get access to all the features.
- package/{src/cli → cli}/environment.d.ts.map +1 -1
- package/{src/cli → cli}/environment.js +1 -1
- package/cli/package.json +3 -0
- package/package.json +29 -16
- package/schematics/ng-add/index.d.ts +2 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +12 -6
- package/schematics/ng-add/schema.d.ts +1 -1
- 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 -0
- package/src/interfaces/index.d.ts.map +1 -1
- package/src/interfaces/index.js +1 -0
- package/src/interfaces/index.js.map +1 -1
- package/src/{rule-factories/interfaces.d.ts → interfaces/rule-factories.d.ts} +2 -2
- package/src/interfaces/rule-factories.d.ts.map +1 -0
- package/src/{rule-factories/interfaces.js → interfaces/rule-factories.js} +1 -1
- package/src/interfaces/rule-factories.js.map +1 -0
- package/src/modules/modules.display.rule.d.ts.map +1 -1
- package/src/modules/modules.display.rule.js +3 -4
- 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 +2 -2
- package/src/modules/modules.helpers.js.map +1 -1
- package/src/public_api.d.ts +6 -1
- package/src/public_api.d.ts.map +1 -1
- package/src/public_api.js +6 -1
- package/src/public_api.js.map +1 -1
- package/src/rule-factories/add-imports/index.js.map +1 -1
- package/src/rule-factories/dev-tools/devtools-registration.js +7 -7
- package/src/rule-factories/dev-tools/devtools-registration.js.map +1 -1
- package/src/rule-factories/eslint-fix/index.d.ts +1 -1
- package/src/rule-factories/eslint-fix/index.d.ts.map +1 -1
- package/src/rule-factories/eslint-fix/index.js +5 -3
- package/src/rule-factories/eslint-fix/index.js.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 +1 -1
- package/src/rule-factories/index.d.ts.map +1 -1
- package/src/rule-factories/index.js +1 -1
- package/src/rule-factories/index.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.map +1 -1
- package/src/rule-factories/update-imports/index.d.ts +0 -1
- package/src/rule-factories/update-imports/index.d.ts.map +1 -1
- package/src/rule-factories/update-imports/index.js +0 -1
- package/src/rule-factories/update-imports/index.js.map +1 -1
- package/src/rule-factories/update-imports/list-of-vars.d.ts +4 -5
- package/src/rule-factories/update-imports/list-of-vars.d.ts.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 +1 -1
- package/src/rule-factories/update-imports/update-imports-with-scope.js +3 -3
- 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 +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/rules/install.d.ts +1 -1
- package/src/rules/install.d.ts.map +1 -1
- package/src/tasks/package-manager/add-dev-dependency.js +3 -3
- package/src/tasks/package-manager/add-dev-dependency.js.map +1 -1
- package/src/tasks/package-manager/interfaces.d.ts +1 -1
- package/src/tasks/package-manager/interfaces.d.ts.map +1 -1
- package/src/tasks/package-manager/npm-install.js +3 -3
- package/src/tasks/package-manager/npm-install.js.map +1 -1
- package/src/utility/component.d.ts +1 -1
- package/src/utility/component.d.ts.map +1 -1
- package/src/utility/dependencies.d.ts.map +1 -1
- package/src/utility/environment.d.ts +1 -0
- package/src/utility/environment.d.ts.map +1 -1
- package/src/utility/file-info.d.ts +1 -2
- package/src/utility/file-info.d.ts.map +1 -1
- package/src/utility/file-info.js.map +1 -1
- package/src/utility/generation.d.ts +1 -1
- package/src/utility/generation.d.ts.map +1 -1
- package/src/utility/gitignore.d.ts +1 -1
- package/src/utility/gitignore.d.ts.map +1 -1
- package/src/utility/index.d.ts +2 -0
- package/src/utility/index.d.ts.map +1 -1
- package/src/utility/index.js +2 -0
- package/src/utility/index.js.map +1 -1
- package/src/utility/monorepo.d.ts +1 -1
- package/src/utility/monorepo.d.ts.map +1 -1
- package/src/utility/package-manager-runner.d.ts +1 -1
- package/src/utility/package-manager-runner.d.ts.map +1 -1
- package/src/utility/routes.d.ts +1 -1
- package/src/utility/routes.d.ts.map +1 -1
- package/src/utility/sub-entry.d.ts +1 -1
- package/src/utility/sub-entry.d.ts.map +1 -1
- package/src/utility/template-property.helper.js.map +1 -1
- package/src/utility/update-pipes.d.ts +15 -0
- package/src/utility/update-pipes.d.ts.map +1 -0
- package/src/utility/update-pipes.js +82 -0
- package/src/utility/update-pipes.js.map +1 -0
- package/src/utility/wrapper.d.ts +8 -0
- package/src/utility/wrapper.d.ts.map +1 -0
- package/src/utility/wrapper.js +23 -0
- package/src/utility/wrapper.js.map +1 -0
- package/src/cli/environment.js.map +0 -1
- package/src/index.d.ts +0 -7
- package/src/index.d.ts.map +0 -1
- package/src/index.js +0 -10
- package/src/index.js.map +0 -1
- package/src/rule-factories/interfaces.d.ts.map +0 -1
- package/src/rule-factories/interfaces.js.map +0 -1
- package/src/rule-factories/update-imports/v7-to-v8-map-object.d.ts +0 -8
- package/src/rule-factories/update-imports/v7-to-v8-map-object.d.ts.map +0 -1
- package/src/rule-factories/update-imports/v7-to-v8-map-object.js +0 -2049
- package/src/rule-factories/update-imports/v7-to-v8-map-object.js.map +0 -1
- /package/{src/cli → cli}/environment.d.ts +0 -0
@@ -0,0 +1,82 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.updatePipes = void 0;
|
4
|
+
const node_path_1 = require("node:path");
|
5
|
+
const ts = require("typescript");
|
6
|
+
const ast_1 = require("./ast");
|
7
|
+
const component_1 = require("./component");
|
8
|
+
const loaders_1 = require("./loaders");
|
9
|
+
const applyChanges = (pipeReplacementInfo, ngDecorator, matchers, fileWithImports, templateFile, tree, context) => {
|
10
|
+
if (ts.isObjectLiteralExpression(ngDecorator.expression.arguments[0])) {
|
11
|
+
const importsProp = ngDecorator.expression.arguments[0].properties.find((prop) => ts.isPropertyAssignment(prop)
|
12
|
+
&& ts.isIdentifier(prop.name)
|
13
|
+
&& prop.name.text === 'imports'
|
14
|
+
&& ts.isArrayLiteralExpression(prop.initializer));
|
15
|
+
if (importsProp) {
|
16
|
+
matchers.forEach((matcher) => {
|
17
|
+
const pipeName = matcher[1];
|
18
|
+
const importModuleRegexp = new RegExp(`\\b${pipeReplacementInfo[pipeName].import}\\b`, 'g');
|
19
|
+
if (importsProp.initializer.elements.some((element) => importModuleRegexp.test(element.getText()))) {
|
20
|
+
if (pipeReplacementInfo[pipeName].new.import) {
|
21
|
+
tree.overwrite(fileWithImports, tree.readText(fileWithImports).replaceAll(importModuleRegexp, pipeReplacementInfo[pipeName].new.import));
|
22
|
+
}
|
23
|
+
tree.overwrite(templateFile, tree.readText(templateFile).replaceAll(new RegExp(`\\|\\s*${pipeName}`, 'g'), `| ${pipeReplacementInfo[pipeName].new.name}`));
|
24
|
+
}
|
25
|
+
else {
|
26
|
+
context.logger.warn(`Deprecated pipe ${pipeName} was found in ${templateFile} `
|
27
|
+
+ `but no associated import in ${fileWithImports}`
|
28
|
+
+ `to be able to migrate to the new pipe ${pipeReplacementInfo[pipeName].new.name}.`);
|
29
|
+
}
|
30
|
+
});
|
31
|
+
}
|
32
|
+
}
|
33
|
+
};
|
34
|
+
const isNgModuleDecorator = (decorator) => ts.isCallExpression(decorator.expression)
|
35
|
+
&& decorator.expression.expression
|
36
|
+
&& ts.isIdentifier(decorator.expression.expression)
|
37
|
+
&& decorator.expression.expression.text === 'NgModule';
|
38
|
+
/**
|
39
|
+
* Returns a rule tu update pipes
|
40
|
+
* @param pipeReplacementInfo
|
41
|
+
*/
|
42
|
+
const updatePipes = (pipeReplacementInfo) => (tree, context) => {
|
43
|
+
const pipeRegex = new RegExp(`\\|\\s*(${Object.keys(pipeReplacementInfo).join('|')})`, 'g');
|
44
|
+
const files = (0, loaders_1.findFilesInTree)(tree.root, (file) => file.endsWith('.html'));
|
45
|
+
files.forEach((file) => {
|
46
|
+
const matchers = Array.from(file.content.toString().matchAll(pipeRegex)).filter((matcher) => !!pipeReplacementInfo[matcher[1]]);
|
47
|
+
if (matchers.length) {
|
48
|
+
const directory = (0, node_path_1.dirname)(file.path);
|
49
|
+
const baseFileName = (0, node_path_1.basename)(file.path, '.template.html');
|
50
|
+
const componentFile = (0, node_path_1.join)(directory, `${baseFileName}.component.ts`);
|
51
|
+
const moduleFile = (0, node_path_1.join)(directory, `${baseFileName}.module.ts`);
|
52
|
+
let standalone = false;
|
53
|
+
if (tree.exists(componentFile)) {
|
54
|
+
try {
|
55
|
+
const info = (0, component_1.getO3rComponentInfoOrThrowIfNotFound)(tree, componentFile);
|
56
|
+
standalone = info.standalone;
|
57
|
+
}
|
58
|
+
catch { }
|
59
|
+
}
|
60
|
+
if (standalone) {
|
61
|
+
const componentSourceFile = ts.createSourceFile(componentFile, tree.readText(componentFile), ts.ScriptTarget.ES2020, true);
|
62
|
+
const [ngClass] = componentSourceFile.statements.filter((statement) => ts.isClassDeclaration(statement)
|
63
|
+
&& (0, component_1.isNgClassComponent)(statement));
|
64
|
+
const [ngDecorator] = ((ngClass && ts.getDecorators(ngClass)) || []).filter(component_1.isNgClassDecorator);
|
65
|
+
if (ngDecorator) {
|
66
|
+
applyChanges(pipeReplacementInfo, ngDecorator, matchers, componentFile, file.path, tree, context);
|
67
|
+
}
|
68
|
+
}
|
69
|
+
else if (tree.exists(moduleFile)) {
|
70
|
+
const moduleSourceFile = ts.createSourceFile(moduleFile, tree.readText(moduleFile), ts.ScriptTarget.ES2020, true);
|
71
|
+
const ngModuleClass = moduleSourceFile.statements.find((statement) => ts.isClassDeclaration(statement)
|
72
|
+
&& !!(ts.getDecorators(statement) || []).find(isNgModuleDecorator));
|
73
|
+
const ngDecorator = ((ngModuleClass && ts.getDecorators(ngModuleClass)) || []).find(isNgModuleDecorator);
|
74
|
+
if (ngDecorator && (0, ast_1.isDecoratorWithArg)(ngDecorator)) {
|
75
|
+
applyChanges(pipeReplacementInfo, ngDecorator, matchers, moduleFile, file.path, tree, context);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
});
|
80
|
+
};
|
81
|
+
exports.updatePipes = updatePipes;
|
82
|
+
//# sourceMappingURL=update-pipes.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"update-pipes.js","sourceRoot":"","sources":["../../../src/utility/update-pipes.ts"],"names":[],"mappings":";;;AACA,yCAAoD;AACpD,iCAAiC;AACjC,+BAA6D;AAC7D,2CAA2G;AAC3G,uCAA4C;AAK5C,MAAM,YAAY,GAAG,CACnB,mBAAwC,EACxC,WAA6B,EAC7B,QAA4B,EAC5B,eAAuB,EACvB,YAAoB,EACpB,IAAU,EACV,OAAyB,EACzB,EAAE;IACF,IAAI,EAAE,CAAC,yBAAyB,CAAC,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;QACrE,MAAM,WAAW,GAAG,WAAW,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAA8E,EAAE,CAC3J,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC;eAClB,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;eAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS;eAC5B,EAAE,CAAC,wBAAwB,CAAC,IAAI,CAAC,WAAW,CAAC,CACzD,CAAC;QACF,IAAI,WAAW,EAAE;YACf,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gB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C,SAAS,EAAoC,EAAE,CACrG,EAAE,CAAC,kBAAkB,CAAC,SAAS,CAAC;uBAC7B,CAAC,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CACnE,CAAC;gBACF,MAAM,WAAW,GAAG,CAAC,CAAC,aAAa,IAAI,EAAE,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBACzG,IAAI,WAAW,IAAI,IAAA,wBAAkB,EAAC,WAAW,CAAC,EAAE;oBAClD,YAAY,CAAC,mBAAmB,EAAE,WAAW,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;iBAChG;aACF;SACF;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AApDW,QAAA,WAAW,eAoDtB"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import type { SchematicWrapper } from '@o3r/telemetry';
|
2
|
+
/**
|
3
|
+
* Wrapper method of a schematic to retrieve some metrics around the schematic run
|
4
|
+
* if @o3r/telemetry is installed
|
5
|
+
* @param schematicFn
|
6
|
+
*/
|
7
|
+
export declare const createSchematicWithMetricsIfInstalled: SchematicWrapper;
|
8
|
+
//# sourceMappingURL=wrapper.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wrapper.d.ts","sourceRoot":"","sources":["../../../src/utility/wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIvD;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,EAAE,gBAUnD,CAAC"}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.createSchematicWithMetricsIfInstalled = void 0;
|
4
|
+
const noopSchematicWrapper = (fn) => fn;
|
5
|
+
/**
|
6
|
+
* Wrapper method of a schematic to retrieve some metrics around the schematic run
|
7
|
+
* if @o3r/telemetry is installed
|
8
|
+
* @param schematicFn
|
9
|
+
*/
|
10
|
+
const createSchematicWithMetricsIfInstalled = (schematicFn) => (opts) => async (_, context) => {
|
11
|
+
let wrapper = noopSchematicWrapper;
|
12
|
+
try {
|
13
|
+
const { createSchematicWithMetrics } = await Promise.resolve().then(() => require('@o3r/telemetry'));
|
14
|
+
wrapper = createSchematicWithMetrics;
|
15
|
+
}
|
16
|
+
catch (e) {
|
17
|
+
// Do not throw if `@o3r/telemetry is not installed
|
18
|
+
context.logger.debug('`@o3r/telemetry` is not available\n' + e.toString());
|
19
|
+
}
|
20
|
+
return wrapper(schematicFn)(opts);
|
21
|
+
};
|
22
|
+
exports.createSchematicWithMetricsIfInstalled = createSchematicWithMetricsIfInstalled;
|
23
|
+
//# sourceMappingURL=wrapper.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../../src/utility/wrapper.ts"],"names":[],"mappings":";;;AAEA,MAAM,oBAAoB,GAAqB,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC;AAE1D;;;;GAIG;AACI,MAAM,qCAAqC,GAAqB,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE;IACrH,IAAI,OAAO,GAAqB,oBAAoB,CAAC;IACrD,IAAI;QACF,MAAM,EAAE,0BAA0B,EAAE,GAAG,2CAAa,gBAAgB,EAAC,CAAC;QACtE,OAAO,GAAG,0BAA0B,CAAC;KACtC;IAAC,OAAO,CAAM,EAAE;QACf,mDAAmD;QACnD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qCAAqC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;KAC5E;IACD,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC,CAAC;AAVW,QAAA,qCAAqC,yCAUhD"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"environment.js","sourceRoot":"","sources":["../../../src/cli/environment.ts"],"names":[],"mappings":";;AAAA,4CAA+D;AAE/D,OAAO,CAAC,IAAI,CAAC,4BAA4B,IAAA,mCAA2B,GAAE,EAAE,CAAC,CAAC"}
|
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
package/src/index.js
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const tslib_1 = require("tslib");
|
4
|
-
tslib_1.__exportStar(require("./interfaces/index"), exports);
|
5
|
-
tslib_1.__exportStar(require("./rule-factories/index"), exports);
|
6
|
-
tslib_1.__exportStar(require("./rules/index"), exports);
|
7
|
-
tslib_1.__exportStar(require("./tasks/index"), exports);
|
8
|
-
tslib_1.__exportStar(require("./utility/index"), exports);
|
9
|
-
tslib_1.__exportStar(require("./modules/index"), exports);
|
10
|
-
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,iEAAuC;AACvC,wDAA8B;AAC9B,wDAA8B;AAC9B,0DAAgC;AAChC,0DAAgC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../src/rule-factories/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,6BAA6B;AAC7B,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,EAAE;IAAC,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAC,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/rule-factories/interfaces.ts"],"names":[],"mappings":""}
|
@@ -1,8 +0,0 @@
|
|
1
|
-
import type { ImportsMapping } from '../../utility';
|
2
|
-
/** Packages that were renamed */
|
3
|
-
export declare const renamedPackagesV7toV8: {
|
4
|
-
[key: string]: string;
|
5
|
-
};
|
6
|
-
/** Map containing the import changes in otter packages for the exported elements */
|
7
|
-
export declare const mapImportV7toV8: ImportsMapping;
|
8
|
-
//# sourceMappingURL=v7-to-v8-map-object.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"v7-to-v8-map-object.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/update-imports/v7-to-v8-map-object.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,iCAAiC;AACjC,eAAO,MAAM,qBAAqB,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAa1D,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,eAAe,EAAE,cA6+D7B,CAAC"}
|