Skip to content

Trim the npm package and correct the Node requirement - #220

Merged
mnot merged 3 commits into
mainfrom
chore/npm-package-contents
Nov 3, 2026
Merged

mnot merged 3 commits into
mainfrom
chore/npm-package-contents

Conversation

@mnot

@mnot mnot commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

npm publish for http-cache-tests currently ships almost the whole repository, because there's no .npmignore or files list and npm falls back on .gitignore: 148 files, 8.9 MB unpacked (0.4.5 on the registry is 3.2 MB). The results, now carrying traces, are 5 MB of that and the annotated spec is 2.4 MB.

  • .npmignore: leaves out the annotated spec's build inputs (spec/Makefile, spec/*.xml, spec/lib/), docker/ (the image's build files; test-docker.sh pulls the image) and repository tooling (.editorconfig, .github/, CNAME, server.pid). Everything else ships, including index.html, results/, the built spec/rfc9111.html with its three assets, and test-docker.sh and test-browser.sh. Having the file means .gitignore is no longer consulted, which is why server.pid is listed. The patterns are anchored to the root so they can't match nested paths.
  • The two scripts: their full runs write into results/, which the package doesn't have, so each now runs mkdir -p results before writing.
  • engines: was >=14.8.0, but the pinned undici 8.12.3 requires >=22.19.0, so package.json and the README's Node requirement now say that.
  • README: a sentence in the npm section saying what the package does and doesn't include.

The package comes to 92 files, 6.8 MB unpacked, 0.93 MB packed (it was 148 files, 8.9 MB unpacked, 1.34 MB packed; the results compress well, so keeping them costs little in the download). I packed it, extracted the tarball, and from there ran the server, fetched index.html, results/index.mjs, a results file, spec/rfc9111.html and its assets (all 200), and loaded index.html in a browser: the results table renders with every implementation's column and no console errors. An earlier version of this change (before index.html, the results and the scripts were added) was also checked from a tarball with the CLI for one test and for the whole suite (365 results with 365 traces) and with npm test. I haven't run test-docker.sh or test-browser.sh from an extracted package, so the mkdir -p results change is untested end to end, and I haven't run it through npm publish or installed it from the registry.

asset/ (1.2 MB, mostly Font Awesome) is needed by both the results page and the browser test page. test.yml and lint.yml still use Node 14; I left them alone.

AI-generated: written with Claude Code. Mark Nottingham asked for the PR and a sensible .npmignore; the choices of what to include are mine (shipping the scripts, index.html and the results were Mark's calls) and haven't had a separate human review yet.

🤖 Generated with Claude Code

mnot and others added 3 commits November 3, 2026 16:59
With no .npmignore or files list, npm falls back on .gitignore and ships
nearly everything: 148 files, 8.9 MB unpacked, of which the results (now
carrying traces) are 5 MB and the annotated spec 2.4 MB. .npmignore drops
the website (index.html, results/, spec/, CNAME), the scripts that assume
a git checkout (test-docker.sh and test-browser.sh write into results/;
docker/ builds the image the former pulls), and repository tooling. The
package comes to 73 files and 1.5 MB unpacked, and still runs the server,
the CLI and the browser test page.

engines said Node 14.8.0 or later, but undici 8.12.3 needs 22.19.0, so
engines and the README now say that.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Both were excluded because their full runs write into results/, which the
package doesn't contain. They now create results/ if it's missing, so they
can be shipped, and only docker/ (the image's build files, which
test-docker.sh pulls rather than builds) stays out. The package is 75
files and 1.5 MB unpacked.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
index.html is how results are viewed locally, and it needs results/ (the
implementation list and each implementation's JSON) and links to the
annotated specification at spec/rfc9111.html. Excluding them left a package
that could run the tests but not show the outcome. They now ship, as do
the built spec page and its three assets; the spec's build inputs
(Makefile, the XML sources and lib/) stay out, along with docker/ and
repository tooling.

The package is 92 files and 6.8 MB unpacked, 0.93 MB packed (the results
compress well). From an extracted tarball, index.html renders the results
table with no console errors.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mnot
mnot merged commit 4c48fa1 into main Nov 3, 2026
2 checks passed
@mnot
mnot deleted the chore/npm-package-contents branch November 3, 2026 06:07
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