cna: create `.env.example` correctly
What?
- Rename
.env.exampletoenv.examplein the CNA templates. - Update index.ts to create
.env.examplecorrectly. - Add
.env.exampleto integration tests.
Why?
At #56469, .env.example was added to CNA templates.
However, create-next-app command doesn't make it due to dotfile.
CC: @samcx
Allow CI Workflow Run
- [ ] approve CI run for commit: 861396305912df329ace9721bfb12c4478222071
Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer
I don't think we should switch it to env.example since the convention is with the .env.<xyz>.
However, create-next-app command doesn't make it due to dotfile.
Is it possible to fix this? 👀
I don't think we should switch it to
env.examplesince the convention is with the.env.<xyz>.However, create-next-app command doesn't make it due to dotfile.
Is it possible to fix this? 👀
You are right, but .gitignore file has already named gitignore for .gitignore conversion.
https://github.com/vercel/next.js/blob/fd5f588f43360913197f655a7322b37022c51e17/packages/create-next-app/templates/index.ts#L60-L78
Make sure that the output env file name will be .env.example like .gitignore conversion.
⚠️ No Changeset found
Latest commit: 085a7977263f2fba268814f787caf8a5d058aba8
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
@JamBalaya56562 These are still not using .env.example (starting with a .)
@JamBalaya56562 These are still not using
.env.example(starting with a.)
I'm sorry but I'm not sure what you mean.
By the way, I will tell you why the dotfiles aren't made by create-next-app.
You can create .env.example correctly in local create-next-app folder.
However, you can't do that with dist/index.ts after build because of @vercel/ncc compile.
@vercel/ncc doesn't output dotfiles to dist folder.
That's why .gitignore is replaced with gitignore.