@unisphere/nx 3.19.3 â 3.20.0
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/dist/generators/internal-dev-runner/generator.js +2 -2
- package/dist/migrations/3-19-4/update-eslint-ignored-files.d.ts +11 -0
- package/dist/migrations/3-19-4/update-eslint-ignored-files.d.ts.map +1 -0
- package/dist/migrations/3-19-4/update-eslint-ignored-files.js +62 -0
- package/migrations.json +8 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.default = testMigrationGenerator;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
// Import the migrations to test
|
|
6
|
-
const
|
|
6
|
+
const update_eslint_ignored_files_1 = tslib_1.__importDefault(require("../../migrations/3-19-4/update-eslint-ignored-files"));
|
|
7
7
|
async function testMigrationGenerator(tree) {
|
|
8
|
-
await (0,
|
|
8
|
+
await (0, update_eslint_ignored_files_1.default)(tree);
|
|
9
9
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration: Update ESLint dependency-checks ignoredFiles
|
|
3
|
+
*
|
|
4
|
+
* Updates the @nx/dependency-checks ignoredFiles patterns in .eslintrc.json
|
|
5
|
+
* to use glob patterns that cover all vite/rollup config file extensions
|
|
6
|
+
* (ts, mts, js, mjs). Previously only vite.config.ts and rollup.config.js
|
|
7
|
+
* were ignored, causing false positives when projects use .mts or .mjs extensions.
|
|
8
|
+
*/
|
|
9
|
+
import { Tree } from '@nx/devkit';
|
|
10
|
+
export default function update(tree: Tree): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=update-eslint-ignored-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-eslint-ignored-files.d.ts","sourceRoot":"","sources":["../../../src/migrations/3-19-4/update-eslint-ignored-files.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,IAAI,EAA+B,MAAM,YAAY,CAAC;AAO/D,wBAA8B,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CA+D9D"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Migration: Update ESLint dependency-checks ignoredFiles
|
|
4
|
+
*
|
|
5
|
+
* Updates the @nx/dependency-checks ignoredFiles patterns in .eslintrc.json
|
|
6
|
+
* to use glob patterns that cover all vite/rollup config file extensions
|
|
7
|
+
* (ts, mts, js, mjs). Previously only vite.config.ts and rollup.config.js
|
|
8
|
+
* were ignored, causing false positives when projects use .mts or .mjs extensions.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.default = update;
|
|
12
|
+
const devkit_1 = require("@nx/devkit");
|
|
13
|
+
const OLD_VITE_PATTERN = '**/vite.config.ts';
|
|
14
|
+
const OLD_ROLLUP_PATTERN = '**/rollup.config.js';
|
|
15
|
+
const NEW_VITE_PATTERN = '**/vite.config.{ts,mts,js,mjs}';
|
|
16
|
+
const NEW_ROLLUP_PATTERN = '**/rollup.config.{js,mjs}';
|
|
17
|
+
async function update(tree) {
|
|
18
|
+
devkit_1.logger.info('đ Updating ESLint dependency-checks ignoredFiles patterns...');
|
|
19
|
+
const eslintrcPath = '.eslintrc.json';
|
|
20
|
+
if (!tree.exists(eslintrcPath)) {
|
|
21
|
+
devkit_1.logger.info('âšī¸ No .eslintrc.json found, skipping migration');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const eslintrc = (0, devkit_1.readJson)(tree, eslintrcPath);
|
|
25
|
+
if (!eslintrc.overrides || !Array.isArray(eslintrc.overrides)) {
|
|
26
|
+
devkit_1.logger.info('âšī¸ No overrides found in .eslintrc.json, skipping migration');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
let updated = false;
|
|
30
|
+
for (const override of eslintrc.overrides) {
|
|
31
|
+
const depChecks = override.rules?.['@nx/dependency-checks'];
|
|
32
|
+
if (!depChecks || !Array.isArray(depChecks))
|
|
33
|
+
continue;
|
|
34
|
+
const options = depChecks[1];
|
|
35
|
+
if (!options?.ignoredFiles || !Array.isArray(options.ignoredFiles))
|
|
36
|
+
continue;
|
|
37
|
+
const ignoredFiles = options.ignoredFiles;
|
|
38
|
+
// Check if already using new patterns
|
|
39
|
+
if (ignoredFiles.includes(NEW_VITE_PATTERN) &&
|
|
40
|
+
ignoredFiles.includes(NEW_ROLLUP_PATTERN)) {
|
|
41
|
+
devkit_1.logger.info('â
ESLint ignoredFiles already using updated patterns, skipping');
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
// Replace old patterns with new ones
|
|
45
|
+
const newIgnoredFiles = ignoredFiles.map((pattern) => {
|
|
46
|
+
if (pattern === OLD_VITE_PATTERN)
|
|
47
|
+
return NEW_VITE_PATTERN;
|
|
48
|
+
if (pattern === OLD_ROLLUP_PATTERN)
|
|
49
|
+
return NEW_ROLLUP_PATTERN;
|
|
50
|
+
return pattern;
|
|
51
|
+
});
|
|
52
|
+
options.ignoredFiles = newIgnoredFiles;
|
|
53
|
+
updated = true;
|
|
54
|
+
}
|
|
55
|
+
if (updated) {
|
|
56
|
+
(0, devkit_1.writeJson)(tree, eslintrcPath, eslintrc);
|
|
57
|
+
devkit_1.logger.info('â
Updated ignoredFiles to cover all vite/rollup config extensions');
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
devkit_1.logger.info('âšī¸ No @nx/dependency-checks ignoredFiles found to update');
|
|
61
|
+
}
|
|
62
|
+
}
|
package/migrations.json
CHANGED
|
@@ -370,6 +370,14 @@
|
|
|
370
370
|
"cli": {
|
|
371
371
|
"postUpdateMessage": "â
Claude Code configuration added to root .gitignore"
|
|
372
372
|
}
|
|
373
|
+
},
|
|
374
|
+
"3-19-4-update-eslint-ignored-files": {
|
|
375
|
+
"version": "3.19.4",
|
|
376
|
+
"description": "Updates ESLint dependency-checks ignoredFiles to cover all vite/rollup config extensions",
|
|
377
|
+
"factory": "./dist/migrations/3-19-4/update-eslint-ignored-files.js",
|
|
378
|
+
"cli": {
|
|
379
|
+
"postUpdateMessage": "â
ESLint ignoredFiles updated to cover vite.config.{ts,mts,js,mjs} and rollup.config.{js,mjs}"
|
|
380
|
+
}
|
|
373
381
|
}
|
|
374
382
|
},
|
|
375
383
|
"packageJsonUpdates": {
|