create-snowpack-app icon indicating copy to clipboard operation
create-snowpack-app copied to clipboard

Add support for creating .gitignore from template

Open jihchi opened this issue 5 years ago • 5 comments

It seems like currently create-snowpack-app won't pick up .gitignore from template?

https://github.com/pikapkg/create-snowpack-app/blob/a795622011744fe8aee8e712b67704bac30edad8/packages/create-snowpack-app/index.js#L93-L96

Am I misunderstanding here? it would be nice if we can derive .gitignore from template if there is one.

jihchi avatar Jul 02 '20 01:07 jihchi

I've ran into issues with this in the past on generators, I can take a look here soon

stramel avatar Jul 02 '20 01:07 stramel

Thanks @stramel ! Hopefully it's just that we're overwriting it naively. If a template provides their own, we should honor that

FredKSchott avatar Jul 02 '20 04:07 FredKSchott

@FredKSchott .gitignore has always been problematic in template generators. https://github.com/npm/npm/issues/1862

The workaround that I have seen is for the template to have a gitignore or something like similar that we can handle as a special case and rename it. However, if a template doesn't do this, the file still becomes .npmignore.

I'm looking for direction on this.

stramel avatar Jul 03 '20 19:07 stramel

Just FYI. create-react-app takes gitignore and rename it to .gitignore. (code reference)

jihchi avatar Jul 04 '20 02:07 jihchi

@jihchi yep, I remember participating in the issue that discussed the solution. Couldn't remember what it was though.

stramel avatar Jul 04 '20 02:07 stramel