Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion apps/api/src/__tests__/integration/loadEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function thisDir(): string {

// apps/api/src/__tests__/integration → monorepo root
const envPath = path.resolve(thisDir(), '..', '..', '..', '..', '..', '.env.test');
config({ path: envPath });
config({ path: envPath, quiet: true });

// Hard-coded defaults matching docker-compose.test.yml. These take effect
// only if neither the host environment nor .env.test supplied a value
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/config/normalizeNodeEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
//
// This module MUST be imported before any module that reads NODE_ENV at import
// time (e.g. routes/metrics.ts, routes/docs.ts, routes/portal/schemas.ts) — it
// is imported in index.ts immediately after `dotenv/config`, so .env is loaded
// first and every later import observes the canonical value.
// is imported in index.ts immediately after dotenv's config() call, so .env
// is loaded first and every later import observes the canonical value.

/**
* Returns the canonical NODE_ENV for a raw value, or null if it is not a
Expand Down
4 changes: 2 additions & 2 deletions apps/api/src/db/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { config } from 'dotenv';
// Load .env from monorepo root (when running from apps/api) or cwd (when running from root)
config({ path: '../../.env' });
config(); // Also try cwd
config({ path: '../../.env', quiet: true });
config({ quiet: true }); // Also try cwd

import { AsyncLocalStorage } from 'node:async_hooks';
import { sql, type SQL } from 'drizzle-orm';
Expand Down
3 changes: 2 additions & 1 deletion apps/api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dotenv/config';
import { config as loadDotenv } from 'dotenv';
loadDotenv({ quiet: true });
// Canonicalize NODE_ENV before any module reads it (some routes/services gate
// on `NODE_ENV === 'production'` at import time). Must stay directly after
// dotenv so .env is loaded first. See #917 (L-6).
Expand Down
3 changes: 2 additions & 1 deletion apps/api/src/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
* then the phases run (drain → workers → queues → eventbus → redis → db →
* sentry), mirroring index.ts's Part A semantics.
*/
import 'dotenv/config';
import { config as loadDotenv } from 'dotenv';
loadDotenv({ quiet: true });
import { createServer, type IncomingMessage, type ServerResponse, type Server } from 'node:http';
import { sql } from 'drizzle-orm';
import { AI_AGENTS_ENABLED, abuseSignalsEnabled, breezeRole, eventDispatchMode } from './config/env';
Expand Down
2 changes: 1 addition & 1 deletion apps/api/vitest.config.rls-coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { config } from 'dotenv';
// and must never carry the truncate hazard.
//
// Run with: pnpm -F @breeze/api test:rls-coverage
config({ path: '../../.env.test' });
config({ path: '../../.env.test', quiet: true });

export default defineConfig({
test: {
Expand Down
2 changes: 1 addition & 1 deletion apps/api/vitest.integration.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { defineConfig } from 'vitest/config';
import { config } from 'dotenv';

// Load test environment variables
config({ path: '../../.env.test' });
config({ path: '../../.env.test', quiet: true });

export default defineConfig({
test: {
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/live-signup/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { registerViaUi } from './phases/uiFlow';
import { simulatePaymentAndAssertActivation } from './phases/simulatePayment';
import { purgePartner, sweepStaleCanaries } from './phases/cleanup';

loadEnv({ path: join(dirname(fileURLToPath(import.meta.url)), '.env') });
loadEnv({ path: join(dirname(fileURLToPath(import.meta.url)), '.env'), quiet: true });

function arg(name: string): string | undefined {
const hit = process.argv.find((a) => a.startsWith(`--${name}=`));
Expand Down
2 changes: 1 addition & 1 deletion e2e-tests/perf-harness/run-perf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url));

// Load parent .env (same convention as the Playwright suite) if present.
const parentEnv = path.resolve(__dirname, '..', '..', '.env');
if (existsSync(parentEnv)) loadEnv({ path: parentEnv });
if (existsSync(parentEnv)) loadEnv({ path: parentEnv, quiet: true });

function env(name: string, fallback: string): string {
const v = process.env[name];
Expand Down
6 changes: 3 additions & 3 deletions ee/workspace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@
"dependencies": {
"@breeze/extension-sdk": "workspace:*",
"@breeze/extension-web-sdk": "workspace:*",
"@breeze/shared": "workspace:*",
"drizzle-orm": "0.45.2",
"hono": "4.13.5",
"mailparser": "^3.9.14",
"v9u-smb2": "^1.0.6",
"zod": "4.4.3",
"@breeze/shared": "workspace:*"
"zod": "4.4.3"
},
"devDependencies": {
"@breeze/extension-testkit": "workspace:*",
"@types/mailparser": "^3.4.6",
"@types/node": "^26.4.1",
"dotenv": "16.6.1",
"dotenv": "17.4.2",
"happy-dom": "^20.11.0",
"postgres": "3.4.9",
"tsup": "8.5.1",
Expand Down
2 changes: 1 addition & 1 deletion ee/workspace/vitest.integration.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { config } from 'dotenv';
// DATABASE_URL_APP directly via the job env, and locally the suites fall
// back to the shared :5433 test-stack defaults baked into each
// *.integration.test.ts.
config({ path: '../../.env.test' });
config({ path: '../../.env.test', quiet: true });

export default defineConfig({
test: {
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading