@o3r/schematics 10.3.0-prerelease.71 → 10.3.0-prerelease.72
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +5 -5
- package/src/rule-factories/eslint-fix/index.d.ts +7 -2
- package/src/rule-factories/eslint-fix/index.d.ts.map +1 -1
- package/src/rule-factories/eslint-fix/index.js +1 -1
- package/src/rule-factories/eslint-fix/index.js.map +1 -1
- package/src/tasks/eslint/index.d.ts +8 -1
- package/src/tasks/eslint/index.d.ts.map +1 -1
- package/src/tasks/eslint/index.js +8 -1
- package/src/tasks/eslint/index.js.map +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@o3r/schematics",
|
3
|
-
"version": "10.3.0-prerelease.
|
3
|
+
"version": "10.3.0-prerelease.72",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"@angular-devkit/core": "~17.3.0",
|
31
31
|
"@angular-devkit/schematics": "~17.3.0",
|
32
32
|
"@angular/cli": "~17.3.0",
|
33
|
-
"@o3r/telemetry": "^10.3.0-prerelease.
|
33
|
+
"@o3r/telemetry": "^10.3.0-prerelease.72",
|
34
34
|
"@schematics/angular": "~17.3.0",
|
35
35
|
"eslint": "^8.42.0",
|
36
36
|
"rxjs": "^7.8.1",
|
@@ -82,9 +82,9 @@
|
|
82
82
|
"@nx/eslint-plugin": "~18.3.0",
|
83
83
|
"@nx/jest": "~18.3.0",
|
84
84
|
"@nx/js": "~18.3.0",
|
85
|
-
"@o3r/build-helpers": "^10.3.0-prerelease.
|
86
|
-
"@o3r/eslint-plugin": "^10.3.0-prerelease.
|
87
|
-
"@o3r/telemetry": "^10.3.0-prerelease.
|
85
|
+
"@o3r/build-helpers": "^10.3.0-prerelease.72",
|
86
|
+
"@o3r/eslint-plugin": "^10.3.0-prerelease.72",
|
87
|
+
"@o3r/telemetry": "^10.3.0-prerelease.72",
|
88
88
|
"@schematics/angular": "~17.3.0",
|
89
89
|
"@stylistic/eslint-plugin-ts": "^1.5.4",
|
90
90
|
"@types/inquirer": "~8.2.10",
|
@@ -1,5 +1,9 @@
|
|
1
|
-
import { Rule } from '@angular-devkit/schematics';
|
1
|
+
import { Rule, type TaskId } from '@angular-devkit/schematics';
|
2
2
|
import { LinterOptions } from '../../tasks/index';
|
3
|
+
interface ApplyEslintFixOption extends LinterOptions {
|
4
|
+
/** List of task to wait to run the linter */
|
5
|
+
dependencyTaskIds?: TaskId[];
|
6
|
+
}
|
3
7
|
/**
|
4
8
|
* Apply EsLint fix
|
5
9
|
* @param prootPath Root path
|
@@ -7,5 +11,6 @@ import { LinterOptions } from '../../tasks/index';
|
|
7
11
|
* @param extension List of file extensions to lint
|
8
12
|
* @param options Linter options
|
9
13
|
*/
|
10
|
-
export declare function applyEsLintFix(_prootPath?: string, extension?: string[], options?:
|
14
|
+
export declare function applyEsLintFix(_prootPath?: string, extension?: string[], options?: ApplyEslintFixOption): Rule;
|
15
|
+
export {};
|
11
16
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,IAAI,EAAoB,KAAK,MAAM,EAAQ,MAAM,4BAA4B,CAAC;AAEvG,OAAO,EAAiB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEjE,UAAU,oBAAqB,SAAQ,aAAa;IAClD,6CAA6C;IAC7C,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,UAAU,SAAM,EAAE,SAAS,GAAE,MAAM,EAAW,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAqEnH"}
|
@@ -55,7 +55,7 @@ You can consider to run later the following command to add otter linter rules: n
|
|
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));
|
58
|
+
context.addTask(new index_1.EslintFixTask(Array.from(files), undefined, eslintFile, linterOptions), options?.dependencyTaskIds);
|
59
59
|
}
|
60
60
|
return tree;
|
61
61
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":";;;AAAA,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/eslint-fix/index.ts"],"names":[],"mappings":";;;AAAA,2DAAuG;AACvG,yCAA0C;AAC1C,6CAAiE;AAOjE;;;;;;GAMG;AACH,SAAgB,cAAc,CAAC,UAAU,GAAG,GAAG,EAAE,YAAsB,CAAC,IAAI,CAAC,EAAE,OAA8B;IAC3G,IAAI,CAAC;QACH,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACzC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAA,iBAAI,GAAE,CAAC;IAChB,CAAC;IAED,MAAM,aAAa,GAAkB;QACnC,eAAe,EAAE,IAAI;QACrB,YAAY,EAAE,IAAI;QAClB,GAAG,OAAO;KACX,CAAC;IAEF,OAAO,CAAC,IAAU,EAAE,OAAyB,EAAE,EAAE;QAC/C,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO;aAC/B,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC;aAC7B,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;QAE7C,gCAAgC;QAChC,IAAI,GAAG,GAAoB,IAAI,CAAC,MAAM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IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC/G,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YACpB,CAAC;YAED,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,IAAI,GAAG,EAAU,CAAC,CAAC;QAEtB,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YACf,OAAO,CAAC,OAAO,CACb,IAAI,qBAAa,CACf,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EACjB,SAAS,EACT,UAAU,EACV,aAAa,CACd,EACD,OAAO,EAAE,iBAAiB,CAC3B,CAAC;QACJ,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;AACJ,CAAC;AArED,wCAqEC"}
|
@@ -1,5 +1,7 @@
|
|
1
1
|
import { TaskConfiguration, TaskConfigurationGenerator } from '@angular-devkit/schematics';
|
2
2
|
import { NodePackageTaskOptions } from '@angular-devkit/schematics/tasks/package-manager/options';
|
3
|
+
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
|
4
|
+
import type { WorkspaceSchema } from '../../interfaces';
|
3
5
|
/**
|
4
6
|
* Linter options
|
5
7
|
*/
|
@@ -14,13 +16,18 @@ export interface LinterOptions {
|
|
14
16
|
* @default true
|
15
17
|
*/
|
16
18
|
hideWarnings?: boolean;
|
19
|
+
/** Workspace configuration file */
|
20
|
+
workspaceConfig?: WorkspaceSchema;
|
21
|
+
/** Enforced NPM Package */
|
22
|
+
enforcedNpmManager?: string;
|
17
23
|
}
|
18
|
-
export declare class EslintFixTask implements TaskConfigurationGenerator<NodePackageTaskOptions> {
|
24
|
+
export declare class EslintFixTask extends NodePackageInstallTask implements TaskConfigurationGenerator<NodePackageTaskOptions> {
|
19
25
|
files: string[];
|
20
26
|
workingDirectory?: string | undefined;
|
21
27
|
configFile?: string | undefined;
|
22
28
|
linterOptions: LinterOptions;
|
23
29
|
constructor(files: string[], workingDirectory?: string | undefined, configFile?: string | undefined, options?: LinterOptions);
|
30
|
+
/** @inheritdoc */
|
24
31
|
toConfiguration(): TaskConfiguration<NodePackageTaskOptions>;
|
25
32
|
}
|
26
33
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tasks/eslint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAmB,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tasks/eslint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAmB,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAEnH,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,mCAAmC;IACnC,eAAe,CAAC,EAAE,eAAe,CAAC;IAElC,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,qBAAa,aAAc,SAAQ,sBAAuB,YAAW,0BAA0B,CAAC,sBAAsB,CAAC;IAGlG,KAAK,EAAE,MAAM,EAAE;IAAS,gBAAgB,CAAC;IAAiB,UAAU,CAAC;IAFjF,aAAa,EAAE,aAAa,CAAC;gBAEjB,KAAK,EAAE,MAAM,EAAE,EAAS,gBAAgB,CAAC,oBAAQ,EAAS,UAAU,CAAC,oBAAQ,EAAE,OAAO,CAAC,EAAE,aAAa;IAWzH,kBAAkB;IACX,eAAe,IAAI,iBAAiB,CAAC,sBAAsB,CAAC;CAqBpE"}
|
@@ -3,8 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EslintFixTask = void 0;
|
4
4
|
const options_1 = require("@angular-devkit/schematics/tasks/package-manager/options");
|
5
5
|
const package_manager_runner_1 = require("../../utility/package-manager-runner");
|
6
|
-
|
6
|
+
const tasks_1 = require("@angular-devkit/schematics/tasks");
|
7
|
+
class EslintFixTask extends tasks_1.NodePackageInstallTask {
|
7
8
|
constructor(files, workingDirectory, configFile, options) {
|
9
|
+
super({
|
10
|
+
packageManager: (0, package_manager_runner_1.getPackageManager)(options)
|
11
|
+
});
|
8
12
|
this.files = files;
|
9
13
|
this.workingDirectory = workingDirectory;
|
10
14
|
this.configFile = configFile;
|
@@ -14,6 +18,7 @@ class EslintFixTask {
|
|
14
18
|
...options
|
15
19
|
};
|
16
20
|
}
|
21
|
+
/** @inheritdoc */
|
17
22
|
toConfiguration() {
|
18
23
|
return {
|
19
24
|
name: options_1.NodePackageName,
|
@@ -22,8 +27,10 @@ class EslintFixTask {
|
|
22
27
|
quiet: false,
|
23
28
|
workingDirectory: this.workingDirectory,
|
24
29
|
packageName: [
|
30
|
+
'exec',
|
25
31
|
'eslint',
|
26
32
|
...this.files,
|
33
|
+
...(this.packageName !== 'npm' ? [] : ['--']),
|
27
34
|
'--fix',
|
28
35
|
...(this.linterOptions?.hideWarnings ? ['--quiet'] : []),
|
29
36
|
...(this.configFile ? ['--config', this.configFile] : []),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tasks/eslint/index.ts"],"names":[],"mappings":";;;AACA,sFAAmH;AACnH,iFAAyE;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tasks/eslint/index.ts"],"names":[],"mappings":";;;AACA,sFAAmH;AACnH,iFAAyE;AACzE,4DAA0E;AAyB1E,MAAa,aAAc,SAAQ,8BAAsB;IAGv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