Skip to content

Add a Nix flake so the benchmark runs without npm install - #1

Merged
DrMkdaddy merged 1 commit into
mainfrom
noor/nix-flake
Sep 24, 2026
Merged

DrMkdaddy merged 1 commit into
mainfrom
noor/nix-flake

Conversation

@DrMkdaddy

Copy link
Copy Markdown
Contributor

Runs the benchmark with no clone, no npm install, and no network:

nix run github:StanzaAPI/benchmark-harness#smoke
nix run .#generate -- --transactions 255000 --claims 5 --out data/claims.x12
nix run .#bench    -- data/claims.x12
nix run .#compare  -- --file data/claims.x12 --cap 25
nix run .#help

buildNpmPackage builds node_modules and dist/ from package-lock.json, so the apps are hermetic (the npm dep hash is pinned in the flake). nix flake check runs a smoke pass, and nix develop gives a Node 24 shell.

Building it hermetically surfaced two packaging bugs, both fixed here:

  • dist/ was never shipped. npm pack falls back to .gitignore when there is no .npmignore, and .gitignore lists dist/. Added an explicit files allowlist.
  • node-x12 and x12-parser were devDependencies, but compare.mjs needs them at runtime. Moved to dependencies.

Verified: smoke, bench and compare all run; compare --cap 25 emits the three-parser table (stanza / node-x12 / x12-parser), and nix flake check passes.

buildNpmPackage builds node_modules and dist from the lockfile, so smoke,
bench, generate and compare run hermetically. nix flake check runs a smoke
pass.

Two packaging fixes it surfaced: an explicit files allowlist so npm pack stops
honoring .gitignore and ships dist/, and node-x12 and x12-parser are runtime
dependencies of compare.mjs, not build-time.
@DrMkdaddy
DrMkdaddy merged commit b2c52a1 into main Sep 24, 2026
2 checks passed
@DrMkdaddy
DrMkdaddy deleted the noor/nix-flake branch September 24, 2026 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant