[defer] feat(release): bun-pack — bun-first global installs (build stays on Node) - #12801
opensource-elearning wants to merge 3 commits into
Conversation
bun pm pack produces the same universal npm tarball npm pack does, so a bun-packed artifact installs with both 'bun add -g' and 'npm install -g'. Add scripts/release/bun-pack.mjs (--pm bun|npm, --skip-build, --destination) plus the bun:release npm script, and a Bun row in the README install table. The next build and dist assembly stay on Node; Bun handles the build orchestration, packing, and the end-user install.
|
Nice, and careful about the Bun-scope boundary — verified that |
|
Follow-up on the one pre-merge item left here (a unit test for Two ways forward, whichever you prefer:
Everything else on this PR came out clean in review (⭐4) — the Bun-scope boundary is respected |
|
done, try now |
Extract the two pure pieces of logic in scripts/release/bun-pack.mjs so they are importable and testable without running a real build: parseArgs and verifyTarball now throw UsageError on bad input instead of calling fail()/process.exit directly, and the top-level script body is wrapped in main() behind a direct-run guard (import.meta.url check) that still translates a UsageError into the same fail() CLI output as before - verified manually that --pm bogus / --skip-build without dist/ / an unknown flag print identical messages and exit codes to pre-change behavior. Adds tests/unit/bun-pack.test.ts (node:test) covering parseArgs flag parsing, defaults and bad input, and verifyTarball against real tarballs built in a temp dir (good tarball, missing/corrupted tarball, missing required bin entry, empty dist/) - satisfies Hard Rule diegosouzapw#8 for this PR's production code. Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
|
Re-homed to |
What
Adds a bun-first companion to the npm release path so users can install
omniroute globally with bun, without changing how the package is built or
published.
scripts/release/bun-pack.mjs— release pack script, Bun-first:--pm bun→bun run build:release(bun orchestrates, Node runsthe actual
nextbuild and the dist assembly), thenbun pm packinto auniversal npm tarball.
--pm npmfallback → same flow vianpm(works on machines without bun).--skip-buildreuses a stageddist/.options), bun
>=1.1, node>=22.package.json→bun:releasescript (bun scripts/release/bun-pack.mjs).README.md→ Bun (global) row in the install table.Why
bun pm packandnpm packproduce the same universal npm tarball format, soa bun-packed artifact installs with both
bun add -g <tarball>andnpm install -g <tarball>. Bun is measurably faster on installs and lighter onmemory, and
bun install -g omnirouteis already a supported path (thebest-effort
bun:sqliteadapter lets it boot withoutbetter-sqlite3). Thenpm publish channel (
npm-publish.yml,verify-published.mjs) is unchanged —this is strictly additive: bun is only packer + install path, never the build
or the published runtime (AGENTS.md scope guard).
Verification
OMNIROUTE_BUILD_MEMORY_MBheap cap) completed green in an isolated worktree.
--pm bunand--pm npm: same tarball, 4168 trackeddist/entries verified in each,bin/omniroute.mjs,bin/reset-password.mjs, andpackage.jsonpresent._artifacts/omniroute-3.8.51.tgz(~73 MB).