Add support for the changedFilePatterns config#1033
Conversation
🦋 Changeset detectedLatest commit: 1d229e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 16 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1d229e0:
|
packages/config/schema.json
Outdated
| "changedFilesPatterns": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "default": ["**"], | ||
| "description": "Glob patterns for changed files that should determining the package as changed." | ||
| }, |
There was a problem hiding this comment.
I went with an array because it's much easier to write a couple of small globs than one big one - especially if some negated pattern is involved.
There was a problem hiding this comment.
perhaps this should be named changedFilePatterns? WDYT?
| ref: string; | ||
| }) { | ||
| changedFilesPatterns?: readonly string[]; | ||
| }): Promise<Package[]> { |
There was a problem hiding this comment.
The core of the change is really in this method. I also rewrote this looping to be more efficient.
|
|
||
| export const tempdir = f.temp; | ||
|
|
||
| export async function gitdir(dir: Fixture) { |
There was a problem hiding this comment.
Extracted this here to reuse in the refactored tests for changeset status
changedFilesPatterns configchangedFilePatterns config
This PR introduces a new config option:
changedFilesPatterns.At first, I thought about introducing this just as a CLI argument for
changeset status. However, I realized thatchangeset addshould also use this to split packages between changed and not changed in the prompt. That's why I went with the config option approach.The main purpose of this new feature is to have a way to optionally validate PRs that changesets are added for changed packages but without requiring changesets to be added for test file changes, docs changes etc.