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
This commit is contained in:
danijel-lf
2026-05-26 14:13:31 +02:00
parent e734530ffe
commit d71e30bb3a
3 changed files with 11 additions and 5 deletions

View File

@@ -151,6 +151,10 @@ export async function bindAllDevSeed(): Promise<void> {
* (IRealtimeBroadcaster, IRealtimeHandlerRegistry) and pass them through. * (IRealtimeBroadcaster, IRealtimeHandlerRegistry) and pass them through.
*/ */
export async function bindAll(): Promise<void> { export async function bindAll(): Promise<void> {
if (process.env.USE_DEV_SEED === "false") {
await bindAllProduction();
return;
}
if (process.env.USE_DEV_SEED === "true") { if (process.env.USE_DEV_SEED === "true") {
await bindAllDevSeed(); await bindAllDevSeed();
return; return;

View File

@@ -7,8 +7,8 @@
"node": ">=20" "node": ">=20"
}, },
"scripts": { "scripts": {
"build": "turbo run build", "build": "dotenv -- turbo run build",
"dev": "turbo run dev", "dev": "dotenv -- turbo run dev",
"lint": "turbo run lint", "lint": "turbo run lint",
"test": "turbo run test", "test": "turbo run test",
"test:e2e": "turbo run test:e2e", "test:e2e": "turbo run test:e2e",
@@ -32,19 +32,20 @@
}, },
"devDependencies": { "devDependencies": {
"@ai-hero/sandcastle": "^0.5.10", "@ai-hero/sandcastle": "^0.5.10",
"@typescript-eslint/parser": "^8.25.0",
"zod": "^3.25.0",
"@playwright/test": "^1.49.0", "@playwright/test": "^1.49.0",
"@stryker-mutator/core": "^8.7.0", "@stryker-mutator/core": "^8.7.0",
"@stryker-mutator/vitest-runner": "^8.7.0", "@stryker-mutator/vitest-runner": "^8.7.0",
"@turbo/gen": "^2.4.0", "@turbo/gen": "^2.4.0",
"@types/node": "^22.0.0", "@types/node": "^22.0.0",
"@typescript-eslint/parser": "^8.25.0",
"dotenv-cli": "^11.0.0",
"fallow": "^2.73.0", "fallow": "^2.73.0",
"husky": "^9.0.0", "husky": "^9.0.0",
"lint-staged": "^16.0.0", "lint-staged": "^16.0.0",
"prettier": "^3.5.0", "prettier": "^3.5.0",
"turbo": "^2.4.0", "turbo": "^2.4.0",
"typescript": "^5.8.0" "typescript": "^5.8.0",
"zod": "^3.25.0"
}, },
"lint-staged": { "lint-staged": {
"*.{ts,tsx,js,mjs,jsx}": [ "*.{ts,tsx,js,mjs,jsx}": [

View File

@@ -1,5 +1,6 @@
{ {
"$schema": "https://turborepo.dev/schema.json", "$schema": "https://turborepo.dev/schema.json",
"globalDependencies": [".env"],
"globalEnv": [ "globalEnv": [
"CI", "CI",
"DATABASE_URL", "DATABASE_URL",