build: add a license gate for shipped npm packages and Rust crates (P2.3)

scripts/check-licenses.mjs (npm run check:licenses) reads the production
dependency closures of the sidecar (@waggle/server minus the packages
stage-sidecar-deps.mjs never ships) and the web UI (apps/web) from
package-lock.json and fails on GPL, AGPL, SSPL, missing and unknown
licenses. It allows permissive licenses plus MPL-2.0 and lists named
exceptions with reasons; LGPL libvips and node-webpmux, the OFL fonts and
the unlicensed buffers package are marked as pending the licensing review.

app/src-tauri/deny.toml applies the same allowlist to the Tauri crates with
cargo-deny; the npm check fails when the two lists drift apart. A new CI
job runs both, with cargo-deny 0.18.3 installed and cached in CI.

scripts/license-inventory.mjs holds the shared closure logic.
This commit is contained in:
shumeiko.it
2026-11-01 00:30:06 +01:00
parent 5a7f3d24d9
commit 3ebe97e033
6 changed files with 720 additions and 0 deletions

View File

@@ -27,6 +27,7 @@
"build:www": "npm run build -w apps/www",
"lint": "eslint .",
"check:deps": "node scripts/check-workspace-deps.mjs",
"check:licenses": "node scripts/check-licenses.mjs",
"lint:no-invalid-snapshots": "node scripts/check-no-invalid-snapshots.mjs",
"ux:contrast": "node scripts/ux-gates/contrast-tokens.mjs",
"ux:color-guard": "node scripts/ux-gates/text-color-guard.mjs",