Add a Nix flake so the benchmark runs without npm install - #1
Merged
Merged
Conversation
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.
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.
Runs the benchmark with no clone, no
npm install, and no network:buildNpmPackagebuildsnode_modulesanddist/frompackage-lock.json, so the apps are hermetic (the npm dep hash is pinned in the flake).nix flake checkruns a smoke pass, andnix developgives a Node 24 shell.Building it hermetically surfaced two packaging bugs, both fixed here:
dist/was never shipped. npm pack falls back to.gitignorewhen there is no.npmignore, and.gitignorelistsdist/. Added an explicitfilesallowlist.node-x12andx12-parserweredevDependencies, butcompare.mjsneeds them at runtime. Moved todependencies.Verified:
smoke,benchandcompareall run;compare --cap 25emits the three-parser table (stanza / node-x12 / x12-parser), andnix flake checkpasses.