File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,12 @@ test('the caller-side replay source subpaths are denied to daemon production cod
4545 file ,
4646 ) ;
4747 }
48- for ( const file of [ 'src/daemon/replay-runtime.ts' , 'packages/daemon/src/replay-runtime.ts' ] ) {
48+ for ( const file of [
49+ 'src/daemon/replay-runtime.ts' ,
50+ 'packages/daemon/src/replay-runtime.ts' ,
51+ 'src/daemon.ts' ,
52+ 'src/daemon-composition.ts' ,
53+ ] ) {
4954 const violations = check ( file ) . filter ( ( v ) => / c a l l e r - s i d e r e p l a y s o u r c e s / . test ( v . message ) ) ;
5055 assert . equal ( violations . length , 1 , file ) ;
5156 }
Original file line number Diff line number Diff line change @@ -204,11 +204,16 @@ export const CLIENT_ONLY_SUBPATHS: ReadonlySet<string> = new Set([
204204] ) ;
205205
206206const DAEMON_SOURCE_FILE = / ^ (?: s r c \/ d a e m o n | p a c k a g e s \/ d a e m o n \/ s r c ) \/ / ;
207+ // The daemon process also runs its root entry and composition root, outside the daemon tree.
208+ const DAEMON_PROCESS_ROOT_FILES : ReadonlySet < string > = new Set ( [
209+ 'src/daemon.ts' ,
210+ 'src/daemon-composition.ts' ,
211+ ] ) ;
207212
208213function importsClientOnlyFromDaemon ( file : string , specifier : string ) : boolean {
209214 return (
210215 CLIENT_ONLY_SUBPATHS . has ( specifier ) &&
211- DAEMON_SOURCE_FILE . test ( file ) &&
216+ ( DAEMON_SOURCE_FILE . test ( file ) || DAEMON_PROCESS_ROOT_FILES . has ( file ) ) &&
212217 ! isTestConsumerFile ( file )
213218 ) ;
214219}
You can’t perform that action at this time.
0 commit comments