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

Add .env to .gitignore file generated by starter #2718

Closed
brittneypostma opened this issue Nov 1, 2021 · 4 comments · Fixed by #2732
Closed

Add .env to .gitignore file generated by starter #2718

brittneypostma opened this issue Nov 1, 2021 · 4 comments · Fixed by #2732
Labels
feature request New feature or request p2-nice-to-have SvelteKit cannot be used by a small number of people, quality of life improvements, etc.

Comments

@brittneypostma
Copy link
Contributor

Describe the problem

Currently when running npm init svelte@next and starting either a demo or skeleton app, then doing a git init, the generated .gitignore file does not include .env. This is a pretty common file extension and typically should not be added to a repository. I wanted to conversation around it and get a consensus if this is something that should be added to the starters.

Describe the proposed solution

Add .env or variation of that to the .gitignore file generated by the starter app.

Alternatives considered

No response

Importance

would make my life easier

Additional Information

No response

@Conduitry
Copy link
Member

It does seem reasonable to assume that people are generally not going to want to commit .env files to their Git repo for a SvelteKit project, but I'm not sure where the line is here. There's no dotenv stuff that comes included in the starter projects - which other third party things (that are not currently used in the project) would it make sense to add .gitignore entries for? There are a ton of other things that people might add to their apps (videos recorded by Cypress, reports from Codecov), but that I don't think it's SvelteKit's place to add here.

@brittneypostma
Copy link
Contributor Author

I agree with that as well that there are lots of things that could be in there, but.env specifically is a pretty popularly used file. It's easy to forget to check the .gitignore if it's included and accidentally commit private keys and cause huge issues.

@benmccann
Copy link
Member

We have some built-in support for .env via Vite, so it seems reasonable to me: https://kit.svelte.dev/faq#env-vars

@benmccann benmccann added feature request New feature or request p2-nice-to-have SvelteKit cannot be used by a small number of people, quality of life improvements, etc. labels Nov 2, 2021
@Conduitry
Copy link
Member

👍 That seems like a good enough reason for me.

@brittneypostma brittneypostma changed the title Add .env to .gitiignore file generated by starter Add .env to .gitignore file generated by starter Nov 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request p2-nice-to-have SvelteKit cannot be used by a small number of people, quality of life improvements, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants