You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Last slice of the #434 umbrella (Proper optionalDependencies support). Slices 1–6 (#439, #456, #467, #474, #485, #495) cover the install-time filter, the current-lockfile prune, and the wire-shape plumbing. This slice adds the user-facing ignoredOptionalDependencies setting — a list of dep-name patterns the user wants entirely excluded from resolution and install.
Lockfile field: lockfile/types/src/index.ts:19 — ignoredOptionalDependencies?: string[] at the top level of the lockfile (sibling of lockfileVersion, overrides, etc., not inside settings).
pacquet-config: add ignored_optional_dependencies: Option<Vec<String>> to Config; deserialize from pnpm-workspace.yaml.
pacquet-lockfile: add ignored_optional_dependencies: Option<Vec<String>> to Lockfile as a top-level field (matching upstream's wire shape — NOT inside LockfileSettings).
pacquet-package-manifest: add a mutator method on PackageManifest that takes patterns and drops matching keys from optionalDependencies and dependencies. Mirrors the hook above.
Apply at install time: in Install::run, clone the manifest, apply the filter, pass the filtered manifest to satisfies_package_manifest. Necessary because the lockfile was already resolved with the hook applied, but the on-disk package.json still has the entry — without the filter, the freshness check would flag them as drift.
Outdated-setting check: extend satisfies_package_manifest (or add a sibling check) to compare the lockfile's ignoredOptionalDependencies (sorted) against config.ignored_optional_dependencies (sorted). Mismatch surfaces as a new StalenessReason::IgnoredOptionalDependenciesChanged variant → OutdatedLockfile error.
Slice 6 current-lockfile filter: preserve the ignored_optional_dependencies field when filtering the wanted lockfile down to the current lockfile (so subsequent installs see the same recorded set).
Tests
Yaml-parse round-trip for the new Config field.
Lockfile serde round-trip for the new top-level field.
PackageManifest::remove_optional_dependencies_matching deletes matching keys from both maps; non-matching keys survive.
satisfies_package_manifest: drift between recorded set and config surfaces as IgnoredOptionalDependenciesChanged; matching sets (regardless of order) pass; both-empty passes.
Slice-6 filter preserves the field through the current-lockfile write.
Out of scope
The resolver-side hook itself for transitive packages — pacquet has no resolver. The mutator method is still useful for the importer manifest (used by the freshness check) and for parity with the resolver-port shape.
Catalogs / patchedDependencies outdated-setting checks — different settings, separate slices.
Pattern matching beyond the existing pacquet_config::matcher (workspace-level helper used by hoistPattern etc.).
Upstream pin
pnpm/pnpm@94240bc046. Umbrella slice 1 in #439, slice 2 in #456, slice 3 in #467, slice 4 in #474, slice 5 in #485, slice 6 in #495; this is umbrella slice 7 — last of the optional-dependencies umbrella.
Written by an agent (Claude Code, claude-opus-4-7).
Last slice of the #434 umbrella (
Proper optionalDependencies support). Slices 1–6 (#439, #456, #467, #474, #485, #495) cover the install-time filter, the current-lockfile prune, and the wire-shape plumbing. This slice adds the user-facingignoredOptionalDependenciessetting — a list of dep-name patterns the user wants entirely excluded from resolution and install.Upstream surface (pnpm/pnpm@94240bc046):
hooks/read-package-hook/src/createOptionalDependenciesRemover.ts:1-22— builds a matcher from the list; for eachoptionalDependencieskey, if matched, delete fromoptionalDependenciesAND fromdependencies(in case the package lists the dep under both).lockfile/types/src/index.ts:19—ignoredOptionalDependencies?: string[]at the top level of the lockfile (sibling oflockfileVersion,overrides, etc., not insidesettings).lockfile/settings-checker/src/getOutdatedLockfileSetting.ts:58-60— sorts both arrays and compares; mismatch triggersneedsFullResolution(in pacquet's frozen-only flow, this surfaces asOutdatedLockfile).Scope
pacquet-config: addignored_optional_dependencies: Option<Vec<String>>toConfig; deserialize frompnpm-workspace.yaml.pacquet-lockfile: addignored_optional_dependencies: Option<Vec<String>>toLockfileas a top-level field (matching upstream's wire shape — NOT insideLockfileSettings).pacquet-package-manifest: add a mutator method onPackageManifestthat takes patterns and drops matching keys fromoptionalDependenciesanddependencies. Mirrors the hook above.Install::run, clone the manifest, apply the filter, pass the filtered manifest tosatisfies_package_manifest. Necessary because the lockfile was already resolved with the hook applied, but the on-diskpackage.jsonstill has the entry — without the filter, the freshness check would flag them as drift.satisfies_package_manifest(or add a sibling check) to compare the lockfile'signoredOptionalDependencies(sorted) againstconfig.ignored_optional_dependencies(sorted). Mismatch surfaces as a newStalenessReason::IgnoredOptionalDependenciesChangedvariant →OutdatedLockfileerror.ignored_optional_dependenciesfield when filtering the wanted lockfile down to the current lockfile (so subsequent installs see the same recorded set).Tests
PackageManifest::remove_optional_dependencies_matchingdeletes matching keys from both maps; non-matching keys survive.satisfies_package_manifest: drift between recorded set and config surfaces asIgnoredOptionalDependenciesChanged; matching sets (regardless of order) pass; both-empty passes.Out of scope
pacquet_config::matcher(workspace-level helper used byhoistPatternetc.).Upstream pin
pnpm/pnpm@94240bc046. Umbrella slice 1 in #439, slice 2 in #456, slice 3 in #467, slice 4 in #474, slice 5 in #485, slice 6 in #495; this is umbrella slice 7 — last of the optional-dependencies umbrella.
Written by an agent (Claude Code, claude-opus-4-7).