Repository navigation
ci: assert every @chestnutlabs tarball lists LICENSE and NOTICE.md before publish - #438
Merged
Merged
Conversation
…fore publish The 0.20.1 tarballs shipped with files: ["dist"], so none carried the MIT notice for the inherited code. Each package now holds LICENSE and NOTICE.md (copies of the root files) and names both in "files". A new tools/pack-license-check.mjs runs npm pack --dry-run --json -w <pkg> for every publishable workspace and fails when LICENSE or NOTICE.md is not listed, when "files" does not name them, or when a package copy differs from the root file. It runs first in the test gate and in the publish workflow, before anything uploads. Pack snapshots updated. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sobechestnut-dev
marked this pull request as ready for review
October 26, 2026 03:27
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.
What
CI gate for ChestnutLabs/AnyBridge#2765 (owner ruling 6a): before any publish, every
@chestnutlabs/*tarball must listLICENSEandNOTICE.md.The 0.20.1 tarballs shipped with
files: ["dist"]and carried no MIT notice for the inherited remcoder/gcode-preview code. This PR makes the fix and the guard that keeps it. Nothing is published: nonpm publish, no tag, no version bump. The 0.20.2 republish waits for go-public.LICENSEandNOTICE.md(byte copies of the repo root's) and names both infiles.tools/pack-license-check.mjs(npm run pack:license-check), per publishable workspace:npm pack --dry-run --json -w <pkg>must listLICENSEandNOTICE.md;filesmust name both (npm auto-adds a package-localLICENSE, so the packed list alone would not noticeLICENSEleavingfiles);It needs no build and runs with
--ignore-scripts. It reads both npm JSON shapes (array on npm 10/11, object keyed by name on npm 12).npm ciinrun-tests.yml(buildjob) and inrelease-publish.yml, before the build and beforerelease:publish.pack-check.mjsallowsNOTICE.mdat the tarball root;pack-check-snapshots.jsongainsLICENSE+NOTICE.mdfor all 14 (+28 lines, nothing reordered).release-process.mdstep 5 names the new gate.RED-check (the guard fails when it should)
Unit and CLI tests (
tools/pack-license-check.test.mjs, 17 tests) drive the realnpm pack --dry-runagainst throwaway two-package repos. Mutants run on the WIP-committed tree, no-op control green first:filesok /filesnot read: all caught. One mutant (backslash normalisation of listed paths) survived because the code was dead for these names; the code was deleted, not tested.packages/gcode-parser(the actual repo, CLI exit code):filesdropsNOTICE.mdfilesdropsLICENSEfilesback to["dist"](the 0.20.1 shape)LICENSEdeletedNOTICE.mddriftedGate
Local, fresh
npm ci --ignore-scriptsplus a build of toolpath-core (thepreparestep CI runs):lint(0 errors, 79 pre-existing warnings),typeCheck,test(16 files, 309 tests),test:packages(61),license:check,docs:links,prettier --check .,test:consumer-vue, andpack:check(14 snapshots, publint, attw: OK) under npm 10.9.2.pack:checkfails on this PC's npm 12 (parsed[0]on an object-shaped--jsonresult). That is pre-existing, unrelated to this PR, and CI uses npm 10/11. Flagged below as a follow-up.Notes for the reviewer
NOTICE.mdships verbatim. Its relative links (docs/...) will not resolve inside a tarball;LICENSEdoes. Left as is: it is the file the upstream notice requires.prepackcopy step is the alternative; it hides the files from review.packages/*/src).Follow-ups (each with a recommendation)
pack-check.mjsreadsparsed[0].files, which breaks on npm 12's object-shaped--json. Recommendation: follow-up (CI is on npm 10/11 today; fix before the runners move).tools/release/publish.mjs(andrelease:dry-run) call the same check, so a local rehearsal fails too. Recommendation: adopt later; the workflow already runs it before publish.LICENSEstill has the upstream "Remco Veldkamp" copyright line. Recommendation: skip; the owner has not decided whether LICENSE also carries the Chestnut line.🤖 Generated with Claude Code