From 4599fcdc02d466310dc3c62e0cc832c251629234 Mon Sep 17 00:00:00 2001 From: George Fu Date: Wed, 14 May 2025 12:50:43 -0400 Subject: [PATCH 1/2] chore(build): allow personal turbo config --- .gitignore | 1 + scripts/turbo/index.js | 24 +++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 42563176b83e8..e84d79372d2fd 100644 --- a/.gitignore +++ b/.gitignore @@ -51,6 +51,7 @@ workspace ./scripts/compilation/tmp/*.mjs .turbo +turbo.private.json coverage dist dist-* diff --git a/scripts/turbo/index.js b/scripts/turbo/index.js index 86323723cfe5b..7b071b3afecef 100644 --- a/scripts/turbo/index.js +++ b/scripts/turbo/index.js @@ -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"; @@ -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, "..", ".."); @@ -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, From cb361f41bfd7dd8e7d01bb3b4f9045e1c5886b0d Mon Sep 17 00:00:00 2001 From: George Fu Date: Wed, 14 May 2025 13:47:33 -0400 Subject: [PATCH 2/2] chore: rename private->dev --- .gitignore | 2 +- scripts/turbo/index.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index e84d79372d2fd..73c9fe68119ba 100644 --- a/.gitignore +++ b/.gitignore @@ -51,7 +51,7 @@ workspace ./scripts/compilation/tmp/*.mjs .turbo -turbo.private.json +turbo.dev.json coverage dist dist-* diff --git a/scripts/turbo/index.js b/scripts/turbo/index.js index 7b071b3afecef..ac1f6eec03a09 100644 --- a/scripts/turbo/index.js +++ b/scripts/turbo/index.js @@ -3,9 +3,9 @@ const { spawnProcess } = require("../utils/spawn-process"); const path = require("node:path"); const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey } = {}) => { - const privateConfig = (() => { + const devConfig = (() => { try { - return require("../../turbo.private.json"); + return require("../../turbo.dev.json"); } catch (e) { return {}; } @@ -14,8 +14,8 @@ const runTurbo = async (task, args, { apiSecret, apiEndpoint, apiSignatureKey } "turbo", "run", task, - `--concurrency=${privateConfig.concurrency ?? "100%"}`, - `--output-logs=${privateConfig.outputLogs ?? "errors-only"}`, + `--concurrency=${devConfig.concurrency ?? "100%"}`, + `--output-logs=${devConfig.outputLogs ?? "errors-only"}`, ]; const cacheReadWriteKey = process.env.AWS_JSV3_TURBO_CACHE_BUILD_TYPE ?? "dev";