Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for a new validator (joi) #95

Closed
wants to merge 3 commits into from
Closed
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
14 changes: 7 additions & 7 deletions examples/nextjs/app/env.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { createEnv } from "@t3-oss/env-nextjs";
import Joi from "joi";
import { z } from "zod";

export const env = createEnv({
server: {
NODE_ENV: z.enum(["development", "production"]).optional(),
SECRET: z.string(),
},
client: {
NEXT_PUBLIC_GREETING: z.string(),
NEXT_PUBLIC_GREETING: Joi.string(),
},
server: {
SECRET: Joi.string(),
},

experimental__runtimeEnv: {
NEXT_PUBLIC_GREETING: process.env.NEXT_PUBLIC_GREETING,
NEXT_PUBLIC_GREETING: "wds",
},
validator: "joi",
});
1 change: 1 addition & 0 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"@types/react": "18.0.38",
"@types/react-dom": "18.0.11",
"eslint": "^8.39.0",
"joi": "^17.9.2",
"next": "^13.4.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
7 changes: 3 additions & 4 deletions examples/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
"build": "nuxt build",
"dev": "nuxt dev",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "turbo build --filter env-nuxt && nuxt prepare"
"preview": "nuxt preview"
},
"devDependencies": {
"@types/node": "^18.15.13",
"nuxt": "^3.4.2"
"@types/node": "^18.16.18",
"nuxt": "^3.6.0"
},
"dependencies": {
"@t3-oss/env-nuxt": "0.5.1",
Expand Down
Loading