Move rules about release files from .gitattributes to package.json #1573
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're moving to releasing the kit as a package rather than as an archive of the repo, so we need to tell npm what should go into that package. This commit does that by adding a
files
list topackage.json
[1].The advantage of using the
files
list is thatnpm
will also use the rules in the.gitignore
, so we don't need to worry about duplicating them, whereas if we used the alternative approach, a.npmignore
file, then we would have to copy the rules from.gitignore
into there. We can also add the.gitignore
file to the files to pack and still have the rules be applied, which is good because we want to copy the.gitignore
when making a new prototype from the starter files. The downside is that we do have to remember to add files to thefiles
list in future, and there doesn't appear to be a way to ignore the*.test.js
files.On balance though I think that the
*.test.js
files are small, and the risk of accidentally including files in the release is greater than the downside of having these extre files. I find that having an allowlist like this is easier to understand than a denylist like the.npmignore
method, so I've gone with thefiles
list approach.