From aaacdc0ef7128def5e08f3d992ca5e0f6444f15d Mon Sep 17 00:00:00 2001 From: RRFZ <247457381+Plastic-time@users.noreply.github.com> Date: Wed, 18 Nov 2026 08:49:15 -0500 Subject: [PATCH] fix(packaging): include the linked dinosaur notice (#11793) --- package.json | 1 + .../process/packageNoticeLinks.test.ts | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/boundary/process/packageNoticeLinks.test.ts diff --git a/package.json b/package.json index b207db52fb..7725126ec3 100644 --- a/package.json +++ b/package.json @@ -88,6 +88,7 @@ "README.md", "DISCLAIMER.md", "THIRD_PARTY_NOTICES.md", + "website/public/assets/licenses/dinosaur.txt", "LICENSE", "native/windows/build/manifest.json", "native/windows/build/rea-windows-x64.node", diff --git a/tests/boundary/process/packageNoticeLinks.test.ts b/tests/boundary/process/packageNoticeLinks.test.ts new file mode 100644 index 0000000000..a293452a44 --- /dev/null +++ b/tests/boundary/process/packageNoticeLinks.test.ts @@ -0,0 +1,41 @@ +import { readFile } from "node:fs/promises"; +import { posix } from "node:path"; + +import { expect } from "vitest"; + +import { npmInvocation } from "../../../scripts/lib/npm-invocation.mjs"; +import { processTest as test } from "../../support/process/processFixture.js"; + +test("packs the local license texts linked from the shipped notices", async ({ + processes, +}) => { + // Inspect npm's actual selection without running prepack or creating a tarball. + const npm = npmInvocation( + ["pack", "--dry-run", "--ignore-scripts", "--json"], + process.env, + ); + const packed = await processes.run(npm.command, npm.arguments); + expect(packed.exitCode, packed.stderr).toBe(0); + const [{ files }] = JSON.parse(packed.stdout) as [ + { files: { path: string }[] }, + ]; + const paths = new Set(files.map(({ path }) => path)); + for (const document of ["THIRD_PARTY_NOTICES.md", "licenses/README.md"]) { + expect(paths.has(document)).toBe(true); + const text = await readFile(document, "utf8"); + const notices = [...text.matchAll(/\]\(([^)]+)\)/gu)] + .map((match) => match[1]!) + .filter( + (link) => + !link.includes(":") && /(?:\.txt|LICENSE(?:\.md)?)$/u.test(link), + ); + expect(notices.length).toBeGreaterThan(0); + for (const link of notices) { + const target = posix.normalize(posix.join(posix.dirname(document), link)); + expect( + paths.has(target), + `${document} links to unpacked notice ${target}`, + ).toBe(true); + } + } +});