1
1
// Build script to handle Turborepo build execution
2
2
const { spawnProcess } = require ( "../utils/spawn-process" ) ;
3
- const path = require ( "path" ) ;
3
+ const path = require ( "node: path" ) ;
4
4
5
5
const runTurbo = async ( task , args , { apiSecret, apiEndpoint, apiSignatureKey } = { } ) => {
6
- const command = [ "turbo" , "run" , task , "--concurrency=100%" , "--output-logs=errors-only" ] ;
6
+ const devConfig = ( ( ) => {
7
+ try {
8
+ return require ( "../../turbo.dev.json" ) ;
9
+ } catch ( e ) {
10
+ return { } ;
11
+ }
12
+ } ) ( ) ;
13
+ const execArguments = [
14
+ "turbo" ,
15
+ "run" ,
16
+ task ,
17
+ `--concurrency=${ devConfig . concurrency ?? "100%" } ` ,
18
+ `--output-logs=${ devConfig . outputLogs ?? "errors-only" } ` ,
19
+ ] ;
7
20
8
21
const cacheReadWriteKey = process . env . AWS_JSV3_TURBO_CACHE_BUILD_TYPE ?? "dev" ;
9
22
@@ -17,8 +30,8 @@ const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey }
17
30
dev : "--cache=local:rw,remote:r" ,
18
31
} ;
19
32
20
- command . push ( cacheReadWrite [ cacheReadWriteKey ] ) ;
21
- command . push ( ...args ) ;
33
+ execArguments . push ( cacheReadWrite [ cacheReadWriteKey ] ) ;
34
+ execArguments . push ( ...args ) ;
22
35
23
36
const turboRoot = path . join ( __dirname , ".." , ".." ) ;
24
37
@@ -36,7 +49,8 @@ const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey }
36
49
} ;
37
50
38
51
try {
39
- return await spawnProcess ( "yarn" , command , {
52
+ console . log ( "RUNNING: yarn" , execArguments . join ( " " ) ) ;
53
+ return await spawnProcess ( "yarn" , execArguments , {
40
54
stdio : "inherit" ,
41
55
cwd : turboRoot ,
42
56
env : turboEnv ,
0 commit comments