diff --git a/apps/backend/.env.codegen b/apps/backend/.env.codegen new file mode 100644 index 000000000..71e1e82ef --- /dev/null +++ b/apps/backend/.env.codegen @@ -0,0 +1,5 @@ +STACK_DATABASE_CONNECTION_STRING=postgres://postgres@localhost:8118/postgres?pgbouncer=true&connection_limit=1 +STACK_DIRECT_DATABASE_CONNECTION_STRING=postgres://postgres@localhost:8118/postgres?connection_limit=1 +STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY=this-publishable-client-key-is-for-local-development-only +STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY=this-secret-server-key-is-for-local-development-only +STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY=this-super-secret-admin-key-is-for-local-development-only \ No newline at end of file diff --git a/apps/backend/package.json b/apps/backend/package.json index a1f452bd0..ba6a8b6eb 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -13,7 +13,7 @@ "build-self-host-seed-script": "tsup --config prisma/tsup.config.ts", "analyze-bundle": "ANALYZE_BUNDLE=1 pnpm run build", "start": "next start --port 8102", - "codegen-prisma": "concurrently -k -s first \"tsx scripts/mock-postgres.mjs\" \"node -e \\\"setTimeout(() => process.exit(0), 2000)\\\" && cross-env STACK_DATABASE_CONNECTION_STRING=\\\"postgres://postgres@localhost:8118/postgres?pgbouncer=true&connection_limit=1\\\" STACK_DIRECT_DATABASE_CONNECTION_STRING=\\\"postgres://postgres@localhost:8118/postgres?connection_limit=1\\\" STACK_SEED_INTERNAL_PROJECT_PUBLISHABLE_CLIENT_KEY=\\\"test_key\\\" STACK_SEED_INTERNAL_PROJECT_SECRET_SERVER_KEY=\\\"test_secret\\\" STACK_SEED_INTERNAL_PROJECT_SUPER_SECRET_ADMIN_KEY=\\\"test_admin\\\" sh -c \\\"pnpm run prisma migrate reset --force && pnpm run prisma generate --sql\\\"\"", + "codegen-prisma": "concurrently -k -s first \"tsx scripts/mock-postgres.mjs\" \"node -e \\\"setTimeout(() => process.exit(0), 2000)\\\" && dotenv -c codegen -- sh -c \\\"pnpm run prisma migrate reset --force && pnpm run prisma generate --sql\\\"\"", "codegen-prisma:watch": "pnpm run codegen-prisma && chokidar \"prisma/**/*\" -c \"pnpm run codegen-prisma\"", "codegen": "pnpm run with-env bash -c 'if [ \"$STACK_ACCELERATE_ENABLED\" = \"true\" ]; then pnpm run prisma generate --sql --no-engine && pnpm run generate-docs; else pnpm run codegen-prisma && pnpm run generate-docs; fi'", "codegen:watch": "concurrently -n \"prisma,docs\" -k \"pnpm run codegen-prisma:watch\" \"pnpm run watch-docs\"",