Allow ignoring files for `status` and `add`
See original GitHub issueAffected Packages
@changesets/git
, @changesets:cli
Problem
We do not publish any of our test files in our packages. So a change that only affects test files never needs a changeset. It would be nice if changeset add
didn’t list a package with test-only changes as a changed package, and if changeset status
didn’t consider a package with test-only changes as needing a changeset.
Proposed solution
Allow specifying some sort of lists of globs or patterns like **/__tests__/**
in config.json for files that should be ignored by getChangedFilesSince
. For me it would be fine for this to be a single configuration point in config.json rooted at the top of the repository rather than per-package. (Perhaps this needs to also support !
like .npmignore
to unignore things ignored by previous lines.)
Note that the answer is not to apply .npmignore
, since you may use .npmignore
to avoid publishing source files whose compiled output goes in the package. This needs to specifically be about files where changes to them never affect the package output.
Issue Analytics
- State:
- Created a year ago
- Comments:9 (9 by maintainers)
Top GitHub Comments
One problem with this is that those ignore files usually live at the root, together with config files. In Changesets, we keep the config in the
.changeset
directory. I’m not totally sure if.changesetignore
would also immediately point to what we are actually ignoring here - a config option can be way more descriptive in this case.What do yall think about implementing this through a plaintext
.changesetignore
file? Follows a fairly common pattern in js tooling for ignoring files, so it’d be immediately familiar to many users.