Repository navigation
fix(pnpm): resolve relative patchedDependencies against lockfileDir - #12762
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughPatched 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. ChangesPatch path resolution fix
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested labels: Suggested reviewers: ✨ Finishing Touches🧪 Generate unit tests (beta)
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
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. Comment |
PR Summary by QodoFix pnpm patch hashing to resolve patchedDependencies relative to lockfileDir
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. Pacquet patch base mismatch
|
There was a problem hiding this comment.
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 winAdd a
pnpmpatch 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 winRedundant re-resolve of already-absolute paths.
resolvedPatchedDepsvalues are already made absolute viapath.resolve(opts.lockfileDir, value)at line 650. Re-runningpath.resolve(opts.lockfileDir, resolvedPatchedDeps![key])(and the same for thepkgNamefallback at line 667) is a no-op givenpath.resolveshort-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
📒 Files selected for processing (3)
pnpm11/deps/status/src/checkDepsStatus.tspnpm11/installing/deps-installer/src/install/index.tspnpm11/installing/deps-installer/test/install/patch.ts
|
Code review by qodo was updated up to the latest commit 41c9e88 |
|
Code review by qodo was updated up to the latest commit 8147f94 |
1 similar comment
|
Code review by qodo was updated up to the latest commit 8147f94 |
|
@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. |
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.
|
Code review by qodo was updated up to the latest commit 379592e |
1 similar comment
|
Code review by qodo was updated up to the latest commit 379592e |
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.
|
Code review by qodo was updated up to the latest commit 28b67f2 |
1 similar comment
|
Code review by qodo was updated up to the latest commit 28b67f2 |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. Scenario: Isolated linker: fresh restore, cold cache + cold store
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
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
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
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
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
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
]
}
]
} |
|
| Branch | pr/12762 |
| Testbed | pnpr |
⚠️ 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-thresholdsflag.
Click to view all benchmark results
| Benchmark | Latency | milliseconds (ms) |
|---|---|---|
| isolated-linker.fresh-install.cold-cache.cold-store | 📈 view plot | 2,053.72 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 500.22 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 507.49 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,978.93 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 4,669.81 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 565.99 ms |
|
Code review by qodo was updated up to the latest commit 61af31e |
1 similar comment
|
Code review by qodo was updated up to the latest commit 61af31e |
|
Congrats on merging your first pull request! 🎉🎉🎉 |
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) |  |  | --- ### 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 [#​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":{"@​":{"authToken":"npm-token"},"@​org":{"authToken":"org-token"}}}' ``` The equivalent in the global `config.yaml`: ```yaml _auth: https://registry.npmjs.org: "@​": authToken: npm-token "@​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`, `--@​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 [#​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 [#​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:@​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:@​/bar`), path separators inside the name (e.g. `gh:@​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 [#​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 [#​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` [#​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>@​<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 [#​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]>
Summary
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
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.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
Summary by CodeRabbit
patchedDependenciesentries now use the same resolved patch paths for consistent results.lockfileDir, including verification of patch application and the recorded lockfile hash.