FredKSchott / create-snowpack-app

The all-in-one app template for Snowpack. [moved]
https://www.snowpack.dev
Other
727 stars 96 forks source link

Add support for creating .gitignore from template #164

Open jihchi opened 4 years ago

jihchi commented 4 years ago

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.

stramel commented 4 years ago

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

FredKSchott commented 4 years ago

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

stramel commented 4 years ago

@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.

jihchi commented 4 years ago

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

stramel commented 4 years ago

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