@@ -5,6 +5,7 @@ import * as NodeOS from "node:os";
55import * as NodePath from "node:path" ;
66import * as NodeURL from "node:url" ;
77
8+ import { 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" ) ,
0 commit comments