fix(release): resolve native platform entries and registry metadata in shrinkwrap - #1564
Conversation
Resolve published @bastani/atomic-natives metadata when generating release shrinkwraps, while keeping versionless main output deterministic. Preserve generated native optional package constraints, including optional flags and Linux glibc libc guards, and cover the checked-in shrinkwrap shape with a focused regression test. Assistant-model: GPT-5.5
Code Review —
|
Summary
Hardens the
@bastani/atomicnpm shrinkwrap generator so that release publishes correctly resolve the already-published@bastani/atomic-nativesregistry metadata and all six optional native platform packages, while keeping the versionlessmainshrinkwrap output deterministic with0.0.0placeholder entries.Changes
generate-coding-agent-shrinkwrap.mjsnow fetches real npm registry metadata (tarball URL, integrity hash,optionalDependencies) for non-placeholder versions of@bastani/atomic-natives, respectingnpm_config_registry/NPM_CONFIG_REGISTRYenv overrides. Placeholder0.0.0versions skip the fetch and keep deterministic output formain.@bastani/atomic-natives-*platform packages (darwin-arm64,darwin-x64,linux-arm64-gnu,linux-x64-gnu,win32-arm64-msvc,win32-x64-msvc) are now generated and preserved in the shrinkwrap, includingoptional: true,os,cpu, and Linuxlibc: ["glibc"]constraints derived from the package'snapi.targets.generateShrinkwrap()is now async; the script entry point usesimport.meta.urldetection and exportsgenerateShrinkwrapfor unit testing.packages/coding-agent/npm-shrinkwrap.jsonnow includesoptionalDependencieson the@bastani/atomic-nativesentry and all six platform package entries.test/unit/shrinkwrap-atomic-natives.test.tsto assert that the checked-in shrinkwrap contains all required optional native platform package entries with correct version pins,os/cpu/libcconstraints, and resolved tarball URLs.## [Unreleased] > ### Fixedinpackages/coding-agent/CHANGELOG.md.Validation
bun run check:shrinkwrapNPM_CONFIG_REGISTRY=https://example.invalid/ bun run check:shrinkwrapnpm_config_registry=https://example.invalid/ bun run check:shrinkwrapbun test test/unit/shrinkwrap-atomic-natives.test.tsbun run typecheckbun run check:file-lengthgit diff --check origin/mainbun run test:unit0.9.4-alpha.1published-version simulation verified registry-resolved native platform entries include integrity,optionalflag,os/cpu, and LinuxlibcconstraintsNotes
This intentionally does not include the temporary recovery-only
publish.ymlcheckout pinning used to complete0.9.4-alpha.1.