@@ -66,6 +66,28 @@ async function createNextInstall({
6666 )
6767 require ( 'console' ) . log ( 'Creating temp repo dir' , tmpRepoDir )
6868
69+ for ( const item of [ 'package.json' , 'packages' ] ) {
70+ await rootSpan
71+ . traceChild ( `copy ${ item } to temp dir` )
72+ . traceAsyncFn ( ( ) =>
73+ fs . copy (
74+ path . join ( origRepoDir , item ) ,
75+ path . join ( tmpRepoDir , item ) ,
76+ {
77+ filter : ( item ) => {
78+ return (
79+ ! item . includes ( 'node_modules' ) &&
80+ ! item . includes ( 'pnpm-lock.yaml' ) &&
81+ ! item . includes ( '.DS_Store' ) &&
82+ // Exclude Rust compilation files
83+ ! / n e x t - s w c [ \\ / ] t a r g e t / . test ( item )
84+ )
85+ } ,
86+ }
87+ )
88+ )
89+ }
90+
6991 await rootSpan
7092 . traceChild ( 'ensure swc binary' )
7193 . traceAsyncFn ( async ( ) => {
@@ -81,7 +103,7 @@ async function createNextInstall({
81103 folder
82104 )
83105 const outputPath = path . join (
84- origRepoDir ,
106+ tmpRepoDir ,
85107 'packages/next-swc/native'
86108 )
87109 await fs . copy ( swcPkgPath , outputPath , {
@@ -99,33 +121,9 @@ async function createNextInstall({
99121 }
100122 } )
101123
102- for ( const item of [ 'package.json' , 'packages' ] ) {
103- await rootSpan
104- . traceChild ( `copy ${ item } to temp dir` )
105- . traceAsyncFn ( ( ) =>
106- fs . copy (
107- path . join ( origRepoDir , item ) ,
108- path . join ( tmpRepoDir , item ) ,
109- {
110- filter : ( item ) => {
111- return (
112- ! item . includes ( 'node_modules' ) &&
113- ! item . includes ( 'pnpm-lock.yaml' ) &&
114- ! item . includes ( '.DS_Store' ) &&
115- // Exclude Rust compilation files
116- ! / n e x t [ \\ / ] b u i l d [ \\ / ] s w c [ \\ / ] t a r g e t / . test ( item ) &&
117- ! / n e x t - s w c [ \\ / ] t a r g e t / . test ( item )
118- )
119- } ,
120- }
121- )
122- )
123- }
124-
125124 pkgPaths = await rootSpan . traceChild ( 'linkPackages' ) . traceAsyncFn ( ( ) =>
126125 linkPackages ( {
127126 repoDir : tmpRepoDir ,
128- nextSwcVersion : null ,
129127 } )
130128 )
131129 }
0 commit comments