Repository navigation
fix(js): use optional overrides in lock graphs - #601
Conversation
|
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. |
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.