Repository navigation
Conversation
…pm's way pacquet decided which projects fire their own preinstall / install / postinstall / prepare from one `is_full_install` flag: every project the run materialized ran them for a selector-less `install` or `update`, and no project ran them for `add` or a targeted `update <pkg>`. pnpm decides per project, from the mutated-importer list its command layer builds — the projects the command was pointed at, plus the workspace root, which the recursive dispatch pushes in as a plain `mutation: 'install'` whenever the selection leaves it out. A project runs its scripts when that list covers only part of the workspace, or, when it covers the whole workspace, when its own mutation is a full install. The rule was read off the TypeScript CLI by running it, not off its source: 17 invocations across a 3-project workspace, a 2-project workspace, a root-only workspace and a plain project, each project stamping a file from `postinstall`. Replace the flag with `ProjectMutation`, which names pnpm's mutation kind (`InstallWorkspace`, `InstallSelected`, `InstallSome`, `NoInstall`), and select the projects from it. `ProjectMutation::is_full_install()` keeps the old flag's other four uses — the scope log, the optimistic repeat-install gate, the resolution-skipped message and the `--no-optional` exclusion — unchanged. What changes for users: `update <pkg>` and `add <pkg>` in a workspace stop skipping the workspace root's scripts, `update` at a workspace root stops running the other members' scripts, and `update --latest` stops running the project's own scripts (it rewrites named dependency specs, so pnpm makes it `installSome` like `update <pkg>`). The TypeScript CLI is unchanged; it gets the same matrix as e2e tests so the contract is pinned on both sides. One divergence in the same area is left alone, because it is not about lifecycle scripts: under `--filter`, pnpm installs the workspace root alongside the filtered projects and pacquet does not install it at all, so pacquet cannot run its scripts either. Filed separately. Closes #13358.
|
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)
📝 WalkthroughWalkthroughThe install pipeline now uses ChangesLifecycle mutation behavior
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant Update
participant Install
participant WorkspaceProjects
User->>Update: run update command
Update->>Install: pass ProjectMutation
Install->>WorkspaceProjects: determine mutated projects
Install->>WorkspaceProjects: run selected lifecycle scripts
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 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 QodoAlign lifecycle-script execution with pnpm mutated-importer rules
AI Description
Diagram
High-Level Assessment
Files changed (19)
|
|
@coderabbitai review (The automatic review was skipped due to the rate limit.) Written by an agent (Claude Code, claude-opus-5). |
|
✅ Action performedReview finished.
|
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (3): Last reviewed commit: "test(pnpm): cover the workspace-member m..." | Re-trigger Greptile |
Micro-Benchmark ResultsLinux |
Code Review by Qodo
Context used✅ Compliance rules (platform):
32 rules 1.
|
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13398 +/- ##
==========================================
+ Coverage 87.25% 87.32% +0.06%
==========================================
Files 540 542 +2
Lines 92662 93242 +580
==========================================
+ Hits 80855 81422 +567
- Misses 11807 11820 +13 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
… use The repo's TypeScript style relies on hoisting and declares functions below their call sites; the new helpers in the lifecycle-scripts e2e suite were sitting above the tests that use them.
|
Thanks — went through the four findings. One was real and is fixed; the other three I'm declining, with reasons. 1. TS helpers declared before use — fixed in 46ddbb9. 2. Repeated path normalization — declining. 3. Changeset missing a 4. Alias breaks root detection — declining, and it is empirically refuted. macOS is exactly the platform where this class of bug shows up: its temp dirs live under That is not an accident. Every path the function compares comes out of the same discovery pipeline: Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 46ddbb9 |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pnpm11/pnpm/test/install/lifecycleScripts.ts (1)
562-600: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd TS lifecycle-script coverage for workspace member mutations.
The TS suite still lacks a counterpart to the Rust workspace-root-vs-member tests: argumentless
updaterun frompackages/a, plus equivalentaddandremoveworkspace-member script behavior (addshould run the member and root;removeshould run no project scripts). Add these cases under the existing workspace lifecycle test section so pnpm and pacquet lifecycle semantics stay covered in both stacks.🤖 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/pnpm/test/install/lifecycleScripts.ts` around lines 562 - 600, Add TypeScript lifecycle tests alongside the existing workspace update cases in the relevant test section: cover argumentless update executed with cwd set to packages/a, and add equivalent workspace-member cases for add and remove. Assert that add runs the mutated member and workspace root scripts, while remove runs no project scripts, using the existing prepareInstalledWorkspace, execPnpmSync, and projectsThatRanPostinstall helpers.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.
Nitpick comments:
In `@pnpm11/pnpm/test/install/lifecycleScripts.ts`:
- Around line 562-600: Add TypeScript lifecycle tests alongside the existing
workspace update cases in the relevant test section: cover argumentless update
executed with cwd set to packages/a, and add equivalent workspace-member cases
for add and remove. Assert that add runs the mutated member and workspace root
scripts, while remove runs no project scripts, using the existing
prepareInstalledWorkspace, execPnpmSync, and projectsThatRanPostinstall helpers.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0f1a8fcd-f5d9-4fbe-9322-daa03924b7f9
📒 Files selected for processing (19)
.changeset/project-lifecycle-scripts-follow-the-mutated-projects.mdpnpm/crates/cli/src/cli_args/dedupe.rspnpm/crates/cli/src/cli_args/deploy.rspnpm/crates/cli/src/cli_args/fetch.rspnpm/crates/cli/src/cli_args/import.rspnpm/crates/cli/src/cli_args/install.rspnpm/crates/cli/src/cli_args/link.rspnpm/crates/cli/src/cli_args/prune.rspnpm/crates/cli/src/cli_args/rebuild.rspnpm/crates/cli/tests/lifecycle_scripts.rspnpm/crates/napi/src/install.rspnpm/crates/package-manager/src/add.rspnpm/crates/package-manager/src/install.rspnpm/crates/package-manager/src/install/tests.rspnpm/crates/package-manager/src/install_with_fresh_lockfile.rspnpm/crates/package-manager/src/remove.rspnpm/crates/package-manager/src/update.rspnpm11/pnpm/test/install/lifecycleScripts.tspnpr/crates/pnpr/src/resolver/resolve.rs
…ite too The Rust suite pinned the member-side cases — an argumentless update, an add, and a remove run inside a workspace member — while the TypeScript suite only covered the ones driven from the workspace root. Both stacks now assert the same matrix.
|
Good catch on the missing TypeScript cases — the Rust suite pinned the member-side mutations and the TypeScript one only covered the root-side ones, which is exactly the asymmetry the two-stack rule exists to prevent. Added in 8ee589f:
All three assert the behavior I measured from the TypeScript CLI before writing the fix, and they match the corresponding pacquet tests one for one. Written by an agent (Claude Code, claude-opus-5). |
|
Code review by qodo was updated up to the latest commit 8ee589f |
PR Code Suggestions ✨Warning
No code suggestions found for the PR. |
Integrated-Benchmark Report (Linux)Commit: Each scenario reports direct installs and pnpr installs. Bencher consumes pacquet@HEAD and pnpr@HEAD. The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time). Scenario: Isolated linker: fresh restore, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.52179448324,
"stddev": 0.12106186450266923,
"median": 2.47231985284,
"user": 1.50871442,
"system": 1.26030374,
"min": 2.39193085484,
"max": 2.7219641358400004,
"times": [
2.39193085484,
2.5110391838400004,
2.7219641358400004,
2.63746679784,
2.6500995238400002,
2.4207364618400002,
2.41595625184,
2.4287353828400002,
2.60641571784,
2.4336005218400003
]
},
{
"command": "pacquet@main",
"mean": 2.47652597774,
"stddev": 0.10596126486024735,
"median": 2.44765682284,
"user": 1.51261822,
"system": 1.2621773399999998,
"min": 2.3408104948400004,
"max": 2.6192484048400004,
"times": [
2.54694899884,
2.61343781484,
2.4255736688400003,
2.6192484048400004,
2.38832357184,
2.58643147784,
2.39631080284,
2.3408104948400004,
2.37843456584,
2.46973997684
]
},
{
"command": "pnpr@HEAD",
"mean": 1.5156632912399999,
"stddev": 0.16099976084817247,
"median": 1.4643575653399998,
"user": 1.04113712,
"system": 1.10412184,
"min": 1.34967262484,
"max": 1.79426415684,
"times": [
1.79426415684,
1.35122855884,
1.45176225384,
1.43202773484,
1.61478253684,
1.35021764884,
1.47695287684,
1.71773960584,
1.6179849148399998,
1.34967262484
]
},
{
"command": "pnpr@main",
"mean": 1.55981287974,
"stddev": 0.13396286111064856,
"median": 1.5428949313399998,
"user": 1.05207352,
"system": 1.0849951399999997,
"min": 1.3726588498399999,
"max": 1.7708723948399998,
"times": [
1.47776416184,
1.65094566184,
1.7058211968399999,
1.7708723948399998,
1.5469984268399999,
1.65385299884,
1.50156166784,
1.3788620028399998,
1.5387914358399999,
1.3726588498399999
]
}
]
}Scenario: Isolated linker: fresh restore, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.25052603264,
"stddev": 0.00845286892253747,
"median": 0.25010881954,
"user": 0.20372523999999997,
"system": 0.52669928,
"min": 0.23687362104,
"max": 0.26776634404,
"times": [
0.23687362104,
0.24934279404,
0.24497295904000002,
0.25197382204,
0.24315369904,
0.26776634404,
0.24825897704000002,
0.25761752304,
0.25087484504,
0.25442574204
]
},
{
"command": "pacquet@main",
"mean": 0.25106876104000003,
"stddev": 0.0062425906331238035,
"median": 0.25190404554,
"user": 0.21334694,
"system": 0.50890498,
"min": 0.24252927404000002,
"max": 0.26446180104,
"times": [
0.25419693204,
0.24369931404,
0.25332529304,
0.24252927404000002,
0.24688871104000001,
0.24883585204,
0.25287423504,
0.25093385604,
0.26446180104,
0.25294234204
]
},
{
"command": "pnpr@HEAD",
"mean": 0.27442592714,
"stddev": 0.007497128669582505,
"median": 0.27410104954000003,
"user": 0.21809953999999995,
"system": 0.53055638,
"min": 0.26474739804,
"max": 0.28549884404000003,
"times": [
0.26967950104,
0.26725046404,
0.28549884404000003,
0.27416322104,
0.27403887804,
0.26689118904000003,
0.27542469204000003,
0.28269291804,
0.26474739804,
0.28387216604000004
]
},
{
"command": "pnpr@main",
"mean": 0.26661003684,
"stddev": 0.005633704540482327,
"median": 0.26525319854,
"user": 0.21350843999999997,
"system": 0.52844188,
"min": 0.25902871604,
"max": 0.27667554504,
"times": [
0.27266097704000003,
0.27667554504,
0.27133965304,
0.26000115304,
0.26834784704000003,
0.25902871604,
0.26294450804,
0.26459557204,
0.26524630604,
0.26526009104000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + cold store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 2.7687076511399997,
"stddev": 0.019565309660373235,
"median": 2.7676338660399997,
"user": 1.76507178,
"system": 1.23775718,
"min": 2.7250625295399997,
"max": 2.79600662554,
"times": [
2.78318474054,
2.76848792754,
2.76677980454,
2.78982420454,
2.76265807854,
2.7250625295399997,
2.76438756054,
2.75996140054,
2.77072363954,
2.79600662554
]
},
{
"command": "pacquet@main",
"mean": 2.76469657614,
"stddev": 0.01949054909359711,
"median": 2.7647898510399997,
"user": 1.67533088,
"system": 1.2923426800000002,
"min": 2.72160072254,
"max": 2.78925998454,
"times": [
2.78925998454,
2.7602827845399998,
2.77998030954,
2.75173010754,
2.78554619354,
2.76420560754,
2.72160072254,
2.77162133754,
2.76537409454,
2.7573646195399997
]
},
{
"command": "pnpr@HEAD",
"mean": 1.6265927342400002,
"stddev": 0.16698047757522827,
"median": 1.66848413954,
"user": 1.0217077799999998,
"system": 1.13683518,
"min": 1.4364349605400002,
"max": 1.82610391054,
"times": [
1.45632874254,
1.4364349605400002,
1.76996865754,
1.75251090254,
1.43772739854,
1.82610391054,
1.44067270354,
1.70369700754,
1.80921178754,
1.6332712715400002
]
},
{
"command": "pnpr@main",
"mean": 1.58227484184,
"stddev": 0.13872787192182828,
"median": 1.5471807315400001,
"user": 1.03975978,
"system": 1.10981878,
"min": 1.42922179654,
"max": 1.8084502085400003,
"times": [
1.5635733145400001,
1.48411631754,
1.5307881485400001,
1.4404591125400001,
1.49603840054,
1.78306816254,
1.7164036845400001,
1.8084502085400003,
1.42922179654,
1.5706292725400002
]
}
]
}Scenario: Isolated linker: fresh install, hot cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.59721191836,
"stddev": 0.012196347869592413,
"median": 0.59896629166,
"user": 0.7211229,
"system": 0.6729346799999999,
"min": 0.5717513131599999,
"max": 0.61068536316,
"times": [
0.60119905716,
0.5717513131599999,
0.60764336616,
0.59140379116,
0.59673352616,
0.60622102516,
0.61068536316,
0.59613638516,
0.60656716416,
0.5837781921599999
]
},
{
"command": "pacquet@main",
"mean": 0.57885893566,
"stddev": 0.01419468981698491,
"median": 0.57825267916,
"user": 0.6958366999999999,
"system": 0.67697008,
"min": 0.55475049716,
"max": 0.60499059216,
"times": [
0.58802303816,
0.57939515616,
0.59193983816,
0.56458756216,
0.57711020216,
0.60499059216,
0.57199675416,
0.57352308216,
0.55475049716,
0.58227263416
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30189972066,
"stddev": 0.00430357989829006,
"median": 0.30332702616000007,
"user": 0.1871061,
"system": 0.53403808,
"min": 0.29576706616000004,
"max": 0.30631900416,
"times": [
0.30434574616000004,
0.29581494616000004,
0.30210726916,
0.30512329716000003,
0.30230830616000004,
0.29635857816,
0.30584966216000004,
0.30500333116,
0.30631900416,
0.29576706616000004
]
},
{
"command": "pnpr@main",
"mean": 0.29661006106000004,
"stddev": 0.009623474252759678,
"median": 0.29584924016,
"user": 0.18715579999999996,
"system": 0.51164188,
"min": 0.28599912116000004,
"max": 0.32002952716000005,
"times": [
0.29295234716,
0.28926834416,
0.32002952716000005,
0.29630555716,
0.29627017116000004,
0.28876491916,
0.29818530016,
0.28599912116000004,
0.29542830916,
0.30289701416000003
]
}
]
}Scenario: Isolated linker: fresh install, cold cache + hot store
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 1.89978418208,
"stddev": 0.012481940488737343,
"median": 1.8973538485800001,
"user": 0.94463864,
"system": 0.7427184,
"min": 1.8834786805800001,
"max": 1.9241809035800002,
"times": [
1.91334954058,
1.9241809035800002,
1.89784561758,
1.89587896058,
1.8834786805800001,
1.9070459855800002,
1.8968620795800002,
1.90238353458,
1.88603759958,
1.8907789185800001
]
},
{
"command": "pacquet@main",
"mean": 1.8930866585800004,
"stddev": 0.013860887815290032,
"median": 1.88995922158,
"user": 0.93597284,
"system": 0.736191,
"min": 1.8721828305800001,
"max": 1.9177988435800002,
"times": [
1.8797158095800002,
1.8905423435800002,
1.9177988435800002,
1.90829004058,
1.88835414758,
1.90530578158,
1.8721828305800001,
1.8949404975800002,
1.88937609958,
1.8843601915800001
]
},
{
"command": "pnpr@HEAD",
"mean": 0.30642740498,
"stddev": 0.009106705443218649,
"median": 0.30191702758,
"user": 0.20615834,
"system": 0.5274665,
"min": 0.29928455458000003,
"max": 0.32910120058000003,
"times": [
0.30230109458,
0.30106540258000003,
0.30771427958,
0.30134643058,
0.30693380258,
0.30111293158,
0.31388139258000003,
0.29928455458000003,
0.30153296058,
0.32910120058000003
]
},
{
"command": "pnpr@main",
"mean": 0.30067315548,
"stddev": 0.0071874767118806585,
"median": 0.30037510908,
"user": 0.20353643999999999,
"system": 0.5247358999999999,
"min": 0.28452798658,
"max": 0.31226423258,
"times": [
0.30038809858,
0.30507962658,
0.30018056858000003,
0.30335454458,
0.30500898458000003,
0.28452798658,
0.29586144058,
0.30036211958000003,
0.31226423258,
0.29970395258
]
}
]
}Scenario: Isolated linker: fresh resolve, hot cache, offline
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 0.36409105666,
"stddev": 0.016489685817161103,
"median": 0.36134254476,
"user": 0.35289209999999993,
"system": 0.06051667999999999,
"min": 0.34541988176,
"max": 0.39534141776000004,
"times": [
0.39534141776000004,
0.34897711776,
0.34541988176,
0.38398530176,
0.35696547276,
0.35943487376,
0.36918972076,
0.34593977776,
0.36325021576,
0.37240678676
]
},
{
"command": "pacquet@main",
"mean": 0.35423660726000006,
"stddev": 0.006809720535654438,
"median": 0.35117917626,
"user": 0.3514711,
"system": 0.050469780000000006,
"min": 0.34638418276,
"max": 0.36610479176,
"times": [
0.35183794476,
0.36610479176,
0.35124460976,
0.35009131176,
0.35059214276,
0.35111374276,
0.35003763076,
0.36069394076,
0.36426577476,
0.34638418276
]
},
{
"command": "pnpr@HEAD",
"mean": 0.08536589415393939,
"stddev": 0.0019007853547955672,
"median": 0.08578795176000001,
"user": 0.020419984848484854,
"system": 0.008162477575757575,
"min": 0.08227464876,
"max": 0.08809385676,
"times": [
0.08631669676,
0.08578795176000001,
0.08237135076,
0.08560025976,
0.08678673976,
0.08656244876000001,
0.08709531976,
0.08762374276,
0.08806678576,
0.08540051376,
0.08537962476000001,
0.08515069476,
0.08583064276,
0.08274175676000001,
0.08253904576,
0.08531036376000001,
0.08763104676,
0.08427318476000001,
0.08310488876,
0.08791766576,
0.08601053076,
0.08250224676,
0.08306927276,
0.08441766576,
0.08637488576,
0.08621811076000001,
0.08332781776,
0.08778259176,
0.08653370376,
0.08227464876,
0.08809385676,
0.08638102676000001,
0.08259742476
]
},
{
"command": "pnpr@main",
"mean": 0.08586068348727274,
"stddev": 0.002139775535686925,
"median": 0.08638970376,
"user": 0.020703227272727276,
"system": 0.007786092121212122,
"min": 0.08107694676,
"max": 0.08970639776,
"times": [
0.08617492976,
0.08665653476,
0.08629867276,
0.08387112976,
0.08699637376,
0.08740948976,
0.08680560476,
0.08937378276,
0.08622821976,
0.08721775976,
0.08815780676,
0.08606943076,
0.08365992176,
0.08683777576,
0.08428591876000001,
0.08587470476,
0.08107694676,
0.08712244976,
0.08496829176000001,
0.08657424076,
0.08234353776,
0.08248161776,
0.08739406076,
0.08674335776,
0.08295179176,
0.08862670876,
0.08764983176,
0.08584743476000001,
0.08217368876,
0.08300797676,
0.08970639776,
0.08638970376,
0.08642646176
]
}
]
}Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr
BENCHMARK_REPORT.json{
"results": [
{
"command": "pacquet@HEAD",
"mean": 4.52513435926,
"stddev": 0.13939844420975084,
"median": 4.44329509126,
"user": 1.6626364999999996,
"system": 1.37356664,
"min": 4.42014265176,
"max": 4.79005313976,
"times": [
4.58844177276,
4.43376620976,
4.44318482376,
4.53687414276,
4.42167661576,
4.42014265176,
4.79005313976,
4.42964229776,
4.443405358760001,
4.74415657976
]
},
{
"command": "pacquet@main",
"mean": 4.544596654059999,
"stddev": 0.10511306770048523,
"median": 4.54876060376,
"user": 1.6879963999999998,
"system": 1.3056076400000003,
"min": 4.43352153676,
"max": 4.67260929276,
"times": [
4.62826104476,
4.66824991876,
4.67260929276,
4.437191325760001,
4.60925681476,
4.43933905176,
4.43909522376,
4.43352153676,
4.63017793876,
4.4882643927600006
]
},
{
"command": "pnpr@HEAD",
"mean": 3.5349776866600005,
"stddev": 0.11313046894759231,
"median": 3.4871423117600004,
"user": 1.1615248999999999,
"system": 1.20813614,
"min": 3.42897577576,
"max": 3.7556594397600005,
"times": [
3.45209361876,
3.5846673787600003,
3.70198356776,
3.47711459876,
3.42897577576,
3.44348100976,
3.46564805576,
3.5429833967600004,
3.7556594397600005,
3.4971700247600004
]
},
{
"command": "pnpr@main",
"mean": 3.4939939490600005,
"stddev": 0.05769059381018632,
"median": 3.4695377627600004,
"user": 1.1311449999999998,
"system": 1.2339777399999998,
"min": 3.4328918147600005,
"max": 3.5930666377600002,
"times": [
3.4649472787600004,
3.4731369727600003,
3.4622685247600002,
3.4874134167600004,
3.4659385527600004,
3.5766109337600005,
3.4350240927600004,
3.4328918147600005,
3.54864126576,
3.5930666377600002
]
}
]
} |
|
| Project | pnpm's project |
| Branch | pr/13398 |
| 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 | 1,436.43 ms |
| isolated-linker.fresh-install.cold-cache.hot-store | 📈 view plot | 299.28 ms |
| isolated-linker.fresh-install.hot-cache.hot-store | 📈 view plot | 295.77 ms |
| isolated-linker.fresh-resolve.hot-cache.offline | 📈 view plot | 82.27 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store | 📈 view plot | 1,349.67 ms |
| isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr | 📈 view plot | 3,428.98 ms |
| isolated-linker.fresh-restore.hot-cache.hot-store | 📈 view plot | 264.75 ms |
…scripts pnpm's way (pnpm#13398) pacquet decided which projects fire their own preinstall / install / postinstall / prepare from one `is_full_install` flag: every project the run materialized ran them for a selector-less `install` or `update`, and no project ran them for `add` or a targeted `update <pkg>`. pnpm decides per project, from the mutated-importer list its command layer builds — the projects the command was pointed at, plus the workspace root, which the recursive dispatch pushes in as a plain `mutation: 'install'` whenever the selection leaves it out. A project runs its scripts when that list covers only part of the workspace, or, when it covers the whole workspace, when its own mutation is a full install. The rule was read off the TypeScript CLI by running it, not off its source: 17 invocations across four workspace shapes, each project stamping a file from `postinstall`. Replace the flag with `ProjectMutation`, which names pnpm's mutation kind (`InstallWorkspace`, `InstallSelected`, `InstallSome`, `NoInstall`), and select the projects from it. `ProjectMutation::is_full_install()` keeps the old flag's other four uses — the scope log, the optimistic repeat-install gate, the resolution-skipped message and the `--no-optional` exclusion — unchanged. What changes for users: `update <pkg>` and `add <pkg>` in a workspace stop skipping the workspace root's scripts, `update` at a workspace root stops running the other members' scripts, and `update --latest` stops running the project's own scripts (it rewrites named dependency specs, so pnpm makes it `installSome` like `update <pkg>`). The TypeScript CLI is unchanged; it gets the same matrix as e2e tests so the contract is pinned on both sides. Closes pnpm#13358.
Summary
Closes #13358.
The issue asked which projects should run their own lifecycle scripts for a targeted
update <pkg>, and reported that pnpm runs them and pacquet does not. Rather than read the TypeScript source, I ran it: 17 invocations across a 3-project workspace, a 2-project workspace, a root-only workspace and a plain project, each project stamping a file frompostinstall, with the lockfile pinned below the manifest range so every update had real work to do.The report turns out to be half right. pnpm does not run the scripts of the project you targeted — what the reporter saw was the workspace root, which pnpm's recursive dispatch pushes into the mutated importers as a plain
mutation: 'install'whenever the selection leaves it out. The full rule pnpm follows, which reproduces all 17 observations:The decision on this issue was to mirror the TypeScript CLI in every case, so this PR changes pacquet only; the TypeScript CLI is untouched and gets the same matrix as tests.
Measured behavior in a
root+packages/a+packages/bworkspace, before and after:updateupdate <pkg>update --latestadd <pkg>remove <pkg>installupdateupdate <pkg>update --latestadd <pkg>install-r update-r update <pkg>--filter a update--filter a update <pkg>--filter a add <pkg>In a 2-project workspace (root + one member),
update <pkg>run in the member runs the root's scripts and not the member's in both stacks — the mutated set covers the whole workspace there, so the partial mutation is filtered out. That is the exact scenario the issue opened on.--filterrows still differ, by the workspace root only, and not because of lifecycle scripts: under--filter, pnpm installs the workspace root alongside the filtered projects and pacquet does not install it at all. Running the root's scripts without linking its dependencies would be worse than skipping them, so this PR leaves those rows alone and the materialization divergence is filed separately as #13397.Squash Commit Body
Checklist
pnpm/port, or the description notes what still needs porting.(The TypeScript CLI already behaves this way and is the reference here; it
gains the matrix as tests. Only pacquet's behavior changes.)
pnpm changeset) if this PR changes any publishedpackage. Keep it short and written for pnpm users — it becomes a release note.
tests, covering the same matrix in both stacks.)
Written by an agent (Claude Code, claude-opus-5).
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by CodeRabbit
pnpm update --latestno longer runs the project’s own lifecycle scripts.