GeezerVison is showing github.com — fix(server): sync device tool license versions with installer pins (#… · pingdotgg/t3code@bb9b9aa
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/server/src/device/DeviceToolchain.ts +3-2Lines changed: 3 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | import type { DeviceToolVersions } from "@t3tools/contracts"; | | 2 | +import { DEVICE_TOOL_VERSIONS } from "@t3tools/shared/deviceToolVersions"; | 2 | 3 | /** | 3 | 4 | * Pinned installs of the two external tools device support is built on. | 4 | 5 | * | @@ -26,9 +27,9 @@ import * as Semaphore from "effect/Semaphore"; | 26 | 27 | import * as ProcessRunner from "../processRunner.ts"; | 27 | 28 |
| 28 | 29 | const DEVICE_HUB_PACKAGE = "expo-device-hub"; | 29 | | -export const DEVICE_HUB_VERSION = "0.15.3"; | | 30 | +export const DEVICE_HUB_VERSION = DEVICE_TOOL_VERSIONS[DEVICE_HUB_PACKAGE]; | 30 | 31 | const AGENT_DEVICE_PACKAGE = "agent-device"; | 31 | | -export const AGENT_DEVICE_VERSION = "0.21.24"; | | 32 | +export const AGENT_DEVICE_VERSION = DEVICE_TOOL_VERSIONS[AGENT_DEVICE_PACKAGE]; | 32 | 33 |
| 33 | 34 | const INSTALL_TIMEOUT = Duration.minutes(10); | 34 | 35 | const installLock = Semaphore.makeUnsafe(1); | |
Collapse file Copy file name to clipboardExpand all lines: docs/internals/open-source-licenses.md +4Lines changed: 4 additions & 0 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -60,6 +60,10 @@ relative to the config file. `bundles` controls which generated manifests includ | 60 | 60 | supplies the label shown to users. Use `includeInBundles` when those differ, such as an optional | 61 | 61 | server tool that should appear in both client manifests but is not bundled into either client. | 62 | 62 |
| | 63 | +The `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 | | 65 | +in the config; their versions do not need manual updates. | | 66 | + | 63 | 67 | Use `packageOverrides` only when an installed npm archive omits its notice or has incorrect | 64 | 68 | metadata: | 65 | 69 |
| |
Collapse file Copy file name to clipboardExpand all lines: packages/shared/package.json +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 359 | 359 | "types": "./src/thirdPartyLicenses.ts", | 360 | 360 | "import": "./src/thirdPartyLicenses.ts" | 361 | 361 | }, | | 362 | + "./deviceToolVersions": { | | 363 | + "types": "./src/deviceToolVersions.ts", | | 364 | + "import": "./src/deviceToolVersions.ts" | | 365 | + }, | 362 | 366 | "./claudeCompaction": { | 363 | 367 | "types": "./src/claudeCompaction.ts", | 364 | 368 | "import": "./src/claudeCompaction.ts" | |
Collapse file Copy file name to clipboard +5Lines changed: 5 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +// The installer and third-party notices share these pins for tools installed outside the workspace. | | 2 | +export const DEVICE_TOOL_VERSIONS = { | | 3 | + "agent-device": "0.21.24", | | 4 | + "expo-device-hub": "0.15.3", | | 5 | +} as const; |
Collapse file Copy file name to clipboardExpand all lines: scripts/lib/third-party-licenses.test.ts +51Lines changed: 51 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -5,6 +5,7 @@ import * as NodeOS from "node:os"; | 5 | 5 | import * as NodePath from "node:path"; | 6 | 6 | import * as NodeURL from "node:url"; | 7 | 7 |
| | 8 | +import { DEVICE_TOOL_VERSIONS } from "@t3tools/shared/deviceToolVersions"; | 8 | 9 | import { afterEach, describe, expect, it } from "vite-plus/test"; | 9 | 10 |
| 10 | 11 | import { | @@ -77,6 +78,56 @@ afterEach(async () => { | 77 | 78 | }); | 78 | 79 |
| 79 | 80 | describe("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 | + | 80 | 131 | it("keeps the GhosttyKit notice pinned to the vendored framework revision", async () => { | 81 | 132 | const [config, revision] = await Promise.all([ | 82 | 133 | NodeFSP.readFile(NodePath.join(REPOSITORY_ROOT, "third-party-licenses.config.json"), "utf8"), | |
Collapse file Copy file name to clipboardExpand all lines: scripts/lib/third-party-licenses.ts +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -5,12 +5,14 @@ import * as NodePath from "node:path"; | 5 | 5 | import * as NodeURL from "node:url"; | 6 | 6 | import * as NodeModule from "node:module"; | 7 | 7 |
| | 8 | +import { DEVICE_TOOL_VERSIONS } from "@t3tools/shared/deviceToolVersions"; | 8 | 9 | import type { Plugin } from "vite-plus"; | 9 | 10 |
| 10 | 11 | export const THIRD_PARTY_LICENSES_FILE_NAME = "third-party-licenses.json"; | 11 | 12 | const SPDX_LICENSE_LIST_VERSION = "v3.28.0"; | 12 | 13 | const SPDX_LICENSE_LIST_REVISION = "c4a7237ec8f4654e867546f9f409749300f1bf4c"; | 13 | 14 | const GENERATED_NOTICE_CACHE_DIRECTORY = ".generated/third-party-licenses/spdx"; | | 15 | +const DEVICE_TOOL_NOTICE_VERSIONS = new Map(Object.entries(DEVICE_TOOL_VERSIONS)); | 14 | 16 |
| 15 | 17 | export interface ThirdPartyLicenseEntry { | 16 | 18 | readonly bundles: ReadonlyArray<string>; | @@ -868,7 +870,7 @@ async function customEntries( | 868 | 870 | name: notice.name, | 869 | 871 | noticeText, | 870 | 872 | sourceUrl: notice.sourceUrl ?? null, | 871 | | - version: notice.version ?? null, | | 873 | + version: DEVICE_TOOL_NOTICE_VERSIONS.get(notice.name) ?? notice.version ?? null, | 872 | 874 | }; | 873 | 875 | }), | 874 | 876 | ); | |
Collapse file Copy file name to clipboardExpand all lines: third-party-licenses.config.json -10Lines changed: 0 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 62 | 62 | "license": "MIT", | 63 | 63 | "name": "agent-device", | 64 | 64 | "sourceUrl": "https://github.com/callstack/agent-device", | 65 | | - "version": "0.21.7", | 66 | 65 | "generatedNotices": [ | 67 | 66 | { | 68 | 67 | "licenseId": "MIT", | | 76 | 75 | "license": "MIT AND Apache-2.0 AND BSD-3-Clause", | 77 | 76 | "name": "expo-device-hub", | 78 | 77 | "sourceUrl": "https://github.com/expo/expo-device-hub", | 79 | | - "version": "0.10.1", | 80 | 78 | "generatedNotices": [ | 81 | 79 | { | 82 | 80 | "licenseId": "MIT", | | 174 | 172 | "copyrights": ["Copyright 2021-2024 The Connect Authors"] | 175 | 173 | } | 176 | 174 | }, | 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 | | - }, | 185 | 175 | { | 186 | 176 | "name": "@connectrpc/connect-web", | 187 | 177 | "version": "1.7.0", | |
|