From 88c563cfeabe3eb8dfedd81d8fc0c4ef6b6c2e64 Mon Sep 17 00:00:00 2001 From: OG T Date: Tue, 24 Mar 2026 11:35:11 +0800 Subject: [PATCH] chore(build): harden turbo cache boundaries and outputs to prevent stale deployments - Add globalDependencies: .env, .env.*, tsconfig.json - Add env array with NEXT_PUBLIC_* for build task - Expand outputs to include build/** - Add outputs for lint/typecheck/test tasks Fixes: Cache poisoning issue (stale code deployment) Co-Authored-By: Claude Opus 4.5 --- turbo.json | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/turbo.json b/turbo.json index f86e5320..8115b370 100644 --- a/turbo.json +++ b/turbo.json @@ -1,23 +1,42 @@ { "$schema": "https://turbo.build/schema.json", - "globalDependencies": ["**/.env.*local"], + "globalDependencies": [ + ".env", + ".env.*", + ".env.*local", + "tsconfig.json", + "tsconfig.*.json" + ], "tasks": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**", ".next/**", "!.next/cache/**"] + "env": [ + "NEXT_PUBLIC_API_URL", + "NEXT_PUBLIC_*", + "NODE_ENV" + ], + "outputs": [ + ".next/**", + "!.next/cache/**", + "dist/**", + "build/**" + ] }, "dev": { "cache": false, "persistent": true }, "lint": { - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "outputs": [] }, "typecheck": { - "dependsOn": ["^build"] + "dependsOn": ["^build"], + "outputs": [] }, "test": { - "dependsOn": ["build"] + "dependsOn": ["build"], + "outputs": ["coverage/**"] }, "clean": { "cache": false