@nx/js 22.1.0-canary.20251111-647d751 → 22.1.0-rc.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/migrations.json +5 -0
- package/package.json +4 -4
- package/src/generators/typescript-sync/typescript-sync.d.ts.map +1 -1
- package/src/generators/typescript-sync/typescript-sync.js +7 -2
- package/src/migrations/update-22-1-0/remove-redundant-ts-project-references.d.ts +3 -0
- package/src/migrations/update-22-1-0/remove-redundant-ts-project-references.d.ts.map +1 -0
- package/src/migrations/update-22-1-0/remove-redundant-ts-project-references.js +7 -0
package/migrations.json
CHANGED
|
@@ -9,6 +9,11 @@
|
|
|
9
9
|
"version": "22.0.0-beta.0",
|
|
10
10
|
"description": "Remove the deprecated `external` and `externalBuildTargets` options from the `@nx/js:swc` and `@nx/js:tsc` executors.",
|
|
11
11
|
"factory": "./src/migrations/update-22-0-0/remove-external-options-from-js-executors"
|
|
12
|
+
},
|
|
13
|
+
"remove-redundant-ts-project-references": {
|
|
14
|
+
"version": "22.1.0-beta.8",
|
|
15
|
+
"description": "Removes redundant TypeScript project references from project's tsconfig.json files when runtime tsconfig files (e.g., tsconfig.lib.json, tsconfig.app.json) exist.",
|
|
16
|
+
"factory": "./src/migrations/update-22-1-0/remove-redundant-ts-project-references"
|
|
12
17
|
}
|
|
13
18
|
},
|
|
14
19
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "22.1.0-
|
|
3
|
+
"version": "22.1.0-rc.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
|
|
6
6
|
"repository": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"@babel/preset-env": "^7.23.2",
|
|
40
40
|
"@babel/preset-typescript": "^7.22.5",
|
|
41
41
|
"@babel/runtime": "^7.22.6",
|
|
42
|
-
"@nx/devkit": "22.1.0-
|
|
43
|
-
"@nx/workspace": "22.1.0-
|
|
42
|
+
"@nx/devkit": "22.1.0-rc.0",
|
|
43
|
+
"@nx/workspace": "22.1.0-rc.0",
|
|
44
44
|
"@zkochan/js-yaml": "0.0.7",
|
|
45
45
|
"babel-plugin-const-enum": "^1.0.1",
|
|
46
46
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"tslib": "^2.3.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"nx": "22.1.0-
|
|
63
|
+
"nx": "22.1.0-rc.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"verdaccio": "^6.0.5"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript-sync.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/typescript-sync/typescript-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAIpB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAC;AA2CtC,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,
|
|
1
|
+
{"version":3,"file":"typescript-sync.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/typescript-sync/typescript-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAIpB,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,8BAA8B,CAAC;AA2CtC,wBAAsB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAgQ5E;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -129,16 +129,21 @@ async function syncGenerator(tree) {
|
|
|
129
129
|
}
|
|
130
130
|
// Collect the dependencies of the source project
|
|
131
131
|
const dependencies = collectProjectDependencies(tree, projectName, projectGraph, collectedDependencies);
|
|
132
|
+
let foundRuntimeTsConfig = false;
|
|
132
133
|
for (const runtimeTsConfigFileName of runtimeTsConfigFileNames) {
|
|
133
134
|
const runtimeTsConfigPath = (0, devkit_1.joinPathFragments)(sourceProjectNode.data.root, runtimeTsConfigFileName);
|
|
134
135
|
if (!tsconfigExists(tree, tsconfigInfoCaches, runtimeTsConfigPath)) {
|
|
135
136
|
continue;
|
|
136
137
|
}
|
|
138
|
+
foundRuntimeTsConfig = true;
|
|
137
139
|
// Update project references for the runtime tsconfig
|
|
138
140
|
updateTsConfigReferences(tree, tsSysFromTree, tsconfigInfoCaches, runtimeTsConfigPath, dependencies, sourceProjectNode.data.root, projectRoots, changedFiles, runtimeTsConfigFileName, runtimeTsConfigFileNames);
|
|
139
141
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
updateTsConfigReferences(tree, tsSysFromTree, tsconfigInfoCaches, sourceProjectTsconfigPath,
|
|
143
|
+
// If we find a runtime tsconfig file, we make sure the external
|
|
144
|
+
// dependencies are emptied from the tsconfig.json file instead,
|
|
145
|
+
// otherwise we update the project references for the tsconfig.json file
|
|
146
|
+
foundRuntimeTsConfig ? [] : dependencies, sourceProjectNode.data.root, projectRoots, changedFiles);
|
|
142
147
|
}
|
|
143
148
|
if (changedFiles.size > 0) {
|
|
144
149
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-redundant-ts-project-references.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/migrations/update-22-1-0/remove-redundant-ts-project-references.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,yBAA+B,IAAI,EAAE,IAAI,iBAExC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = default_1;
|
|
4
|
+
const typescript_sync_1 = require("../../generators/typescript-sync/typescript-sync");
|
|
5
|
+
async function default_1(tree) {
|
|
6
|
+
await (0, typescript_sync_1.syncGenerator)(tree);
|
|
7
|
+
}
|