authorgravatar for saiansh2525@gmail.comYash Singh <saiansh2525@gmail.com> 2026-10-11 02:02:11-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-10-11 02:02:11-05:00
logbb9b9aae57ce5614c9c26d540ca51c805cdbf09b
tree3da434ed3aca95184a558986afa8351849ec0fbf
parentcf821991863d5e374f698cb45bcef4759d3a0b7f
signature Signed by PGP key B5690EEEBB952194

fix(server): sync device tool license versions with installer pins (#18121)


7 files changed, 70 insertions(+), 13 deletions(-)

apps/server/src/device/DeviceToolchain.ts+3-2
......@@ -1,4 +1,5 @@
11import type { DeviceToolVersions } from "@t3tools/contracts";
2import { DEVICE_TOOL_VERSIONS } from "@t3tools/shared/deviceToolVersions";
23/**
34 * Pinned installs of the two external tools device support is built on.
45 *
......@@ -26,9 +27,9 @@ import * as Semaphore from "effect/Semaphore";
2627import * as ProcessRunner from "../processRunner.ts";
2728
2829const DEVICE_HUB_PACKAGE = "expo-device-hub";
29export const DEVICE_HUB_VERSION = "0.15.3";
30export const DEVICE_HUB_VERSION = DEVICE_TOOL_VERSIONS[DEVICE_HUB_PACKAGE];
3031const AGENT_DEVICE_PACKAGE = "agent-device";
31export const AGENT_DEVICE_VERSION = "0.21.24";
32export const AGENT_DEVICE_VERSION = DEVICE_TOOL_VERSIONS[AGENT_DEVICE_PACKAGE];
3233
3334const INSTALL_TIMEOUT = Duration.minutes(10);
3435const installLock = Semaphore.makeUnsafe(1);
docs/internals/open-source-licenses.md+4
......@@ -60,6 +60,10 @@ relative to the config file. `bundles` controls which generated manifests includ
6060supplies the label shown to users. Use `includeInBundles` when those differ, such as an optional
6161server tool that should appear in both client manifests but is not bundled into either client.
6262
63The `agent-device` and `expo-device-hub` custom notices take their versions from the
64[shared installer pins](../../packages/shared/src/deviceToolVersions.ts). Keep their package names
65in the config; their versions do not need manual updates.
66
6367Use `packageOverrides` only when an installed npm archive omits its notice or has incorrect
6468metadata:
6569
packages/shared/package.json+4
......@@ -359,6 +359,10 @@
359359 "types": "./src/thirdPartyLicenses.ts",
360360 "import": "./src/thirdPartyLicenses.ts"
361361 },
362 "./deviceToolVersions": {
363 "types": "./src/deviceToolVersions.ts",
364 "import": "./src/deviceToolVersions.ts"
365 },
362366 "./claudeCompaction": {
363367 "types": "./src/claudeCompaction.ts",
364368 "import": "./src/claudeCompaction.ts"
packages/shared/src/deviceToolVersions.ts created+5
......@@ -0,0 +1,5 @@
1// The installer and third-party notices share these pins for tools installed outside the workspace.
2export const DEVICE_TOOL_VERSIONS = {
3 "agent-device": "0.21.24",
4 "expo-device-hub": "0.15.3",
5} as const;
scripts/lib/third-party-licenses.test.ts+51
......@@ -5,6 +5,7 @@ import * as NodeOS from "node:os";
55import * as NodePath from "node:path";
66import * as NodeURL from "node:url";
77
8import { DEVICE_TOOL_VERSIONS } from "@t3tools/shared/deviceToolVersions";
89import { afterEach, describe, expect, it } from "vite-plus/test";
910
1011import {
......@@ -77,6 +78,56 @@ afterEach(async () => {
7778});
7879
7980describe("third-party license generation", () => {
81 it.each(["web", "mobile"])(
82 "uses installer pins for device tool notices in the %s manifest",
83 async (bundle) => {
84 const fixture = await createFixture();
85 await writeJson(fixture.configFile, {
86 customNotices: [
87 {
88 name: "agent-device",
89 license: "MIT",
90 noticeFile: "asset-notice.txt",
91 bundles: ["device-tools"],
92 includeInBundles: ["web", "mobile"],
93 },
94 {
95 name: "expo-device-hub",
96 license: "MIT",
97 noticeFile: "asset-notice.txt",
98 version: "0.0.0",
99 bundles: ["device-tools"],
100 includeInBundles: ["web", "mobile"],
101 },
102 {
103 name: "vendored-asset",
104 license: "MIT",
105 noticeFile: "asset-notice.txt",
106 version: "1.2.3",
107 bundles: ["web", "mobile"],
108 },
109 ],
110 });
111
112 const manifest = await generateThirdPartyLicenseManifest({
113 configFile: fixture.configFile,
114 packageManifests: [{ bundle, path: fixture.appManifest }],
115 });
116
117 expect(manifest.entries.find((entry) => entry.name === "agent-device")).toMatchObject({
118 version: DEVICE_TOOL_VERSIONS["agent-device"],
119 bundles: ["device-tools"],
120 });
121 expect(manifest.entries.find((entry) => entry.name === "expo-device-hub")).toMatchObject({
122 version: DEVICE_TOOL_VERSIONS["expo-device-hub"],
123 bundles: ["device-tools"],
124 });
125 expect(manifest.entries.find((entry) => entry.name === "vendored-asset")?.version).toBe(
126 "1.2.3",
127 );
128 },
129 );
130
80131 it("keeps the GhosttyKit notice pinned to the vendored framework revision", async () => {
81132 const [config, revision] = await Promise.all([
82133 NodeFSP.readFile(NodePath.join(REPOSITORY_ROOT, "third-party-licenses.config.json"), "utf8"),
scripts/lib/third-party-licenses.ts+3-1
......@@ -5,12 +5,14 @@ import * as NodePath from "node:path";
55import * as NodeURL from "node:url";
66import * as NodeModule from "node:module";
77
8import { DEVICE_TOOL_VERSIONS } from "@t3tools/shared/deviceToolVersions";
89import type { Plugin } from "vite-plus";
910
1011export const THIRD_PARTY_LICENSES_FILE_NAME = "third-party-licenses.json";
1112const SPDX_LICENSE_LIST_VERSION = "v3.28.0";
1213const SPDX_LICENSE_LIST_REVISION = "c4a7237ec8f4654e867546f9f409749300f1bf4c";
1314const GENERATED_NOTICE_CACHE_DIRECTORY = ".generated/third-party-licenses/spdx";
15const DEVICE_TOOL_NOTICE_VERSIONS = new Map(Object.entries(DEVICE_TOOL_VERSIONS));
1416
1517export interface ThirdPartyLicenseEntry {
1618 readonly bundles: ReadonlyArray<string>;
......@@ -868,7 +870,7 @@ async function customEntries(
868870 name: notice.name,
869871 noticeText,
870872 sourceUrl: notice.sourceUrl ?? null,
871 version: notice.version ?? null,
873 version: DEVICE_TOOL_NOTICE_VERSIONS.get(notice.name) ?? notice.version ?? null,
872874 };
873875 }),
874876 );
third-party-licenses.config.json-10
......@@ -62,7 +62,6 @@
6262 "license": "MIT",
6363 "name": "agent-device",
6464 "sourceUrl": "https://github.com/callstack/agent-device",
65 "version": "0.21.7",
6665 "generatedNotices": [
6766 {
6867 "licenseId": "MIT",
......@@ -76,7 +75,6 @@
7675 "license": "MIT AND Apache-2.0 AND BSD-3-Clause",
7776 "name": "expo-device-hub",
7877 "sourceUrl": "https://github.com/expo/expo-device-hub",
79 "version": "0.10.1",
8078 "generatedNotices": [
8179 {
8280 "licenseId": "MIT",
......@@ -174,14 +172,6 @@
174172 "copyrights": ["Copyright 2021-2024 The Connect Authors"]
175173 }
176174 },
177 {
178 "name": "@connectrpc/connect-node",
179 "version": "1.7.0",
180 "generatedNotice": {
181 "licenseId": "Apache-2.0",
182 "copyrights": ["Copyright 2021-2024 The Connect Authors"]
183 }
184 },
185175 {
186176 "name": "@connectrpc/connect-web",
187177 "version": "1.7.0",