Skip to content

chore(build): allow turbo dev config #7079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ workspace
./scripts/compilation/tmp/*.mjs

.turbo
turbo.dev.json
coverage
dist
dist-*
Expand Down
24 changes: 19 additions & 5 deletions scripts/turbo/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
// Build script to handle Turborepo build execution
const { spawnProcess } = require("../utils/spawn-process");
const path = require("path");
const path = require("node:path");

const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey } = {}) => {
const command = ["turbo", "run", task, "--concurrency=100%", "--output-logs=errors-only"];
const devConfig = (() => {
try {
return require("../../turbo.dev.json");
} catch (e) {
return {};
}
})();
const execArguments = [
"turbo",
"run",
task,
`--concurrency=${devConfig.concurrency ?? "100%"}`,
`--output-logs=${devConfig.outputLogs ?? "errors-only"}`,
];

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

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

command.push(cacheReadWrite[cacheReadWriteKey]);
command.push(...args);
execArguments.push(cacheReadWrite[cacheReadWriteKey]);
execArguments.push(...args);

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

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

try {
return await spawnProcess("yarn", command, {
console.log("RUNNING: yarn", execArguments.join(" "));
return await spawnProcess("yarn", execArguments, {
stdio: "inherit",
cwd: turboRoot,
env: turboEnv,
Expand Down
Loading