Use bun as the kit package manager and script runner - #799
Closed
mishig25 wants to merge 3 commits into
Closed
Conversation
- kit: bun.lock replaces package-lock.json (generated against the public registry, resolving the same dependency versions incl. the @huggingface/inference pin). bun.lock stores no registry URLs, making it immune to the internal-mirror-baked-URL trap package-lock had. - doc-builder build/preview invoke `bun install --frozen-lockfile` and `bun run build|dev` instead of `npm ci`/`npm run`. Vite itself still runs on Node.js (>= 20): bun is the installer/script runner, node stays the battle-tested runtime. The toolchain check verifies both. - CI: setup-bun added to the lint workflow (bun-only there) and to the shared build workflows + accelerate integration workflow alongside setup-node (kept for custom-container jobs where node may be absent). - bump-huggingface-js-packages workflow and README instructions updated. Install time for kit deps drops from ~20s (npm ci, warm) to <1s locally and ~5s cold. Verified: accelerate e2e output identical to the npm-built output on all 48 pages — the only normalized difference is the hydration node_ids ordering, which is fs-readdir-order-dependent in svelte-kit (unsorted readdirSync) and nondeterministic across ANY two builds, npm or bun; each build is internally consistent, confirmed by browser tests (hydration, SPA nav, shorthand URLs, tooltips). preview smoke-tested (install + dev server + serving). ruff/pytest clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
It runs on ubuntu-latest, where node is preinstalled (22.x satisfies the >= 20 toolchain check) — same treatment as the lint workflow. setup-node stays only in the shared build workflows, which can run in custom containers without node. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Hosted runners ship node; custom-container jobs are expected to provide node >= 20 in their image (the doc-builder toolchain check fails fast with a clear message if it's missing). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Closing for now: checking the transformers workflow surfaced two blockers for a safe rollout —
The branch is kept. A safe re-roll would need: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Switches the kit toolchain from npm to bun for installing dependencies and running package scripts, across local commands (
doc-builder build --html,doc-builder preview) and all CI workflows.What bun is (and isn't) here: bun replaces npm (installs, ~20s → <1s warm / ~5s cold) and the script runner. It does not replace ESLint/Prettier — bun ships no linter/formatter (that would be Biome, which still has partial Svelte support and no tailwind class sorting, so it's not a good trade here). And Vite itself still runs on Node.js (≥ 20): bun is the installer/runner, node stays the battle-tested runtime for the build — the python toolchain check now verifies both.
Changes
kit/bun.lockreplacespackage-lock.json— generated against the public registry, resolving the same dependency versions (verified, incl. the@huggingface/inference@4.13.15pin). Bonus:bun.lockstores no registry URLs, so it's structurally immune to the internal-mirror-baked-URL trap that once broke CI withpackage-lock.json.build.py/preview.py:bun install --frozen-lockfile+bun run build|dev;check_toolchain_is_available()checks bun ≥ 1.2 and node ≥ 20 up front.setup-bunadded to the SvelteKit lint workflow, the sharedbuild_main_documentation/build_pr_documentationworkflows, and the accelerate integration workflow.setup-nodeis kept in the build workflows on purpose: they can run in custom containers where node isn't preinstalled.bump-huggingface-js-packagesworkflow and README dev instructions updated (bun install,bun run dev,bun run update-inference-providers).Verification
node_idspointers differ across any two builds (npm↔npm or bun↔bun alike) because SvelteKit enumerates route nodes with unsortedreaddirSync— each build is internally consistent, and everything else is byte-identical once that's normalized.doc-builder previewsmoke-tested: bun install + vite dev server + page serving work end-to-end.🤖 Generated with Claude Code