nx 23.3.2 → 23.3.3

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.
@@ -939,7 +939,7 @@ function saveProjectsConfigurationsInWrappedSchematic(host, content) {
939
939
  }
940
940
  }
941
941
  async function getWrappedWorkspaceNodeModulesArchitectHost(workspace, root, projects) {
942
- const { WorkspaceNodeModulesArchitectHost: AngularWorkspaceNodeModulesArchitectHost, } = await (0, handle_import_1.handleImport)('@angular-devkit/architect/node/index.js');
942
+ const { WorkspaceNodeModulesArchitectHost: AngularWorkspaceNodeModulesArchitectHost, } = await (0, handle_import_1.handleImport)('@angular-devkit/architect/node');
943
943
  class WrappedWorkspaceNodeModulesArchitectHost extends AngularWorkspaceNodeModulesArchitectHost {
944
944
  constructor(workspace, root, projects) {
945
945
  super(workspace, root);
Binary file
@@ -25,18 +25,62 @@ function packageJsonDependencyChanges(touchedFiles, nxJson, projectGraph) {
25
25
  projects: touched.filter((name) => name in projectGraph.nodes),
26
26
  };
27
27
  }
28
+ const PNPM_WORKSPACE_FILES = ['pnpm-workspace.yaml', 'pnpm-workspace.yml'];
28
29
  /**
29
30
  * External nodes and workspace projects the root package.json change names,
30
31
  * or null when it cannot be pinned to them: a removed dependency, a global
31
32
  * package, or an override selector matching nothing in the graph.
33
+ *
34
+ * Also reads `overrides` from `pnpm-workspace.yaml` (pnpm 10+): the field
35
+ * moves there when the root `package.json` has no `pnpm` block, and pnpm 12
36
+ * no longer reads `package.json#pnpm` at all. Yaml override diffs are rewritten
37
+ * to the `pnpm.overrides.*` path and matched by the existing pnpm selector
38
+ * logic. Catalog and other workspace settings are left alone.
32
39
  */
33
40
  function touchedNpmPackages(touchedFiles, nxJson, projectGraph) {
34
41
  const packageJsonChange = touchedFiles.find((f) => f.file === 'package.json');
35
- if (!packageJsonChange)
42
+ const workspaceYamlChange = touchedFiles.find((f) => PNPM_WORKSPACE_FILES.includes(f.file));
43
+ if (!packageJsonChange && !workspaceYamlChange)
36
44
  return [];
37
45
  const globalPackages = new Set(getGlobalPackages(nxJson.plugins));
38
46
  let touched = [];
39
- const changes = packageJsonChange.getChanges();
47
+ const changes = packageJsonChange
48
+ ? [...packageJsonChange.getChanges()]
49
+ : [];
50
+ if (workspaceYamlChange) {
51
+ for (const c of workspaceYamlChange.getChanges()) {
52
+ // Unparseable yaml - be conservative and fall back to all projects.
53
+ if (!(0, json_diff_1.isJsonChange)(c))
54
+ return null;
55
+ // Catalog, patchedDependencies, settings, etc. do not change which
56
+ // packages the lockfile resolves to.
57
+ if (c.path[0] !== 'overrides')
58
+ continue;
59
+ // Replacing the whole `overrides` map with something non-mappy
60
+ // (null, scalar, array) is a shape we don't understand - fall back.
61
+ if (c.path.length === 1) {
62
+ if (!isObjectOrUndefined(c.value.lhs))
63
+ return null;
64
+ if (!isObjectOrUndefined(c.value.rhs))
65
+ return null;
66
+ }
67
+ else {
68
+ // pnpm's workspace overrides take string selectors as keys and
69
+ // string versions as leaves; a non-string leaf is a shape we
70
+ // don't model.
71
+ if (c.value.lhs !== undefined && typeof c.value.lhs !== 'string') {
72
+ return null;
73
+ }
74
+ if (c.value.rhs !== undefined && typeof c.value.rhs !== 'string') {
75
+ return null;
76
+ }
77
+ }
78
+ changes.push({
79
+ ...c,
80
+ path: ['pnpm', 'overrides', ...c.path.slice(1)],
81
+ });
82
+ }
83
+ }
40
84
  const npmPackages = Object.values(projectGraph.externalNodes);
41
85
  let packagesByName;
42
86
  const missingTouchedNpmPackages = [];
@@ -143,3 +187,7 @@ function getGlobalPackages(plugins) {
143
187
  .map((p) => (0, get_package_name_from_import_path_1.getPackageNameFromImportPath)(typeof p === 'string' ? p : p.plugin))
144
188
  .concat('nx');
145
189
  }
190
+ function isObjectOrUndefined(value) {
191
+ return (value === undefined ||
192
+ (value !== null && typeof value === 'object' && !Array.isArray(value)));
193
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "23.3.2",
3
+ "version": "23.3.3",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "description": "The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.",
@@ -159,16 +159,16 @@
159
159
  }
160
160
  },
161
161
  "optionalDependencies": {
162
- "@nx/nx-darwin-arm64": "23.3.2",
163
- "@nx/nx-darwin-x64": "23.3.2",
164
- "@nx/nx-freebsd-x64": "23.3.2",
165
- "@nx/nx-linux-arm-gnueabihf": "23.3.2",
166
- "@nx/nx-linux-arm64-gnu": "23.3.2",
167
- "@nx/nx-linux-arm64-musl": "23.3.2",
168
- "@nx/nx-linux-x64-gnu": "23.3.2",
169
- "@nx/nx-linux-x64-musl": "23.3.2",
170
- "@nx/nx-win32-arm64-msvc": "23.3.2",
171
- "@nx/nx-win32-x64-msvc": "23.3.2"
162
+ "@nx/nx-darwin-arm64": "23.3.3",
163
+ "@nx/nx-darwin-x64": "23.3.3",
164
+ "@nx/nx-freebsd-x64": "23.3.3",
165
+ "@nx/nx-linux-arm-gnueabihf": "23.3.3",
166
+ "@nx/nx-linux-arm64-gnu": "23.3.3",
167
+ "@nx/nx-linux-arm64-musl": "23.3.3",
168
+ "@nx/nx-linux-x64-gnu": "23.3.3",
169
+ "@nx/nx-linux-x64-musl": "23.3.3",
170
+ "@nx/nx-win32-arm64-msvc": "23.3.3",
171
+ "@nx/nx-win32-x64-msvc": "23.3.3"
172
172
  },
173
173
  "nx-migrations": {
174
174
  "migrations": "./migrations.json",