Skip to content
Discussion options

You must be logged in to vote

Thanks for the detailed repro. Confirmed two causes in the npm writer: optional was only computed for packages reachable from a root optionalDependencies entry, so packages behind an optional edge of a regular dependency (esbuild's @esbuild/*) lost the flag, and hasInstallScript was never read or written. The writer now marks packages reached only through optional edges as optional (or devOptional), and hasInstallScript round-trips.

Fix is in #1775, covered by a unit test of a parse/write round trip. I haven't run your repro repo or npm against it. Not addressed yet: the field reordering in existing entries and the dropped funding.type, which account for much of the extra diff you saw.

AI…

Replies: 2 comments

Comment options

jdx
Oct 19, 2026 — with coder-jdx
Maintainer

You must be logged in to vote
0 replies
Answer selected by mwolson
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants