feat: type-safe env via @t3-oss/env-core + zod - #139
Conversation
|
Done, thanks for the review! |
|
Yes! The env schema rename to Separately, I think the workflows could be reorganized so each does one thing, happy to open a follow-up issue for that. |
|
Nice catch! Fixed that in a new commit. The new code looks cleaner now. |
Replace ad-hoc process.env access with a validated env module so missing or malformed vars fail fast at startup instead of producing undefined runtime values.
The env schema rename in 12d0497 wasn't propagated to the GitHub Actions workflows, causing every job to fail at `pnpm install` because the `prepare` hook runs `gen:api`, which loads `src/env.ts` and rejects an undefined `EXPO_PUBLIC_BASE_URL`. Also adds a public demo URL fallback in code-quality.yml so lint and typecheck pass on forks where `vars.API_URL` isn't configured.
Derive EXPO_PUBLIC_AUTH_URL and EXPO_PUBLIC_OPENAPI_URL from EXPO_PUBLIC_BASE_URL inside `runtimeEnv` so both vars are always defined and validated as URLs. Consumers now read `env.EXPO_PUBLIC_*` directly without per-call-site fallback logic.
6903242 to
3db4618
Compare
# Conflicts: # src/components/ui/badge.tsx # src/components/ui/button.tsx # src/components/ui/pin-input.tsx # src/features/auth/view-otp-verification.tsx
|
Thanks a lot @azizbecha for the contribution! ❤️ I only made a couple of small adjustments:
Everything else looks great. Thanks again for the contribution! |

Replaced ad-hoc process.env access with a validated env module so missing or malformed vars fail fast at startup instead of producing undefined runtime values, in addition to having typed env vars instead of ghosted process.env.*.