Skip to content

Commit ba21028

Browse files
authored
chore(build): allow turbo dev config (#7079)
* chore(build): allow personal turbo config * chore: rename private->dev
1 parent b51a0f6 commit ba21028

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ workspace
5151
./scripts/compilation/tmp/*.mjs
5252

5353
.turbo
54+
turbo.dev.json
5455
coverage
5556
dist
5657
dist-*

scripts/turbo/index.js

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
// Build script to handle Turborepo build execution
22
const { spawnProcess } = require("../utils/spawn-process");
3-
const path = require("path");
3+
const path = require("node:path");
44

55
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+
];
720

821
const cacheReadWriteKey = process.env.AWS_JSV3_TURBO_CACHE_BUILD_TYPE ?? "dev";
922

@@ -17,8 +30,8 @@ const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey }
1730
dev: "--cache=local:rw,remote:r",
1831
};
1932

20-
command.push(cacheReadWrite[cacheReadWriteKey]);
21-
command.push(...args);
33+
execArguments.push(cacheReadWrite[cacheReadWriteKey]);
34+
execArguments.push(...args);
2235

2336
const turboRoot = path.join(__dirname, "..", "..");
2437

@@ -36,7 +49,8 @@ const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey }
3649
};
3750

3851
try {
39-
return await spawnProcess("yarn", command, {
52+
console.log("RUNNING: yarn", execArguments.join(" "));
53+
return await spawnProcess("yarn", execArguments, {
4054
stdio: "inherit",
4155
cwd: turboRoot,
4256
env: turboEnv,

0 commit comments

Comments
 (0)