feat(licenses): ship LICENSE and the third-party notices with every installer

build-sidecar.mjs copies LICENSE and THIRD_PARTY_NOTICES.md from the
repository root next to service.js in app/src-tauri/resources, and fails
when either is missing. The resources/* glob of tauri.conf.json bundles
them into every desktop installer, and build-server-archive.mjs refuses a
payload without them, so the server archive carries them too. The copies
are ignored by git. Tests cover the copy, the archive and the ignore rule.
This commit is contained in:
shumeiko.it
2026-11-04 10:24:35 +01:00
parent 0acaa1cf29
commit 9ac6b9f0d4
6 changed files with 112 additions and 2 deletions

View File

@@ -4,8 +4,8 @@
*
* The archive holds the same sidecar payload the desktop app ships, staged by
* bundle-node, build-sidecar, bundle-native-deps and stage-sidecar-deps into
* app/src-tauri/resources, plus the built web UI under web/ and a
* manifest.json. Run it after those steps and the web build, on the system
* app/src-tauri/resources (with LICENSE and THIRD_PARTY_NOTICES.md next to
* service.js), plus the built web UI under web/ and a manifest.json. Run it after those steps and the web build, on the system
* the archive is for.
*
* Usage:
@@ -78,6 +78,9 @@ try {
requireFile(path.join(options.resources, nodeName), stageHint);
requireFile(path.join(options.resources, 'service.js'), stageHint);
requireFile(path.join(options.resources, 'node_modules'), stageHint);
// The license and the third-party notices must ship with the archive.
requireFile(path.join(options.resources, 'LICENSE'), stageHint);
requireFile(path.join(options.resources, 'THIRD_PARTY_NOTICES.md'), stageHint);
requireFile(path.join(options.web, 'index.html'), 'Build the web UI first: cd apps/web && npx vite build');
let nodeVersion = options.nodeVersion;