Skip to content

fix(js): use optional overrides in lock graphs - #601

Merged
rowkav09 merged 1 commit into
mainfrom
fix/js-lock-optional-override
Oct 1, 2026
Merged

rowkav09 merged 1 commit into
mainfrom
fix/js-lock-optional-override

Conversation

@rowkav09

@rowkav09 rowkav09 commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Closes #600.

Use optionalDependencies constraints before overridden runtime entries in graph builder's distinct declaration reader. Prevents valid Yarn classic locks resolving the stale runtime range or incorrectly becoming incomplete.

Fail-first graph regression, then470/470 JS tests+lint green. Companion to #590, independent one-line ordering fix.

@rowkav09

rowkav09 commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

APPROVE at 6527194

readDeclared keeps the first constraint it sees per name, so listing optionalDependencies before dependencies makes the optional constraint the effective one, as npm and Yarn classic resolve it. Both are non-dev, and devDependencies still come last, so nothing else changes. The test has dependencies shared "1" and optional shared "2" with only shared@2 in yarn.lock: the graph is complete and the closure for shared contains leaf. Before this change, shared@1 would not be found in the lockfile. This lines up with the earlier #590 manifest change. JS/TS adapter suite on the head merged with main: 470/470.

CI: not checked by me; the lane merges on APPROVE plus green CI.

Reviewed as rowkav09, the same account as the author, so this is not an independent GitHub approval.

@rowkav09
rowkav09 merged commit fef3a6c into main Oct 1, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Yarn classic graph ignores optional dependency override constraints

1 participant