mirror of
https://github.com/whekin/household-bot.git
synced 2026-03-31 18:44:03 +00:00
fix(review): address CodeRabbit review feedback
- Guard prepare script for Docker builds without .git - Add pre-push hook for heavier quality gates (typecheck/test/build) - Pin drizzle-orm version in scripts/package.json - Add E2E_SMOKE_ALLOW_WRITE opt-in guard via e2eEnv abstraction - Create @household/config env-e2e.ts using same t3-env + zod pattern - Make e2e teardown robust with optional chaining + allSettled - Fix markdown code block language identifier (MD040) - Fix CI integration docs to reflect actual workflow
This commit is contained in:
21
packages/config/src/env-e2e.ts
Normal file
21
packages/config/src/env-e2e.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { createEnv } from '@t3-oss/env-core'
|
||||
import { z } from 'zod'
|
||||
|
||||
const server = {
|
||||
DATABASE_URL: z.string().url(),
|
||||
E2E_SMOKE_ALLOW_WRITE: z
|
||||
.enum(['true', 'false'])
|
||||
.default('false')
|
||||
.transform((v) => v === 'true')
|
||||
}
|
||||
|
||||
export const e2eEnv = createEnv({
|
||||
server,
|
||||
runtimeEnv: process.env,
|
||||
emptyStringAsUndefined: true,
|
||||
onValidationError: (issues) => {
|
||||
console.error('Invalid e2e environment variables:')
|
||||
console.error(JSON.stringify(issues, null, 2))
|
||||
throw new Error('E2E environment validation failed')
|
||||
}
|
||||
})
|
||||
@@ -1 +1,2 @@
|
||||
export { env } from './env'
|
||||
export { e2eEnv } from './env-e2e'
|
||||
|
||||
Reference in New Issue
Block a user