@o3r/schematics 10.0.0-next.14 → 10.0.0-next.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +17 -12
- package/src/cli/environment.d.ts +2 -0
- package/src/cli/environment.d.ts.map +1 -0
- package/src/cli/environment.js +5 -0
- package/src/cli/environment.js.map +1 -0
- package/src/interfaces/angular-workspace.d.ts +16 -14
- package/src/interfaces/angular-workspace.d.ts.map +1 -1
- package/src/modules/modules.constants.d.ts +6 -2
- package/src/modules/modules.constants.d.ts.map +1 -1
- package/src/modules/modules.constants.js +5 -3
- package/src/modules/modules.constants.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 +4 -4
- package/src/rule-factories/check-packages-peers/index.js.map +1 -1
- package/src/rule-factories/dev-tools/devtools-registration.d.ts +20 -0
- package/src/rule-factories/dev-tools/devtools-registration.d.ts.map +1 -0
- package/src/rule-factories/dev-tools/devtools-registration.js +50 -0
- package/src/rule-factories/dev-tools/devtools-registration.js.map +1 -0
- package/src/rule-factories/dev-tools/index.d.ts +2 -0
- package/src/rule-factories/dev-tools/index.d.ts.map +1 -0
- package/src/rule-factories/dev-tools/index.js +5 -0
- package/src/rule-factories/dev-tools/index.js.map +1 -0
- package/src/rule-factories/eslint-fix/index.d.ts +1 -17
- package/src/rule-factories/eslint-fix/index.d.ts.map +1 -1
- package/src/rule-factories/eslint-fix/index.js +10 -24
- package/src/rule-factories/eslint-fix/index.js.map +1 -1
- package/src/rule-factories/index.d.ts +1 -0
- package/src/rule-factories/index.d.ts.map +1 -1
- package/src/rule-factories/index.js +1 -0
- package/src/rule-factories/index.js.map +1 -1
- package/src/rule-factories/ng-add/index.d.ts +2 -5
- package/src/rule-factories/ng-add/index.d.ts.map +1 -1
- package/src/rule-factories/ng-add/index.js +107 -83
- package/src/rule-factories/ng-add/index.js.map +1 -1
- package/src/tasks/eslint/index.d.ts +26 -1
- package/src/tasks/eslint/index.d.ts.map +1 -1
- package/src/tasks/eslint/index.js +15 -5
- package/src/tasks/eslint/index.js.map +1 -1
- package/src/utility/collection.d.ts +2 -5
- package/src/utility/collection.d.ts.map +1 -1
- package/src/utility/collection.js +11 -9
- package/src/utility/collection.js.map +1 -1
- package/src/utility/component.d.ts.map +1 -1
- package/src/utility/component.js +4 -3
- package/src/utility/component.js.map +1 -1
- package/src/utility/environment.d.ts +27 -0
- package/src/utility/environment.d.ts.map +1 -0
- package/src/utility/environment.js +51 -0
- package/src/utility/environment.js.map +1 -0
- package/src/utility/error.d.ts +7 -0
- package/src/utility/error.d.ts.map +1 -0
- package/src/utility/error.js +17 -0
- package/src/utility/error.js.map +1 -0
- package/src/utility/generation.d.ts +0 -1
- package/src/utility/generation.d.ts.map +1 -1
- package/src/utility/generation.js +7 -11
- package/src/utility/generation.js.map +1 -1
- package/src/utility/index.d.ts +9 -7
- package/src/utility/index.d.ts.map +1 -1
- package/src/utility/index.js +9 -7
- package/src/utility/index.js.map +1 -1
- package/src/utility/loaders.d.ts +19 -17
- package/src/utility/loaders.d.ts.map +1 -1
- package/src/utility/loaders.js +38 -18
- package/src/utility/loaders.js.map +1 -1
- package/src/utility/modules.d.ts +2 -7
- package/src/utility/modules.d.ts.map +1 -1
- package/src/utility/modules.js +5 -10
- package/src/utility/modules.js.map +1 -1
- package/src/utility/package-manager-runner.d.ts +16 -1
- package/src/utility/package-manager-runner.d.ts.map +1 -1
- package/src/utility/package-manager-runner.js +39 -1
- package/src/utility/package-manager-runner.js.map +1 -1
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
<h1 align="center">Otter schematics</h1>
|
2
2
|
<p align="center">
|
3
|
-
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main
|
3
|
+
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
|
4
4
|
</p>
|
5
5
|
|
6
6
|
This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/otter/tree/main/docs/core/MODULE.md).
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@o3r/schematics",
|
3
|
-
"version": "10.0.0-next.
|
3
|
+
"version": "10.0.0-next.16",
|
4
4
|
"description": "Schematics module of the Otter framework",
|
5
5
|
"main": "./src/public_api.js",
|
6
6
|
"keywords": [
|
@@ -16,6 +16,9 @@
|
|
16
16
|
"prepare:build:builders": "yarn cpy 'schematics/**/*.json' dist/schematics && yarn cpy 'collection.json' dist",
|
17
17
|
"build:builders": "tsc -b tsconfig.builders.json --pretty && yarn generate-cjs-manifest"
|
18
18
|
},
|
19
|
+
"bin": {
|
20
|
+
"environment": "src/cli/environment.js"
|
21
|
+
},
|
19
22
|
"peerDependencies": {
|
20
23
|
"@angular-devkit/architect": "~0.1602.0",
|
21
24
|
"@angular-devkit/core": "~16.2.0",
|
@@ -36,7 +39,7 @@
|
|
36
39
|
"dependencies": {
|
37
40
|
"chalk": "^4.1.2",
|
38
41
|
"globby": "^11.1.0",
|
39
|
-
"minimatch": "
|
42
|
+
"minimatch": "~9.0.3",
|
40
43
|
"semver": "^7.5.2",
|
41
44
|
"tslib": "^2.5.3"
|
42
45
|
},
|
@@ -44,7 +47,7 @@
|
|
44
47
|
"@angular-devkit/build-angular": "~16.2.0",
|
45
48
|
"@angular-devkit/core": "~16.2.0",
|
46
49
|
"@angular-devkit/schematics": "~16.2.0",
|
47
|
-
"@angular-eslint/eslint-plugin": "~16.
|
50
|
+
"@angular-eslint/eslint-plugin": "~16.2.0",
|
48
51
|
"@angular/cli": "~16.2.0",
|
49
52
|
"@angular/common": "~16.2.0",
|
50
53
|
"@angular/compiler": "~16.2.0",
|
@@ -52,30 +55,32 @@
|
|
52
55
|
"@angular/core": "~16.2.0",
|
53
56
|
"@angular/platform-browser": "~16.2.0",
|
54
57
|
"@angular/platform-browser-dynamic": "~16.2.0",
|
55
|
-
"@babel/core": "~7.
|
56
|
-
"@babel/preset-typescript": "~7.
|
58
|
+
"@babel/core": "~7.23.0",
|
59
|
+
"@babel/preset-typescript": "~7.23.0",
|
57
60
|
"@compodoc/compodoc": "^1.1.19",
|
61
|
+
"@nx/eslint-plugin": "~16.8.0",
|
58
62
|
"@nx/jest": "~16.8.0",
|
59
63
|
"@nx/js": "~16.8.0",
|
60
64
|
"@nx/linter": "~16.8.0",
|
61
|
-
"@o3r/build-helpers": "^10.0.0-next.
|
62
|
-
"@o3r/dev-tools": "^10.0.0-next.
|
63
|
-
"@o3r/eslint-plugin": "^10.0.0-next.
|
65
|
+
"@o3r/build-helpers": "^10.0.0-next.16",
|
66
|
+
"@o3r/dev-tools": "^10.0.0-next.16",
|
67
|
+
"@o3r/eslint-plugin": "^10.0.0-next.16",
|
64
68
|
"@schematics/angular": "~16.2.0",
|
65
69
|
"@types/jest": "~29.5.2",
|
66
70
|
"@types/node": "^18.0.0",
|
67
71
|
"@types/semver": "^7.3.13",
|
68
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
69
|
-
"@typescript-eslint/parser": "^5.
|
72
|
+
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
73
|
+
"@typescript-eslint/parser": "^5.60.1",
|
70
74
|
"cpy-cli": "^4.2.0",
|
71
75
|
"eslint": "^8.42.0",
|
72
76
|
"eslint-import-resolver-node": "^0.3.4",
|
73
|
-
"eslint-plugin-jest": "~27.
|
77
|
+
"eslint-plugin-jest": "~27.4.0",
|
74
78
|
"eslint-plugin-jsdoc": "~46.8.0",
|
75
79
|
"eslint-plugin-prefer-arrow": "~1.2.3",
|
76
80
|
"eslint-plugin-unicorn": "^47.0.0",
|
77
81
|
"jest": "~29.7.0",
|
78
82
|
"jest-junit": "~16.0.0",
|
83
|
+
"jsonc-eslint-parser": "~2.3.0",
|
79
84
|
"jsonschema": "~1.4.1",
|
80
85
|
"nx": "~16.8.0",
|
81
86
|
"rxjs": "^7.8.1",
|
@@ -85,7 +90,7 @@
|
|
85
90
|
"zone.js": "~0.13.1"
|
86
91
|
},
|
87
92
|
"engines": {
|
88
|
-
"node": ">=
|
93
|
+
"node": ">=18.0.0"
|
89
94
|
},
|
90
95
|
"schematics": "./collection.json",
|
91
96
|
"type": "commonjs",
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/cli/environment.ts"],"names":[],"mappings":""}
|
@@ -0,0 +1 @@
|
|
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"}
|
@@ -18,47 +18,49 @@ export interface WorkspaceLayout {
|
|
18
18
|
appsDir: string;
|
19
19
|
}
|
20
20
|
export interface WorkspaceSchematics extends SchematicOptions {
|
21
|
-
/** @deprecated */
|
21
|
+
/** @deprecated will be removed in v10 */
|
22
22
|
'@otter/ng-tools:api-service'?: {
|
23
23
|
path: string;
|
24
24
|
};
|
25
|
-
/** @deprecated */
|
25
|
+
/** @deprecated will be removed in v10 */
|
26
26
|
'@otter/ng-tools:component'?: {
|
27
27
|
path: string;
|
28
28
|
};
|
29
|
-
/** @deprecated */
|
29
|
+
/** @deprecated will be removed in v10 */
|
30
30
|
'@otter/ng-tools:service'?: {
|
31
31
|
path: string;
|
32
32
|
};
|
33
|
-
/** @deprecated */
|
33
|
+
/** @deprecated will be removed in v10 */
|
34
34
|
'@otter/ng-tools:store'?: {
|
35
35
|
path: string;
|
36
36
|
};
|
37
|
-
/** @deprecated */
|
37
|
+
/** @deprecated will be removed in v10*/
|
38
38
|
'@otter/ng-tools:schematics'?: {
|
39
39
|
path: string;
|
40
40
|
};
|
41
|
-
'@o3r/
|
41
|
+
'@o3r/core:component'?: {
|
42
42
|
path: string;
|
43
|
-
};
|
44
|
-
'@o3r/
|
43
|
+
} & WorkspaceSchematics['*:*'];
|
44
|
+
'@o3r/core:service'?: {
|
45
45
|
path: string;
|
46
|
-
};
|
47
|
-
'@o3r/
|
46
|
+
} & WorkspaceSchematics['*:*'];
|
47
|
+
'@o3r/core:store'?: {
|
48
48
|
path: string;
|
49
|
-
};
|
49
|
+
} & WorkspaceSchematics['*:*'];
|
50
50
|
'@o3r/core:schematics'?: {
|
51
51
|
path: string;
|
52
|
-
};
|
52
|
+
} & WorkspaceSchematics['*:*'];
|
53
53
|
'*:ng-add'?: {
|
54
54
|
enableMetadataExtract?: boolean;
|
55
|
-
|
55
|
+
registerDevtool?: boolean;
|
56
|
+
} & WorkspaceSchematics['*:*'];
|
56
57
|
'*:*'?: WorkspaceLayout & {
|
57
|
-
/** in
|
58
|
+
/** in addition to the WorkspaceLayout, an optional testFramework attribute is available */
|
58
59
|
testFramework?: AvailableTestFrameworks;
|
59
60
|
};
|
60
61
|
}
|
61
62
|
export interface WorkspaceProject extends NgWorkspaceProject {
|
63
|
+
name?: string;
|
62
64
|
architect?: WorkspaceTool;
|
63
65
|
i18n?: WorkspaceProjectI18n;
|
64
66
|
prefix: string;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"angular-workspace.d.ts","sourceRoot":"","sources":["../../../src/interfaces/angular-workspace.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,QAAQ,IAAI,kBAAkB,EAC9B,MAAM,IAAI,iBAAiB,EAC3B,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AACD,MAAM,WAAW,aAAa;IAC5B,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,
|
1
|
+
{"version":3,"file":"angular-workspace.d.ts","sourceRoot":"","sources":["../../../src/interfaces/angular-workspace.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,QAAQ,IAAI,kBAAkB,EAC9B,MAAM,IAAI,iBAAiB,EAC3B,gBAAgB,EACjB,MAAM,0CAA0C,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,SAAS,CAAC;AAEzD,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AACD,MAAM,WAAW,aAAa;IAC5B,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D,yCAAyC;IACzC,6BAA6B,CAAC,EAAE;QAC9B,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,yCAAyC;IACzC,2BAA2B,CAAC,EAAE;QAC5B,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,yCAAyC;IACzC,yBAAyB,CAAC,EAAE;QAC1B,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,yCAAyC;IACzC,uBAAuB,CAAC,EAAE;QACxB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,wCAAwC;IACxC,4BAA4B,CAAC,EAAE;QAC7B,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,qBAAqB,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
export declare const OTTER_MODULE_PREFIX = "otter-";
|
26
26
|
/** Otter NPM Keyword pattern */
|
27
27
|
export type OtterModuleTag<T extends string = ''> = `${typeof OTTER_MODULE_PREFIX}${T}`;
|
28
|
-
/**
|
29
|
-
export declare const
|
28
|
+
/** Prefix of the Otter module keyword tags */
|
29
|
+
export declare const OTTER_MODULE_PRESET_PREFIX: OtterModuleTag<'preset-'>;
|
30
|
+
/** Otter Preset NPM Keyword pattern */
|
31
|
+
export type OtterModulePreset<T extends string = ''> = `${typeof OTTER_MODULE_PRESET_PREFIX}${T}`;
|
30
32
|
/** Keyword defining an Otter compatible module */
|
31
33
|
export declare const OTTER_MODULE_KEYWORD: OtterModuleTag<'module'>;
|
32
34
|
/** Package Keyword to identify the module allowing CMS administration */
|
33
35
|
export declare const OTTER_KEYWORD_CMS: OtterModuleTag<'cms'>;
|
36
|
+
/** List of whitelisted package scopes for Otter modules */
|
37
|
+
export declare const OTTER_MODULE_SUPPORTED_SCOPES: readonly ["otter", "o3r"];
|
34
38
|
//# sourceMappingURL=modules.constants.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modules.constants.d.ts","sourceRoot":"","sources":["../../../src/modules/modules.constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,4CAA4C;AAC5C,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC,GACnG;IACE,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,KAAK,CAAC,EAAE;QACN,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;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AS,MAAM,GAAG,EAAE,IAAI,GAAG,OAAO,mBAAmB,GAAG,CAAC,EAAE,CAAC;AAExF,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC,SAAS,CAAmB,CAAC;AACrF,uCAAuC;AACvC,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,EAAE,IAAI,GAAG,OAAO,0BAA0B,GAAG,CAAC,EAAE,CAAC;AAElG,kDAAkD;AAClD,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,QAAQ,CAAkB,CAAC;AAC7E,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,EAAE,cAAc,CAAC,KAAK,CAAe,CAAC;AAEpE,2DAA2D;AAC3D,eAAO,MAAM,6BAA6B,2BAA4B,CAAC"}
|
@@ -1,12 +1,14 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.OTTER_KEYWORD_CMS = exports.OTTER_MODULE_KEYWORD = exports.
|
3
|
+
exports.OTTER_MODULE_SUPPORTED_SCOPES = exports.OTTER_KEYWORD_CMS = exports.OTTER_MODULE_KEYWORD = exports.OTTER_MODULE_PRESET_PREFIX = exports.OTTER_MODULE_PREFIX = void 0;
|
4
4
|
/** Prefix of the Otter module keyword tags */
|
5
5
|
exports.OTTER_MODULE_PREFIX = 'otter-';
|
6
|
-
/**
|
7
|
-
exports.
|
6
|
+
/** Prefix of the Otter module keyword tags */
|
7
|
+
exports.OTTER_MODULE_PRESET_PREFIX = 'otter-preset-';
|
8
8
|
/** Keyword defining an Otter compatible module */
|
9
9
|
exports.OTTER_MODULE_KEYWORD = 'otter-module';
|
10
10
|
/** Package Keyword to identify the module allowing CMS administration */
|
11
11
|
exports.OTTER_KEYWORD_CMS = 'otter-cms';
|
12
|
+
/** List of whitelisted package scopes for Otter modules */
|
13
|
+
exports.OTTER_MODULE_SUPPORTED_SCOPES = ['otter', 'o3r'];
|
12
14
|
//# sourceMappingURL=modules.constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"modules.constants.js","sourceRoot":"","sources":["../../../src/modules/modules.constants.ts"],"names":[],"mappings":";;;AAyBA,8CAA8C;AACjC,QAAA,mBAAmB,GAAG,QAAQ,CAAC;
|
1
|
+
{"version":3,"file":"modules.constants.js","sourceRoot":"","sources":["../../../src/modules/modules.constants.ts"],"names":[],"mappings":";;;AAyBA,8CAA8C;AACjC,QAAA,mBAAmB,GAAG,QAAQ,CAAC;AAI5C,8CAA8C;AACjC,QAAA,0BAA0B,GAA8B,eAAe,CAAC;AAIrF,kDAAkD;AACrC,QAAA,oBAAoB,GAA6B,cAAc,CAAC;AAC7E,yEAAyE;AAC5D,QAAA,iBAAiB,GAA0B,WAAW,CAAC;AAEpE,2DAA2D;AAC9C,QAAA,6BAA6B,GAAG,CAAC,OAAO,EAAE,KAAK,CAAU,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/check-packages-peers/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/check-packages-peers/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AA8FpE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,UACrC,IAAI,6FAKnB"}
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkPackagesRule = void 0;
|
4
4
|
const path = require("node:path");
|
5
5
|
const semver_1 = require("semver");
|
6
|
-
const
|
6
|
+
const index_1 = require("../../utility/index");
|
7
7
|
/**
|
8
8
|
* Check if the first level of peer deps of a given package are installed.
|
9
9
|
* List all not installed packages or packages with version mismatch
|
@@ -16,7 +16,7 @@ function getPackagesToInstallOrUpdate(packageName) {
|
|
16
16
|
installedPackage = require(`${packageName}${path.posix.sep}package.json`);
|
17
17
|
}
|
18
18
|
catch (err) {
|
19
|
-
throw new
|
19
|
+
throw new index_1.O3rCliError(`The provided package is not installed: ${packageName}`);
|
20
20
|
}
|
21
21
|
const packagesToInstall = [];
|
22
22
|
const packagesWrongVersion = [];
|
@@ -52,7 +52,7 @@ function getPackagesToInstallOrUpdate(packageName) {
|
|
52
52
|
* @param logger
|
53
53
|
*/
|
54
54
|
function checkPackagesToInstallOrUpdate(packageName, logger, angularJsonString) {
|
55
|
-
const packageManager = (0,
|
55
|
+
const packageManager = (0, index_1.getPackageManager)({ workspaceConfig: angularJsonString });
|
56
56
|
const { packagesToInstall, packagesWrongVersion } = getPackagesToInstallOrUpdate(packageName);
|
57
57
|
if (packagesWrongVersion.length) {
|
58
58
|
logger.warn('');
|
@@ -68,7 +68,7 @@ function checkPackagesToInstallOrUpdate(packageName, logger, angularJsonString)
|
|
68
68
|
logger.error('');
|
69
69
|
logger.error(`The following packages need to be installed to have "${packageName}" working. Run the commands one by one:`);
|
70
70
|
packagesToInstall.forEach((dep) => logger.error(`${packageManager} run ng add ${dep.packageName}@${dep.version}`));
|
71
|
-
throw new
|
71
|
+
throw new index_1.O3rCliError('Missing peer dependencies');
|
72
72
|
}
|
73
73
|
if (!packagesToInstall.length && !packagesWrongVersion.length) {
|
74
74
|
logger.info(`The package ${packageName} has all peer deps installed.\n`);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/check-packages-peers/index.ts"],"names":[],"mappings":";;;AAEA,kCAAkC;AAClC,mCAAmC;AAEnC
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/check-packages-peers/index.ts"],"names":[],"mappings":";;;AAEA,kCAAkC;AAClC,mCAAmC;AAEnC,+CAAqE;AAarE;;;;;GAKG;AACH,SAAS,4BAA4B,CAAC,WAAmB;IACvD,IAAI,gBAA6B,CAAC;IAClC,IAA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AC,CAAC;KACzH;IAED,IAAI,iBAAiB,CAAC,MAAM,EAAE;QAC5B,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACjB,MAAM,CAAC,KAAK,CAAC,wDAAwD,WAAW,yCAAyC,CAAC,CAAC;QAC3H,iBAAiB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,cAAc,eAAe,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACnH,MAAM,IAAI,mBAAW,CAAC,2BAA2B,CAAC,CAAC;KACpD;IAED,IAAI,CAAC,iBAAiB,CAAC,MAAM,IAAI,CAAC,oBAAoB,CAAC,MAAM,EAAE;QAC7D,MAAM,CAAC,IAAI,CAAC,eAAe,WAAW,iCAAiC,CAAC,CAAC;KAC1E;AAEH,CAAC;AAED;;;;GAIG;AACH,SAAgB,iBAAiB,CAAC,WAAmB;IACnD,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC/C,8BAA8B,CAAC,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrF,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AAND,8CAMC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { Rule } from '@angular-devkit/schematics';
|
2
|
+
/** Options for the devtools register rule factory */
|
3
|
+
export interface DevtoolRegisterOptions {
|
4
|
+
/** Name of the devtool module */
|
5
|
+
moduleName: string;
|
6
|
+
/** Package name from which the devtools is exposed */
|
7
|
+
packageName: string;
|
8
|
+
/** Name of the workspace project name */
|
9
|
+
projectName?: string;
|
10
|
+
/** Name of the devtools service (if available) */
|
11
|
+
serviceName?: string;
|
12
|
+
}
|
13
|
+
/**
|
14
|
+
* Register Devtools to the application
|
15
|
+
* @param tree
|
16
|
+
* @param context
|
17
|
+
* @param options
|
18
|
+
*/
|
19
|
+
export declare const registerDevtoolsToApplication: (options: DevtoolRegisterOptions) => Rule;
|
20
|
+
//# sourceMappingURL=devtools-registration.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"devtools-registration.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/devtools-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAOzD,qDAAqD;AACrD,MAAM,WAAW,sBAAsB;IACrC,iCAAiC;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAqCD;;;;;GAKG;AACH,eAAO,MAAM,6BAA6B,YAAa,sBAAsB,KAAG,IAqB/E,CAAC"}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.registerDevtoolsToApplication = void 0;
|
4
|
+
const schematics_1 = require("@angular-devkit/schematics");
|
5
|
+
const ts = require("typescript");
|
6
|
+
const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
|
7
|
+
const utility_1 = require("../../utility");
|
8
|
+
const utility_2 = require("../../utility");
|
9
|
+
const registerModule = (options) => (tree, context) => {
|
10
|
+
const moduleFilePath = (0, utility_1.getAppModuleFilePath)(tree, context, options.projectName);
|
11
|
+
if (!moduleFilePath) {
|
12
|
+
return tree;
|
13
|
+
}
|
14
|
+
const sourceFileContent = tree.read(moduleFilePath).toString();
|
15
|
+
const sourceFile = ts.createSourceFile(moduleFilePath, sourceFileContent, ts.ScriptTarget.ES2015, true);
|
16
|
+
if ((0, ast_utils_1.isImported)(sourceFile, options.moduleName, options.packageName)) {
|
17
|
+
return tree;
|
18
|
+
}
|
19
|
+
let recorder = tree.beginUpdate(moduleFilePath);
|
20
|
+
const ngModulesMetadata = (0, ast_utils_1.getDecoratorMetadata)(sourceFile, 'NgModule', '@angular/core');
|
21
|
+
const moduleIndex = ngModulesMetadata[0] ? ngModulesMetadata[0].pos - ('NgModule'.length + 1) : sourceFileContent.indexOf('@NgModule');
|
22
|
+
const addImportToModuleFile = (name, file, moduleFunction) => recorder = (0, utility_2.addImportToModuleFile)(name, file, sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, moduleFunction);
|
23
|
+
addImportToModuleFile(options.moduleName, options.packageName, '.instrument({isActivatedOnBootstrap: true})');
|
24
|
+
tree.commitUpdate(recorder);
|
25
|
+
return tree;
|
26
|
+
};
|
27
|
+
/**
|
28
|
+
* Register Devtools to the application
|
29
|
+
* @param tree
|
30
|
+
* @param context
|
31
|
+
* @param options
|
32
|
+
*/
|
33
|
+
const registerDevtoolsToApplication = (options) => (tree, context) => {
|
34
|
+
const workspace = (0, utility_1.getWorkspaceConfig)(tree);
|
35
|
+
const project = options.projectName ? workspace?.projects[options.projectName] : undefined;
|
36
|
+
if (!workspace || !project || project.projectType !== 'application') {
|
37
|
+
context.logger.warn(`Failed to determine the application to update, the devtool modules ${options.moduleName}.`);
|
38
|
+
return tree;
|
39
|
+
}
|
40
|
+
const schematicConfig = (0, utility_1.getDefaultOptionsForSchematic)(workspace, options.packageName, 'ng-add', options);
|
41
|
+
if (!schematicConfig?.registerDevtool) {
|
42
|
+
return tree;
|
43
|
+
}
|
44
|
+
return (0, schematics_1.chain)([
|
45
|
+
registerModule(options),
|
46
|
+
(_, ctx) => ctx.logger.info(`The devtools module ${options.moduleName} has been registered and automatically activated${options.serviceName ? ', its activation can be driven via ' + options.serviceName : ''}.`)
|
47
|
+
])(tree, context);
|
48
|
+
};
|
49
|
+
exports.registerDevtoolsToApplication = registerDevtoolsToApplication;
|
50
|
+
//# sourceMappingURL=devtools-registration.js.map
|
@@ -0,0 +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,qEAAyF;AACzF,2CAAwG;AAExG,2CAAkF;AAclF,MAAM,cAAc,GAAG,CAAC,OAA+B,EAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;IAClF,MAAM,cAAc,GAAG,IAAA,8BAAoB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAChF,IAAI,CAAC,cAAc,EAAE;QACnB,OAAO,IAAI,CAAC;KACb;IAED,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,CAAE,CAAC,QAAQ,EAAE,CAAC;IAChE,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACpC,cAAc,EACd,iBAAiB,EACjB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,IAAI,IAAA,sBAAU,EAAC,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE;QACnE,OAAO,IAAI,CAAC;KACb;IAED,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAChD,MAAM,iBAAiB,GAAG,IAAA,gCAAoB,EAAC,UAAU,EAAE,UAAU,EAAE,eAAe,CAAC,CAAC;IACxF,MAAM,WAAW,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEvI,MAAM,qBAAqB,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,cAAuB,EAA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,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;AArBW,QAAA,6BAA6B,iCAqBxC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/dev-tools/index.ts"],"names":[],"mappings":";;;AAAA,kEAAwC"}
|
@@ -1,21 +1,5 @@
|
|
1
1
|
import { Rule } from '@angular-devkit/schematics';
|
2
|
-
|
3
|
-
* Linter options
|
4
|
-
*/
|
5
|
-
export interface LinterOptions {
|
6
|
-
/**
|
7
|
-
* Indicates if the linter process should succeed even if there are lint errors remaining
|
8
|
-
*
|
9
|
-
* @default true
|
10
|
-
*/
|
11
|
-
force?: boolean;
|
12
|
-
/**
|
13
|
-
* If enabled, only errors are reported (--quiet option of ESLint CLI)
|
14
|
-
*
|
15
|
-
* @default true
|
16
|
-
*/
|
17
|
-
hideWarnings?: boolean;
|
18
|
-
}
|
2
|
+
import { LinterOptions } from '../../tasks';
|
19
3
|
/**
|
20
4
|
* Apply EsLint fix
|
21
5
|
*
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAA0B,MAAM,4BAA4B,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAEpF,OAAO,EAAiB,aAAa,EAAE,MAAM,aAAa,CAAC;AAE3D;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,UAAU,SAAM,EAAE,SAAS,GAAE,MAAM,EAAW,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CA6D5G"}
|
@@ -1,9 +1,8 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.applyEsLintFix = void 0;
|
4
|
-
const node_child_process_1 = require("node:child_process");
|
5
4
|
const node_path_1 = require("node:path");
|
6
|
-
const
|
5
|
+
const tasks_1 = require("../../tasks");
|
7
6
|
/**
|
8
7
|
* Apply EsLint fix
|
9
8
|
*
|
@@ -14,15 +13,17 @@ const package_manager_runner_1 = require("../../utility/package-manager-runner")
|
|
14
13
|
*/
|
15
14
|
function applyEsLintFix(_prootPath = '/', extension = ['ts'], options) {
|
16
15
|
const linterOptions = {
|
16
|
+
continueOnError: options?.force ?? true,
|
17
17
|
force: true,
|
18
18
|
hideWarnings: true,
|
19
19
|
...options
|
20
20
|
};
|
21
21
|
return (tree, context) => {
|
22
|
+
const filesToBeLint = tree.actions
|
23
|
+
.filter((a) => a.kind !== 'd')
|
24
|
+
.map((action) => action.path.substring(1));
|
22
25
|
// directory of the deepest file
|
23
|
-
let dir = tree.getDir((0, node_path_1.dirname)(
|
24
|
-
.map((action) => action.path.substr(1))
|
25
|
-
.reduce((acc, path) => {
|
26
|
+
let dir = tree.getDir((0, node_path_1.dirname)(filesToBeLint.reduce((acc, path) => {
|
26
27
|
const level = path.split('/').length;
|
27
28
|
if (acc.level < level) {
|
28
29
|
return { level, path };
|
@@ -33,7 +34,7 @@ function applyEsLintFix(_prootPath = '/', extension = ['ts'], options) {
|
|
33
34
|
do {
|
34
35
|
eslintFile = dir.subfiles.find((f) => f.startsWith('.eslintrc'));
|
35
36
|
if (eslintFile) {
|
36
|
-
eslintFile = (0, node_path_1.join)(dir.path.
|
37
|
+
eslintFile = (0, node_path_1.join)(dir.path.substring(1), eslintFile);
|
37
38
|
break;
|
38
39
|
}
|
39
40
|
dir = dir.parent;
|
@@ -42,28 +43,13 @@ function applyEsLintFix(_prootPath = '/', extension = ['ts'], options) {
|
|
42
43
|
context.logger.warn(`Asked to run lint fixes, but could not find a eslintrc config file.
|
43
44
|
You can consider to run later the following command to add otter linter rules: ng add @o3r/eslint-config-otter`);
|
44
45
|
}
|
45
|
-
const files =
|
46
|
-
|
47
|
-
if (extension.some((ext) => filePath.endsWith(`.${ext}`)) && dir && action.path.startsWith(dir.path)) {
|
46
|
+
const files = filesToBeLint.reduce((acc, filePath) => {
|
47
|
+
if (extension.some((ext) => filePath.endsWith(`.${ext}`)) && dir && filePath.startsWith(dir.path)) {
|
48
48
|
acc.add(filePath);
|
49
49
|
}
|
50
50
|
return acc;
|
51
51
|
}, new Set());
|
52
|
-
|
53
|
-
(0, node_child_process_1.exec)(`${(0, package_manager_runner_1.getPackageManagerExecutor)()} eslint ` +
|
54
|
-
Array.from(files).map((file) => `"${file}"`).join(' ') +
|
55
|
-
' --fix --color' +
|
56
|
-
(linterOptions.hideWarnings ? ' --quiet' : '') +
|
57
|
-
(eslintFile ? ` --config ${eslintFile} --parser-options=tsconfigRootDir:${(0, node_path_1.resolve)(process.cwd(), (0, node_path_1.dirname)(eslintFile))}` : ''), (_error, stdout, stderr) => {
|
58
|
-
context.logger.info(stdout);
|
59
|
-
if (!linterOptions.force) {
|
60
|
-
context.logger.error(stderr);
|
61
|
-
}
|
62
|
-
});
|
63
|
-
}
|
64
|
-
catch {
|
65
|
-
context.logger.error('Could not run eslint');
|
66
|
-
}
|
52
|
+
context.addTask(new tasks_1.EslintFixTask(Array.from(files), undefined, eslintFile, linterOptions));
|
67
53
|
return tree;
|
68
54
|
};
|
69
55
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":";;;AACA,
|
1
|
+
{"version":3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AC;AAC7C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,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,cAAc,CAAC;AAC7B,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"}
|
@@ -10,4 +10,5 @@ tslib_1.__exportStar(require("./ng-add/index"), exports);
|
|
10
10
|
tslib_1.__exportStar(require("./remove-packages/index"), exports);
|
11
11
|
tslib_1.__exportStar(require("./update-imports/index"), exports);
|
12
12
|
tslib_1.__exportStar(require("./vscode-extensions/index"), exports);
|
13
|
+
tslib_1.__exportStar(require("./dev-tools/index"), exports);
|
13
14
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC;AACnC,uDAA6B;AAC7B,sEAA4C;AAC5C,uEAA6C;AAC7C,yDAA+B;AAC/B,kEAAwC;AACxC,iEAAuC;AACvC,oEAA0C"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rule-factories/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC;AACpC,6DAAmC;AACnC,uDAA6B;AAC7B,sEAA4C;AAC5C,uEAA6C;AAC7C,yDAA+B;AAC/B,kEAAwC;AACxC,iEAAuC;AACvC,oEAA0C;AAC1C,4DAAkC"}
|
@@ -5,7 +5,6 @@ import { SchematicOptionObject } from '../../interfaces';
|
|
5
5
|
import type { NgAddPackageOptions } from '../../tasks/index';
|
6
6
|
/**
|
7
7
|
* Install via `ng add` a list of npm packages.
|
8
|
-
*
|
9
8
|
* @param packages List of packages to be installed via `ng add`
|
10
9
|
* @param options install options
|
11
10
|
* @param packageJsonPath path of the package json of the project where they will be installed
|
@@ -15,7 +14,6 @@ export declare function ngAddPackages(packages: string[], options?: Omit<NgAddPa
|
|
15
14
|
}, packageJsonPath?: string): Rule;
|
16
15
|
/**
|
17
16
|
* Look for the peer dependencies and run ng add on the package requested version
|
18
|
-
*
|
19
17
|
* @param packages list of the name of the packages needed
|
20
18
|
* @param packageJsonPath path to package json that needs the peer to be resolved
|
21
19
|
* @param type how to install the dependency (dev, peer for a library or default for an application)
|
@@ -25,16 +23,15 @@ export declare function ngAddPackages(packages: string[], options?: Omit<NgAddPa
|
|
25
23
|
export declare function ngAddPeerDependencyPackages(packages: string[], packageJsonPath: string, type: NodeDependencyType | undefined, options: NgAddPackageOptions, parentPackageInfo?: string): Rule;
|
26
24
|
/**
|
27
25
|
* Register the given package in the Angular CLI schematics
|
28
|
-
*
|
29
26
|
* @param packageJson PackageJson of the project containing the collection to add to the project
|
30
27
|
* @param angularJsonFile Path to the Angular.json file. Will use the workspace root's angular.json if not specified
|
31
28
|
*/
|
32
29
|
export declare function registerPackageCollectionSchematics(packageJson: PackageJson, angularJsonFile?: string): Rule;
|
33
30
|
/**
|
34
31
|
* Setup schematics default params in angular.json
|
35
|
-
*
|
36
32
|
* @param schematicsDefaultParams default params to setup by schematic
|
33
|
+
* @param overrideValue Define if the given value should override the one already defined in the workspace
|
37
34
|
* @param angularJsonFile Path to the Angular.json file. Will use the workspace root's angular.json if not specified
|
38
35
|
*/
|
39
|
-
export declare function setupSchematicsDefaultParams(schematicsDefaultParams: Record<string, SchematicOptionObject>, angularJsonFile?: string): Rule;
|
36
|
+
export declare function setupSchematicsDefaultParams(schematicsDefaultParams: Record<string, SchematicOptionObject>, overrideValue?: boolean, angularJsonFile?: string): Rule;
|
40
37
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,IAAI,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,IAAI,EAA+B,MAAM,4BAA4B,CAAC;AAG/G,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAI9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAG7D;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,CAAA;CAAE,EAAE,eAAe,SAAkB,GAAG,IAAI,CA0HzL;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,IAAI,gCAAiD,EAC5I,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,CAAC,EAAE,MAAM,QAgBzD;AAED;;;;GAIG;AACH,wBAAgB,mCAAmC,CAAC,WAAW,EAAE,WAAW,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAY5G;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,EAAE,aAAa,UAAQ,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAgClK"}
|