Skip to content
This repository has been archived by the owner on Jun 8, 2024. It is now read-only.

Commit

Permalink
chore: validate env
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban committed Jan 23, 2024
1 parent ff8be0d commit 46066c8
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 16 deletions.
2 changes: 2 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
await import("./src/env.js")

/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@radix-ui/react-separator": "^1.0.3",
"@radix-ui/react-slot": "^1.0.2",
"@radix-ui/react-tabs": "^1.0.4",
"@vercel/analytics": "^1.1.2",
"@t3-oss/env-nextjs": "^0.7.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"dayjs": "^1.11.10",
Expand All @@ -28,7 +28,8 @@
"react-dom": "^18.2.0",
"react-wrap-balancer": "^1.1.0",
"rss-parser": "^3.13.0",
"tailwind-merge": "^2.2.1"
"tailwind-merge": "^2.2.1",
"zod": "^3.22.4"
},
"devDependencies": {
"@egoist/tailwindcss-icons": "^1.7.2",
Expand Down
51 changes: 37 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions src/env.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { createEnv } from "@t3-oss/env-nextjs"
import { z } from "zod"

export const env = createEnv({
server: {
NOTION_TOKEN: z.string(),
NOTION_FEED_ID: z.string(),
},
client: {},
experimental__runtimeEnv: {},
emptyStringAsUndefined: true,
})

0 comments on commit 46066c8

Please sign in to comment.