One concept, one module (src/maintain/lockfiles.ts, plain data in, plain data out): given a lockfile's text, return [{ecosystem, name, version}]. Parts of #6004.
Files: src/maintain/lockfiles.ts, test/lockfiles.test.ts.
Risks: bun.lock is JSONC (trailing commas); parse it tolerantly. Run bun scripts/similar.ts on the draft and reuse what exists.
Reviewed pull #17064 at its head: ticked bun.lock and package-lock.json parse; a malformed file returns an empty list and a named reason, never throws.; Tests with small fixtures of each file kind, plus one malformed; no network..
One concept, one module (src/maintain/lockfiles.ts, plain data in, plain data out): given a lockfile's text, return [{ecosystem, name, version}]. Parts of #6004.
Files: src/maintain/lockfiles.ts, test/lockfiles.test.ts. Risks: bun.lock is JSONC (trailing commas); parse it tolerantly. Run
bun scripts/similar.tson the draft and reuse what exists.