@o3r/schematics 10.0.0-prerelease.11 → 10.0.0-prerelease.110
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +2 -1
- 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 +44 -36
- 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 +30 -27
- 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/dependencies.d.ts +78 -0
- package/src/rule-factories/ng-add/dependencies.d.ts.map +1 -0
- package/src/rule-factories/ng-add/dependencies.js +156 -0
- package/src/rule-factories/ng-add/dependencies.js.map +1 -0
- package/src/rule-factories/ng-add/index.d.ts +3 -36
- package/src/rule-factories/ng-add/index.d.ts.map +1 -1
- package/src/rule-factories/ng-add/index.js +4 -218
- package/src/rule-factories/ng-add/index.js.map +1 -1
- package/src/rule-factories/ng-add/ng-add.helpers.d.ts +22 -0
- package/src/rule-factories/ng-add/ng-add.helpers.d.ts.map +1 -0
- package/src/rule-factories/ng-add/ng-add.helpers.js +162 -0
- package/src/rule-factories/ng-add/ng-add.helpers.js.map +1 -0
- package/src/rule-factories/ng-add/schematics-register.d.ts +17 -0
- package/src/rule-factories/ng-add/schematics-register.d.ts.map +1 -0
- package/src/rule-factories/ng-add/schematics-register.js +64 -0
- package/src/rule-factories/ng-add/schematics-register.js.map +1 -0
- 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 +7 -6
- package/src/rule-factories/update-imports/update-ts-imports.js.map +1 -1
- package/src/rules/install.d.ts +8 -4
- package/src/rules/install.d.ts.map +1 -1
- package/src/rules/install.js +10 -8
- package/src/rules/install.js.map +1 -1
- package/src/tasks/ng-add/index.d.ts +1 -0
- package/src/tasks/ng-add/index.d.ts.map +1 -1
- package/src/tasks/ng-add/index.js +1 -0
- package/src/tasks/ng-add/index.js.map +1 -1
- package/src/tasks/package-manager/add-dev-dependency.d.ts +1 -0
- package/src/tasks/package-manager/add-dev-dependency.d.ts.map +1 -1
- package/src/tasks/package-manager/add-dev-dependency.js +4 -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/collection.d.ts.map +1 -1
- package/src/utility/collection.js +1 -1
- package/src/utility/collection.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/dependencies.js +1 -1
- package/src/utility/dependencies.js.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 +1 -0
- package/src/utility/index.d.ts.map +1 -1
- package/src/utility/index.js +1 -0
- package/src/utility/index.js.map +1 -1
- package/src/utility/loaders.d.ts +6 -1
- package/src/utility/loaders.d.ts.map +1 -1
- package/src/utility/loaders.js +10 -2
- package/src/utility/loaders.js.map +1 -1
- package/src/utility/matching-peers.d.ts.map +1 -1
- package/src/utility/matching-peers.js +1 -1
- package/src/utility/matching-peers.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-imports.d.ts.map +1 -1
- package/src/utility/update-imports.js +17 -7
- package/src/utility/update-imports.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.map +1 -1
- package/src/utility/wrapper.js +49 -3
- package/src/utility/wrapper.js.map +1 -1
- 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
package/src/utility/wrapper.js
CHANGED
@@ -1,19 +1,65 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.createSchematicWithMetricsIfInstalled = void 0;
|
4
|
+
const prompt_1 = require("@angular/cli/src/utilities/prompt");
|
5
|
+
const dependencies_1 = require("@schematics/angular/utility/dependencies");
|
6
|
+
const node_fs_1 = require("node:fs");
|
7
|
+
const path = require("node:path");
|
8
|
+
const rxjs_1 = require("rxjs");
|
9
|
+
const index_1 = require("../tasks/index");
|
4
10
|
const noopSchematicWrapper = (fn) => fn;
|
5
11
|
/**
|
6
12
|
* Wrapper method of a schematic to retrieve some metrics around the schematic run
|
7
13
|
* if @o3r/telemetry is installed
|
8
14
|
* @param schematicFn
|
9
15
|
*/
|
10
|
-
const createSchematicWithMetricsIfInstalled = (schematicFn) => (opts) => async () => {
|
16
|
+
const createSchematicWithMetricsIfInstalled = (schematicFn) => (opts) => async (tree, context) => {
|
11
17
|
let wrapper = noopSchematicWrapper;
|
18
|
+
const packageJsonPath = 'package.json';
|
19
|
+
const packageJson = tree.exists(packageJsonPath) ? tree.readJson(packageJsonPath) : {};
|
12
20
|
try {
|
13
21
|
const { createSchematicWithMetrics } = await Promise.resolve().then(() => require('@o3r/telemetry'));
|
14
|
-
|
22
|
+
if (packageJson.config?.o3rMetrics) {
|
23
|
+
wrapper = createSchematicWithMetrics;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
catch (e) {
|
27
|
+
// Do not throw if `@o3r/telemetry is not installed
|
28
|
+
if (packageJson.config?.o3rMetrics) {
|
29
|
+
context.logger.warn('`config.o3rMetrics` is set to true in your package.json, please install the telemetry package with `ng add @o3r/telemetry` to enable the collection of metrics.');
|
30
|
+
}
|
31
|
+
else if (context.interactive && packageJson.config?.o3rMetrics !== false) {
|
32
|
+
context.logger.debug('`@o3r/telemetry` is not available.\nAsking to add the dependency\n' + e.toString());
|
33
|
+
const isReplyPositive = await (0, prompt_1.askConfirmation)(`
|
34
|
+
Would you like to share anonymous data about the usage of Otter builders and schematics with the Otter Team at Amadeus ?
|
35
|
+
It will help us to improve our tools.
|
36
|
+
For more details and instructions on how to change these settings, see https://github.com/AmadeusITGroup/otter/blob/main/docs/telemetry/README.md.
|
37
|
+
`, false);
|
38
|
+
if (isReplyPositive) {
|
39
|
+
const version = JSON.parse((0, node_fs_1.readFileSync)(path.join(__dirname, '..', '..', 'package.json'), 'utf-8')).version;
|
40
|
+
context.addTask(new index_1.NodePackageNgAddTask('@o3r/telemetry', {
|
41
|
+
dependencyType: dependencies_1.NodeDependencyType.Dev,
|
42
|
+
version
|
43
|
+
}));
|
44
|
+
await (0, rxjs_1.lastValueFrom)(context.engine.executePostTasks());
|
45
|
+
try {
|
46
|
+
const { createSchematicWithMetrics } = await Promise.resolve().then(() => require('@o3r/telemetry'));
|
47
|
+
wrapper = createSchematicWithMetrics;
|
48
|
+
}
|
49
|
+
catch {
|
50
|
+
// If pnp context package installed in the same process will not be available
|
51
|
+
}
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
context.logger.info('You can activate it at any time by running `ng add @o3r/telemetry`.');
|
55
|
+
packageJson.config ||= {};
|
56
|
+
packageJson.config.o3rMetrics = false;
|
57
|
+
if (tree.exists(packageJsonPath)) {
|
58
|
+
tree.overwrite(packageJsonPath, JSON.stringify(packageJson, null, 2));
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
15
62
|
}
|
16
|
-
catch { }
|
17
63
|
return wrapper(schematicFn)(opts);
|
18
64
|
};
|
19
65
|
exports.createSchematicWithMetricsIfInstalled = createSchematicWithMetricsIfInstalled;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../../src/utility/wrapper.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"wrapper.js","sourceRoot":"","sources":["../../../src/utility/wrapper.ts"],"names":[],"mappings":";;;AACA,8DAAoE;AAEpE,2EAA8E;AAC9E,qCAAuC;AACvC,kCAAkC;AAClC,+BAAqC;AACrC,0CAAsD;AAEtD,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,IAAI,EAAE,OAAO,EAAE,EAAE;IACxH,IAAI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vD,IAAI;oBACF,MAAM,EAAE,0BAA0B,EAAE,GAAG,2CAAa,gBAAgB,EAAC,CAAC;oBACtE,OAAO,GAAG,0BAA0B,CAAC;iBACtC;gBAAC,MAAM;oBACN,6EAA6E;iBAC9E;aACF;iBAAM;gBACL,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,qEAAqE,CAAC,CAAC;gBAE3F,WAAW,CAAC,MAAM,KAAK,EAAE,CAAC;gBACzB,WAAW,CAAC,MAAqB,CAAC,UAAU,GAAG,KAAK,CAAC;gBAEtD,IAAI,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE;oBAChC,IAAI,CAAC,SAAS,CACZ,eAAe,EACf,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CACrC,CAAC;iBACH;aACF;SACF;KACF;IACD,OAAO,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;AACpC,CAAC,CAAC;AA5DW,QAAA,qCAAqC,yCA4DhD"}
|
@@ -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"}
|