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 frontend/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (process.env.NODE_ENV !== 'test') {

const IS_LOCAL_ENV = APP_ENV === 'local';

0const STRICT_LOCAL_DB_GUARD = process.env.SHOP_STRICT_LOCAL_DB === '1';
const STRICT_LOCAL_DB_GUARD = process.env.SHOP_STRICT_LOCAL_DB === '1';
const REQUIRED_LOCAL_DB_URL = process.env.SHOP_REQUIRED_DATABASE_URL_LOCAL;

if (STRICT_LOCAL_DB_GUARD) {
Expand Down
7 changes: 7 additions & 0 deletions frontend/scripts/generate-env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Generate .env from .env.example allowlist using current environment.
# Only variables listed in .env.example are included — no platform internals leak.
grep '^[A-Z]' .env.example | cut -d= -f1 | while read -r var; do
val="${!var}"
[ -n "$val" ] && printf '%s=%s\n' "$var" "$val"
done > .env
7 changes: 2 additions & 5 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
[build]
base = "frontend"
command = "npm ci --include=optional && npm run build"
command = "bash scripts/generate-env.sh && npm ci --include=optional && npm run build"
publish = ".next"

[build.environment]
NODE_VERSION = "20.19.0"

[[plugins]]
package = "@netlify/plugin-nextjs"

[[plugins]]
package = "netlify-plugin-bundle-env"
package = "@netlify/plugin-nextjs"
Loading