Skip to content

[pull] main from pnpm:main - #518

Merged
pull[bot] merged 2 commits into
dwongdev:mainfrom
pnpm:main
Aug 18, 2026
Merged

pull[bot] merged 2 commits into
dwongdev:mainfrom
pnpm:main

Conversation

@pull

@pull pull Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

KSXGitHub and others added 2 commits August 18, 2026 13:36
The optimistic-repeat-install fast path compares filesystem mtimes
against the `lastValidatedTimestamp` recorded in
`node_modules/.pnpm-workspace-state-v1.json`. That value is itself a
filesystem mtime, so production keeps both sides of the comparison on
one clock. The tests did not: they seeded the timestamp from
`now_millis()` and ordered writes with `sleep(20ms)`, so every
assertion depended on the wall clock and the kernel's coarse mtime
clock staying close, and on sub-second mtimes existing at all. A
whole-second-mtime filesystem collapses that gap to nothing.

The tests now set mtimes explicitly instead. `backdate_existing_files`
backdates a workspace tree and returns the matching timestamp, so
earlier files read as validated and later ones as modified without
sleeping. `bump_mtime` derives from the recorded timestamp rather than
`SystemTime::now() + 2s`, which a baseline an earlier bump pushed into
the future could outrank. Both keep a full second of separation, wider
than any supported filesystem's mtime granularity.

`build_workspace_state` keeps one wall-clock read, the fallback used
when no lockfile and no manifest can be stat'd. It now goes through the
`Clock` capability that `pnpm-modules-yaml` already exposes, so a
`FrozenClock` fake drives it. That seam is the whole of the production
diff and changes no behavior.

Resolves #12730
…13982)

Config drift the fast lockfile rewrites cannot absorb (a changed
override, packageExtensions, patches) used to withhold the lockfile
reuse seed entirely, leaving the walk with only the name-global
preferred-versions bias. With several versions of one package locked,
every open range (jest's @types/node: "*") then collapsed onto the
highest locked version, churning unrelated lockfile entries - the
mechanism behind the churn investigated in #13975.

Two changes, mirroring the TypeScript resolver's split between forcing
the walk (proceed) and unpinning (update):

1. The walk now takes the prior lockfile even when subtree reuse must
be denied, via the new reuse_lockfile_subtrees flag: false keeps the
lockfile as a per-edge version-pin source only.

2. The fresh-resolve path hard-pins a transitive edge whose recorded
version still satisfies its hook-rewritten manifest range (the
counterpart of replaceVersionInBareSpecifier under !update). Edges a
changed override or extension actually reaches fail the satisfies gate
and re-resolve; pacquet update targets and the stale-pin refresh keep
re-picking.

The TypeScript CLI already behaves this way, so nothing needs
mirroring there.
@pull pull Bot locked and limited conversation to collaborators Aug 18, 2026
@pull pull Bot added the ⤵️ pull label Aug 18, 2026
@pull
pull Bot merged commit a615254 into dwongdev:main Aug 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants