1- import { performCompilation } from '../../packages/ compiler-cli/index.js ' ;
1+ import { performCompilation } from '@angular/ compiler-cli' ;
22import * as fs from 'fs/promises' ;
33import * as path from 'path' ;
44import * as os from 'os' ;
@@ -33,6 +33,11 @@ async function main() {
3333 const testChunkStart = testChunkSize * testShardIndex ;
3434 const shardExports = allExports . slice ( testChunkStart , testChunkStart + testChunkSize ) ;
3535
36+ // Sub-test directory where the first-party linked node modules end up being available.
37+ const testDir = path . join ( tmpDir , 'test' ) ;
38+ await fs . mkdir ( testDir ) ;
39+ await fs . mkdir ( path . join ( testDir , 'node_modules/@angular' ) , { recursive : true } ) ;
40+
3641 const testFiles = shardExports . map ( ( e ) => ( {
3742 content : `
3843 import {NgModule, Component} from '@angular/core';
@@ -46,15 +51,16 @@ async function main() {
4651 @Component({imports: [TestModule], template: ''})
4752 export class TestComponent {}
4853 ` ,
49- path : path . join ( tmpDir , `${ e . symbolName . toLowerCase ( ) } .ts` ) ,
54+ path : path . join ( testDir , `${ e . symbolName . toLowerCase ( ) } .ts` ) ,
5055 } ) ) ;
5156
5257 // Prepare node modules to resolve e.g. `@angular/core`
53- await fs . symlink ( path . resolve ( './node_modules' ) , path . join ( tmpDir , 'node_modules' ) ) ;
58+ await fs . symlink ( path . resolve ( './integration/node_modules' ) , path . join ( tmpDir , 'node_modules' ) ) ;
59+
5460 // Prepare node modules to resolve e.g. `@angular/cdk`. This is possible
5561 // as we are inside the sandbox, inside our test runfiles directory.
5662 for ( const { packagePath, name} of packages ) {
57- await fs . symlink ( path . resolve ( packagePath ) , `./ node_modules/ ${ name } ` ) ;
63+ await fs . symlink ( path . resolve ( packagePath ) , path . join ( testDir , ' node_modules' , name ) ) ;
5864 }
5965
6066 const diagnostics : ts . Diagnostic [ ] = [ ] ;
0 commit comments