From 65a026835328fb3f905a6cdc424c24c9a2783142 Mon Sep 17 00:00:00 2001 From: anybridge-backups Date: Sun, 25 Oct 2026 20:24:20 -0700 Subject: [PATCH] ci: assert every @chestnutlabs tarball lists LICENSE and NOTICE.md before 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 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 --- .github/workflows/release-publish.yml | 2 + .github/workflows/run-tests.yml | 2 + docs/reference/release-process.md | 3 +- package.json | 1 + packages/gcode-bgcode/LICENSE | 21 ++ packages/gcode-bgcode/NOTICE.md | 46 +++++ packages/gcode-bgcode/package.json | 4 +- packages/gcode-colors/LICENSE | 21 ++ packages/gcode-colors/NOTICE.md | 46 +++++ packages/gcode-colors/package.json | 4 +- packages/gcode-containers/LICENSE | 21 ++ packages/gcode-containers/NOTICE.md | 46 +++++ packages/gcode-containers/package.json | 4 +- packages/gcode-dialects/LICENSE | 21 ++ packages/gcode-dialects/NOTICE.md | 46 +++++ packages/gcode-dialects/package.json | 4 +- packages/gcode-model-renderer/LICENSE | 21 ++ packages/gcode-model-renderer/NOTICE.md | 46 +++++ packages/gcode-model-renderer/package.json | 4 +- packages/gcode-parser/LICENSE | 21 ++ packages/gcode-parser/NOTICE.md | 46 +++++ packages/gcode-parser/package.json | 4 +- packages/gcode-preview-core/LICENSE | 21 ++ packages/gcode-preview-core/NOTICE.md | 46 +++++ packages/gcode-preview-core/package.json | 4 +- packages/gcode-preview-element/LICENSE | 21 ++ packages/gcode-preview-element/NOTICE.md | 46 +++++ packages/gcode-preview-element/package.json | 4 +- packages/gcode-preview-react/LICENSE | 21 ++ packages/gcode-preview-react/NOTICE.md | 46 +++++ packages/gcode-preview-react/package.json | 4 +- packages/gcode-preview-svelte/LICENSE | 21 ++ packages/gcode-preview-svelte/NOTICE.md | 46 +++++ packages/gcode-preview-svelte/package.json | 4 +- packages/gcode-preview-vue/LICENSE | 21 ++ packages/gcode-preview-vue/NOTICE.md | 46 +++++ packages/gcode-preview-vue/package.json | 4 +- packages/gcode-renderer-2d/LICENSE | 21 ++ packages/gcode-renderer-2d/NOTICE.md | 46 +++++ packages/gcode-renderer-2d/package.json | 4 +- packages/gcode-renderer-three/LICENSE | 21 ++ packages/gcode-renderer-three/NOTICE.md | 46 +++++ packages/gcode-renderer-three/package.json | 4 +- packages/toolpath-core/LICENSE | 21 ++ packages/toolpath-core/NOTICE.md | 46 +++++ packages/toolpath-core/package.json | 4 +- tools/pack-check-snapshots.json | 28 +++ tools/pack-check.mjs | 3 +- tools/pack-license-check.mjs | 141 +++++++++++++ tools/pack-license-check.test.mjs | 217 ++++++++++++++++++++ vitest.config.mts | 2 +- 51 files changed, 1376 insertions(+), 17 deletions(-) create mode 100644 packages/gcode-bgcode/LICENSE create mode 100644 packages/gcode-bgcode/NOTICE.md create mode 100644 packages/gcode-colors/LICENSE create mode 100644 packages/gcode-colors/NOTICE.md create mode 100644 packages/gcode-containers/LICENSE create mode 100644 packages/gcode-containers/NOTICE.md create mode 100644 packages/gcode-dialects/LICENSE create mode 100644 packages/gcode-dialects/NOTICE.md create mode 100644 packages/gcode-model-renderer/LICENSE create mode 100644 packages/gcode-model-renderer/NOTICE.md create mode 100644 packages/gcode-parser/LICENSE create mode 100644 packages/gcode-parser/NOTICE.md create mode 100644 packages/gcode-preview-core/LICENSE create mode 100644 packages/gcode-preview-core/NOTICE.md create mode 100644 packages/gcode-preview-element/LICENSE create mode 100644 packages/gcode-preview-element/NOTICE.md create mode 100644 packages/gcode-preview-react/LICENSE create mode 100644 packages/gcode-preview-react/NOTICE.md create mode 100644 packages/gcode-preview-svelte/LICENSE create mode 100644 packages/gcode-preview-svelte/NOTICE.md create mode 100644 packages/gcode-preview-vue/LICENSE create mode 100644 packages/gcode-preview-vue/NOTICE.md create mode 100644 packages/gcode-renderer-2d/LICENSE create mode 100644 packages/gcode-renderer-2d/NOTICE.md create mode 100644 packages/gcode-renderer-three/LICENSE create mode 100644 packages/gcode-renderer-three/NOTICE.md create mode 100644 packages/toolpath-core/LICENSE create mode 100644 packages/toolpath-core/NOTICE.md create mode 100644 tools/pack-license-check.mjs create mode 100644 tools/pack-license-check.test.mjs diff --git a/.github/workflows/release-publish.yml b/.github/workflows/release-publish.yml index a35432fa..ec9c504a 100644 --- a/.github/workflows/release-publish.yml +++ b/.github/workflows/release-publish.yml @@ -37,6 +37,8 @@ jobs: cache: 'npm' registry-url: 'https://registry.npmjs.org' - run: npm ci + # Owner ruling 6a (AnyBridge#2765): no tarball goes out without LICENSE + NOTICE.md. + - run: npm run pack:license-check # Full repository gate — identical to the required CI check, before anything uploads. - run: npm run build - run: npm run test diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 49459bb4..89c83654 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -36,6 +36,8 @@ jobs: node-version: '22.x' cache: "npm" - run: npm ci + # Owner ruling 6a (AnyBridge#2765): every tarball lists LICENSE + NOTICE.md. Needs no build. + - run: npm run pack:license-check - run: npm run build - run: npm run test - run: npm run test:packages diff --git a/docs/reference/release-process.md b/docs/reference/release-process.md index f2ddd7d6..c4082184 100644 --- a/docs/reference/release-process.md +++ b/docs/reference/release-process.md @@ -56,7 +56,8 @@ from the protected `Release / publish` workflow on a tag from `main` — never f and nothing else — triggers publication. 5. **`Release / publish` workflow:** verifies the tag is on `main`, fresh `npm ci`, then the full repository gate (build, root + package suites, typeCheck, lint, license, docs links, consumer - fixture, pack-check, sync-check) before a dependency-ordered `npm publish` ×14 with **npm + fixture, pack-check, sync-check, and `pack:license-check`, which fails if any tarball would ship + without `LICENSE` and `NOTICE.md`) before a dependency-ordered `npm publish` ×14 with **npm provenance**. The orchestrator (`tools/release/publish.mjs`) refuses real publishes outside the workflow; `npm run release:dry-run` is the local rehearsal (it exercises the full pack + validation path without uploading). diff --git a/package.json b/package.json index 1d53ba12..ed655472 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "test:consumer-vue": "node tools/consumer-vue/run.mjs", "verify:registry": "node tools/consumer-vue/run-registry.mjs", "pack:check": "node tools/pack-check.mjs", + "pack:license-check": "node tools/pack-license-check.mjs", "docs:links": "node tools/link-check.mjs", "docs:api": "typedoc", "docs:api:watch": "typedoc --watch", diff --git a/packages/gcode-bgcode/LICENSE b/packages/gcode-bgcode/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-bgcode/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-bgcode/NOTICE.md b/packages/gcode-bgcode/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-bgcode/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-bgcode/package.json b/packages/gcode-bgcode/package.json index f65befda..7d242673 100644 --- a/packages/gcode-bgcode/package.json +++ b/packages/gcode-bgcode/package.json @@ -36,7 +36,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-colors/LICENSE b/packages/gcode-colors/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-colors/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-colors/NOTICE.md b/packages/gcode-colors/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-colors/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-colors/package.json b/packages/gcode-colors/package.json index feee8c6f..691218ce 100644 --- a/packages/gcode-colors/package.json +++ b/packages/gcode-colors/package.json @@ -36,7 +36,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-containers/LICENSE b/packages/gcode-containers/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-containers/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-containers/NOTICE.md b/packages/gcode-containers/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-containers/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-containers/package.json b/packages/gcode-containers/package.json index 21728e57..dda2ba5e 100644 --- a/packages/gcode-containers/package.json +++ b/packages/gcode-containers/package.json @@ -35,7 +35,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "scripts": { "build": "tsc -p tsconfig.json", diff --git a/packages/gcode-dialects/LICENSE b/packages/gcode-dialects/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-dialects/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-dialects/NOTICE.md b/packages/gcode-dialects/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-dialects/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-dialects/package.json b/packages/gcode-dialects/package.json index 1ce25989..512dc90e 100644 --- a/packages/gcode-dialects/package.json +++ b/packages/gcode-dialects/package.json @@ -38,7 +38,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "scripts": { "build": "tsc -p tsconfig.json", diff --git a/packages/gcode-model-renderer/LICENSE b/packages/gcode-model-renderer/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-model-renderer/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-model-renderer/NOTICE.md b/packages/gcode-model-renderer/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-model-renderer/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-model-renderer/package.json b/packages/gcode-model-renderer/package.json index 39d72db4..ce8b46d6 100644 --- a/packages/gcode-model-renderer/package.json +++ b/packages/gcode-model-renderer/package.json @@ -44,7 +44,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-parser/LICENSE b/packages/gcode-parser/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-parser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-parser/NOTICE.md b/packages/gcode-parser/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-parser/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-parser/package.json b/packages/gcode-parser/package.json index 334197b0..9bc95a5d 100644 --- a/packages/gcode-parser/package.json +++ b/packages/gcode-parser/package.json @@ -38,7 +38,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-preview-core/LICENSE b/packages/gcode-preview-core/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-preview-core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-preview-core/NOTICE.md b/packages/gcode-preview-core/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-preview-core/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-preview-core/package.json b/packages/gcode-preview-core/package.json index a9feb630..043ef341 100644 --- a/packages/gcode-preview-core/package.json +++ b/packages/gcode-preview-core/package.json @@ -41,7 +41,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-preview-element/LICENSE b/packages/gcode-preview-element/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-preview-element/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-preview-element/NOTICE.md b/packages/gcode-preview-element/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-preview-element/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-preview-element/package.json b/packages/gcode-preview-element/package.json index 747d287f..42dcbc60 100644 --- a/packages/gcode-preview-element/package.json +++ b/packages/gcode-preview-element/package.json @@ -49,7 +49,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-preview-react/LICENSE b/packages/gcode-preview-react/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-preview-react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-preview-react/NOTICE.md b/packages/gcode-preview-react/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-preview-react/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-preview-react/package.json b/packages/gcode-preview-react/package.json index f7f956e4..69662df7 100644 --- a/packages/gcode-preview-react/package.json +++ b/packages/gcode-preview-react/package.json @@ -42,7 +42,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-preview-svelte/LICENSE b/packages/gcode-preview-svelte/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-preview-svelte/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-preview-svelte/NOTICE.md b/packages/gcode-preview-svelte/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-preview-svelte/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-preview-svelte/package.json b/packages/gcode-preview-svelte/package.json index a5f0b258..ef7596a2 100644 --- a/packages/gcode-preview-svelte/package.json +++ b/packages/gcode-preview-svelte/package.json @@ -53,7 +53,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-preview-vue/LICENSE b/packages/gcode-preview-vue/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-preview-vue/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-preview-vue/NOTICE.md b/packages/gcode-preview-vue/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-preview-vue/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-preview-vue/package.json b/packages/gcode-preview-vue/package.json index 5900313f..f7777186 100644 --- a/packages/gcode-preview-vue/package.json +++ b/packages/gcode-preview-vue/package.json @@ -43,7 +43,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-renderer-2d/LICENSE b/packages/gcode-renderer-2d/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-renderer-2d/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-renderer-2d/NOTICE.md b/packages/gcode-renderer-2d/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-renderer-2d/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-renderer-2d/package.json b/packages/gcode-renderer-2d/package.json index 73ccf06c..5407e28a 100644 --- a/packages/gcode-renderer-2d/package.json +++ b/packages/gcode-renderer-2d/package.json @@ -38,7 +38,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/gcode-renderer-three/LICENSE b/packages/gcode-renderer-three/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/gcode-renderer-three/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/gcode-renderer-three/NOTICE.md b/packages/gcode-renderer-three/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/gcode-renderer-three/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/gcode-renderer-three/package.json b/packages/gcode-renderer-three/package.json index 8df59830..82f6c9e9 100644 --- a/packages/gcode-renderer-three/package.json +++ b/packages/gcode-renderer-three/package.json @@ -38,7 +38,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/packages/toolpath-core/LICENSE b/packages/toolpath-core/LICENSE new file mode 100644 index 00000000..10b7de5c --- /dev/null +++ b/packages/toolpath-core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-2025 Remco Veldkamp + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/toolpath-core/NOTICE.md b/packages/toolpath-core/NOTICE.md new file mode 100644 index 00000000..2289eb50 --- /dev/null +++ b/packages/toolpath-core/NOTICE.md @@ -0,0 +1,46 @@ +# NOTICE — Attribution & Provenance + +This file summarizes attribution and provenance for **ChestnutLabs/gcode-preview**. It complements, +and does not replace, the [`LICENSE`](LICENSE) file and the full +[Upstream, Fork, License & Contribution Policy](docs/03_UPSTREAM_FORK_LICENSE_AND_CONTRIBUTION_POLICY.md). + +## Upstream origin + +- **This repository is a public GitHub fork of** [`xyz-tools/gcode-preview`](https://github.com/xyz-tools/gcode-preview) + (project identity `remcoder/gcode-preview`; npm package `gcode-preview`). +- **Chestnut founding baseline:** branch `develop` at commit + `15375e56129f5a57aebc099ed7bfb5a092dcfb9e` (2026-06-08). +- The inherited Git history and the upstream fork relationship are preserved. Chestnut Labs maintains + its own roadmap, governance, release cadence, and package APIs. + +## Copyright + +- Inherited code: **Copyright (c) 2017–2025 Remco Veldkamp** and the `xyz-tools/gcode-preview` + contributors, licensed under the MIT License (see [`LICENSE`](LICENSE)). +- Chestnut Labs additions and modifications: **Copyright (c) 2026 Chestnut Labs**, also under the MIT + License. + +The upstream copyright notice and MIT permission notice are retained in [`LICENSE`](LICENSE) and must +not be removed. Chestnut notices are added **alongside** — never in place of — upstream notices. + +## License + +MIT for both the inherited fork and Chestnut Labs additions, unless a later, explicit +legal/governance decision changes the license for an independently separable new package. See the +fork/license policy for the full rationale, including how an MIT package may be consumed by a +GPL-3.0 application (e.g., AnyBridge) without altering the package's MIT notice obligations. + +## Derived vs. independently replaced code + +Chestnut Labs does **not** claim a clean-room implementation. Subsystem provenance (inherited / +modified / replaced / original) is tracked in +[`docs/UPSTREAM_PROVENANCE.md`](docs/UPSTREAM_PROVENANCE.md). Replacing every line of an inherited +file does not by itself establish clean-room status; the ledger exists for honesty, maintenance, and +license review. + +## Third-party code + +Bundled and dependency notices are tracked in [`THIRD_PARTY_NOTICES.md`](THIRD_PARTY_NOTICES.md). +Reference implementations studied for behavior (Sindarius/Mainsail, Fluidd, PrusaSlicer/libvgcode, +BambuBuddy, and others) are **not** incorporated as source unless their license is compatible and the +incorporation is recorded per policy. diff --git a/packages/toolpath-core/package.json b/packages/toolpath-core/package.json index b9b4b1a1..94e8a40a 100644 --- a/packages/toolpath-core/package.json +++ b/packages/toolpath-core/package.json @@ -37,7 +37,9 @@ } }, "files": [ - "dist" + "dist", + "LICENSE", + "NOTICE.md" ], "publishConfig": { "access": "public" diff --git a/tools/pack-check-snapshots.json b/tools/pack-check-snapshots.json index e4b1e232..653154ff 100644 --- a/tools/pack-check-snapshots.json +++ b/tools/pack-check-snapshots.json @@ -1,5 +1,7 @@ { "toolpath-core": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/bounds.d.ts", "dist/bounds.d.ts.map", @@ -34,6 +36,8 @@ "package.json" ], "gcode-colors": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/colors.d.ts", "dist/colors.d.ts.map", @@ -44,6 +48,8 @@ "package.json" ], "gcode-dialects": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/annotate.d.ts", "dist/annotate.d.ts.map", @@ -87,6 +93,8 @@ "package.json" ], "gcode-containers": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/gcode-3mf.d.ts", "dist/gcode-3mf.d.ts.map", @@ -100,6 +108,8 @@ "package.json" ], "gcode-bgcode": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/adapter.d.ts", "dist/adapter.d.ts.map", @@ -119,6 +129,8 @@ "package.json" ], "gcode-parser": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/growable.d.ts", "dist/growable.d.ts.map", @@ -156,6 +168,8 @@ "package.json" ], "gcode-renderer-three": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/build-volume.d.ts", "dist/build-volume.d.ts.map", @@ -217,6 +231,8 @@ "package.json" ], "gcode-renderer-2d": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/index.d.ts", "dist/index.d.ts.map", @@ -227,6 +243,8 @@ "package.json" ], "gcode-model-renderer": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/cache-key.d.ts", "dist/cache-key.d.ts.map", @@ -270,6 +288,8 @@ "package.json" ], "gcode-preview-core": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/color-resolve.d.ts", "dist/color-resolve.d.ts.map", @@ -295,6 +315,8 @@ "package.json" ], "gcode-preview-vue": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/gcode-preview-component.d.ts", "dist/gcode-preview-component.d.ts.map", @@ -317,6 +339,8 @@ "package.json" ], "gcode-preview-react": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/gcode-preview-component.d.ts", "dist/gcode-preview-component.d.ts.map", @@ -339,6 +363,8 @@ "package.json" ], "gcode-preview-svelte": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/GcodePreview.svelte", "dist/create-gcode-preview.d.ts", @@ -357,6 +383,8 @@ "package.json" ], "gcode-preview-element": [ + "LICENSE", + "NOTICE.md", "README.md", "dist/define.d.ts", "dist/define.d.ts.map", diff --git a/tools/pack-check.mjs b/tools/pack-check.mjs index 43b281f6..5715013c 100644 --- a/tools/pack-check.mjs +++ b/tools/pack-check.mjs @@ -82,7 +82,8 @@ for (const name of PACKAGES) { const parsed = JSON.parse(packJson); const files = parsed[0].files.map((f) => f.path.replace(/\\/g, '/')).sort(); next[name] = files; - const allowedRoots = /^(dist\/|package\.json$|README(\.md)?$|LICENSE(\.md)?$|CHANGELOG\.md$|GcodePreview\.svelte$)/; + const allowedRoots = + /^(dist\/|package\.json$|README(\.md)?$|LICENSE(\.md)?$|NOTICE\.md$|CHANGELOG\.md$|GcodePreview\.svelte$)/; const stray = files.filter((f) => !allowedRoots.test(f)); if (stray.length > 0) { process.stderr.write(` ✗ unexpected tarball contents: ${stray.join(', ')}\n`); diff --git a/tools/pack-license-check.mjs b/tools/pack-license-check.mjs new file mode 100644 index 00000000..888c1498 --- /dev/null +++ b/tools/pack-license-check.mjs @@ -0,0 +1,141 @@ +/* + * Licence-text gate for the published tarballs (ChestnutLabs/AnyBridge#2765, owner ruling 6a). + * + * The 0.20.1 tarballs shipped with `files: ["dist"]`, so none of them carried the MIT notice for the + * inherited remcoder/gcode-preview code. npm adds a package-local LICENSE on its own, but NOTICE.md + * only ships when `files` names it, and neither is found at the repo root. So for EVERY publishable + * workspace package this asserts, from `npm pack --dry-run --json` (the list npm would really upload): + * + * (1) the tarball lists LICENSE and NOTICE.md; + * (2) the package's own LICENSE / NOTICE.md are byte-identical to the repo root's, so a copy that + * drifted (or an empty placeholder) cannot ship as the notice. + * + * It needs no build: the legal files are not build output, and `--ignore-scripts` keeps `prepare` + * (toolpath-core builds there) from running. Run before any publish; CI runs it first in the gate. + * + * Usage: node tools/pack-license-check.mjs [--root ] + */ +import fs from 'node:fs'; +import path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { spawnSync } from 'node:child_process'; + +export const REQUIRED_FILES = ['LICENSE', 'NOTICE.md']; + +/** The publishable (non-private) workspace packages under `/packages`, found by walking. */ +export function publishablePackages(root) { + const packagesDir = path.join(root, 'packages'); + const found = []; + for (const entry of fs.readdirSync(packagesDir, { withFileTypes: true })) { + const manifest = path.join(packagesDir, entry.name, 'package.json'); + if (!entry.isDirectory() || !fs.existsSync(manifest)) continue; + const pkg = JSON.parse(fs.readFileSync(manifest, 'utf8')); + if (pkg.private === true) continue; + found.push({ name: pkg.name, dir: path.join(packagesDir, entry.name), files: pkg.files }); + } + return found.sort((a, b) => a.name.localeCompare(b.name)); +} + +/** + * Problems with the packed file lists. `packed` is the `name`/`files` results of `npm pack --dry-run --json -w ...`. + * A package that npm did not report at all is a problem too (never "nothing listed, nothing wrong"). + */ +export function listProblems(packages, packed) { + const problems = []; + const byName = new Map(packed.map((p) => [p.name, p])); + for (const { name } of packages) { + const result = byName.get(name); + if (!result) { + problems.push(`${name}: npm pack reported no result for this package`); + continue; + } + const listed = new Set(result.files.map((f) => f.path)); + for (const required of REQUIRED_FILES) { + if (!listed.has(required)) { + problems.push(`${name}: tarball does not list ${required} (add it to "files" and the package dir)`); + } + } + } + return problems; +} + +/** + * Each manifest's own `files` names LICENSE and NOTICE.md. npm adds a package-local LICENSE by itself, + * so the packed list alone would not notice `LICENSE` leaving `files`; the manifest should say it. + */ +export function manifestProblems(packages) { + const problems = []; + for (const { name, files } of packages) { + for (const required of REQUIRED_FILES) { + if (!Array.isArray(files) || !files.includes(required)) { + problems.push(`${name}: package.json "files" does not name ${required}`); + } + } + } + return problems; +} + +/** Problems with the on-disk copies: each package's legal files must equal the repo root's. */ +export function copyProblems(root, packages) { + const problems = []; + for (const required of REQUIRED_FILES) { + const rootFile = path.join(root, required); + if (!fs.existsSync(rootFile)) { + problems.push(`repo root has no ${required}`); + continue; + } + const want = fs.readFileSync(rootFile); + for (const { name, dir } of packages) { + const copy = path.join(dir, required); + if (!fs.existsSync(copy)) { + problems.push(`${name}: ${required} is missing from the package directory`); + } else if (!want.equals(fs.readFileSync(copy))) { + problems.push(`${name}: ${required} differs from the repo root's ${required}`); + } + } + } + return problems; +} + +/** + * `npm pack --dry-run --json -w ...` for the given packages, one npm start-up (npm is slow to + * boot, especially on Windows). The JSON shape depends on the npm version (an array of results on + * npm 10/11, an object keyed by workspace name on npm 12), so read either. + */ +function packDryRun(root, names) { + const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm'; + const args = ['pack', '--dry-run', '--json', '--ignore-scripts', ...names.flatMap((n) => ['-w', n])]; + const r = spawnSync(npmCmd, args, { cwd: root, encoding: 'utf8', shell: process.platform === 'win32' }); + if (r.status !== 0) { + throw new Error(`npm pack --dry-run failed (exit ${r.status}):\n${r.stdout}\n${r.stderr}`); + } + const parsed = JSON.parse(r.stdout); + return Array.isArray(parsed) ? parsed : Object.values(parsed); +} + +export function checkRoot(root) { + const packages = publishablePackages(root); + if (packages.length === 0) return ['no publishable packages found (is --root the repo root?)']; + const packed = packDryRun( + root, + packages.map((p) => p.name) + ); + return [...listProblems(packages, packed), ...manifestProblems(packages), ...copyProblems(root, packages)]; +} + +const isMain = process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url); +if (isMain) { + const flag = process.argv.indexOf('--root'); + const root = + flag === -1 + ? path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') + : path.resolve(process.argv[flag + 1]); + const problems = checkRoot(root); + if (problems.length > 0) { + process.stderr.write(`pack-license-check: FAILED\n${problems.map((p) => ` ✗ ${p}`).join('\n')}\n`); + process.exit(1); + } + process.stderr.write( + `pack-license-check: OK (${publishablePackages(root).length} packages list ${REQUIRED_FILES.join(' + ')})\n` + ); +} diff --git a/tools/pack-license-check.test.mjs b/tools/pack-license-check.test.mjs new file mode 100644 index 00000000..fe114ccf --- /dev/null +++ b/tools/pack-license-check.test.mjs @@ -0,0 +1,217 @@ +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; +import { spawnSync } from 'node:child_process'; +import { fileURLToPath } from 'node:url'; +import { afterEach, describe, expect, it } from 'vitest'; +import { checkRoot, copyProblems, listProblems, manifestProblems, publishablePackages } from './pack-license-check.mjs'; + +const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); +const script = path.join(repoRoot, 'tools', 'pack-license-check.mjs'); +const scratch = []; +// Each CLI case boots npm (slow on Windows); the real-repo case packs all fourteen packages. +const NPM_MS = 90_000; + +const LICENSE = 'MIT License\n\nCopyright (c) 2017-2025 Remco Veldkamp\n'; +const NOTICE = '# NOTICE\n\nCopyright (c) 2026 Chestnut Labs\n'; + +/** A two-package workspace in a temp dir, each package shaped like the real ones. */ +function makeRepo(overrides = {}) { + const root = fs.mkdtempSync(path.join(os.tmpdir(), 'packlic-')); + scratch.push(root); + fs.writeFileSync(path.join(root, 'LICENSE'), LICENSE); + fs.writeFileSync(path.join(root, 'NOTICE.md'), NOTICE); + fs.writeFileSync( + path.join(root, 'package.json'), + JSON.stringify({ name: 'ws', version: '0.0.0', private: true, workspaces: ['packages/*'] }) + ); + for (const name of ['alpha', 'beta']) { + const dir = path.join(root, 'packages', name); + fs.mkdirSync(path.join(dir, 'dist'), { recursive: true }); + fs.writeFileSync(path.join(dir, 'dist', 'index.js'), 'export {};\n'); + fs.writeFileSync(path.join(dir, 'LICENSE'), LICENSE); + fs.writeFileSync(path.join(dir, 'NOTICE.md'), NOTICE); + const manifest = { + name: `@chestnutlabs/${name}`, + version: '0.0.1', + files: ['dist', 'LICENSE', 'NOTICE.md'], + ...(overrides[name]?.manifest ?? {}) + }; + fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify(manifest)); + for (const [file, content] of Object.entries(overrides[name]?.files ?? {})) { + if (content === null) fs.rmSync(path.join(dir, file)); + else fs.writeFileSync(path.join(dir, file), content); + } + } + return root; +} + +function runCli(root) { + const r = spawnSync(process.execPath, [script, '--root', root], { encoding: 'utf8' }); + return { code: r.status, err: r.stderr }; +} + +afterEach(() => { + for (const dir of scratch.splice(0)) fs.rmSync(dir, { recursive: true, force: true }); +}); + +describe('listProblems', () => { + const pkgs = [{ name: '@chestnutlabs/a' }]; + const entry = (files) => ({ name: '@chestnutlabs/a', files: files.map((p) => ({ path: p })) }); + + it('passes when LICENSE and NOTICE.md are both listed', () => { + expect(listProblems(pkgs, [entry(['dist/x.js', 'LICENSE', 'NOTICE.md', 'package.json'])])).toEqual([]); + }); + + it('names the missing file', () => { + expect(listProblems(pkgs, [entry(['dist/x.js', 'NOTICE.md'])])).toEqual([ + '@chestnutlabs/a: tarball does not list LICENSE (add it to "files" and the package dir)' + ]); + expect(listProblems(pkgs, [entry(['dist/x.js', 'LICENSE'])])).toEqual([ + '@chestnutlabs/a: tarball does not list NOTICE.md (add it to "files" and the package dir)' + ]); + }); + + it('does not accept a look-alike path (a nested or differently-cased file)', () => { + expect(listProblems(pkgs, [entry(['dist/LICENSE', 'docs/NOTICE.md', 'license', 'NOTICE.MD'])])).toHaveLength(2); + }); + + it('fails a package npm did not report at all', () => { + expect(listProblems(pkgs, [])).toEqual(['@chestnutlabs/a: npm pack reported no result for this package']); + }); +}); + +describe('manifestProblems', () => { + it('names each file `files` does not list, and treats a missing `files` as listing nothing', () => { + expect(manifestProblems([{ name: 'p', files: ['dist', 'LICENSE', 'NOTICE.md'] }])).toEqual([]); + expect(manifestProblems([{ name: 'p', files: ['dist', 'NOTICE.md'] }])).toEqual([ + 'p: package.json "files" does not name LICENSE' + ]); + expect(manifestProblems([{ name: 'p', files: ['dist', 'LICENSE'] }])).toEqual([ + 'p: package.json "files" does not name NOTICE.md' + ]); + expect(manifestProblems([{ name: 'p' }])).toHaveLength(2); + }); +}); + +describe('checkRoot', () => { + it('refuses a root with no publishable packages instead of passing vacuously', () => { + const root = fs.mkdtempSync(path.join(os.tmpdir(), 'packlic-')); + scratch.push(root); + fs.mkdirSync(path.join(root, 'packages')); + expect(checkRoot(root)).toEqual(['no publishable packages found (is --root the repo root?)']); + }); +}); + +describe('copyProblems', () => { + it('passes when the copies equal the root files', () => { + const root = makeRepo(); + expect(copyProblems(root, publishablePackages(root))).toEqual([]); + }); + + it('fails a copy that differs, an empty copy, and a missing copy', () => { + const root = makeRepo({ + alpha: { files: { LICENSE: 'MIT License\n' } }, + beta: { files: { 'NOTICE.md': '' } } + }); + expect(copyProblems(root, publishablePackages(root))).toEqual([ + "@chestnutlabs/alpha: LICENSE differs from the repo root's LICENSE", + "@chestnutlabs/beta: NOTICE.md differs from the repo root's NOTICE.md" + ]); + fs.rmSync(path.join(root, 'packages', 'alpha', 'NOTICE.md')); + expect(copyProblems(root, publishablePackages(root))).toContain( + '@chestnutlabs/alpha: NOTICE.md is missing from the package directory' + ); + }); + + it('fails when the repo root has no LICENSE', () => { + const root = makeRepo(); + fs.rmSync(path.join(root, 'LICENSE')); + expect(copyProblems(root, publishablePackages(root))).toEqual(['repo root has no LICENSE']); + }); +}); + +describe('publishablePackages', () => { + it('skips private packages and finds the rest by walking', () => { + const root = makeRepo({ beta: { manifest: { private: true } } }); + expect(publishablePackages(root).map((p) => p.name)).toEqual(['@chestnutlabs/alpha']); + }); +}); + +describe('the CLI against a real `npm pack --dry-run`', () => { + it( + 'passes a repo whose packages ship both files', + () => { + const { code, err } = runCli(makeRepo()); + expect(err).toContain('pack-license-check: OK (2 packages'); + expect(code).toBe(0); + }, + NPM_MS + ); + + it( + 'FAILS when a package `files` drops LICENSE', + () => { + // The package dir still holds LICENSE and npm auto-adds a package-local LICENSE, so the packed + // list alone stays green: the manifest check is what catches this one. + const root = makeRepo({ alpha: { manifest: { files: ['dist', 'NOTICE.md'] } } }); + const { code, err } = runCli(root); + expect(code).toBe(1); + expect(err).toContain('@chestnutlabs/alpha: package.json "files" does not name LICENSE'); + expect(err).not.toContain('tarball does not list'); + expect(err).not.toContain('beta'); + }, + NPM_MS + ); + + it( + 'FAILS when a package has no LICENSE in its directory (npm cannot ship what is not there)', + () => { + const root = makeRepo({ beta: { files: { LICENSE: null } } }); + const { code, err } = runCli(root); + expect(code).toBe(1); + expect(err).toContain('@chestnutlabs/beta: tarball does not list LICENSE'); + expect(err).toContain('@chestnutlabs/beta: LICENSE is missing from the package directory'); + }, + NPM_MS + ); + + it( + 'FAILS when `files` is back to dist only (the 0.20.1 shape) and the package dir has no copies', + () => { + const root = makeRepo({ + alpha: { manifest: { files: ['dist'] }, files: { LICENSE: null, 'NOTICE.md': null } } + }); + const { code, err } = runCli(root); + expect(code).toBe(1); + expect(err).toContain('@chestnutlabs/alpha: tarball does not list LICENSE'); + expect(err).toContain('@chestnutlabs/alpha: tarball does not list NOTICE.md'); + }, + NPM_MS + ); + + it( + 'FAILS a drifted copy even though the tarball lists it', + () => { + const root = makeRepo({ alpha: { files: { 'NOTICE.md': '# stale\n' } } }); + const { code, err } = runCli(root); + expect(code).toBe(1); + expect(err).toContain("NOTICE.md differs from the repo root's NOTICE.md"); + }, + NPM_MS + ); +}); + +describe('this repository', () => { + it( + 'every publishable package ships LICENSE and NOTICE.md', + () => { + expect(checkRoot(repoRoot)).toEqual([]); + }, + NPM_MS + ); + + it('covers all fourteen packages', () => { + expect(publishablePackages(repoRoot)).toHaveLength(14); + }); +}); diff --git a/vitest.config.mts b/vitest.config.mts index 1326bf78..4cb24f6d 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -2,7 +2,7 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { - include: ['src/__tests__/**/*.ts'], + include: ['src/__tests__/**/*.ts', 'tools/*.test.mjs'], environment: 'happy-dom', globals: true }