Replace .npmignore with the package.json 'files' property.
This field is more intuitive than the .npmignore file.
pnpm pack doesn't support the negative patterns yet, so we can't merge this in until that's fixed.
🤔 Interesting. I can understand "files" being more intuitive because it doesn't have that "reversed pattern" problem, but it also is tucked away in package.json (it isn't a file you can copy between projects anymore).
I also just want to double-check whether this change is honored by the other pieces of Rush that honor .npmignore -- for example, will rush deploy correctly behave the same way if your projects only have "files": entries?
I also just want to double-check whether this change is honored by the other pieces of Rush that honor .npmignore -- for example, will rush deploy correctly behave the same way if your projects only have "files": entries?
Hmm. Probably not. That needs to be investigated.
Is there a solution that doesn't rely on package.json?
- package.json cannot store code comments to document why the globs were added (this is arguably more important than the glob not being inverted)
- with .npmignore you can quickly check whether a folder is configured, copy+paste recipes between folders, and diff them to see if they're up to date -- package.json lacks all those features
-
package.json by design cannot validate its settings (e.g. what if someone mistypes
"files"as"files "?
I agree with the criticisms of .npmignore, but maybe we can make the situation better rather than differently bad. 😃