Skip to content

Commit

Permalink
Add skipValidation option to env configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
estepanov committed Mar 31, 2024
1 parent 3d5d221 commit 39644ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/trpc-api/src/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ import { createEnv } from '@t3-oss/env-core'
import { z } from 'zod'
import { env as authEnv } from '@myturbostack/auth/env'

const skip =
!!process.env.SKIP_ENV_VALIDATION &&
(process.env.SKIP_ENV_VALIDATION === 'true' ||
process.env.SKIP_ENV_VALIDATION === '1')

export const env = createEnv({
extends: [authEnv],
server: {
Expand All @@ -13,4 +18,5 @@ export const env = createEnv({
runtimeEnv: {
NODE_ENV: process.env.NODE_ENV,
},
skipValidation: skip,
})
6 changes: 6 additions & 0 deletions packages/auth/src/env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { createEnv } from '@t3-oss/env-core'
import { z } from 'zod'

const skip =
!!process.env.SKIP_ENV_VALIDATION &&
(process.env.SKIP_ENV_VALIDATION === 'true' ||
process.env.SKIP_ENV_VALIDATION === '1')

export const env = createEnv({
server: {
NODE_ENV: z
Expand All @@ -15,4 +20,5 @@ export const env = createEnv({
NEXTAUTH_SECRET: process.env.NEXTAUTH_SECRET,
NEXTAUTH_URL: process.env.NEXTAUTH_URL,
},
skipValidation: skip,
})

0 comments on commit 39644ba

Please sign in to comment.