nx 23.1.0-rc.2 → 23.1.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.
Binary file
@@ -24,7 +24,9 @@ function isPackageJsonAtProjectRoot(roots, fileName) {
24
24
  if (!fileName.endsWith('package.json')) {
25
25
  return false;
26
26
  }
27
- const filePath = fileName.slice(0, -13);
27
+ // A root-level package.json has no directory prefix, so its project root is '.';
28
+ // every other manifest sits at '<root>/package.json'.
29
+ const filePath = fileName === 'package.json' ? '.' : fileName.slice(0, -13);
28
30
  return !!roots[filePath];
29
31
  }
30
32
  function processPackageJson(sourceProject, packageJsonPath, ctx, targetProjectLocator, collectedDeps) {
@@ -225,7 +225,23 @@ function preparePackageInstallation(pkg, requiredVersion, packageManager) {
225
225
  // it into the temp dir, so the `-w` here resolves to the temp dir.
226
226
  const pmCommands = (0, package_manager_1.getPackageManagerCommand)(packageManager);
227
227
  const preInstallCommand = pmCommands.preInstall;
228
- const installCommand = `${pmCommands.addDev} ${pkg}@${requiredVersion} ${pmCommands.ignoreScriptsFlag ?? ''}`;
228
+ // Omit peer dependencies from the temp install. `ensurePackage` puts the
229
+ // workspace's `node_modules` on `NODE_PATH`, so a loaded package resolves its
230
+ // peers from the workspace instead of pulling its own (possibly incompatible)
231
+ // copies into the temp dir.
232
+ const omitPeerDependenciesFlag = packageManager === 'npm' || packageManager === 'bun'
233
+ ? '--omit=peer'
234
+ : packageManager === 'pnpm'
235
+ ? '--config.auto-install-peers=false'
236
+ : '';
237
+ const installCommand = [
238
+ pmCommands.addDev,
239
+ `${pkg}@${requiredVersion}`,
240
+ omitPeerDependenciesFlag,
241
+ pmCommands.ignoreScriptsFlag,
242
+ ]
243
+ .filter(Boolean)
244
+ .join(' ');
229
245
  const execOptions = {
230
246
  cwd: tempDir,
231
247
  stdio: isVerbose ? 'inherit' : 'ignore',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx",
3
- "version": "23.1.0-rc.2",
3
+ "version": "23.1.0",
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.",
@@ -176,16 +176,16 @@
176
176
  }
177
177
  },
178
178
  "optionalDependencies": {
179
- "@nx/nx-darwin-arm64": "23.1.0-rc.2",
180
- "@nx/nx-darwin-x64": "23.1.0-rc.2",
181
- "@nx/nx-freebsd-x64": "23.1.0-rc.2",
182
- "@nx/nx-linux-arm-gnueabihf": "23.1.0-rc.2",
183
- "@nx/nx-linux-arm64-gnu": "23.1.0-rc.2",
184
- "@nx/nx-linux-arm64-musl": "23.1.0-rc.2",
185
- "@nx/nx-linux-x64-gnu": "23.1.0-rc.2",
186
- "@nx/nx-linux-x64-musl": "23.1.0-rc.2",
187
- "@nx/nx-win32-arm64-msvc": "23.1.0-rc.2",
188
- "@nx/nx-win32-x64-msvc": "23.1.0-rc.2"
179
+ "@nx/nx-darwin-arm64": "23.1.0",
180
+ "@nx/nx-darwin-x64": "23.1.0",
181
+ "@nx/nx-freebsd-x64": "23.1.0",
182
+ "@nx/nx-linux-arm-gnueabihf": "23.1.0",
183
+ "@nx/nx-linux-arm64-gnu": "23.1.0",
184
+ "@nx/nx-linux-arm64-musl": "23.1.0",
185
+ "@nx/nx-linux-x64-gnu": "23.1.0",
186
+ "@nx/nx-linux-x64-musl": "23.1.0",
187
+ "@nx/nx-win32-arm64-msvc": "23.1.0",
188
+ "@nx/nx-win32-x64-msvc": "23.1.0"
189
189
  },
190
190
  "nx-migrations": {
191
191
  "migrations": "./migrations.json",