@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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../cli/environment.ts"],"names":[],"mappings":""}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const index_1 = require("../utility/index");
|
3
|
+
const index_1 = require("../src/utility/index");
|
4
4
|
console.info(`Environment information: ${(0, index_1.getEnvironmentInfoStringify)()}`);
|
5
5
|
//# sourceMappingURL=environment.js.map
|
package/cli/package.json
ADDED
package/package.json
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
{
|
2
2
|
"name": "@o3r/schematics",
|
3
|
-
"version": "10.0.0-prerelease.
|
3
|
+
"version": "10.0.0-prerelease.81",
|
4
|
+
"publishConfig": {
|
5
|
+
"access": "public"
|
6
|
+
},
|
4
7
|
"description": "Schematics module of the Otter framework",
|
5
8
|
"main": "./src/public_api.js",
|
6
9
|
"typings": "./src/public_api.d.ts",
|
@@ -12,22 +15,26 @@
|
|
12
15
|
"nx": "nx",
|
13
16
|
"ng": "yarn nx",
|
14
17
|
"build": "yarn nx build schematics",
|
15
|
-
"postbuild": "patch-package-json-main",
|
18
|
+
"postbuild": "yarn cpy 'package.json' dist && patch-package-json-main",
|
16
19
|
"prepare:publish": "prepare-publish ./dist",
|
17
20
|
"prepare:build:builders": "yarn cpy 'schematics/**/*.json' dist/schematics && yarn cpy 'collection.json' dist",
|
18
|
-
"build:
|
21
|
+
"build:source": "tsc -b tsconfig.build.json --pretty",
|
22
|
+
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest",
|
23
|
+
"build:cli": "tsc -b tsconfig.cli.json --pretty && yarn generate-cjs-manifest"
|
19
24
|
},
|
20
25
|
"bin": {
|
21
|
-
"environment": "
|
26
|
+
"o3r-environment": "./cli/environment.js"
|
22
27
|
},
|
23
28
|
"peerDependencies": {
|
24
29
|
"@angular-devkit/architect": "~0.1700.0",
|
25
30
|
"@angular-devkit/core": "~17.0.0",
|
26
31
|
"@angular-devkit/schematics": "~17.0.0",
|
27
32
|
"@angular/cli": "~17.0.0",
|
33
|
+
"@o3r/telemetry": "^10.0.0-prerelease.81",
|
28
34
|
"@schematics/angular": "~17.0.0",
|
29
35
|
"eslint": "^8.42.0",
|
30
36
|
"rxjs": "^7.8.1",
|
37
|
+
"type-fest": "^4.10.2",
|
31
38
|
"typescript": "~5.2.2"
|
32
39
|
},
|
33
40
|
"peerDependenciesMeta": {
|
@@ -37,6 +44,9 @@
|
|
37
44
|
"@angular-devkit/core": {
|
38
45
|
"optional": true
|
39
46
|
},
|
47
|
+
"@o3r/telemetry": {
|
48
|
+
"optional": true
|
49
|
+
},
|
40
50
|
"eslint": {
|
41
51
|
"optional": true
|
42
52
|
}
|
@@ -53,6 +63,7 @@
|
|
53
63
|
"@angular-devkit/core": "~17.0.3",
|
54
64
|
"@angular-devkit/schematics": "~17.0.3",
|
55
65
|
"@angular-eslint/eslint-plugin": "~17.2.0",
|
66
|
+
"@angular/animations": "~17.0.4",
|
56
67
|
"@angular/cli": "~17.0.3",
|
57
68
|
"@angular/common": "~17.0.4",
|
58
69
|
"@angular/compiler": "~17.0.4",
|
@@ -63,33 +74,36 @@
|
|
63
74
|
"@babel/core": "~7.23.0",
|
64
75
|
"@babel/preset-typescript": "~7.23.0",
|
65
76
|
"@compodoc/compodoc": "^1.1.19",
|
66
|
-
"@nx/eslint": "~
|
67
|
-
"@nx/eslint-plugin": "~
|
68
|
-
"@nx/jest": "~
|
69
|
-
"@nx/js": "~
|
70
|
-
"@o3r/build-helpers": "^10.0.0-prerelease.
|
71
|
-
"@o3r/eslint-plugin": "^10.0.0-prerelease.
|
77
|
+
"@nx/eslint": "~18.0.2",
|
78
|
+
"@nx/eslint-plugin": "~18.0.2",
|
79
|
+
"@nx/jest": "~18.0.2",
|
80
|
+
"@nx/js": "~18.0.2",
|
81
|
+
"@o3r/build-helpers": "^10.0.0-prerelease.81",
|
82
|
+
"@o3r/eslint-plugin": "^10.0.0-prerelease.81",
|
83
|
+
"@o3r/telemetry": "^10.0.0-prerelease.81",
|
72
84
|
"@schematics/angular": "~17.0.3",
|
85
|
+
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
73
86
|
"@types/jest": "~29.5.2",
|
74
87
|
"@types/node": "^20.0.0",
|
75
88
|
"@types/semver": "^7.3.13",
|
76
|
-
"@typescript-eslint/eslint-plugin": "^
|
77
|
-
"@typescript-eslint/parser": "^
|
89
|
+
"@typescript-eslint/eslint-plugin": "^7.0.1",
|
90
|
+
"@typescript-eslint/parser": "^7.0.1",
|
78
91
|
"cpy-cli": "^5.0.0",
|
79
92
|
"eslint": "^8.42.0",
|
80
93
|
"eslint-import-resolver-node": "^0.3.4",
|
81
94
|
"eslint-plugin-jest": "~27.6.0",
|
82
95
|
"eslint-plugin-jsdoc": "~48.0.0",
|
83
96
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
84
|
-
"eslint-plugin-unicorn": "^
|
97
|
+
"eslint-plugin-unicorn": "^51.0.0",
|
85
98
|
"jest": "~29.7.0",
|
86
99
|
"jest-junit": "~16.0.0",
|
87
100
|
"jsonc-eslint-parser": "~2.4.0",
|
88
101
|
"jsonschema": "~1.4.1",
|
89
|
-
"nx": "~
|
102
|
+
"nx": "~18.0.2",
|
90
103
|
"rxjs": "^7.8.1",
|
91
104
|
"ts-jest": "~29.1.1",
|
92
|
-
"
|
105
|
+
"ts-node": "~10.9.1",
|
106
|
+
"type-fest": "^4.10.2",
|
93
107
|
"typescript": "~5.2.2",
|
94
108
|
"zone.js": "~0.14.2"
|
95
109
|
},
|
@@ -97,7 +111,6 @@
|
|
97
111
|
"node": ">=18.0.0"
|
98
112
|
},
|
99
113
|
"schematics": "./collection.json",
|
100
|
-
"type": "commonjs",
|
101
114
|
"contributors": [
|
102
115
|
{
|
103
116
|
"name": "Yannick Adam",
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { Rule } from '@angular-devkit/schematics';
|
2
|
+
import type { NgAddSchematicsSchema } from './schema';
|
2
3
|
/**
|
3
4
|
* Add Otter schematics to an Angular Project
|
4
5
|
*/
|
5
|
-
export declare
|
6
|
+
export declare const ngAdd: (options: NgAddSchematicsSchema) => Rule;
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAM/E;;GAEG;AACH,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAM/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAmCtD;;GAEG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
|
@@ -4,19 +4,21 @@ exports.ngAdd = void 0;
|
|
4
4
|
const fs = require("node:fs");
|
5
5
|
const path = require("node:path");
|
6
6
|
const rxjs_1 = require("rxjs");
|
7
|
+
const public_api_1 = require("../../src/public_api");
|
7
8
|
/**
|
8
9
|
* Add Otter schematics to an Angular Project
|
10
|
+
* @param options schematics options
|
9
11
|
*/
|
10
|
-
function
|
12
|
+
function ngAddFn(options) {
|
11
13
|
const schematicsDependencies = ['@angular-devkit/architect', '@angular-devkit/schematics', '@angular-devkit/core', '@schematics/angular', 'globby'];
|
12
|
-
return async (tree, context) => {
|
13
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
14
|
-
const { AddDevInstall } = await Promise.resolve().then(() => require('@o3r/schematics'));
|
14
|
+
return () => async (tree, context) => {
|
15
15
|
context.logger.info('Running ng add for schematics');
|
16
16
|
const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
|
17
17
|
const treePackageJson = tree.readJson('./package.json');
|
18
18
|
const packageJsonContent = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }));
|
19
19
|
const getDependencyVersion = (dependency) => packageJsonContent?.dependencies?.[dependency] || packageJsonContent?.peerDependencies?.[dependency];
|
20
|
+
const workspaceProject = options.projectName ? (0, public_api_1.getWorkspaceConfig)(tree)?.projects[options.projectName] : undefined;
|
21
|
+
const workingDirectory = workspaceProject?.root || '.';
|
20
22
|
let packageName = '';
|
21
23
|
for (const dependency of schematicsDependencies) {
|
22
24
|
const version = getDependencyVersion(dependency);
|
@@ -24,9 +26,10 @@ function ngAdd() {
|
|
24
26
|
treePackageJson.devDependencies = { ...treePackageJson.devDependencies, [dependency]: version };
|
25
27
|
packageName = `${packageName} ${dependency}${version ? '@' + version : ''}`;
|
26
28
|
}
|
27
|
-
context.addTask(new AddDevInstall({
|
29
|
+
context.addTask(new public_api_1.AddDevInstall({
|
28
30
|
hideOutput: false,
|
29
31
|
packageName,
|
32
|
+
workingDirectory,
|
30
33
|
quiet: false
|
31
34
|
}));
|
32
35
|
await (0, rxjs_1.lastValueFrom)(context.engine.executePostTasks());
|
@@ -34,5 +37,8 @@ function ngAdd() {
|
|
34
37
|
return () => tree;
|
35
38
|
};
|
36
39
|
}
|
37
|
-
|
40
|
+
/**
|
41
|
+
* Add Otter schematics to an Angular Project
|
42
|
+
*/
|
43
|
+
exports.ngAdd = (0, public_api_1.createSchematicWithMetricsIfInstalled)(ngAddFn);
|
38
44
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAElE,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAClE,mBAAmB;IACnB,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC"}
|
@@ -1 +1 @@
|
|
1
|
-
{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Ac,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
package/src/interfaces/index.js
CHANGED
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
tslib_1.__exportStar(require("./angular-workspace"), exports);
|
5
5
|
tslib_1.__exportStar(require("./schematic-option"), exports);
|
6
|
+
tslib_1.__exportStar(require("./rule-factories"), exports);
|
6
7
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC;AACnC,2DAAiC"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { Rule } from '@angular-devkit/schematics';
|
1
|
+
import type { Rule } from '@angular-devkit/schematics';
|
2
2
|
/** Rule Factory prototype */
|
3
3
|
export type RuleFactory = (options: {
|
4
4
|
[k: string]: unknown;
|
5
5
|
}, rootPath: string) => Rule;
|
6
|
-
//# sourceMappingURL=
|
6
|
+
//# sourceMappingURL=rule-factories.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rule-factories.d.ts","sourceRoot":"","sources":["../../../src/interfaces/rule-factories.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEvD,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"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rule-factories.js","sourceRoot":"","sources":["../../../src/interfaces/rule-factories.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modules.display.rule.d.ts","sourceRoot":"","sources":["../../../src/modules/modules.display.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAMvD,0CAA0C;AAC1C,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAAC;IAC7C;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,cAAc,EAAE,OAAO,CAAC;IACxB,oEAAoE;IACpE,uBAAuB,EAAE,OAAO,CAAC;IACjC,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,IAAI,
|
1
|
+
{"version":3,"file":"modules.display.rule.d.ts","sourceRoot":"","sources":["../../../src/modules/modules.display.rule.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAMvD,0CAA0C;AAC1C,MAAM,WAAW,wBAAwB;IACvC;;;OAGG;IACH,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAAC;IAC7C;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB,6DAA6D;IAC7D,cAAc,EAAE,OAAO,CAAC;IACxB,oEAAoE;IACpE,uBAAuB,EAAE,OAAO,CAAC;IACjC,8DAA8D;IAC9D,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAgCvF"}
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.displayModuleListRule = void 0;
|
4
4
|
const node_os_1 = require("node:os");
|
5
5
|
const modules_constants_1 = require("./modules.constants");
|
6
|
-
const
|
6
|
+
const index_1 = require("../utility/index");
|
7
7
|
const modules_helpers_1 = require("./modules.helpers");
|
8
8
|
/**
|
9
9
|
* Display the list of available Otter modules
|
@@ -14,8 +14,7 @@ function displayModuleListRule(options) {
|
|
14
14
|
const keyword = options?.keyword || modules_constants_1.OTTER_MODULE_KEYWORD;
|
15
15
|
return async (tree, context) => {
|
16
16
|
const tagMap = { [modules_constants_1.OTTER_KEYWORD_CMS]: 'CMS enabler' };
|
17
|
-
|
18
|
-
const workspaceConfig = (0, utility_1.getWorkspaceConfig)(tree);
|
17
|
+
const workspaceConfig = (0, index_1.getWorkspaceConfig)(tree);
|
19
18
|
try {
|
20
19
|
const modules = await (0, modules_helpers_1.getAvailableModulesWithLatestPackage)(keyword, {
|
21
20
|
scopeWhitelist,
|
@@ -25,7 +24,7 @@ function displayModuleListRule(options) {
|
|
25
24
|
});
|
26
25
|
const message = modules
|
27
26
|
.filter((mod) => !options?.onlyCmsModules || mod.keywords?.includes(modules_constants_1.OTTER_KEYWORD_CMS))
|
28
|
-
.map((mod) => (0, modules_helpers_1.formatModuleDescription)(mod, (0,
|
27
|
+
.map((mod) => (0, modules_helpers_1.formatModuleDescription)(mod, (0, index_1.getPackageManagerExecutor)(workspaceConfig, options?.packageName), tagMap))
|
29
28
|
.filter((msg) => !!msg)
|
30
29
|
.join(node_os_1.EOL + node_os_1.EOL);
|
31
30
|
if (message) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modules.display.rule.js","sourceRoot":"","sources":["../../../src/modules/modules.display.rule.ts"],"names":[],"mappings":";;;AACA,qCAA8B;AAC9B,2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,CAAC,MAAM,CAAC,IAAI,CAAC,iGAAiG,CAAC,CAAC;gBACvH,qEAAqE;gBACrE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,aAAG,GAAG,OAAO,CAAC,CAAC;aACpC;SACF;QAAC,OAAO,CAAM,EAAE;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,EAAE,CAAC,CAAC,CAAC;YAC7D,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;SAC3D;QACD,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAhCD,sDAgCC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { NpmRegistryPackage } from './modules.constants';
|
2
2
|
import type { logging } from '@angular-devkit/core';
|
3
|
-
import { PackageManagerOptions } from '../utility';
|
3
|
+
import { type PackageManagerOptions } from '../utility/index';
|
4
4
|
/**
|
5
5
|
* Determine if the given keyword is an Otter tag
|
6
6
|
* @param keyword Keyword to identify
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modules.helpers.d.ts","sourceRoot":"","sources":["../../../src/modules/modules.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuH,MAAM,qBAAqB,CAAC;AAG9K,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAUpD,OAAO,EAAqB,qBAAqB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"modules.helpers.d.ts","sourceRoot":"","sources":["../../../src/modules/modules.helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAuH,MAAM,qBAAqB,CAAC;AAG9K,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAUpD,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAkDjF;;;;GAIG;AACH,eAAO,MAAM,UAAU,0CAA2C,GAAG,+EAGpE,CAAC;AAEF,+CAA+C;AAC/C,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAsBxK;AAED,gEAAgE;AAChE,MAAM,WAAW,uCAAwC,SAAQ,sBAAsB;IACrF;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,MAAM,EAAE,CAAC;CAC/C;AAED;;;;;GAKG;AACH,wBAAsB,oCAAoC,CAAC,OAAO,oBAA+B,EAAE,OAAO,EAAE,uCAAuC,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAoBlL;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACnC,UAAU,EAAE,kBAAkB,EAC9B,MAAM,SAAQ,EACd,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACxC,MAAM,CAAC,EAAE,OAAO,CAAC,SAAS,UA8B7B"}
|
@@ -11,7 +11,7 @@ const path = require("node:path");
|
|
11
11
|
const node_util_1 = require("node:util");
|
12
12
|
const node_child_process_1 = require("node:child_process");
|
13
13
|
const chalk = require("chalk");
|
14
|
-
const
|
14
|
+
const index_1 = require("../utility/index");
|
15
15
|
const DEFAULT_NPM_REGISTRY = 'registry.npmjs.org';
|
16
16
|
async function promiseGetRequest(url) {
|
17
17
|
const res = await new Promise((resolve, reject) => (0, node_https_1.get)(url, resolve)
|
@@ -31,7 +31,7 @@ async function promiseGetRequest(url) {
|
|
31
31
|
* @param logger
|
32
32
|
*/
|
33
33
|
async function npmSearchExec(search, packageManagerOptions, logger) {
|
34
|
-
const manager = (0,
|
34
|
+
const manager = (0, index_1.getPackageManager)(packageManagerOptions);
|
35
35
|
switch (manager) {
|
36
36
|
case 'npm': {
|
37
37
|
const remoteModulesPromise = (0, node_util_1.promisify)(node_child_process_1.execFile)('npm', ['search', search, '--json']);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modules.helpers.js","sourceRoot":"","sources":["../../../src/modules/modules.helpers.ts"],"names":[],"mappings":";;;AAAA,2DAA8K;AAI9K,gEAAoE;AACpE,mCAAmC;AACnC,2CAAiC;AACjC,qCAA8B;AAC9B,8BAA8B;AAC9B,kCAAkC;AAClC,yCAAsC;AACtC,2DAA8C;AAC9C,+BAA+B;AAC/B,
|
1
|
+
{"version":3,"file":"modules.helpers.js","sourceRoot":"","sources":["../../../src/modules/modules.helpers.ts"],"names":[],"mappings":";;;AAAA,2DAA8K;AAI9K,gEAAoE;AACpE,mCAAmC;AACnC,2CAAiC;AACjC,qCAA8B;AAC9B,8BAA8B;AAC9B,kCAAkC;AAClC,yCAAsC;AACtC,2DAA8C;AAC9C,+BAA+B;AAC/B,4CAAiF;AAEjF,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAElD,KAAK,UAAU,iBAAiB,CAAuB,GAAW;IAChE,MAAM,GAAG,GAAG,MAAM,IAAI,OAAO,CAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,IAAA,gBAAG,EAAC,GAAG,EAAE,OAAO,CAAC;SAClF,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAEtC,OAAO,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACxC,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAA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EAAE,CAAC;QAC7F,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KAC3F,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,aAAG,CAAC,CAAC;AACzB,CAAC;AAlCD,0DAkCC"}
|
package/src/public_api.d.ts
CHANGED
@@ -1,2 +1,7 @@
|
|
1
|
-
export * from './index';
|
1
|
+
export * from './interfaces/index';
|
2
|
+
export * from './rule-factories/index';
|
3
|
+
export * from './rules/index';
|
4
|
+
export * from './tasks/index';
|
5
|
+
export * from './utility/index';
|
6
|
+
export * from './modules/index';
|
2
7
|
//# sourceMappingURL=public_api.d.ts.map
|
package/src/public_api.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":"AAAA,cAAc,
|
1
|
+
{"version":3,"file":"public_api.d.ts","sourceRoot":"","sources":["../../src/public_api.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/public_api.js
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const tslib_1 = require("tslib");
|
4
|
-
tslib_1.__exportStar(require("./index"), exports);
|
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);
|
5
10
|
//# sourceMappingURL=public_api.js.map
|
package/src/public_api.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"public_api.js","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"public_api.js","sourceRoot":"","sources":["../../src/public_api.ts"],"names":[],"mappings":";;;AAAA,6DAAmC;AACnC,iEAAuC;AACvC,wDAA8B;AAC9B,wDAA8B;AAC9B,0DAAgC;AAChC,0DAAgC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/add-imports/index.ts"],"names":[],"mappings":";;;AACA,qEAAqE;AACrE,+
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/add-imports/index.ts"],"names":[],"mappings":";;;AACA,qEAAqE;AACrE,+DAAwF;AACxF,iCAAiC;AAEjC;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAC5B,QAAgB,EAChB,OAGG,EACG,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IAC3B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAC1B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,qCAAqC,QAAQ,kBAAkB,CAAC,CAAC;QACrF,OAAO;KACR;IACD,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACpC,QAAQ,EACR,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACvB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,GAAa,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CACjF,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAA,wBAAY,EAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CACtF,EAAE,EAAE,CAAC,CAAC;IACP,IAAA,8BAAqB,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACzC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAxBW,QAAA,cAAc,kBAwBzB"}
|
@@ -4,11 +4,11 @@ exports.registerDevtoolsToApplication = exports.injectServiceInMain = void 0;
|
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
5
5
|
const ts = require("typescript");
|
6
6
|
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
7
|
+
const index_1 = require("../../utility/index");
|
7
8
|
const utility_1 = require("../../utility");
|
8
|
-
const utility_2 = require("../../utility");
|
9
9
|
const change_1 = require("@schematics/angular/utility/change");
|
10
10
|
const registerModule = (options) => (tree, context) => {
|
11
|
-
const moduleFilePath = (0,
|
11
|
+
const moduleFilePath = (0, index_1.getAppModuleFilePath)(tree, context, options.projectName);
|
12
12
|
if (!moduleFilePath) {
|
13
13
|
return tree;
|
14
14
|
}
|
@@ -18,8 +18,8 @@ const registerModule = (options) => (tree, context) => {
|
|
18
18
|
return tree;
|
19
19
|
}
|
20
20
|
let recorder = tree.beginUpdate(moduleFilePath);
|
21
|
-
const { moduleIndex } = (0,
|
22
|
-
const addImportToModuleFile = (name, file, moduleFunction) => recorder = (0,
|
21
|
+
const { moduleIndex } = (0, index_1.getModuleIndex)(sourceFile, sourceFileContent);
|
22
|
+
const addImportToModuleFile = (name, file, moduleFunction) => recorder = (0, utility_1.addImportToModuleFile)(name, file, sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, moduleFunction);
|
23
23
|
addImportToModuleFile(options.moduleName, options.packageName, '.instrument({isActivatedOnBootstrap: true})');
|
24
24
|
tree.commitUpdate(recorder);
|
25
25
|
return tree;
|
@@ -32,7 +32,7 @@ const injectServiceInMain = (options) => (tree, context) => {
|
|
32
32
|
if (!options.serviceName) {
|
33
33
|
return tree;
|
34
34
|
}
|
35
|
-
const mainFilePath = (0,
|
35
|
+
const mainFilePath = (0, index_1.getMainFilePath)(tree, context, options.projectName);
|
36
36
|
if (!mainFilePath || !tree.exists(mainFilePath)) {
|
37
37
|
return tree;
|
38
38
|
}
|
@@ -69,13 +69,13 @@ exports.injectServiceInMain = injectServiceInMain;
|
|
69
69
|
* @param options
|
70
70
|
*/
|
71
71
|
const registerDevtoolsToApplication = (options) => (tree, context) => {
|
72
|
-
const workspace = (0,
|
72
|
+
const workspace = (0, index_1.getWorkspaceConfig)(tree);
|
73
73
|
const project = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
74
74
|
if (!workspace || !project || project.projectType !== 'application') {
|
75
75
|
context.logger.warn(`Failed to determine the application to update, the devtool modules ${options.moduleName}.`);
|
76
76
|
return tree;
|
77
77
|
}
|
78
|
-
const schematicConfig = (0,
|
78
|
+
const schematicConfig = (0, index_1.getDefaultOptionsForSchematic)(workspace, options.packageName, 'ng-add', options);
|
79
79
|
if (!schematicConfig?.registerDevtool) {
|
80
80
|
return tree;
|
81
81
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"devtools-registration.js","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/devtools-registration.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AACzD,iCAAiC;AACjC,qEAAiF;AACjF
|
1
|
+
{"version":3,"file":"devtools-registration.js","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/devtools-registration.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AACzD,iCAAiC;AACjC,qEAA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AAO,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE1I,IAAI,CAAC,eAAe,EAAE,eAAe,EAAE;QACrC,OAAO,IAAI,CAAC;KACb;IAED,OAAO,IAAA,kBAAK,EAAC;QACX,cAAc,CAAC,OAAO,CAAC;QACvB,IAAA,2BAAmB,EAAC,OAAO,CAAC;QAC5B,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CACzB,uBAAuB,OAAO,CAAC,UAAU,mDAAmD,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,qCAAqC,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,CACtL;KACF,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AACpB,CAAC,CAAC;AAtBW,QAAA,6BAA6B,iCAsBxC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EAAiB,aAAa,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAE1F,OAAO,EAAiB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEjE;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,SAAM,EAAE,SAAS,GAAE,MAAM,EAAW,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAoE5G"}
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.applyEsLintFix = void 0;
|
4
4
|
const schematics_1 = require("@angular-devkit/schematics");
|
5
5
|
const node_path_1 = require("node:path");
|
6
|
-
const
|
6
|
+
const index_1 = require("../../tasks/index");
|
7
7
|
/**
|
8
8
|
* Apply EsLint fix
|
9
9
|
* @param prootPath Root path
|
@@ -49,12 +49,14 @@ function applyEsLintFix(_prootPath = '/', extension = ['ts'], options) {
|
|
49
49
|
You can consider to run later the following command to add otter linter rules: ng add @o3r/eslint-config-otter`);
|
50
50
|
}
|
51
51
|
const files = filesToBeLint.reduce((acc, filePath) => {
|
52
|
-
if (extension.some((ext) => filePath.endsWith(`.${ext}`)) && dir && filePath.startsWith(dir.path)) {
|
52
|
+
if (extension.some((ext) => filePath.endsWith(`.${ext}`)) && dir && filePath.startsWith(dir.path.substring(1))) {
|
53
53
|
acc.add(filePath);
|
54
54
|
}
|
55
55
|
return acc;
|
56
56
|
}, new Set());
|
57
|
-
|
57
|
+
if (files.size) {
|
58
|
+
context.addTask(new index_1.EslintFixTask(Array.from(files), undefined, eslintFile, linterOptions));
|
59
|
+
}
|
58
60
|
return tree;
|
59
61
|
};
|
60
62
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":";;;AAAA,2DAA0F;AAC1F,yCAA0C;AAC1C,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":";;;AAAA,2DAA0F;AAC1F,yCAA0C;AAC1C,6CAAiE;AAEjE;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,UAAU,GAAG,GAAG,EAAE,YAAsB,CAAC,IAAI,CAAC,EAAE,OAAuB;IACpG,IAAI;QACF,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;KACxC;IAAC,MAAM;QACN,OAAO,IAAA,iBAAI,GAAE,CAAC;KACf;IAED,MAAM,aAAa,GAAkB;QACnC,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,GAAG,OAAO;KACX,CAAC;I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,CAAC;+GACqF,CAAC,CAAC;SAC5G;QAED,MAAM,KAAK,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,GAAgB,EAAE,QAAQ,EAAE,EAAE;YAChE,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE;gBAC9G,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;aACnB;YAED,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,IAAI,GAAG,EAAU,CAAC,CAAC;QAEtB,IAAI,KAAK,CAAC,IAAI,EAAE;YACd,OAAO,CAAC,OAAO,CACb,IAAI,qBAAa,CACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,SAAS,EACT,UAAU,EACV,aAAa,CACd,CACF,CAAC;SACH;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AApED,wCAoEC"}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getTestFramework = void 0;
|
4
|
-
const
|
4
|
+
const index_1 = require("../../utility/index");
|
5
5
|
const testPackageMaps = {
|
6
6
|
'jest': ['jest'],
|
7
7
|
'jasmine': ['jasmine-core']
|
@@ -13,7 +13,7 @@ const testPackageMaps = {
|
|
13
13
|
*/
|
14
14
|
function getTestFramework(workspaceOptions, context) {
|
15
15
|
if (workspaceOptions) {
|
16
|
-
const testFramework = (0,
|
16
|
+
const testFramework = (0, index_1.getSchematicOptions)(workspaceOptions, context)?.testFramework;
|
17
17
|
if (testFramework) {
|
18
18
|
return testFramework;
|
19
19
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/get-test-frameworks/index.ts"],"names":[],"mappings":";;;AAEA
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/get-test-frameworks/index.ts"],"names":[],"mappings":";;;AAEA,+CAA0D;AAG1D,MAAM,eAAe,GAA8C;IACjE,MAAM,EAAE,CAAC,MAAM,CAAC;IAChB,SAAS,EAAE,CAAC,cAAc,CAAC;CAC5B,CAAC;AAEF;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,gBAAwC,EAAE,OAAyB;IAClG,IAAI,gBAAgB,EAAE;QACpB,MAAM,aAAa,GAAG,IAAA,2BAAmB,EAAC,gBAAgB,EAAE,OAAO,CAAC,EAAE,aAAa,CAAC;QACpF,IAAI,aAAa,EAAE;YACjB,OAAO,aAAa,CAAC;SACtB;KACF;IACD,OAAO,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;SACnC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,EAAE;QAClB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACvB,IAAI;gBACF,OAAO,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,eAAe,CAAC,CAAC;aACjD;YAAC,MAAM;gBACN,OAAO,KAAK,CAAC;aACd;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,EAAE,CAAC,CAAC,CAA4B,CAAC;AACvC,CAAC;AAjBD,4CAiBC"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
export * from './add-imports/index';
|
2
2
|
export * from './eslint-fix/index';
|
3
|
-
export * from '
|
3
|
+
export * from '../interfaces/rule-factories';
|
4
4
|
export * from './get-test-frameworks/index';
|
5
5
|
export * from './check-packages-peers/index';
|
6
6
|
export * from './ng-add/index';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC"}
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
tslib_1.__exportStar(require("./add-imports/index"), exports);
|
5
5
|
tslib_1.__exportStar(require("./eslint-fix/index"), exports);
|
6
|
-
tslib_1.__exportStar(require("
|
6
|
+
tslib_1.__exportStar(require("../interfaces/rule-factories"), exports);
|
7
7
|
tslib_1.__exportStar(require("./get-test-frameworks/index"), exports);
|
8
8
|
tslib_1.__exportStar(require("./check-packages-peers/index"), exports);
|
9
9
|
tslib_1.__exportStar(require("./ng-add/index"), exports);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC;AACnC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC;AACnC,uEAA6C;AAC7C,sEAA4C;AAC5C,uEAA6C;AAC7C,yDAA+B;AAC/B,kEAAwC;AACxC,iEAAuC;AACvC,oEAA0C;AAC1C,4DAAkC"}
|