-
Notifications
You must be signed in to change notification settings - Fork 247
Description
Motivation ("The Why")
While opinions differ, I consider "files" to be dangerous, since I have zero concern for accidental publishing but I have infinite concern for accidental breakage. (Let's avoid debating this)
When using .npmignore, one has to remember to start by cp .gitignore .npmignore, and then later, to keep those in sync, since unfortunately npm ignores .gitignore when .npmignore is present. This is a maintenance burden and is error-prone over time.
Example/How/Desired Behavior
These examples show a hypothetical where "coverage data" is ignored by both git and npm, but the "dist" folder (build output) is ignored by git but included in npm.
Current:
.gitignore
coverage/ # coverage data
dist/ # build output.npmignore
coverage/ # coverage dataPotential:
.gitignore
coverage/ # coverage data
dist/ # build output.npmignore
<include gitignore> # ideally something that would make the npm CLI crash prior to supporting this feature
!dist/ # unignore build outputThe advantage would be that additions to .gitignore no longer need to be propagated to .npmignore. The disadvantage would be that removals from .gitignore now do need to be propagated, but the explicit opt-in would mean that's expected.
Thoughts?