@@ -21,6 +21,13 @@ const INERT = [
2121 / ^ L I C E N S E $ / ,
2222] ;
2323
24+ // Run everything: the root vite.config.ts loads the first as setup for every
25+ // package's tests, and the vendored mobile tarballs are installed dependencies.
26+ const RUNS_EVERYTHING = [
27+ / ^ p a c k a g e s \/ s h a r e d \/ s r c \/ ( H o s t P r o c e s s | t e s t i n g \/ l o n g T e m p D i r ) \. t s $ / ,
28+ / ^ a p p s \/ m o b i l e \/ d e p s \/ / ,
29+ ] ;
30+
2431// Paths outside a package, or files inside one that other packages read
2532// through relative imports rather than a package.json dependency.
2633const EXTRA_OWNERS = [
@@ -33,8 +40,19 @@ const EXTRA_OWNERS = [
3340] ;
3441const RUST = / ^ n a t i v e \/ ( r e s o u r c e - m o n i t o r | k d e - s n a p - s h o t | h y p r l a n d - s n a p - s h o t ) \/ / ;
3542
36- // Tests that import another package's sources without declaring it.
37- const TEST_ONLY_DEPS = { "@t3tools/provider-pi" : [ "@t3tools/client-runtime" ] } ;
43+ // Tests that read another package's files without declaring it. The scripts
44+ // tests read app manifests, assets, and sources (cursor-sdk-packaging,
45+ // third-party-licenses, brand-assets, build-desktop-artifact).
46+ const TEST_ONLY_DEPS = {
47+ "@t3tools/provider-pi" : [ "@t3tools/client-runtime" ] ,
48+ "@t3tools/scripts" : [
49+ "@t3tools/desktop" ,
50+ "@t3tools/mobile" ,
51+ "@t3tools/web" ,
52+ "t3" ,
53+ "@t3tools/provider-cursor" ,
54+ ] ,
55+ } ;
3856// Declared dependencies that only feed a build step: the server bundles the
3957// built web app (apps/server/vite.config.ts) but never imports it.
4058const BUILD_ONLY_DEPS = { t3 : [ "@t3tools/web" ] } ;
@@ -93,7 +111,9 @@ function ownersOf(file, packages) {
93111 if ( INERT . some ( ( pattern ) => pattern . test ( file ) ) ) return [ ] ;
94112 // A manifest can change dependencies or versions other packages read.
95113 if ( path . posix . basename ( file ) === "package.json" ) return null ;
96- if ( RUST . test ( file ) ) return [ ] ;
114+ if ( RUNS_EVERYTHING . some ( ( pattern ) => pattern . test ( file ) ) ) return null ;
115+ // scripts/build-desktop-artifact.test.ts reads the crates' sources.
116+ if ( RUST . test ( file ) ) return [ "@t3tools/scripts" ] ;
97117
98118 const extra = EXTRA_OWNERS . flatMap ( ( [ pattern , names ] ) => ( pattern . test ( file ) ? names : [ ] ) ) ;
99119 const owner = packages
@@ -120,6 +140,8 @@ function decide(files, packages, full) {
120140 }
121141 }
122142
143+ // Release smoke reads scripts/ itself, not what the scripts tests read.
144+ let scriptsChanged = everything ;
123145 if ( everything ) {
124146 affected = all ;
125147 } else {
@@ -134,6 +156,7 @@ function decide(files, packages, full) {
134156 }
135157 }
136158 }
159+ scriptsChanged = affected . has ( "@t3tools/scripts" ) ;
137160 for ( const [ name , deps ] of Object . entries ( TEST_ONLY_DEPS ) ) {
138161 if ( deps . some ( ( dep ) => affected . has ( dep ) ) ) affected . add ( name ) ;
139162 }
@@ -155,7 +178,7 @@ function decide(files, packages, full) {
155178 test_web : has ( "@t3tools/web" ) ,
156179 test_server : has ( "t3" ) ,
157180 rust : everything || rust ,
158- release_smoke : everything || has ( "@t3tools/scripts" ) ,
181+ release_smoke : scriptsChanged ,
159182 mobile_native : files === null || files . some ( ( file ) => MOBILE_NATIVE . test ( file ) ) ,
160183 } ,
161184 } ;
0 commit comments