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

Defining environment variable types using Zod #1067

Open
sodic opened this issue Mar 21, 2023 · 3 comments · May be fixed by #2362
Open

Defining environment variable types using Zod #1067

sodic opened this issue Mar 21, 2023 · 3 comments · May be fixed by #2362
Assignees
Labels
enhancement New feature or request webdev

Comments

@sodic
Copy link
Contributor

sodic commented Mar 21, 2023

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.

@sodic sodic added enhancement New feature or request no-haskell Coding task that does not need Haskell knowledge webdev labels Mar 21, 2023
@Zeko369
Copy link
Collaborator

Zeko369 commented Mar 22, 2023

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
Copy link
Contributor Author

sodic commented Mar 22, 2023

Related: #1057

@infomiho
Copy link
Contributor

infomiho commented May 18, 2023

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

In short:

  • we want to be aware of all of the variables and list them explicitly in once place
  • we want to enable users to access them via config import vs. using directly process.env or similar
  • we want to collect and validate them in a single place (also list them in the docs, Directus does this well: https://docs.directus.io/self-hosted/config-options.html#general)
  • warn users if they are missing variables (e.g. JWT_SECRET when deploying)

@infomiho infomiho self-assigned this Oct 24, 2024
@infomiho infomiho removed the no-haskell Coding task that does not need Haskell knowledge label Nov 13, 2024
@infomiho infomiho linked a pull request Nov 27, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request webdev
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants