Repository navigation
[pull] main from pnpm:main - #476
Merged
Merged
Conversation
…hase modules (#13624) `InstallWithFreshLockfile::run` had grown to 2103 lines — 68% of its file — and read as one flat sequence with no boundary between the install phases it drives. Give the fresh-install path one module per phase, leaving `run` as the orchestrator that threads state between them: - `resolver_setup` — registries, store-index handles, and the resolver chain with its prefetching and observing wrappers. - `manifest_transforms` — pnpm's built-in read-package chain (`packageExtensions` + `pnpm.overrides`). - `resolve` — the seeds, options, hooks and reuse decisions the walk consumes, the walk itself, and the diagnostics that read its result. - `materialization_plan` — installability host, engine name, skip set. - `linking` — prune, the hoisted and isolated linker arms, and the module-resolution sidecars. Two phases stay in the orchestrator on purpose. The build phase is already `install_frozen_lockfile::run_build_phase`, shared with the frozen path, so a local wrapper would add a layer and no meaning; the `CreateVirtualStore` and build invocations are single calls whose option literals gain nothing from being relocated behind another input type. The resolver-chain split needs two functions rather than one: `PrefetchContext` borrows the store handles, so the caller has to own them before the chain that borrows them is built. Four duplications fell out along the way: - The store-index writer drain appeared verbatim on both the lockfile-only and materializing paths. - The build-then-splice pair of `build_fresh_lockfile` and `merge_filtered_wanted_lockfile` appeared twice; both call sites are now one `build_lockfile` call. - The fast-override pre-pass and the per-importer resolve closure built near-identical `ResolveOptions` literals differing only in `project_dir` and the preferred-versions seed, now `SharedResolveOptions::build`. - `HoistedArmInputs` and `IsolatedArmInputs` were strict subsets of `LinkPhaseInputs`. Two behavior-preserving simplifications: `needs_installability_check` was redundant with `installability_host.is_some()` and collapsed into it, and the `if x.is_empty() { None } else { Some(..) }` shapes around the overrides hooks became `.filter(..).map(..)`. Prose the extraction made redundant is gone: call sites no longer repeat their callee's documentation. That also surfaced a stale comment claiming the lockfile maps are built "only when GVS is on", which the unconditional `build_lockfile` contradicts. No user-visible change, so nothing to mirror in the TypeScript CLI and no changeset.
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )