From d71e30bb3a63fc2926ea18f55ddee0241fa675e5 Mon Sep 17 00:00:00 2001 From: danijel-lf Date: Tue, 26 May 2026 14:13:31 +0200 Subject: [PATCH] fix(web-next): support USE_DEV_SEED=false and load root .env globally - Add USE_DEV_SEED=false branch to bindAll dispatcher - Use dotenv-cli to inject root .env into all Turbo tasks - Add globalDependencies for .env cache invalidation --- apps/web-next/src/server/bind-production.ts | 4 ++++ package.json | 11 ++++++----- turbo.json | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/apps/web-next/src/server/bind-production.ts b/apps/web-next/src/server/bind-production.ts index 711f3f8..021ebe9 100644 --- a/apps/web-next/src/server/bind-production.ts +++ b/apps/web-next/src/server/bind-production.ts @@ -151,6 +151,10 @@ export async function bindAllDevSeed(): Promise { * (IRealtimeBroadcaster, IRealtimeHandlerRegistry) and pass them through. */ export async function bindAll(): Promise { + if (process.env.USE_DEV_SEED === "false") { + await bindAllProduction(); + return; + } if (process.env.USE_DEV_SEED === "true") { await bindAllDevSeed(); return; diff --git a/package.json b/package.json index c1f9126..d93dc33 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ "node": ">=20" }, "scripts": { - "build": "turbo run build", - "dev": "turbo run dev", + "build": "dotenv -- turbo run build", + "dev": "dotenv -- turbo run dev", "lint": "turbo run lint", "test": "turbo run test", "test:e2e": "turbo run test:e2e", @@ -32,19 +32,20 @@ }, "devDependencies": { "@ai-hero/sandcastle": "^0.5.10", - "@typescript-eslint/parser": "^8.25.0", - "zod": "^3.25.0", "@playwright/test": "^1.49.0", "@stryker-mutator/core": "^8.7.0", "@stryker-mutator/vitest-runner": "^8.7.0", "@turbo/gen": "^2.4.0", "@types/node": "^22.0.0", + "@typescript-eslint/parser": "^8.25.0", + "dotenv-cli": "^11.0.0", "fallow": "^2.73.0", "husky": "^9.0.0", "lint-staged": "^16.0.0", "prettier": "^3.5.0", "turbo": "^2.4.0", - "typescript": "^5.8.0" + "typescript": "^5.8.0", + "zod": "^3.25.0" }, "lint-staged": { "*.{ts,tsx,js,mjs,jsx}": [ diff --git a/turbo.json b/turbo.json index 51620d1..113394f 100644 --- a/turbo.json +++ b/turbo.json @@ -1,5 +1,6 @@ { "$schema": "https://turborepo.dev/schema.json", + "globalDependencies": [".env"], "globalEnv": [ "CI", "DATABASE_URL",