@nx/js 22.0.0-canary.20251015-f37c13b → 22.0.0-canary.20251018-6549d2a

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/js",
3
- "version": "22.0.0-canary.20251015-f37c13b",
3
+ "version": "22.0.0-canary.20251018-6549d2a",
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.0.0-canary.20251015-f37c13b",
43
- "@nx/workspace": "22.0.0-canary.20251015-f37c13b",
42
+ "@nx/devkit": "22.0.0-canary.20251018-6549d2a",
43
+ "@nx/workspace": "22.0.0-canary.20251018-6549d2a",
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.0.0-canary.20251015-f37c13b"
63
+ "nx": "22.0.0-canary.20251018-6549d2a"
64
64
  },
65
65
  "peerDependencies": {
66
66
  "verdaccio": "^6.0.5"
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,iBAAiB,EAIjB,IAAI,EACL,MAAM,YAAY,CAAC;AAuBpB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAoCtC,wBAAsB,aAAa,CACjC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAgI5B;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/js/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,iBAAiB,EAKjB,IAAI,EACL,MAAM,YAAY,CAAC;AAuBpB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAwCtC,wBAAsB,aAAa,CACjC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAS5B;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,iBAAiB,CAAC,CAgI5B;AAED,eAAe,aAAa,CAAC"}
@@ -14,9 +14,7 @@ const ts_config_1 = require("../../utils/typescript/ts-config");
14
14
  const ts_solution_setup_1 = require("../../utils/typescript/ts-solution-setup");
15
15
  const versions_1 = require("../../utils/versions");
16
16
  async function getInstalledTypescriptVersion(tree) {
17
- const rootPackageJson = (0, devkit_1.readJson)(tree, 'package.json');
18
- const tsVersionInRootPackageJson = rootPackageJson.devDependencies?.['typescript'] ??
19
- rootPackageJson.dependencies?.['typescript'];
17
+ const tsVersionInRootPackageJson = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'typescript');
20
18
  if (!tsVersionInRootPackageJson) {
21
19
  return null;
22
20
  }
@@ -36,7 +34,7 @@ async function getInstalledTypescriptVersion(tree) {
36
34
  }
37
35
  }
38
36
  finally {
39
- return (0, semver_1.checkAndCleanWithSemver)('typescript', tsVersionInRootPackageJson);
37
+ return (0, semver_1.checkAndCleanWithSemver)(tree, 'typescript', tsVersionInRootPackageJson);
40
38
  }
41
39
  }
42
40
  async function initGenerator(tree, schema) {
@@ -1 +1 @@
1
- {"version":3,"file":"version-actions.d.ts","sourceRoot":"","sources":["../../../../../packages/js/src/release/version-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAEZ,IAAI,EAGL,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAM3E,eAAO,MAAM,yBAAyB,EAAE,yBAkBvC,CAAC;AAKF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,cAAc;IAC1D,sBAAsB,WAAoB;IAEpC,oCAAoC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;QAC9D,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAkBI,8BAA8B,CAClC,IAAI,EAAE,IAAI,EACV,8BAA8B,EAAE,6BAA6B,CAAC,gCAAgC,CAAC,GAC9F,OAAO,CAAC;QACT,cAAc,EAAE,MAAM,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAkEI,8BAA8B,CAClC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,qBAAqB,EAAE,MAAM,GAC5B,OAAO,CAAC;QACT,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;KACrC,CAAC;IA+BI,oBAAoB,CACxB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC;IAcd,yBAAyB,CAC7B,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,MAAM,EAAE,CAAC;IAwFpB,OAAO,CAAC,yBAAyB;CAyClC"}
1
+ {"version":3,"file":"version-actions.d.ts","sourceRoot":"","sources":["../../../../../packages/js/src/release/version-actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,YAAY,EAEZ,IAAI,EAGL,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uBAAuB,CAAC;AAM3E,eAAO,MAAM,yBAAyB,EAAE,yBAkBvC,CAAC;AAKF,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,cAAc;IAC1D,sBAAsB,WAAoB;IAEpC,oCAAoC,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC;QAC9D,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IAkBI,8BAA8B,CAClC,IAAI,EAAE,IAAI,EACV,8BAA8B,EAAE,6BAA6B,CAAC,gCAAgC,CAAC,GAC9F,OAAO,CAAC;QACT,cAAc,EAAE,MAAM,CAAC;QACvB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAkEI,8BAA8B,CAClC,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,qBAAqB,EAAE,MAAM,GAC5B,OAAO,CAAC;QACT,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;KACrC,CAAC;IA4CI,oBAAoB,CACxB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,EAAE,CAAC;IAcd,yBAAyB,CAC7B,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAC3C,OAAO,CAAC,MAAM,EAAE,CAAC;IAwHpB,OAAO,CAAC,yBAAyB;CAyClC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.afterAllProjectsVersioned = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
+ const catalog_1 = require("@nx/devkit/src/utils/catalog");
5
6
  const node_child_process_1 = require("node:child_process");
6
7
  const node_path_1 = require("node:path");
7
8
  const release_1 = require("nx/release");
@@ -106,6 +107,13 @@ class JsVersionActions extends release_1.VersionActions {
106
107
  break;
107
108
  }
108
109
  }
110
+ // Resolve catalog references if needed
111
+ if (currentVersion) {
112
+ const catalogManager = (0, catalog_1.getCatalogManager)(tree.root);
113
+ if (catalogManager?.isCatalogReference(currentVersion)) {
114
+ currentVersion = catalogManager.resolveCatalogReference(tree, dependencyPackageName, currentVersion);
115
+ }
116
+ }
109
117
  return {
110
118
  currentVersion,
111
119
  dependencyCollection,
@@ -128,6 +136,8 @@ class JsVersionActions extends release_1.VersionActions {
128
136
  return [];
129
137
  }
130
138
  const logMessages = [];
139
+ const catalogUpdates = [];
140
+ const catalogManager = (0, catalog_1.getCatalogManager)(tree.root);
131
141
  for (const manifestToUpdate of this.manifestsToUpdate) {
132
142
  (0, devkit_1.updateJson)(tree, manifestToUpdate.manifestPath, (json) => {
133
143
  const dependencyTypes = [
@@ -153,8 +163,19 @@ class JsVersionActions extends release_1.VersionActions {
153
163
  }
154
164
  const currentVersion = json[depType][packageName];
155
165
  if (currentVersion) {
156
- // Check if the local dependency protocol should be preserved or not
157
- if (manifestToUpdate.preserveLocalDependencyProtocols &&
166
+ if (catalogManager?.isCatalogReference(currentVersion)) {
167
+ // collect the catalog updates so we can update the catalog definitions later
168
+ const catalogRef = catalogManager.parseCatalogReference(currentVersion);
169
+ catalogUpdates.push({
170
+ packageName,
171
+ version,
172
+ catalogName: catalogRef.catalogName,
173
+ });
174
+ numDependenciesToUpdate--;
175
+ continue;
176
+ }
177
+ // Check if other local dependency protocols should be preserved
178
+ else if (manifestToUpdate.preserveLocalDependencyProtocols &&
158
179
  this.isLocalDependencyProtocol(currentVersion)) {
159
180
  // Reduce the count appropriately to avoid confusing user-facing logs
160
181
  numDependenciesToUpdate--;
@@ -186,6 +207,13 @@ class JsVersionActions extends release_1.VersionActions {
186
207
  const depText = numDependenciesToUpdate === 1 ? 'dependency' : 'dependencies';
187
208
  logMessages.push(`✍️ Updated ${numDependenciesToUpdate} ${depText} in manifest: ${manifestToUpdate.manifestPath}`);
188
209
  }
210
+ // Update catalog definitions in pnpm-workspace.yaml
211
+ if (catalogUpdates.length > 0) {
212
+ // catalogManager is guaranteed to be defined when there are catalog updates
213
+ catalogManager.updateCatalogVersions(tree, catalogUpdates);
214
+ const catalogText = catalogUpdates.length === 1 ? 'entry' : 'entries';
215
+ logMessages.push(`✍️ Updated ${catalogUpdates.length} catalog ${catalogText} in pnpm-workspace.yaml`);
216
+ }
189
217
  return logMessages;
190
218
  }
191
219
  // NOTE: The TODOs were carried over from the original implementation, they are not yet implemented