-
-
Notifications
You must be signed in to change notification settings - Fork 27.1k
fix(react-scripts): proactively append to .gitignore during generation #8028
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
fix(react-scripts): proactively append to .gitignore during generation #8028
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me, and looks good. I'm not sure it can make it into 3.3, but it is a candidate for the next release.
|
Thanks for the approval. Understand timing is sometimes tough, but as far as I know not including this will cause a bug in 3.3.0 |
|
@mrmckeb @iansu @ianschmitz @petetnt hoping this can get looked at again soon - it's an active 3.3.0 bug |
|
@bmuenzenmeyer This issue should be very low impact right now, but I appreciate it needs to be dealt with. @ianschmitz can you take a look at this one? |
|
Thanks @bmuenzenmeyer, we'll get this into v3.3.1 - which should be out in the next week or two. |
close #7892
Proactively append to
.gitignoreduring generation instead relying on atry/catchAs #7892 illustrates, relying on the
EEXISTSerror is not reliable after the[email protected]upgrade. This fact was confirmed by thefs-extrateam when I opened an an issue with them.The solution is to check whether or not
.gitignoreexists in the current repo and proactively appendgitignoreto it, rather than rely on the try catch logic to sniff forEEXISTS/dest already existserrors fromfs-extraTesting
I attempted to test this:
foo.gitignoreinto it with contents.yarn create-react-app foo --template typescriptThis succeeds, but gives me warnings about not having a version that supports
template. If I do not supply a template, the CLI tells me none was applied.When I run this without the
templatearg, I get a reverse error message, stating no template was applied. Having maintained a fork for a long time, I know not to rely on the npm scriptcreate-react-appas gospel for a real generation. I also know that this new template functionality is still in progress - so I am guessing it's just a quick of this being a bit in-flight.I think a better approach may be to add a check for this proper appending via CI, but I wanted to get this out here first. I'd also state that the code is pretty darn simple, mostly co-opted from the existing try / catch, and that I don't see any
.gitignorecoverage currently in the e2e tests. Perhaps a visual review is okay without a formal test - but I'll leave that to the maintainers to decide.