wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.85k stars 1.19k forks source link

Defining environment variable types using Zod #1067

Open sodic opened 1 year ago

sodic commented 1 year ago

This is what T3 does, we can take a look at them for inspiration. We should explore sense and either do it or close this issue.

Zeko369 commented 1 year ago

While we're at this, zod is broken by default in wasp since the "dev client/server" tsconfigs have strict in them while the compile ones don't so in dev i.e.

z.object({name: z.string()})

produces {name: string} in dev (becauase devs can change the tsconfig) produces {name?: string} in production

sodic commented 1 year ago

Related: https://github.com/wasp-lang/wasp/issues/1057

infomiho commented 1 year ago

Internal doc on the matter: https://www.notion.so/wasp-lang/RFC-Wasp-env-variables-92d3c5635391455cb0b074fe4b390af7?pvs=4

In short: