Skip to content

Commit 42e5b16

Browse files
authored
chore: provision node and bun via nix instead of pnpm (#1271)
* chore: provision node and bun via nix instead of pnpm `package.json` declared `engines.runtime` for node and bun with `onFail: download`, so pnpm fetched and managed those runtimes itself. That made every environment depend on a pnpm-managed download at runtime instead of the pinned Nix toolchain. Drop `engines.runtime` and provide both runtimes explicitly: - dev shell: add `nodejs_24` (bun was already present). - test job: install `nodejs_24` for Vitest (dropping the unused bun). - pkg-pr-new: add `nodejs_24` and `bun` for the tsdown / ensure-native-binary prepack scripts that previously relied on the managed runtimes. - perf jobs: add `nodejs_24` alongside the existing bun. - release: add `bun`; node still comes from `setup-node`, which is kept for the npm registry auth and provenance setup. Verified locally with a clean pnpm state: `pnpm install --frozen-lockfile` no longer manages runtimes and Vitest runs on the PATH node. * chore: drop managed runtimes from the pnpm lockfile The lockfile recorded the `engines.runtime` node/bun entries as `runtime:` dependencies. With `engines.runtime` removed, regenerate the lockfile so `pnpm install --frozen-lockfile` stays in sync and no longer resolves the pnpm-managed runtimes. * chore: use the default pnpm and nodejs nixpkgs attributes Pin to the unversioned `pnpm` and `nodejs` attributes rather than `pnpm_11` / `nodejs_24`. `pnpm` currently resolves to 11.1.1 (same as the explicit alias, matching the lockfile) and `nodejs` tracks the active LTS, so the dev shell and CI follow the maintained defaults without hard-coding a major.
1 parent d6d34c4 commit 42e5b16

5 files changed

Lines changed: 12 additions & 233 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ jobs:
4949
persist-credentials: false
5050
- uses: ./.github/actions/setup-nix
5151
# Vitest is the only step that needs the JS toolchain (the coverage step
52-
# builds via `nix build`), so install just pnpm/bun/just instead of
52+
# builds via `nix build`), so install just pnpm/node/just instead of
5353
# realizing the full dev shell, which drags in every linter, formatter,
5454
# and the pre-commit hook closure and dominated this job's wall time.
5555
- name: Install JS tooling
56-
run: nix profile install --inputs-from . nixpkgs#pnpm_11 nixpkgs#bun nixpkgs#just
56+
run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#nodejs nixpkgs#just
5757
- run: pnpm install --frozen-lockfile
5858
- name: Create default Claude directories for tests
5959
run: |
@@ -145,9 +145,9 @@ jobs:
145145
- uses: ./.github/actions/setup-nix
146146
# Packing only repackages the native binaries restored from the build
147147
# matrix below (no Rust build happens here), so the full `nix develop` dev
148-
# shell is unnecessary. Provision just pnpm; bun is fetched via the
149-
# engines.runtime entry during `pnpm install` for the prepack scripts.
150-
- run: nix profile install --inputs-from . nixpkgs#pnpm
148+
# shell is unnecessary. The prepack scripts run tsdown (node) and
149+
# ensure-native-binary (bun), so provision those runtimes explicitly.
150+
- run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#nodejs nixpkgs#bun
151151
- run: pnpm install --frozen-lockfile
152152
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
153153
with:
@@ -231,7 +231,7 @@ jobs:
231231
# `nix develop` dev shell is unnecessary. Install just the tools the perf
232232
# scripts invoke, pinned to the flake's nixpkgs via `--inputs-from .`.
233233
- name: Install perf tooling
234-
run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun nixpkgs#hyperfine nixpkgs#just
234+
run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#nodejs nixpkgs#bun nixpkgs#hyperfine nixpkgs#just
235235
- run: pnpm install --frozen-lockfile
236236

237237
- name: Resolve PR preview package URL
@@ -309,7 +309,7 @@ jobs:
309309
# `nix develop` dev shell is unnecessary. Install just the tools the perf
310310
# scripts invoke, pinned to the flake's nixpkgs via `--inputs-from .`.
311311
- name: Install perf tooling
312-
run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun nixpkgs#hyperfine nixpkgs#just
312+
run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#nodejs nixpkgs#bun nixpkgs#hyperfine nixpkgs#just
313313
- run: pnpm install --frozen-lockfile
314314

315315
- name: Resolve PR preview package URL

‎.github/workflows/release.yaml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ jobs:
9090
registry-url: 'https://registry.npmjs.org'
9191
node-version: lts/*
9292
package-manager-cache: false
93-
- run: nix profile install --inputs-from . nixpkgs#pnpm
93+
# node comes from setup-node above (needed for the npm registry auth);
94+
# bun is required by the ensure-native-binary prepack script.
95+
- run: nix profile install --inputs-from . nixpkgs#pnpm nixpkgs#bun
9496
- run: pnpm install --frozen-lockfile
9597
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
9698
with:

‎nix/dev-shell.nix‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ in
2020
devShells.default = pkgs.mkShell {
2121
buildInputs =
2222
(with pkgs; [
23-
pnpm_11
23+
nodejs
24+
pnpm
2425
bun
2526

2627
rustToolchain

‎package.json‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,5 @@
1818
"pkg-pr-new": "catalog:release",
1919
"vitest": "catalog:testing"
2020
},
21-
"engines": {
22-
"runtime": [
23-
{
24-
"name": "node",
25-
"version": "^24.15.0",
26-
"onFail": "download"
27-
},
28-
{
29-
"name": "bun",
30-
"version": "^1.3.13",
31-
"onFail": "download"
32-
}
33-
]
34-
},
3521
"packageManager": "[email protected]"
3622
}

‎pnpm-lock.yaml‎

Lines changed: 0 additions & 210 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)