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

feat: Improvement to default .env file #424

Closed
benmarg opened this issue Sep 12, 2022 · 2 comments · Fixed by #430
Closed

feat: Improvement to default .env file #424

benmarg opened this issue Sep 12, 2022 · 2 comments · Fixed by #430
Labels
🌟 enhancement New feature or request

Comments

@benmarg
Copy link
Contributor

benmarg commented Sep 12, 2022

Is your feature request related to a problem? Please describe.

Currently when adding additional environment variable beyond the boilerplate that comes with CT3A, it's easy for a first time user to miss that the vars also need to be added to schema.mjs for typesaftey validation through zod. This is most common when adding additional providers for Auth(Google, FB, etc..., with the default currently being Discord). It's easy to miss that there is some default TS validation that is already included in the boilerplate, causing an error

Screen Shot 2022-09-11 at 5 32 02 PM

Describe the solution you'd like to see

Add a comment in the .env file that reminds the developer to specify their additional env variables in the validation found in schema.mjs.

This could be for any environment variable, for example we could include the following at the top of .env:

# Note that if adding additional env variables, the serverSchema in /env/schema.mjs will need to be updated accordingly
Or, since this issue will most commonly occur when adding NextAuth providers, we could just remind people about that specifically, perhaps right below where the discord NextAuth currently is:

# Note that if adding additional NextAuth providers, the serverSchema in /env/schema.mjs will need to be updated accordingly

Desribe alternate solutions

Leaving .env as is.

Additional information

No response

@benmarg benmarg added the 🌟 enhancement New feature or request label Sep 12, 2022
@c-ehrlich
Copy link
Member

I like the idea of putting a note about updating schema in .env (might reduce the number of people who don't use the typesafe env stuff!), but I don't think it should be specific to serverSchema as the same is true for clientSchema.

@benmarg
Copy link
Contributor Author

benmarg commented Sep 12, 2022

That's fair, how about something like:

# Note that when adding additional env variables, the schema in /env/schema.mjs should be updated accordingly

instead?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌟 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants