Skip to content

fix(pnpm): resolve relative patchedDependencies against lockfileDir - #12762

Merged
zkochan merged 5 commits into
pnpm:mainfrom
luo2430:fix/pnpm
Jul 4, 2026
Merged

zkochan merged 5 commits into
pnpm:mainfrom
luo2430:fix/pnpm

Conversation

@luo2430

@luo2430 luo2430 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

PS C:\Users\24306\AppData\Roaming\Code\User\dev\web_learning\apps\galacean\galacean-utils>
pnpm patch-commit "C:\Users\24306\AppData\Roaming\Code\User\node_modules\.pnpm_patches\@galacean\[email protected]"
✓ Lockfile passes supply-chain policies (943 entries in 43s)
[ENOENT] ENOENT: no such file or directory, open 'C:\Users\24306\AppData\Roaming\Code\User\dev\web_learning\apps\galacean\galacean-utils\patches\@[email protected]'

pnpm: ENOENT: no such file or directory, open 'C:\Users\24306\AppData\Roaming\Code\User\dev\web_learning\apps\galacean\galacean-utils\patches\@[email protected]'
    at async open (node:internal/fs/promises:639:25)
    at async Object.readFile (node:internal/fs/promises:1252:14)
    at async readNormalizedFile (file:///C:/Users/24306/AppData/Roaming/npm/node_modules/pnpm/dist/pnpm.mjs:61229:19)
    at async createHexHashFromFile (file:///C:/Users/24306/AppData/Roaming/npm/node_modules/pnpm/dist/pnpm.mjs:61226:24)
    at async file:///C:/Users/24306/AppData/Roaming/npm/node_modules/pnpm/dist/pnpm.mjs:187371:20
    at async Promise.all (index 0)
    at async pMapValues (file:///C:/Users/24306/AppData/Roaming/npm/node_modules/pnpm/dist/pnpm.mjs:187370:3)
    at async _install (file:///C:/Users/24306/AppData/Roaming/npm/node_modules/pnpm/dist/pnpm.mjs:190038:132)

Actually, the patch has already been applied, and the path is C:/Users/24306/AppData/Roaming/Code/User/patches/@[email protected] .

Squash Commit Body

Ensure patchedDependencies paths are resolved relative to the lockfile directory before computing patch hashes. This fixes cases where relative patch paths were incorrectly resolved against the workspace root instead of the lockfile location.

Checklist

  • The change is implemented in both the TypeScript CLI and the Rust
    pacquet/ port, or the description notes what still needs porting.
    (No pacquet code change needed: pacquet already resolves patch paths against the workspace root, which is always its lockfile dir; its doc comments were updated to record that parity invariant.)
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.
  • Updated the documentation if needed.

Summary by CodeRabbit

  • Bug Fixes
    • Patched dependency patch paths now resolve relative to the lockfile directory, avoiding install failures from incorrect patch lookups.
    • Patch hash calculation and lockfile patchedDependencies entries now use the same resolved patch paths for consistent results.
  • Tests
    • Added a Jest test covering relative patch path resolution against lockfileDir, including verification of patch application and the recorded lockfile hash.

@luo2430
luo2430 requested a review from zkochan as a code owner July 2, 2026 08:51
@coderabbitai

coderabbitai Bot commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2a87ac9a-0b1e-4f9d-a1ba-a6c12f3e97a2

📥 Commits

Reviewing files that changed from the base of the PR and between 28b67f2 and 61af31e.

📒 Files selected for processing (1)
  • pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts

📝 Walkthrough

Walkthrough

Patched dependency paths are now resolved relative to the lockfile directory before patch hashes are computed in the status check and installer. A shared resolver module was added and re-exported, and supporting changes update the changeset and related documentation.

Changes

Patch path resolution fix

Layer / File(s) Summary
Add shared patch path resolver
pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts, pnpm11/lockfile/settings-checker/src/index.ts
A new helper resolves patched dependency targets against a base directory, and the package index re-exports it.
Resolve patch paths in lockfile status check
pnpm11/deps/status/src/checkDepsStatus.ts
assertWantedLockfileUpToDate resolves config.patchedDependencies against wantedLockfileDir before calling calcPatchHashes.
Resolve patch paths in installer and add regression test
pnpm11/installing/deps-installer/src/install/index.ts, pnpm11/installing/deps-installer/test/install/patch.ts
_install resolves opts.patchedDependencies against opts.lockfileDir, uses the resolved map for hash calculation and patchGroupInput, and a test verifies the relative-path case.
Update changeset and patching notes
.changeset/patched-deps-lockfile-dir.md, pacquet/crates/config/src/lib.rs, pacquet/crates/patching/src/resolve.rs
The changeset records the version bumps and behavior note, and the Pacquet comments are reworded to describe the lockfile hash output and patch anchoring.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested labels: product: pnpm@11, product: pacquet

Suggested reviewers: zkochan

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Fix pnpm patch hashing to resolve patchedDependencies relative to lockfileDir

🐞 Bug fix 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Resolve relative patchedDependencies paths against lockfileDir before hashing patch files.
• Align install and status-check flows so patch hashes are computed from the correct files.
• Add regression test covering relative patch paths stored under the lockfile directory.
Diagram

graph TD
  I["Installer mutateModules"] --> R["Resolve vs lockfileDir"] --> H["calcPatchHashes"] --> L[("pnpm-lock.yaml")]
  S["Status checker"] --> R
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Normalize patchedDependencies earlier (config load layer)
  • ➕ Single source of truth: all downstream consumers see normalized paths
  • ➕ Avoids repeating resolution in multiple call sites
  • ➖ Harder to guarantee you have the right base dir at config-load time (workspace vs lockfileDir)
  • ➖ Higher risk of unintended behavior changes for other consumers relying on current semantics
2. Make calcPatchHashes accept a baseDir and resolve internally
  • ➕ Keeps callers simpler and prevents future call sites from forgetting to resolve
  • ➕ Encapsulates path semantics close to the hashing behavior
  • ➖ Couples hashing utility to lockfile/workspace concepts
  • ➖ Still requires deciding the correct baseDir at each call site

Recommendation: Current approach (resolve at the two call sites that compute hashes / patch inputs) is the lowest-risk fix and directly addresses the reported ENOENT on relative patch paths. Consider centralizing normalization later if additional call sites start needing the same lockfileDir-relative behavior.

Files changed (3) +69 / -7

Bug fix (2) +31 / -7
checkDepsStatus.tsResolve patchedDependencies relative to wantedLockfileDir before hashing +12/-1

Resolve patchedDependencies relative to wantedLockfileDir before hashing

• Adds a normalization step that converts patchedDependencies values to absolute paths using wantedLockfileDir. Uses the resolved map when computing patch hashes during lockfile up-to-date assertions to avoid resolving relative paths against the wrong working directory.

pnpm11/deps/status/src/checkDepsStatus.ts

index.tsNormalize patchedDependencies against lockfileDir for hashing and patchGroupInput +19/-6

Normalize patchedDependencies against lockfileDir for hashing and patchGroupInput

• Resolves patchedDependencies values against opts.lockfileDir upfront to ensure calcPatchHashes reads the correct patch files. Reuses the same resolved paths when building patchGroupInput so patch hash computation and patchFilePath metadata stay consistent.

pnpm11/installing/deps-installer/src/install/index.ts

Tests (1) +38 / -0
patch.tsAdd regression test for relative patch paths under lockfileDir +38/-0

Add regression test for relative patch paths under lockfileDir

• Introduces a test that places a patch file under a lockfileDir-local patches/ directory while passing a relative patchedDependencies path. Verifies install applies the patch and that the lockfile records the expected patch file hash.

pnpm11/installing/deps-installer/test/install/patch.ts

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Jul 2, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. Pacquet patch base mismatch 🐞 Bug ⛨ Security
Description
This PR changes pnpm (TS) to resolve relative patchedDependencies paths against lockfileDir, but
pacquet still resolves them against workspace_dir, so the same config resolves to different patch
files when those dirs differ. In pacquet this can produce ENOENT during hashing/apply, or worse,
apply/hash a different file if both bases contain a matching relative path.
Code

pnpm11/installing/deps-installer/src/install/index.ts[R641-653]

+    // Resolve patchedDependencies against lockfileDir upfront so both
+    // calcPatchHashes and the patchGroupInput construction use the same
+    // absolute paths. path.resolve with an already-absolute path is a
+    // no-op, so this is safe regardless of whether the upstream config
+    // layer already resolved to absolute paths.
+    const resolvedPatchedDeps = opts.patchedDependencies
+      ? Object.fromEntries(
+        Object.entries(opts.patchedDependencies).map(([key, value]) => [
+          key,
+          path.resolve(opts.lockfileDir, value),
+        ])
+      )
+      : undefined
Evidence
The TS change explicitly resolves each patchedDependencies entry with
path.resolve(opts.lockfileDir, value), anchoring relative paths to the lockfile directory. In
pacquet, resolve_and_group still joins non-absolute patch paths with
workspace_dir.join(candidate), anchoring to the workspace manifest directory instead, which
diverges when lockfileDir != workspace_dir and leads to different files being
read/hashed/applied.

pnpm11/installing/deps-installer/src/install/index.ts[641-653]
pnpm11/deps/status/src/checkDepsStatus.ts[663-680]
pacquet/crates/patching/src/resolve.rs[46-71]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
TypeScript pnpm now anchors `patchedDependencies` relative paths on `lockfileDir` / `wantedLockfileDir`. The Rust `pacquet` port still anchors them on the workspace manifest directory (`workspace_dir`), which breaks pnpm↔pacquet parity and causes patch hashing/application to fail or differ when `lockfileDir` is not the workspace root.
## Issue Context
- pnpm v11 can place the lockfile in a directory different from the workspace manifest (e.g. `--lockfile-dir`, editor-managed lockfile locations, or other tooling).
- Patch files are read (hashed and applied) by absolute path; a different base directory changes which file is read.
## Fix Focus Areas
- pacquet/crates/patching/src/resolve.rs[46-71]
- pacquet/crates/config/src/lib.rs[1002-1016]
- pnpm11/installing/deps-installer/src/install/index.ts[641-673]
## Suggested fix
1. Change `pacquet_patching::resolve_and_group` to accept a `lockfile_dir: &Path` (or a more precise “patch base dir” that matches pnpm semantics) instead of `workspace_dir`, and resolve relative patch paths with `lockfile_dir.join(candidate)`.
2. Update the call site(s) that currently pass `workspace_dir` so they pass the actual lockfile directory.
3. Add/adjust a pacquet test mirroring the new TS test: create patches under lockfileDir while workspace yaml lives elsewhere, set `patchedDependencies` to a relative `patches/...` path, and assert hashing/apply succeeds.
4. Update doc/comments in pacquet that currently claim pnpm resolves relative patched paths against `workspace_dir` (that statement is no longer true after this PR).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Test misses shared lockfileDir 🐞 Bug ⚙ Maintainability
Description
The new test sets lockfileDir to process.cwd(), so it does not cover the real failure mode this
PR targets: relative patch paths when lockfileDir differs from the current working directory
(shared lockfile in a parent/other directory). As a result, a regression in the lockfileDir != cwd
scenario could still slip through CI.
Code

pnpm11/installing/deps-installer/test/install/patch.ts[R574-596]

+test('patch with relative paths resolved against lockfileDir', async () => {
+  const project = prepareEmpty()
+  // Simulate the scenario where patches live under the lockfile directory
+  // but patchedDependencies only records relative paths. The install path
+  // must resolve them against lockfileDir so calcPatchHashes can read them.
+  const patchesDir = path.join(process.cwd(), 'patches')
+  fs.mkdirSync(patchesDir, { recursive: true })
+  fs.copyFileSync(
+    path.join(f.find('patch-pkg'), '[email protected]'),
+    path.join(patchesDir, '[email protected]')
+  )
+
+  const patchedDependencies = {
+    '[email protected]': 'patches/[email protected]',
+  }
+  const opts = testDefaults({
+    fastUnpack: false,
+    sideEffectsCacheRead: true,
+    sideEffectsCacheWrite: true,
+    patchedDependencies,
+    // Explicit lockfileDir so the resolution is deterministic
+    lockfileDir: process.cwd(),
+  }, {}, {}, { packageImportMethod: 'hardlink' })
Evidence
The test currently uses the same directory for both CWD and lockfileDir, so it cannot distinguish
the old behavior (hashing relative paths against CWD) from the new behavior (resolving against
lockfileDir). calcPatchHashes() does no base-dir resolution, so the test must force
lockfileDir and CWD to differ to prove the fix.

pnpm11/installing/deps-installer/test/install/patch.ts[574-596]
pnpm11/utils/prepare/src/index.ts[76-83]
pnpm11/lockfile/settings-checker/src/calcPatchHashes.ts[4-8]
pnpm11/installing/deps-installer/test/install/lockfileDir.ts[46-59]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The added test uses `lockfileDir: process.cwd()`, so relative patch paths resolve against the same directory regardless of whether pnpm resolves against CWD or `lockfileDir`. This doesn’t validate the main bugfix scenario where `lockfileDir` is different (e.g. shared lockfile in a parent directory).
### Issue Context
`calcPatchHashes()` hashes file paths exactly as passed and does not resolve them against `lockfileDir`, so the only way to validate the fix is to create a situation where the patch exists relative to `lockfileDir` but not relative to CWD.
### Fix Focus Areas
- pnpm11/installing/deps-installer/test/install/patch.ts[574-610]
### Suggested change
Update the test to:
1. Set `const lockfileDir = path.resolve('..')`.
2. Create/copy the patch file under `path.join(lockfileDir, 'patches')`.
3. Keep `patchedDependencies` as a relative path like `'patches/[email protected]'`.
4. Pass `lockfileDir` into `testDefaults({ lockfileDir, patchedDependencies, ... })`.
This makes the test fail on old behavior (resolving relative to CWD) and pass only with the new `lockfileDir`-based resolution.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

3. Double-resolved patch paths 🐞 Bug ➹ Performance
Description
In mutateModules(), patchedDependencies entries are first converted to absolute paths by
resolvePatchedDependencies(), but patchGroupInput then applies path.resolve(lockfileDir, ...) again
per entry. This is a low-impact extra step on the install path and makes it less clear whether
resolvedPatchedDeps contains absolute or relative paths.
Code

pnpm11/installing/deps-installer/src/install/index.ts[R642-657]

+    const resolvedPatchedDeps = resolvePatchedDependencies(opts.patchedDependencies, opts.lockfileDir)
const patchedDependencies = opts.ignorePackageManifest
  ? ctx.wantedLockfile.patchedDependencies
-      : (opts.patchedDependencies ? await calcPatchHashes(opts.patchedDependencies) : {})
-    const patchGroupInput = opts.patchedDependencies
+      : (resolvedPatchedDeps ? await calcPatchHashes(resolvedPatchedDeps) : {})
+    const patchGroupInput = resolvedPatchedDeps
  ? Object.fromEntries(
    Object.entries(patchedDependencies ?? {}).map(([key, hash]) => {
-          let patchFilePath = opts.patchedDependencies![key]
-            ? path.resolve(opts.lockfileDir, opts.patchedDependencies![key])
+          let patchFilePath = resolvedPatchedDeps![key]
+            ? path.resolve(opts.lockfileDir, resolvedPatchedDeps![key])
        : undefined
      if (!patchFilePath) {
        const lastAt = key.lastIndexOf('@')
        const pkgName = lastAt > 0 ? key.slice(0, lastAt) : key
-            if (opts.patchedDependencies![pkgName]) {
-              patchFilePath = path.resolve(opts.lockfileDir, opts.patchedDependencies![pkgName])
+            if (resolvedPatchedDeps![pkgName]) {
+              patchFilePath = path.resolve(opts.lockfileDir, resolvedPatchedDeps![pkgName])
        }
Evidence
The helper guarantees absolute paths (via path.resolve), so the later path.resolve(lockfileDir,
alreadyAbsolutePath) is a no-op performed repeatedly during install when patched dependencies are
present.

pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts[3-13]
pnpm11/installing/deps-installer/src/install/index.ts[642-657]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`resolvePatchedDependencies()` already turns each `patchedDependencies` entry into an absolute path via `path.resolve(baseDir, value)`. In `mutateModules()` we then call `path.resolve(opts.lockfileDir, resolvedPatchedDeps![...])` again when constructing `patchGroupInput`, which is redundant and slightly obscures the intended invariant (are these values absolute or lockfileDir-relative?).
### Issue Context
This runs in the install flow and is executed once per patched dependency when building `patchGroups`.
### Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/index.ts[642-657]
- pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts[3-13]
### Suggested change
- When `resolvedPatchedDeps` is used, set `patchFilePath` directly to `resolvedPatchedDeps![key]` (and `resolvedPatchedDeps![pkgName]` in the fallback) without wrapping in `path.resolve(opts.lockfileDir, ...)`.
- (Optional) Consider a small comment or renaming to make it explicit `resolvedPatchedDeps` values are absolute paths.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Previous review results

Review updated until commit 61af31e

Results up to commit 61af31e


🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)


Action required
1. Pacquet patch base mismatch 🐞 Bug ⛨ Security
Description
This PR changes pnpm (TS) to resolve relative patchedDependencies paths against lockfileDir, but
pacquet still resolves them against workspace_dir, so the same config resolves to different patch
files when those dirs differ. In pacquet this can produce ENOENT during hashing/apply, or worse,
apply/hash a different file if both bases contain a matching relative path.
Code

pnpm11/installing/deps-installer/src/install/index.ts[R641-653]

+    // Resolve patchedDependencies against lockfileDir upfront so both
+    // calcPatchHashes and the patchGroupInput construction use the same
+    // absolute paths. path.resolve with an already-absolute path is a
+    // no-op, so this is safe regardless of whether the upstream config
+    // layer already resolved to absolute paths.
+    const resolvedPatchedDeps = opts.patchedDependencies
+      ? Object.fromEntries(
+        Object.entries(opts.patchedDependencies).map(([key, value]) => [
+          key,
+          path.resolve(opts.lockfileDir, value),
+        ])
+      )
+      : undefined
Evidence
The TS change explicitly resolves each patchedDependencies entry with
path.resolve(opts.lockfileDir, value), anchoring relative paths to the lockfile directory. In
pacquet, resolve_and_group still joins non-absolute patch paths with
workspace_dir.join(candidate), anchoring to the workspace manifest directory instead, which
diverges when lockfileDir != workspace_dir and leads to different files being
read/hashed/applied.

pnpm11/installing/deps-installer/src/install/index.ts[641-653]
pnpm11/deps/status/src/checkDepsStatus.ts[663-680]
pacquet/crates/patching/src/resolve.rs[46-71]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
TypeScript pnpm now anchors `patchedDependencies` relative paths on `lockfileDir` / `wantedLockfileDir`. The Rust `pacquet` port still anchors them on the workspace manifest directory (`workspace_dir`), which breaks pnpm↔pacquet parity and causes patch hashing/application to fail or differ when `lockfileDir` is not the workspace root.
## Issue Context
- pnpm v11 can place the lockfile in a directory different from the workspace manifest (e.g. `--lockfile-dir`, editor-managed lockfile locations, or other tooling).
- Patch files are read (hashed and applied) by absolute path; a different base directory changes which file is read.
## Fix Focus Areas
- pacquet/crates/patching/src/resolve.rs[46-71]
- pacquet/crates/config/src/lib.rs[1002-1016]
- pnpm11/installing/deps-installer/src/install/index.ts[641-673]
## Suggested fix
1. Change `pacquet_patching::resolve_and_group` to accept a `lockfile_dir: &Path` (or a more precise “patch base dir” that matches pnpm semantics) instead of `workspace_dir`, and resolve relative patch paths with `lockfile_dir.join(candidate)`.
2. Update the call site(s) that currently pass `workspace_dir` so they pass the actual lockfile directory.
3. Add/adjust a pacquet test mirroring the new TS test: create patches under lockfileDir while workspace yaml lives elsewhere, set `patchedDependencies` to a relative `patches/...` path, and assert hashing/apply succeeds.
4. Update doc/comments in pacquet that currently claim pnpm resolves relative patched paths against `workspace_dir` (that statement is no longer true after this PR).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Test misses shared lockfileDir 🐞 Bug ⚙ Maintainability
Description
The new test sets lockfileDir to process.cwd(), so it does not cover the real failure mode this
PR targets: relative patch paths when lockfileDir differs from the current working directory
(shared lockfile in a parent/other directory). As a result, a regression in the lockfileDir != cwd
scenario could still slip through CI.
Code

pnpm11/installing/deps-installer/test/install/patch.ts[R574-596]

+test('patch with relative paths resolved against lockfileDir', async () => {
+  const project = prepareEmpty()
+  // Simulate the scenario where patches live under the lockfile directory
+  // but patchedDependencies only records relative paths. The install path
+  // must resolve them against lockfileDir so calcPatchHashes can read them.
+  const patchesDir = path.join(process.cwd(), 'patches')
+  fs.mkdirSync(patchesDir, { recursive: true })
+  fs.copyFileSync(
+    path.join(f.find('patch-pkg'), '[email protected]'),
+    path.join(patchesDir, '[email protected]')
+  )
+
+  const patchedDependencies = {
+    '[email protected]': 'patches/[email protected]',
+  }
+  const opts = testDefaults({
+    fastUnpack: false,
+    sideEffectsCacheRead: true,
+    sideEffectsCacheWrite: true,
+    patchedDependencies,
+    // Explicit lockfileDir so the resolution is deterministic
+    lockfileDir: process.cwd(),
+  }, {}, {}, { packageImportMethod: 'hardlink' })
Evidence
The test currently uses the same directory for both CWD and lockfileDir, so it cannot distinguish
the old behavior (hashing relative paths against CWD) from the new behavior (resolving against
lockfileDir). calcPatchHashes() does no base-dir resolution, so the test must force
lockfileDir and CWD to differ to prove the fix.

pnpm11/installing/deps-installer/test/install/patch.ts[574-596]
pnpm11/utils/prepare/src/index.ts[76-83]
pnpm11/lockfile/settings-checker/src/calcPatchHashes.ts[4-8]
pnpm11/installing/deps-installer/test/install/lockfileDir.ts[46-59]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The added test uses `lockfileDir: process.cwd()`, so relative patch paths resolve against the same directory regardless of whether pnpm resolves against CWD or `lockfileDir`. This doesn’t validate the main bugfix scenario where `lockfileDir` is different (e.g. shared lockfile in a parent directory).
### Issue Context
`calcPatchHashes()` hashes file paths exactly as passed and does not resolve them against `lockfileDir`, so the only way to validate the fix is to create a situation where the patch exists relative to `lockfileDir` but not relative to CWD.
### Fix Focus Areas
- pnpm11/installing/deps-installer/test/install/patch.ts[574-610]
### Suggested change
Update the test to:
1. Set `const lockfileDir = path.resolve('..')`.
2. Create/copy the patch file under `path.join(lockfileDir, 'patches')`.
3. Keep `patchedDependencies` as a relative path like `'patches/[email protected]'`.
4. Pass `lockfileDir` into `testDefaults({ lockfileDir, patchedDependencies, ... })`.
This makes the test fail on old behavior (resolving relative to CWD) and pass only with the new `lockfileDir`-based resolution.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
3. Double-resolved patch paths 🐞 Bug ➹ Performance
Description
In mutateModules(), patchedDependencies entries are first converted to absolute paths by
resolvePatchedDependencies(), but patchGroupInput then applies path.resolve(lockfileDir, ...) again
per entry. This is a low-impact extra step on the install path and makes it less clear whether
resolvedPatchedDeps contains absolute or relative paths.
Code

pnpm11/installing/deps-installer/src/install/index.ts[R642-657]

+    const resolvedPatchedDeps = resolvePatchedDependencies(opts.patchedDependencies, opts.lockfileDir)
 const patchedDependencies = opts.ignorePackageManifest
   ? ctx.wantedLockfile.patchedDependencies
-      : (opts.patchedDependencies ? await calcPatchHashes(opts.patchedDependencies) : {})
-    const patchGroupInput = opts.patchedDependencies
+      : (resolvedPatchedDeps ? await calcPatchHashes(resolvedPatchedDeps) : {})
+    const patchGroupInput = resolvedPatchedDeps
   ? Object.fromEntries(
     Object.entries(patchedDependencies ?? {}).map(([key, hash]) => {
-          let patchFilePath = opts.patchedDependencies![key]
-            ? path.resolve(opts.lockfileDir, opts.patchedDependencies![key])
+          let patchFilePath = resolvedPatchedDeps![key]
+            ? path.resolve(opts.lockfileDir, resolvedPatchedDeps![key])
         : undefined
       if (!patchFilePath) {
         const lastAt = key.lastIndexOf('@')
         const pkgName = lastAt > 0 ? key.slice(0, lastAt) : key
-            if (opts.patchedDependencies![pkgName]) {
-              patchFilePath = path.resolve(opts.lockfileDir, opts.patchedDependencies![pkgName])
+            if (resolvedPatchedDeps![pkgName]) {
+              patchFilePath = path.resolve(opts.lockfileDir, resolvedPatchedDeps![pkgName])
         }
Evidence
The helper guarantees absolute paths (via path.resolve), so the later path.resolve(lockfileDir,
alreadyAbsolutePath) is a no-op performed repeatedly during install when patched dependencies are
present.

pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts[3-13]
pnpm11/installing/deps-installer/src/install/index.ts[642-657]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`resolvePatchedDependencies()` already turns each `patchedDependencies` entry into an absolute path via `path.resolve(baseDir, value)`. In `mutateModules()` we then call `path.resolve(opts.lockfileDir, resolvedPatchedDeps![...])` again when constructing `patchGroupInput`, which is redundant and slightly obscures the intended invariant (are these values absolute or lockfileDir-relative?).
### Issue Context
This runs in the install flow and is executed once per patched dependency when building `patchGroups`.
### Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/index.ts[642-657]
- pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts[3-13]
### Suggested change
- When `resolvedPatchedDeps` is used, set `patchFilePath` directly to `resolvedPatchedDeps![key]` (and `resolvedPatchedDeps![pkgName]` in the fallback) without wrapping in `path.resolve(opts.lockfileDir, ...)`.
- (Optional) Consider a small comment or renaming to make it explicit `resolvedPatchedDeps` values are absolute paths.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 28b67f2


🐞 Bugs (3) 📘 Rule violations (0) 📜 Skill insights (0)


Action required
1. Pacquet patch base mismatch 🐞 Bug ⛨ Security
Description
This PR changes pnpm (TS) to resolve relative patchedDependencies paths against lockfileDir, but
pacquet still resolves them against workspace_dir, so the same config resolves to different patch
files when those dirs differ. In pacquet this can produce ENOENT during hashing/apply, or worse,
apply/hash a different file if both bases contain a matching relative path.
Code

pnpm11/installing/deps-installer/src/install/index.ts[R641-653]

+    // Resolve patchedDependencies against lockfileDir upfront so both
+    // calcPatchHashes and the patchGroupInput construction use the same
+    // absolute paths. path.resolve with an already-absolute path is a
+    // no-op, so this is safe regardless of whether the upstream config
+    // layer already resolved to absolute paths.
+    const resolvedPatchedDeps = opts.patchedDependencies
+      ? Object.fromEntries(
+        Object.entries(opts.patchedDependencies).map(([key, value]) => [
+          key,
+          path.resolve(opts.lockfileDir, value),
+        ])
+      )
+      : undefined
Evidence
The TS change explicitly resolves each patchedDependencies entry with
path.resolve(opts.lockfileDir, value), anchoring relative paths to the lockfile directory. In
pacquet, resolve_and_group still joins non-absolute patch paths with
workspace_dir.join(candidate), anchoring to the workspace manifest directory instead, which
diverges when lockfileDir != workspace_dir and leads to different files being
read/hashed/applied.

pnpm11/installing/deps-installer/src/install/index.ts[641-653]
pnpm11/deps/status/src/checkDepsStatus.ts[663-680]
pacquet/crates/patching/src/resolve.rs[46-71]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
TypeScript pnpm now anchors `patchedDependencies` relative paths on `lockfileDir` / `wantedLockfileDir`. The Rust `pacquet` port still anchors them on the workspace manifest directory (`workspace_dir`), which breaks pnpm↔pacquet parity and causes patch hashing/application to fail or differ when `lockfileDir` is not the workspace root.
## Issue Context
- pnpm v11 can place the lockfile in a directory different from the workspace manifest (e.g. `--lockfile-dir`, editor-managed lockfile locations, or other tooling).
- Patch files are read (hashed and applied) by absolute path; a different base directory changes which file is read.
## Fix Focus Areas
- pacquet/crates/patching/src/resolve.rs[46-71]
- pacquet/crates/config/src/lib.rs[1002-1016]
- pnpm11/installing/deps-installer/src/install/index.ts[641-673]
## Suggested fix
1. Change `pacquet_patching::resolve_and_group` to accept a `lockfile_dir: &Path` (or a more precise “patch base dir” that matches pnpm semantics) instead of `workspace_dir`, and resolve relative patch paths with `lockfile_dir.join(candidate)`.
2. Update the call site(s) that currently pass `workspace_dir` so they pass the actual lockfile directory.
3. Add/adjust a pacquet test mirroring the new TS test: create patches under lockfileDir while workspace yaml lives elsewhere, set `patchedDependencies` to a relative `patches/...` path, and assert hashing/apply succeeds.
4. Update doc/comments in pacquet that currently claim pnpm resolves relative patched paths against `workspace_dir` (that statement is no longer true after this PR).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Test misses shared lockfileDir 🐞 Bug ⚙ Maintainability
Description
The new test sets lockfileDir to process.cwd(), so it does not cover the real failure mode this
PR targets: relative patch paths when lockfileDir differs from the current working directory
(shared lockfile in a parent/other directory). As a result, a regression in the lockfileDir != cwd
scenario could still slip through CI.
Code

pnpm11/installing/deps-installer/test/install/patch.ts[R574-596]

+test('patch with relative paths resolved against lockfileDir', async () => {
+  const project = prepareEmpty()
+  // Simulate the scenario where patches live under the lockfile directory
+  // but patchedDependencies only records relative paths. The install path
+  // must resolve them against lockfileDir so calcPatchHashes can read them.
+  const patchesDir = path.join(process.cwd(), 'patches')
+  fs.mkdirSync(patchesDir, { recursive: true })
+  fs.copyFileSync(
+    path.join(f.find('patch-pkg'), '[email protected]'),
+    path.join(patchesDir, '[email protected]')
+  )
+
+  const patchedDependencies = {
+    '[email protected]': 'patches/[email protected]',
+  }
+  const opts = testDefaults({
+    fastUnpack: false,
+    sideEffectsCacheRead: true,
+    sideEffectsCacheWrite: true,
+    patchedDependencies,
+    // Explicit lockfileDir so the resolution is deterministic
+    lockfileDir: process.cwd(),
+  }, {}, {}, { packageImportMethod: 'hardlink' })
Evidence
The test currently uses the same directory for both CWD and lockfileDir, so it cannot distinguish
the old behavior (hashing relative paths against CWD) from the new behavior (resolving against
lockfileDir). calcPatchHashes() does no base-dir resolution, so the test must force
lockfileDir and CWD to differ to prove the fix.

pnpm11/installing/deps-installer/test/install/patch.ts[574-596]
pnpm11/utils/prepare/src/index.ts[76-83]
pnpm11/lockfile/settings-checker/src/calcPatchHashes.ts[4-8]
pnpm11/installing/deps-installer/test/install/lockfileDir.ts[46-59]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The added test uses `lockfileDir: process.cwd()`, so relative patch paths resolve against the same directory regardless of whether pnpm resolves against CWD or `lockfileDir`. This doesn’t validate the main bugfix scenario where `lockfileDir` is different (e.g. shared lockfile in a parent directory).
### Issue Context
`calcPatchHashes()` hashes file paths exactly as passed and does not resolve them against `lockfileDir`, so the only way to validate the fix is to create a situation where the patch exists relative to `lockfileDir` but not relative to CWD.
### Fix Focus Areas
- pnpm11/installing/deps-installer/test/install/patch.ts[574-610]
### Suggested change
Update the test to:
1. Set `const lockfileDir = path.resolve('..')`.
2. Create/copy the patch file under `path.join(lockfileDir, 'patches')`.
3. Keep `patchedDependencies` as a relative path like `'patches/[email protected]'`.
4. Pass `lockfileDir` into `testDefaults({ lockfileDir, patchedDependencies, ... })`.
This makes the test fail on old behavior (resolving relative to CWD) and pass only with the new `lockfileDir`-based resolution.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational
3. Double-resolved patch paths 🐞 Bug ➹ Performance
Description
In mutateModules(), patchedDependencies entries are first converted to absolute paths by
resolvePatchedDependencies(), but patchGroupInput then applies path.resolve(lockfileDir, ...) again
per entry. This is a low-impact extra step on the install path and makes it less clear whether
resolvedPatchedDeps contains absolute or relative paths.
Code

pnpm11/installing/deps-installer/src/install/index.ts[R642-657]

+    const resolvedPatchedDeps = resolvePatchedDependencies(opts.patchedDependencies, opts.lockfileDir)
  const patchedDependencies = opts.ignorePackageManifest
    ? ctx.wantedLockfile.patchedDependencies
-      : (opts.patchedDependencies ? await calcPatchHashes(opts.patchedDependencies) : {})
-    const patchGroupInput = opts.patchedDependencies
+      : (resolvedPatchedDeps ? await calcPatchHashes(resolvedPatchedDeps) : {})
+    const patchGroupInput = resolvedPatchedDeps
    ? Object.fromEntries(
      Object.entries(patchedDependencies ?? {}).map(([key, hash]) => {
-          let patchFilePath = opts.patchedDependencies![key]
-            ? path.resolve(opts.lockfileDir, opts.patchedDependencies![key])
+          let patchFilePath = resolvedPatchedDeps![key]
+            ? path.resolve(opts.lockfileDir, resolvedPatchedDeps![key])
          : undefined
        if (!patchFilePath) {
          const lastAt = key.lastIndexOf('@')
          const pkgName = lastAt > 0 ? key.slice(0, lastAt) : key
-            if (opts.patchedDependencies![pkgName]) {
-              patchFilePath = path.resolve(opts.lockfileDir, opts.patchedDependencies![pkgName])
+            if (resolvedPatchedDeps![pkgName]) {
+              patchFilePath = path.resolve(opts.lockfileDir, resolvedPatchedDeps![pkgName])
          }
Evidence
The helper guarantees absolute paths (via path.resolve), so the later path.resolve(lockfileDir,
alreadyAbsolutePath) is a no-op performed repeatedly during install when patched dependencies are
present.

pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts[3-13]
pnpm11/installing/deps-installer/src/install/index.ts[642-657]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`resolvePatchedDependencies()` already turns each `patchedDependencies` entry into an absolute path via `path.resolve(baseDir, value)`. In `mutateModules()` we then call `path.resolve(opts.lockfileDir, resolvedPatchedDeps![...])` again when constructing `patchGroupInput`, which is redundant and slightly obscures the intended invariant (are these values absolute or lockfileDir-relative?).
### Issue Context
This runs in the install flow and is executed once per patched dependency when building `patchGroups`.
### Fix Focus Areas
- pnpm11/installing/deps-installer/src/install/index.ts[642-657]
- pnpm11/lockfile/settings-checker/src/resolvePatchedDependencies.ts[3-13]
### Suggested change
- When `resolvedPatchedDeps` is used, set `patchFilePath` directly to `resolvedPatchedDeps![key]` (and `resolvedPatchedDeps![pkgName]` in the fallback) without wrapping in `path.resolve(opts.lockfileDir, ...)`.
- (Optional) Consider a small comment or renaming to make it explicit `resolvedPatchedDeps` values are absolute paths.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pnpm11/installing/deps-installer/src/install/index.ts (1)

641-673: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Add a pnpm patch changeset for this user-visible fix.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm11/installing/deps-installer/src/install/index.ts` around lines 641 -
673, This change is user-visible, so add a pnpm patch changeset alongside the
update. Create the appropriate changeset entry for the package affected by the
install logic in install/index.ts, using the repo’s standard changeset flow so
the patch release is captured with a clear summary of the fix.

Source: Path instructions

🧹 Nitpick comments (1)
pnpm11/installing/deps-installer/src/install/index.ts (1)

657-668: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Redundant re-resolve of already-absolute paths.

resolvedPatchedDeps values are already made absolute via path.resolve(opts.lockfileDir, value) at line 650. Re-running path.resolve(opts.lockfileDir, resolvedPatchedDeps![key]) (and the same for the pkgName fallback at line 667) is a no-op given path.resolve short-circuits on an absolute second argument, but it's unnecessary extra work in this hot path and adds confusion about why paths are resolved twice.

♻️ Proposed simplification
-          let patchFilePath = resolvedPatchedDeps![key]
-            ? path.resolve(opts.lockfileDir, resolvedPatchedDeps![key])
-            : undefined
+          let patchFilePath = resolvedPatchedDeps![key]
           if (!patchFilePath) {
             const lastAt = key.lastIndexOf('@')
             const pkgName = lastAt > 0 ? key.slice(0, lastAt) : key
-            if (resolvedPatchedDeps![pkgName]) {
-              patchFilePath = path.resolve(opts.lockfileDir, resolvedPatchedDeps![pkgName])
-            }
+            patchFilePath = resolvedPatchedDeps![pkgName]
           }

As per path instructions: "Performance (§2): Path normalization and hash computation are install/lockfile hot-path code—avoid added filesystem work; prefer using already-computed/normalized absolute paths consistently instead of re-resolving per call."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm11/installing/deps-installer/src/install/index.ts` around lines 657 -
668, The `patchGroupInput` mapping in `install/index.ts` is re-resolving
`resolvedPatchedDeps` entries even though they are already absolute paths from
the earlier normalization step. Update the `Object.entries(patchedDependencies
?? {})` logic to use the existing `resolvedPatchedDeps[key]` and
`resolvedPatchedDeps[pkgName]` values directly in the `patchFilePath`
assignment, without calling `path.resolve` again. Keep the fallback lookup by
`pkgName`, but remove the redundant second resolution to simplify the
`patchGroupInput` hot path.

Source: Path instructions

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm11/deps/status/src/checkDepsStatus.ts`:
- Around line 663-678: The patchedDependencies base-dir resolution is duplicated
between checkDepsStatus and install/index, so centralize it once instead of
re-deriving it in both places. Extract a shared helper such as
resolvePatchedDependencies(patchedDependencies, baseDir) in a common module, and
have both the wantedLockfileDir path in checkDepsStatus and the install/index
call site use that helper so patch/lockfile resolution stays consistent and
owned by the correct layer.

---

Outside diff comments:
In `@pnpm11/installing/deps-installer/src/install/index.ts`:
- Around line 641-673: This change is user-visible, so add a pnpm patch
changeset alongside the update. Create the appropriate changeset entry for the
package affected by the install logic in install/index.ts, using the repo’s
standard changeset flow so the patch release is captured with a clear summary of
the fix.

---

Nitpick comments:
In `@pnpm11/installing/deps-installer/src/install/index.ts`:
- Around line 657-668: The `patchGroupInput` mapping in `install/index.ts` is
re-resolving `resolvedPatchedDeps` entries even though they are already absolute
paths from the earlier normalization step. Update the
`Object.entries(patchedDependencies ?? {})` logic to use the existing
`resolvedPatchedDeps[key]` and `resolvedPatchedDeps[pkgName]` values directly in
the `patchFilePath` assignment, without calling `path.resolve` again. Keep the
fallback lookup by `pkgName`, but remove the redundant second resolution to
simplify the `patchGroupInput` hot path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 574e5d0d-76df-4a83-b06a-504f0a324a2e

📥 Commits

Reviewing files that changed from the base of the PR and between ddbb489 and 41c9e88.

📒 Files selected for processing (3)
  • pnpm11/deps/status/src/checkDepsStatus.ts
  • pnpm11/installing/deps-installer/src/install/index.ts
  • pnpm11/installing/deps-installer/test/install/patch.ts

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 41c9e88

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Jul 2, 2026
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 8147f94

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 8147f94

@luo2430

luo2430 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

@zkochan This bug does exist, but I'm not very good at rust, so I'm not very confident in solving the problems mentioned by qodo.

luo2430 added 2 commits July 4, 2026 02:04
Ensure patchedDependencies paths are resolved relative to the lockfile
directory before computing patch hashes. This fixes cases where relative
patch paths were incorrectly resolved against the workspace root instead
of the lockfile location.
Extract duplicated logic for resolving patched dependency paths into a
shared `resolvePatchedDependencies` helper in lockfile.settings-checker.

Both `checkDepsStatus` and `mutateModules` previously implemented identical
inline path resolution against the lockfile directory. This consolidation
ensures consistent behavior across status checks and installs while reducing
code duplication.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 379592e

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 379592e

zkochan added 2 commits July 4, 2026 02:33
Use the already-absolute paths from resolvePatchedDependencies directly
in patchGroupInput instead of re-resolving them against lockfileDir.

Rework the regression test so the lockfile and patches dir live in the
parent of the project dir: the previous setup had cwd equal to
lockfileDir, so it passed even without the fix. Verified the reworked
test fails with ENOENT when the fix is reverted.

Add the missing changeset.
…leDir

pnpm now anchors still-relative patchedDependencies paths on lockfileDir
when hashing and applying patches. Pacquet's lockfile always lives at
the workspace root, so resolving against workspace_dir is the same base
and no behavior change is needed — note the invariant so a future
lockfile-dir implementation moves the base along with it. Also drop a
sentence that wrongly claimed patch paths are resolved against the
manifest dir.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 28b67f2

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 28b67f2

@codecov-commenter

codecov-commenter commented Jul 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.62%. Comparing base (25c7388) to head (61af31e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12762      +/-   ##
==========================================
- Coverage   85.62%   85.62%   -0.01%     
==========================================
  Files         413      413              
  Lines       64335    64335              
==========================================
- Hits        55089    55085       -4     
- Misses       9246     9250       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 61af31e5e030

Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD.

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 3.906 ± 0.178 3.718 4.196 1.97 ± 0.17
pacquet@main 3.845 ± 0.127 3.687 4.145 1.94 ± 0.15
pnpr@HEAD 1.979 ± 0.141 1.766 2.196 1.00
pnpr@main 2.033 ± 0.135 1.825 2.210 1.03 ± 0.10
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 3.9055440129799996,
      "stddev": 0.17750996226072105,
      "median": 3.83869154018,
      "user": 4.21678368,
      "system": 2.2400094600000005,
      "min": 3.71846075768,
      "max": 4.19585634868,
      "times": [
        4.19585634868,
        3.85531315968,
        4.05721999068,
        3.8220699206799997,
        3.86123398868,
        4.19137566668,
        3.73145805568,
        3.80626345668,
        3.71846075768,
        3.81618878468
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 3.844670824279999,
      "stddev": 0.12726612680417698,
      "median": 3.8193316571800002,
      "user": 4.25465288,
      "system": 2.19940676,
      "min": 3.68667630168,
      "max": 4.14462692468,
      "times": [
        3.76163687168,
        3.84940514368,
        3.81758451368,
        3.84736004368,
        3.96167829968,
        3.7862917076800002,
        3.68667630168,
        3.77036963568,
        3.82107880068,
        4.14462692468
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.97892545478,
      "stddev": 0.14084862234575907,
      "median": 1.9707657701799999,
      "user": 2.95373598,
      "system": 1.88124936,
      "min": 1.7662338386799998,
      "max": 2.19648533068,
      "times": [
        2.02833725168,
        1.83259853368,
        1.92727338268,
        1.7662338386799998,
        2.19648533068,
        2.01425815768,
        1.92321553768,
        1.85831761768,
        2.11719160868,
        2.12534328868
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 2.0330549515799996,
      "stddev": 0.1351340827386392,
      "median": 2.0655326371799996,
      "user": 2.8956644799999998,
      "system": 1.90541196,
      "min": 1.8249834466800001,
      "max": 2.21022560268,
      "times": [
        2.0251914316799997,
        2.12846646168,
        2.10587384268,
        2.14814409268,
        1.8249834466800001,
        1.85653828468,
        2.1447118926799997,
        1.91016281068,
        1.97625164968,
        2.21022560268
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 480.9 ± 7.1 470.6 492.3 1.00
pacquet@main 486.0 ± 10.0 473.0 504.5 1.01 ± 0.03
pnpr@HEAD 566.0 ± 103.6 503.8 787.9 1.18 ± 0.22
pnpr@main 528.0 ± 13.5 511.2 556.2 1.10 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.48091607042,
      "stddev": 0.007127793457951696,
      "median": 0.47952520462000003,
      "user": 0.37580812,
      "system": 0.8007547999999998,
      "min": 0.47058176612,
      "max": 0.49227007612,
      "times": [
        0.47610030412000004,
        0.48369293512,
        0.47646669512,
        0.49227007612,
        0.49055405512,
        0.48009482012000004,
        0.47420282012000003,
        0.47058176612,
        0.48624164312,
        0.47895558912
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.48602529012000006,
      "stddev": 0.010011359489655126,
      "median": 0.48328374212,
      "user": 0.38421131999999997,
      "system": 0.8111761,
      "min": 0.47302570012,
      "max": 0.50448238712,
      "times": [
        0.49489024312,
        0.48290166212,
        0.47302570012,
        0.47698668612,
        0.47847528112000004,
        0.48366582212000003,
        0.47917672612,
        0.49154505812000004,
        0.50448238712,
        0.49510333512000004
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.56599020742,
      "stddev": 0.10360525525563129,
      "median": 0.5188944201200001,
      "user": 0.39512682000000005,
      "system": 0.8229131000000001,
      "min": 0.50384605312,
      "max": 0.78794406512,
      "times": [
        0.53261673612,
        0.51306536412,
        0.50810675312,
        0.5200403891200001,
        0.50819951312,
        0.50384605312,
        0.73199640412,
        0.78794406512,
        0.51774845112,
        0.53633834512
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.5280100261199999,
      "stddev": 0.013496363744388225,
      "median": 0.52624995812,
      "user": 0.39729862000000005,
      "system": 0.8158855,
      "min": 0.51116983812,
      "max": 0.55617463312,
      "times": [
        0.55617463312,
        0.53444923912,
        0.52455688412,
        0.52794303212,
        0.51772721512,
        0.5154470491200001,
        0.51977358112,
        0.54066980712,
        0.51116983812,
        0.53218898212
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.090 ± 0.050 4.010 4.173 2.07 ± 0.21
pacquet@main 4.123 ± 0.046 4.063 4.190 2.09 ± 0.21
pnpr@HEAD 2.054 ± 0.130 1.885 2.246 1.04 ± 0.12
pnpr@main 1.977 ± 0.198 1.760 2.337 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.089896074619999,
      "stddev": 0.04972879816726151,
      "median": 4.0942135211199995,
      "user": 4.106724359999999,
      "system": 2.14380482,
      "min": 4.01004929512,
      "max": 4.1729929621199995,
      "times": [
        4.12585530512,
        4.11726327012,
        4.03779031612,
        4.104046051119999,
        4.04105355612,
        4.01004929512,
        4.077550244119999,
        4.12797875512,
        4.1729929621199995,
        4.08438099112
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.123026555619999,
      "stddev": 0.04630449106994415,
      "median": 4.115068901119999,
      "user": 4.16129576,
      "system": 2.1348026200000003,
      "min": 4.06303630712,
      "max": 4.189787337119999,
      "times": [
        4.189787337119999,
        4.1128826931199995,
        4.15483758212,
        4.0817645021199995,
        4.08565102412,
        4.117255109119999,
        4.17103584712,
        4.17526157012,
        4.06303630712,
        4.078753584119999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 2.05371621312,
      "stddev": 0.12983371350068768,
      "median": 2.03629627962,
      "user": 2.7452238600000003,
      "system": 1.8085095199999999,
      "min": 1.88455053812,
      "max": 2.24616721812,
      "times": [
        1.9864865641200002,
        1.96160061512,
        1.89057522712,
        1.88455053812,
        2.11875946212,
        2.08610599512,
        2.24616721812,
        1.9853683161200002,
        2.19022522512,
        2.18732297012
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.9771222800200001,
      "stddev": 0.1976080925953936,
      "median": 1.92012898662,
      "user": 2.74178336,
      "system": 1.8043056199999998,
      "min": 1.76006249912,
      "max": 2.33656543912,
      "times": [
        1.93442469312,
        2.11039308012,
        1.8198485021200002,
        1.90583328012,
        1.83529149112,
        1.76006249912,
        2.23757280512,
        1.79271651612,
        2.33656543912,
        2.03851449412
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.222 ± 0.007 1.211 1.234 2.41 ± 0.03
pacquet@main 1.224 ± 0.032 1.197 1.311 2.41 ± 0.07
pnpr@HEAD 0.507 ± 0.005 0.498 0.513 1.00
pnpr@main 0.510 ± 0.006 0.500 0.517 1.00 ± 0.01
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.22219857474,
      "stddev": 0.006907075097339294,
      "median": 1.22218684064,
      "user": 1.4020113199999997,
      "system": 1.04019926,
      "min": 1.21089497464,
      "max": 1.23433684364,
      "times": [
        1.22442128464,
        1.21285827564,
        1.21089497464,
        1.22965749264,
        1.2202388686399999,
        1.2215459956399999,
        1.23433684364,
        1.22365833064,
        1.22233796564,
        1.22203571564
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.22411998544,
      "stddev": 0.03170516767002358,
      "median": 1.2173871511399998,
      "user": 1.39503222,
      "system": 1.02900446,
      "min": 1.19701022364,
      "max": 1.3109590416399999,
      "times": [
        1.2168624826399999,
        1.21003526264,
        1.2179118196399998,
        1.19701022364,
        1.20439270864,
        1.3109590416399999,
        1.22057032764,
        1.2254678286399998,
        1.22255137264,
        1.21543878664
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.50749338864,
      "stddev": 0.004991600389993263,
      "median": 0.50864199214,
      "user": 0.35506371999999997,
      "system": 0.76321436,
      "min": 0.49831732364000003,
      "max": 0.51341400364,
      "times": [
        0.50446995764,
        0.50815371864,
        0.50370994164,
        0.51327486064,
        0.5027675196400001,
        0.51341400364,
        0.5111235916400001,
        0.5105727036400001,
        0.5091302656400001,
        0.49831732364000003
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.5097926223399999,
      "stddev": 0.005691795990476918,
      "median": 0.51080168664,
      "user": 0.35548542000000005,
      "system": 0.77025586,
      "min": 0.50024541464,
      "max": 0.51653835364,
      "times": [
        0.50024541464,
        0.51415857064,
        0.5139391426400001,
        0.50705009664,
        0.50187408464,
        0.51157059264,
        0.51003278064,
        0.50673543164,
        0.51653835364,
        0.5157817556400001
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.932 ± 0.031 2.904 3.014 5.86 ± 0.10
pacquet@main 2.924 ± 0.043 2.879 3.032 5.84 ± 0.12
pnpr@HEAD 0.500 ± 0.007 0.488 0.511 1.00
pnpr@main 0.516 ± 0.007 0.504 0.526 1.03 ± 0.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.9322611422600007,
      "stddev": 0.03140225719885674,
      "median": 2.92661111516,
      "user": 1.8873920199999996,
      "system": 1.2377706599999998,
      "min": 2.9038312916600004,
      "max": 3.01355491366,
      "times": [
        2.9445270956600003,
        2.9038312916600004,
        2.9059152796600003,
        2.92801936566,
        2.92393297666,
        2.92719062866,
        2.91156891966,
        2.9380393496600004,
        2.92603160166,
        3.01355491366
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.92366578596,
      "stddev": 0.0425558278867634,
      "median": 2.91252066866,
      "user": 1.8814391199999996,
      "system": 1.2372331600000002,
      "min": 2.87917804266,
      "max": 3.03172558666,
      "times": [
        2.8971485246600004,
        2.94358351966,
        2.9321354626600002,
        2.9268802106600003,
        2.91504271866,
        2.89258046066,
        2.9083847146600004,
        2.9099986186600004,
        2.87917804266,
        3.03172558666
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.50022281666,
      "stddev": 0.007017014287983142,
      "median": 0.5016979861599999,
      "user": 0.34280601999999993,
      "system": 0.77410476,
      "min": 0.48815447266,
      "max": 0.51131345666,
      "times": [
        0.50414168766,
        0.50527426966,
        0.49220466866,
        0.50250009166,
        0.49367830966000004,
        0.50089588066,
        0.48815447266,
        0.49935749266,
        0.50470783666,
        0.51131345666
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.51562973666,
      "stddev": 0.007205505788084064,
      "median": 0.5149439706600001,
      "user": 0.36311301999999995,
      "system": 0.76766086,
      "min": 0.50417727666,
      "max": 0.52569662466,
      "times": [
        0.52191513666,
        0.51042208466,
        0.5213842066600001,
        0.5134701996600001,
        0.50774741966,
        0.5230274286600001,
        0.51203924766,
        0.50417727666,
        0.51641774166,
        0.52569662466
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 6.592 ± 0.184 6.336 6.957 1.41 ± 0.05
pacquet@main 6.727 ± 0.160 6.490 7.076 1.44 ± 0.04
pnpr@HEAD 4.670 ± 0.088 4.510 4.800 1.00
pnpr@main 4.744 ± 0.077 4.638 4.853 1.02 ± 0.03
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 6.59184684848,
      "stddev": 0.18422679306983264,
      "median": 6.58788132708,
      "user": 4.407444999999999,
      "system": 2.4084571999999995,
      "min": 6.33556273708,
      "max": 6.95738839108,
      "times": [
        6.73649228008,
        6.4764196620800005,
        6.5508778560800005,
        6.33556273708,
        6.686668039080001,
        6.62488479808,
        6.43947433008,
        6.42445848108,
        6.686241910080001,
        6.95738839108
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 6.726556819080001,
      "stddev": 0.16042960719851862,
      "median": 6.72185337058,
      "user": 4.516574799999999,
      "system": 2.4569566,
      "min": 6.49017923008,
      "max": 7.07611736508,
      "times": [
        7.07611736508,
        6.67397349508,
        6.73669032208,
        6.53042838308,
        6.6949736600800005,
        6.78006184208,
        6.70701641908,
        6.77340733808,
        6.49017923008,
        6.8027201360800005
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 4.6698127633799995,
      "stddev": 0.08789077742421074,
      "median": 4.67768995008,
      "user": 3.0747978999999996,
      "system": 2.0330790999999997,
      "min": 4.50981338308,
      "max": 4.7996711340800005,
      "times": [
        4.63837438108,
        4.50981338308,
        4.61075790908,
        4.7996711340800005,
        4.5875203330800005,
        4.63447252308,
        4.74078720608,
        4.73644963308,
        4.717005519080001,
        4.72327561208
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 4.74429720968,
      "stddev": 0.0774591878845551,
      "median": 4.760761797080001,
      "user": 3.1306803,
      "system": 2.0613493,
      "min": 4.637694193080001,
      "max": 4.852606151080001,
      "times": [
        4.852606151080001,
        4.6796350250800005,
        4.83872524608,
        4.695111193080001,
        4.64291800108,
        4.74012927808,
        4.637694193080001,
        4.78139431608,
        4.78601299808,
        4.78874569508
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12762
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
4,089.90 ms
(-7.27%)Baseline: 4,410.68 ms
5,292.81 ms
(77.27%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
2,932.26 ms
(-3.88%)Baseline: 3,050.49 ms
3,660.59 ms
(80.10%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
1,222.20 ms
(-10.11%)Baseline: 1,359.62 ms
1,631.54 ms
(74.91%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
3,905.54 ms
(-9.01%)Baseline: 4,292.12 ms
5,150.54 ms
(75.83%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
6,591.85 ms
(-5.98%)Baseline: 7,010.82 ms
8,412.98 ms
(78.35%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
480.92 ms
(-23.32%)Baseline: 627.19 ms
752.63 ms
(63.90%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Jul 4, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Branchpr/12762
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
2,053.72 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
500.22 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
507.49 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,978.93 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
4,669.81 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
565.99 ms
🐰 View full continuous benchmarking report in Bencher

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 61af31e

1 similar comment
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 61af31e

@zkochan
zkochan merged commit ce5d5a5 into pnpm:main Jul 4, 2026
33 checks passed
@welcome

welcome Bot commented Jul 4, 2026

Copy link
Copy Markdown

Congrats on merging your first pull request! 🎉🎉🎉

@luo2430
luo2430 deleted the fix/pnpm branch July 4, 2026 09:02
yamz8 pushed a commit to forgente/docs that referenced this pull request Jul 16, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [pnpm](https://pnpm.io) ([source](https://github.com/pnpm/pnpm/tree/HEAD/pnpm11/pnpm)) | [`11.9.0` → `11.10.0`](https://renovatebot.com/diffs/npm/pnpm/11.9.0/11.10.0) | ![age](https://developer.mend.io/api/mc/badges/age/npm/pnpm/11.10.0?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/pnpm/11.9.0/11.10.0?slim=true) |

---

### Release Notes

<details>
<summary>pnpm/pnpm (pnpm)</summary>

### [`v11.10.0`](https://github.com/pnpm/pnpm/blob/HEAD/pnpm11/pnpm/CHANGELOG.md#11100)

[Compare Source](pnpm/pnpm@v11.9.0...v11.10.0)

##### Minor Changes

- [`e2e3c81`](pnpm/pnpm@e2e3c81): Added the `issues` command as an alias of `bugs`, so `pnpm issues` opens the package's bug tracker URL in the browser.

- [`8491f8e`](pnpm/pnpm@8491f8e): Added the `prefix` command which prints the current package prefix directory (or global prefix directory if `-g` / `--global` is used).

- [`3425e80`](pnpm/pnpm@3425e80): Added an `_auth` setting for configuring registry authentication as a single structured (URL-keyed) value. It can be set in the **global** pnpm config (`config.yaml`) or, for CI, via the `pnpm_config__auth` environment variable. The env form sidesteps the GitHub Actions / bash / zsh limitation that broke the existing `pnpm_config_//host/:_authToken=…` form (env var names containing `/`, `:`, or `.` are silently dropped). Closes [#&#8203;12314](pnpm/pnpm#12314).

  The value is keyed by registry URL so each secret is explicitly bound to the host that may receive it. Registry URL keys must use `http` or `https` and must not include credentials, query strings, or fragments:

  ```sh
  export pnpm_config__auth='{"https://registry.npmjs.org":{"@&#8203;":{"authToken":"npm-token"},"@&#8203;org":{"authToken":"org-token"}}}'
  ```

  The equivalent in the global `config.yaml`:

  ```yaml
  _auth:
    https://registry.npmjs.org:
      "@&#8203;":
        authToken: npm-token
      "@&#8203;org":
        authToken: org-token
  ```

  Within each registry URL, `@` means registry-wide/default credentials and package scopes like `@org` bind credentials to that scope on the same host. The only supported credential field is `authToken` (maps to `_authToken` / bearer auth); the deprecated `basicAuth` / `username` + `password` forms are intentionally not accepted here.

  Each entry also infers a trusted registry route: `@` routes the default registry (and `pnpm add <pkg>` resolves there), and `@org` routes that scope. Because the credential and destination host arrive in one trusted value, repo-controlled `pnpm-workspace.yaml` or project `.npmrc` cannot redirect the token to a different host. `_auth` is honored **only** from the env var and the global config — it is ignored in a project `pnpm-workspace.yaml` / `.npmrc`, so repo-controlled config can never supply registry auth. Precedence: CLI flags (`--registry`, `--@&#8203;scope:registry`) > `pnpm_config__auth` > global `config.yaml` `_auth` > `pnpm-workspace.yaml`.

  Both `pnpm_config__auth` (lowercase, documented form) and `PNPM_CONFIG__AUTH` (all-caps, the shell convention some CI runners apply) are honored. If both are set, lowercase wins unless it is empty, in which case uppercase is used. The env var wins over the global `config.yaml` `_auth` on a conflicting key. `tokenHelper` is not supported in `_auth`. Parsing is strict: a malformed value (bad JSON, wrong shape, invalid registry URL or scope, an unsupported credential field) fails fast with an error rather than being silently dropped.

  **Pacquet parity note:** the pacquet (Rust) port supports the same single credential field as the TS CLI: `authToken`.

- [`a33eeec`](pnpm/pnpm@a33eeec): `pnpm self-update` and `packageManager` version-switching can now install and link pnpm v12 (the Rust port), published with equal content under both the `pnpm` and `@pnpm/exe` names on the `next-12` dist-tag. Its native binaries ship as `@pnpm/exe.<platform>-<arch>` packages, which pnpm's built-in installer links directly — no Node.js launcher, so the command pays no Node startup cost. v12 is initialized exactly like `@pnpm/exe`, including per-platform global-virtual-store hashing. From v12 onward the install converges on the unscoped `pnpm` package (the Rust exe) — even when updating from the SEA `@pnpm/exe` build.

- [`1dd12bd`](pnpm/pnpm@1dd12bd): When resolving through a pnpr install-accelerator server, pnpm no longer forwards its own upstream registry credentials in the resolve request. Only the `Authorization` header identifying the caller to pnpr is sent. The pnpr server now selects upstream credentials from its own route policy (operator-configured upstream credential aliases), so private dependencies resolve through a pnpr-managed alias the caller is authorized to use, rather than by sending the client's registry tokens to the server.

- [`1e81761`](pnpm/pnpm@1e81761): Expose web authentication `authUrl` and `doneUrl` in JSON error output when OTP is required in a non-interactive terminal [#&#8203;12724](pnpm/pnpm#12724).

##### Patch Changes

- [`2f389d6`](pnpm/pnpm@2f389d6): Added the Node.js release team's new signing key (Stewart X Addison, `655F3B5C1FB3FA8D1A0CA6BDE4A7D232B936D2FD`) to the embedded Node.js release keys, so runtimes whose `SHASUMS256.txt` is signed by the new releaser verify successfully.

- [`acbdb94`](pnpm/pnpm@acbdb94): Fixed shell tab completion not suggesting workspaces after the `-F` alias for `--filter` option.

- [`dcabb78`](pnpm/pnpm@dcabb78): Fixed `pnpm up -r <pkg>` bumping unrelated packages that have open semver ranges. Previously, any update mutation nullified the lockfile-derived `preferredVersions` globally, so packages with `^x.y.z` ranges could re-resolve to newer compatible versions even though the user only asked to update a specific package. The install layer now always seeds `preferredVersions` from the lockfile, and caller-supplied preferred versions (such as the vulnerability penalties of `pnpm audit --fix`) layer on top of the seed instead of replacing it. The targeted package still bumps: the per-resolve `updateRequested` flag makes the resolver ignore the target's own lockfile pins.

  Closes [#&#8203;10662](pnpm/pnpm#10662).

- [`d539172`](pnpm/pnpm@d539172): Fixed pnpm pack and pnpm publish failing when prepack generates files that are included in the package and postpack cleans them up.

- [`be6505a`](pnpm/pnpm@be6505a): Hardened global package management:

  - On Windows, removing or updating a global package now also cleans up the `node.exe` flavor of a bin, so a stale `node.exe` no longer survives on `PATH` after uninstall, and a new global install no longer silently overwrites an existing `node.exe`.
  - `pnpm add -g pnpm@<version>` (and `@pnpm/exe@<version>`) is now rejected like the bare `pnpm` form, pointing to `pnpm self-update`.
  - Dependency aliases read from a global package's manifest are validated before being joined onto `node_modules` paths, preventing a tampered manifest from escaping the install directory.
  - Each global install group is created in its own freshly-made directory (no longer reusing a colliding or pre-existing path).
  - Removing or updating a global package no longer unlinks a bin that belongs to a different globally installed package.

- [`25c7388`](pnpm/pnpm@25c7388): pnpm now rejects `jsr:` specifiers whose package name is not a valid npm package name — an empty scope or name (e.g. `jsr:@&#8203;scope/`), path separators inside the name, or any other shape `validate-npm-package-name` rejects — with `ERR_PNPM_INVALID_JSR_PACKAGE_NAME` instead of silently converting them into a malformed `@jsr/...` npm package name.

- [`25c7388`](pnpm/pnpm@25c7388): pnpm now rejects named-registry specifiers (e.g. `gh:`) whose package name is not a valid npm package name — an empty scope (e.g. `gh:@&#8203;/bar`), path separators inside the name (e.g. `gh:@&#8203;scope/../name`), or any other shape `validate-npm-package-name` rejects — with `ERR_PNPM_INVALID_NAMED_REGISTRY_PACKAGE_NAME` instead of passing the name through to registry URLs and metadata cache file paths.

- [`96da7c5`](pnpm/pnpm@96da7c5): node-gyp's `gyp_main.py` and `gyp` entrypoints are now packed with the executable bit in the `pnpm` and `@pnpm/exe` tarballs. Without it, building native addons from source could fail with a permission error.

- [`99982b9`](pnpm/pnpm@99982b9): Sped up resolution and reduced memory use against registries that ignore npm's abbreviated metadata format and always return the full package document (for example, Azure DevOps Artifacts). pnpm now strips such documents down to the abbreviated field set before caching them. Resolution output is unchanged, and registries that honor the abbreviated format (such as the npm registry) pay no extra cost.

- [`11a7fdd`](pnpm/pnpm@11a7fdd): Sped up offline and `--prefer-offline` resolution on large workspaces (e.g. `pnpm dedupe --offline`, `pnpm install --offline`). Package metadata loaded from the local cache is now kept in memory, so each package's metadata is parsed once per command instead of once per dependent that references it.

- [`2c7369d`](pnpm/pnpm@2c7369d): `pnpm pack-app` now rejects `--entry` / `pnpm.app.entry` and `--output-dir` / `pnpm.app.outputDir` values that are absolute paths or escape the project directory via `..` (or a symlink that resolves outside it), and refuses to write the produced executable when its target path already exists as a symlink (or other non-regular file). This prevents a repository-controlled `package.json` from embedding host files (such as an SSH key) into the produced executable, writing build artifacts outside the project, or overwriting an arbitrary file through a committed symlink. The new error codes are `ERR_PNPM_PACK_APP_ENTRY_OUTSIDE_PROJECT`, `ERR_PNPM_PACK_APP_OUTPUT_DIR_OUTSIDE_PROJECT`, and `ERR_PNPM_PACK_APP_OUTPUT_FILE_NOT_REGULAR`.

  When ad-hoc signing macOS targets, `pnpm pack-app` now runs the system `codesign` by absolute path and resolves `ldid` to a location outside the project, so a repository-controlled `node_modules/.bin` on `PATH` cannot hijack the signer.

- [`ce5d5a5`](pnpm/pnpm@ce5d5a5): Relative paths in `patchedDependencies` are now resolved against the lockfile directory when computing patch file hashes, so running `pnpm install` from a subdirectory no longer fails with `ENOENT` looking for the patch file in the wrong location [#&#8203;12762](pnpm/pnpm#12762).

- [`ebb4096`](pnpm/pnpm@ebb4096): `pnpm peers` no longer reports a conflict for a missing peer dependency that is ignored via `pnpm.peerDependencyRules.ignoreMissing`.

- [`dcabb78`](pnpm/pnpm@dcabb78): Fixed a prototype-pollution hazard when seeding preferred versions: a dependency named `__proto__` in a manifest or in `pnpm-lock.yaml` could write through `Object.prototype` (or crash the install) while the preferred-versions map was being built. The maps are now null-prototype objects, so crafted package names land as plain keys.

- [`f38e696`](pnpm/pnpm@f38e696): Hardened `pnpm deploy --force` so it refuses unsafe deploy targets such as workspace roots, parent directories, out-of-workspace paths, and symlinked target parents.

- [`806c3ec`](pnpm/pnpm@806c3ec): pnpm no longer warns about ignored project-level auth settings when `PNPM_CONFIG_NPMRC_AUTH_FILE` points at the project `.npmrc` — setting it to that file is an explicit opt-in to trusting it, so auth env variables in it are expanded [pnpm/pnpm#12480](pnpm/pnpm#12480).

- [`991405e`](pnpm/pnpm@991405e): Restore differential rendering (`ansi-diff`) to fix duplicated output lines introduced by [#&#8203;12351](pnpm/pnpm#12351).

- [`c121235`](pnpm/pnpm@c121235): Fixed the topological order of `--filter`ed commands (`pnpm run`, `pnpm exec`, `pnpm publish`, `pnpm pack`, `pnpm rebuild`) when the selected projects depend on each other only transitively through projects that were not selected. Previously such selected projects could run concurrently or in the wrong order; now a project always runs after the selected projects it transitively depends on, while projects without a real dependency relationship still run concurrently. This now also holds for prod-only filters (`--filter-prod`), which resolve order through the production dependency graph so transitive production dependencies are respected without pulling back the dev dependencies the filter drops, and for selections that mix `--filter` with `--filter-prod` [#&#8203;8335](pnpm/pnpm#8335).

- [`d539172`](pnpm/pnpm@d539172): `pnpm pack` and `pnpm publish` no longer follow a symlinked workspace `LICENSE` file when injecting it into a package that has no license of its own. Following the symlink could pack bytes from outside the workspace into the published tarball.

- [`dcabb78`](pnpm/pnpm@dcabb78): Fixed `pnpm up <pkg>` producing a different result than a fresh install of the same manifests would. The resolver now distinguishes `updateRequested` (true only for packages that match the user's update target) from the broader `update` flag, and for the targeted package ignores only its own lockfile-derived preferred-version pins — so the target re-resolves exactly as if its lockfile entries were deleted and `pnpm install` ran. Preferred versions a fresh install applies (manifest pins, versions propagated down the dependency chain, and the vulnerability-avoidance penalties of `pnpm audit --fix`) stay in effect, so an update never installs duplicate versions that a reinstall from scratch would not reproduce. When a preferred version holds the update target below the newest version its range admits, pnpm now prints a warning explaining that reaching the newer version everywhere requires an override.

- [`dcabb78`](pnpm/pnpm@dcabb78): `pnpm update <dep>@&#8203;<version>` now prints a warning when `<dep>` is only present as a transitive dependency: the requested version cannot be applied there (updates resolve the target the way a fresh install would), and the warning recommends adding the version to `pnpm.overrides` instead, which is the mechanism that does pin transitive dependencies. Closes [#&#8203;12744](pnpm/pnpm#12744).

- [`a6c4d5f`](pnpm/pnpm@a6c4d5f): When a dependency cannot be found in the registry (404) or the registry has no matching version, and a workspace project with the same name exists only at non-matching versions, the error now reports the available workspace versions (`ERR_PNPM_NO_MATCHING_VERSION_INSIDE_WORKSPACE`) instead of the raw registry failure [pnpm/pnpm#1379](pnpm/pnpm#1379). Other registry failures (authorization, network, server errors) still propagate unchanged. The pacquet (Rust) resolver applies the same behavior.

</details>

---------

Co-authored-by: Lunny Xiao <[email protected]>
Reviewed-on: https://gitea.com/gitea/docs/pulls/460
Reviewed-by: Lunny Xiao <[email protected]>
Co-authored-by: Renovate Bot <[email protected]>
@coderabbitai coderabbitai Bot mentioned this pull request Oct 16, 2026
4 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants