Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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.private.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 privateConfig = (() => {
try {
return require("../../turbo.private.json");
} catch (e) {
return {};
}
})();
const execArguments = [
"turbo",
"run",
task,
`--concurrency=${privateConfig.concurrency ?? "100%"}`,
`--output-logs=${privateConfig.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