feat: replace bun with deno for npm tools and runtime#186
Draft
fredrikaverpil wants to merge 4 commits into
Draft
feat: replace bun with deno for npm tools and runtime#186fredrikaverpil wants to merge 4 commits into
fredrikaverpil wants to merge 4 commits into
Conversation
fredrikaverpil
force-pushed
the
claude/deno-package-tools
branch
2 times, most recently
from
July 13, 2026 07:57
e2a2bb0 to
9381f85
Compare
Deno's runtime executes the npm CLIs directly, which paves the way for
enabling packageTools.npmPackages on NixOS (bun/node binaries had
dynamic linking issues there). The Darwin-only guard stays in place
until the tools are validated under Deno's Node compatibility layer.
npmPackages entries are now { package, bin } attrsets: shim names come
from the package.json "bin" field and cannot be derived from the
package name (@googleworkspace/cli installs "gws"). This also fixes
the install check, which previously looked for the wrong filename and
reinstalled every package on each rebuild.
Deno has no equivalent of `bun update -g`, so the module renders an
npm-tools-upgrade script from the declared package list, and rebuild.sh
calls it on --update/--update-unstable. deno is also added to
home.packages so the runtime is on PATH everywhere, which bun never
was.
With deno as the installer/runtime, the npm CLIs run inside deno's Node compatibility layer instead of as standalone node binaries, so the NixOS dynamic-linking restriction no longer applies. Drop the Darwin guards from PATH, the upgrade helper, and the activation script, and remove the macOS-only gotcha from the docs. Needs validation on rpi5-homelab before declaring any npm tools in Linux/NixOS configs; revert this commit if the tools misbehave there.
MCP servers (gemini, copilot, opencode) now launch via `deno run -A npm:<pkg>` instead of bunx, and code_runner runs TypeScript through deno directly. Unlike bunx, deno is guaranteed on PATH since it is in home.packages. pi's npmCommand must be argv-compatible with the npm CLI (`<cmd> install <pkg>`), which deno is not, so pi falls back to npm (available where nodejs is on PATH, e.g. the nvim-deps environment) — same availability domain bun had. Also update the Claude instructions to prefer deno over npm/bunx.
Swap bun for deno in the dotfiles-toolchain dev shell, drop bun from the nvim-only tool PATH (deno is on the regular PATH via home.packages, so Neovim inherits it), and delete the stale npm-tools/ gitignore entry left over from the pre-Nix npm-tools setup.
fredrikaverpil
force-pushed
the
claude/deno-package-tools
branch
from
July 17, 2026 18:17
9381f85 to
4ebf7c4
Compare
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.
Why?
packageTools.npmPackagesmacOS-only.home.packages), so MCP configs no longer depend on an environment that happens to provide the runner.What?
nix/shared/home/package-tools.nix: install viadeno install --global --allow-all --name <bin> npm:<pkg>; shims in~/.deno/binpackageTools.npmPackagesentries are now{ package, bin }— shim names come from the package.jsonbinfield and can't be derived (@googleworkspace/cli→gws); also fixes the install check, which looked for the wrong filename and reinstalled on every rebuildnpm-tools-upgradescript from the declared package list (deno has nobun update -g);rebuild.sh --update/--update-unstablecalls itbunx→deno run -A npm:<pkg>(gemini, copilot, opencode); code_runner runs TS viadeno run -A; pinpmCommand→npm(deno is not argv-compatible with the npm CLI)npm-tools/gitignore entry; docs updatedNotes
./rebuild.shon a Mac to validate thatgemini,codexandpiactually work under deno's Node compat. Test on rpi5-homelab before declaring npm tools in Linux configs; revert the "enable on Linux" commit if they misbehave there.npm-tools-upgradere-creates the shims.npmCommand: ["npm"]relies on npm from nodejs (nvim-deps PATH) — the same availability domain bun had, but worth a sanity check in a pi session.PLAYWRIGHT_BROWSERS_PATHverified when it downloads/locates browsers.