From 346425ec279a4352f5eb4ae9a1ef4505d452bb3f Mon Sep 17 00:00:00 2001 From: Mark Nottingham Date: Tue, 3 Nov 2026 16:59:20 +1100 Subject: [PATCH 1/3] Trim the npm package and correct the Node requirement 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 --- .npmignore | 20 ++++++++++++++++++++ README.md | 4 ++-- package.json | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..0ace5f8 --- /dev/null +++ b/.npmignore @@ -0,0 +1,20 @@ +# Things the published package doesn't need to run the tests. Everything else ships; +# note that having this file means .gitignore is no longer consulted. + +# the website: results data, the annotated spec, and the page that shows them +/index.html +/results/ +/spec/ +/CNAME + +# scripts that assume a git checkout (they write into results/ or use docker/) +/docker/ +/test-browser.sh +/test-docker.sh + +# repository tooling +/.editorconfig +/.github/ + +# local state +/server.pid diff --git a/README.md b/README.md index ec67fb0..9c046e0 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Therefore, if you believe a test should change (based upon common behaviour or y ## Installation -The tests require a recent version of [NodeJS](https://nodejs.org/) (14.8.0 or greater), which includes the `npm` package manager. +The tests require a recent version of [NodeJS](https://nodejs.org/) (22.19.0 or greater), which includes the `npm` package manager. To install the most recent source from GitHub (*recommended; things are moving fast*): @@ -54,7 +54,7 @@ Alternatively, for the most recent release: > npm i --legacy-bundling http-cache-tests -Note that the version in the registry is not necessarily up-to-date. +Note that the version in the registry is not necessarily up-to-date. The package has what you need to run the server, the command-line client and the browser tests, but not the results, the specification or the scripts that assume a clone (`test-docker.sh` and `test-browser.sh`); use the clone for those. ## Running tests with scripts diff --git a/package.json b/package.json index adf9fbd..e3d4632 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "author": "Mark Nottingham", "license": "BSD-3-Clause", "engines": { - "node": ">=14.8.0" + "node": ">=22.19.0" }, "dependencies": { "liquidjs": "^10.9.2", From 105cab6fce9e96149892881cbf9163584dbe34c1 Mon Sep 17 00:00:00 2001 From: Mark Nottingham Date: Tue, 3 Nov 2026 17:03:05 +1100 Subject: [PATCH 2/3] Ship test-docker.sh and test-browser.sh in the npm package 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 --- .npmignore | 4 +--- README.md | 2 +- test-browser.sh | 1 + test-docker.sh | 1 + 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.npmignore b/.npmignore index 0ace5f8..3be7692 100644 --- a/.npmignore +++ b/.npmignore @@ -7,10 +7,8 @@ /spec/ /CNAME -# scripts that assume a git checkout (they write into results/ or use docker/) +# the Docker image's build files; test-docker.sh pulls the image instead /docker/ -/test-browser.sh -/test-docker.sh # repository tooling /.editorconfig diff --git a/README.md b/README.md index 9c046e0..f5bbed8 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Alternatively, for the most recent release: > npm i --legacy-bundling http-cache-tests -Note that the version in the registry is not necessarily up-to-date. The package has what you need to run the server, the command-line client and the browser tests, but not the results, the specification or the scripts that assume a clone (`test-docker.sh` and `test-browser.sh`); use the clone for those. +Note that the version in the registry is not necessarily up-to-date. The package has what you need to run the server, the command-line client, the browser tests and the scripts below, but not the results, the specification or the Docker image's build files; the scripts that save results create a `results` directory if there isn't one. ## Running tests with scripts diff --git a/test-browser.sh b/test-browser.sh index 019ad4b..3df01e1 100755 --- a/test-browser.sh +++ b/test-browser.sh @@ -77,6 +77,7 @@ function test_browser { sleep 1 if [ -f "${TARGET}" ] ; then + mkdir -p results mv "${TARGET}" results/ fi diff --git a/test-docker.sh b/test-docker.sh index c4cd386..29ca69d 100755 --- a/test-docker.sh +++ b/test-docker.sh @@ -87,6 +87,7 @@ function test_proxy { echo "* ${PKG} $(docker container exec tmp_proxies /usr/bin/apt-cache show ${PKG} | grep Version)" if [[ -z "${TEST_ID}" ]]; then + mkdir -p results npm run --silent cli --base=http://localhost:${PROXY_PORT} > "results/${PROXY}.json" else npm run --silent cli --base=http://localhost:${PROXY_PORT} --id="${TEST_ID}" From ccf3937ca84a30d295eb83e8ba68d2a908afb0c6 Mon Sep 17 00:00:00 2001 From: Mark Nottingham Date: Tue, 3 Nov 2026 17:06:27 +1100 Subject: [PATCH 3/3] Ship index.html, the results and the built spec in the npm package 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 --- .npmignore | 14 +++++++------- README.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.npmignore b/.npmignore index 3be7692..07a9522 100644 --- a/.npmignore +++ b/.npmignore @@ -1,11 +1,10 @@ -# Things the published package doesn't need to run the tests. Everything else ships; -# note that having this file means .gitignore is no longer consulted. +# Things the published package doesn't need to run the tests or show their results. Everything +# else ships; note that having this file means .gitignore is no longer consulted. -# the website: results data, the annotated spec, and the page that shows them -/index.html -/results/ -/spec/ -/CNAME +# the annotated spec's build inputs (the built page and its assets ship) +/spec/Makefile +/spec/*.xml +/spec/lib/ # the Docker image's build files; test-docker.sh pulls the image instead /docker/ @@ -13,6 +12,7 @@ # repository tooling /.editorconfig /.github/ +/CNAME # local state /server.pid diff --git a/README.md b/README.md index f5bbed8..016b730 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ Alternatively, for the most recent release: > npm i --legacy-bundling http-cache-tests -Note that the version in the registry is not necessarily up-to-date. The package has what you need to run the server, the command-line client, the browser tests and the scripts below, but not the results, the specification or the Docker image's build files; the scripts that save results create a `results` directory if there isn't one. +Note that the version in the registry is not necessarily up-to-date. The package has what you need to run the server, the command-line client, the browser tests and the scripts below, and to view results locally (`index.html`, the `results` directory and the annotated specification), but not the Docker image's build files or the specification's sources; the scripts that save results create a `results` directory if there isn't one. ## Running tests with scripts