This PR does two things:
- First public testing of entire.io integration
- Converts entire codebase to be typesafe using t3/env
This PR does two things:
Please implement https://env.t3.gg/docs/introduction into our codebase.
170 calls
I'll look up T3 Env's setup docs and how this repo currently handles env vars so we can wire it in cleanly.
Next I'll inventory the env vars in use and how the Next.js apps are structured so the T3 schema matches reality.
I'll dig into how optional vs required env vars are treated, plus Docker/build setup so validation doesn't break CI.
Installing the package and adding validated env schemas for the Next.js apps, then migrating call sites.
Migrating call sites to use the validated env object.
Env schema validates against local .env. Running typechecks next.
Next's config loader is choking on the .ts config; I'll switch to the documented jiti approach with next.config.mjs.
T3 Env is wired into the Next.js apps.
[@t3-oss](/t3-oss)/env-nextjs (+ jiti for config-time validation) to web and communityapps/web/env.ts — server/client split for all app env varsapps/community/env.ts — NEXT_PUBLIC_MAIN_APP_URLnext.config.mjs so env fails at dev/build time (Next.js guide)process.env → envprocess.env.NODE_ENV in client/shared UI code (Next inlines it; env.NODE_ENV would throw on the client)process.env after loadEnvFile (they load env before dynamic imports)import { env } from "@/env"
env.DATABASE_URL // typed, validated
env.WAITLIST_ENABLED // boolean via z.stringbool()
Required vars (fail fast): DATABASE_URL, APP_URL, BETTER_AUTH_SECRET, code-storage credentials, GIT_REMOTE_BASE_URL. Optional ones use emptyStringAsUndefined so blank .env entries are fine.
The focused CI fix is already present in commit 6d5a4ca. It makes nonessential URL variables optional for test-time environment validation, supplies the existing localhost clone URL fallback at its use site, configures the Vitest @ alias, and isolates the admin unit test from the full environment schema. The provided verification run completed successfully: 5 test tasks passed, including all 116 web tests, with no working-tree changes remaining.
No file changes were produced.
Triggered by check.failed
The reported Build web failure is no longer reproducible. Ran the web build with pnpm 9.15.9 and the same CI environment variables; Next.js compiled, type-checked, and generated all pages successfully. The existing test suite also passed in initial verification. Reverted the build-generated next-env.d.ts change, leaving the working tree clean; no code change was necessary.
No file changes were produced.
Triggered by check.failed
You need push access to the source branch to update it.
Sign in to comment.