Repository navigation
build: develop in a nix shell, and lint each commit - #3
Merged
Merged
Conversation
flake.nix gives the shell Bun 1.4.2, Node 24 and Python 3, from nixos-26.05 but for Bun: stable has 1.3.13, so Bun comes from unstable. Entering the shell installs a pre-commit hook that runs the project's own Biome, the version CI checks with, and nixfmt. .zed/settings.json formats with Biome on save, and runs nil and nixfmt from the shell. CI packs with bun pm pack in place of npm pack.
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.
Purpose
Running
bun run checkneeds exact tool versions. With Bun 1.3.13, the frozen install fails and 10 tests fail. This PR gives everyone the same tools, and lints each commit before it reaches CI.flake.nix:nix develop(ordirenv allowonce, via.envrc) gives a shell with Bun 1.4.2, Node 24 and Python 3.nixos-26.05except Bun. Stable ships Bun 1.3.13 and the project pins 1.4.2, so Bun alone comes fromnixos-unstable.node_modules/.bin/biome), so it always formats like CI does. Nix's Biome (2.4.15) is a different version from the project's 2.4.16.tsc, which are slow.bun run checkstill runs them in CI..zed/settings.json:node_modules, so it uses the pinned version.niland nixfmt for Nix files run from the shell throughdirenv exec.bun pm pack --dry-runreplacesnpm pack --dry-run..direnv/and the generated.pre-commit-config.yamlare gitignored. Without that, Biome follows the config link and fails to parse it.Verification
All run inside
nix develop:bun install --frozen-lockfileandbun run checkpass, including all 121 tests and the build.bun pm pack --dry-runlists 20 files.pre-commit run --all-filespasses Biome and nixfmt..tsfile, the hook rewrites it and fails the commit.