-
Notifications
You must be signed in to change notification settings - Fork 504
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
ignored
config (#371)
* add ignored to the config object * exclude ignored packages in release * throw for mixed changesets * Do not delete changeset files for ignored packages * fix a bug where an unchanged package gets a patch release * do not bump ignored packages in prereleases * use Array.prototype.includes * add input validation * filter out ignored packages in flattenReleases() * address comments * correct typo * add --ignore to cli * rename ignored to ignore * Update error message format * add config tests * add tests for apply-release-plan * Add tests for assemble-release-plan * address comment * add tests for the version command * add a test for the pre exit mode fix * show all missing packages when validating --ignore flag * fix lint errors * Throws when --ignore flag and ignore in config are both present * handle --ignore and ignore in config before calling version() * change getDependents() to take a single option argument * pass an option to determineDependents() * add a test for incrementVersion() * update test case description * Update packages/assemble-release-plan/src/index.ts Co-authored-by: Mateusz Burzy艅ski <mateuszburzynski@gmail.com> * run prettier * Require listing all dependents in the ignore array * fix lint * sort deps * update test message * add tests for version for cli * fix tests + prettier * refactor to make test easier * run prettier * Create rich-melons-press.md * remove code for debugging * add integration tests * fix test case * remove line breaks * remove line break again * run prettier * Create proud-tips-allow.md * Create proud-tips-allow.md * Update rich-melons-press.md * Update proud-tips-allow.md * Update .changeset/rich-melons-press.md Co-authored-by: Mitchell Hamilton <mitchell@hamil.town> * Update packages/cli/src/run.ts Co-authored-by: Mitchell Hamilton <mitchell@hamil.town> * Update packages/config/src/index.ts Co-authored-by: Mitchell Hamilton <mitchell@hamil.town> * Update packages/config/src/index.ts Co-authored-by: Mitchell Hamilton <mitchell@hamil.town> * Update .changeset/proud-tips-allow.md Co-authored-by: Mitchell Hamilton <mitchell@hamil.town> * Update packages/cli/src/run.ts Co-authored-by: Mitchell Hamilton <mitchell@hamil.town> * address comments * fix lint issue * add missing bracket * fix merge issue Co-authored-by: Mateusz Burzy艅ski <mateuszburzynski@gmail.com> Co-authored-by: Mitchell Hamilton <mitchell@hamil.town>
- Loading branch information
1 parent
9006375
commit 9dcc364
Showing
25 changed files
with
867 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@changesets/config": minor | ||
"@changesets/types": minor | ||
--- | ||
|
||
Add `ignore` config option to configure ignored packages. The versions of ignored packages will not be bumped during a release, but their dependencies will still be bumped normally. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
"@changesets/apply-release-plan": minor | ||
"@changesets/assemble-release-plan": minor | ||
"@changesets/cli": minor | ||
--- | ||
|
||
Added support for ignoring packages in the `version` command. The version of ignored packages will not be bumped, but their dependencies will still be bumped normally. This is useful when you have private packages, e.g. packages under development. It allows you to make releases for the public packages without changing the version of your private packages. To use the feature, you can define the `ignore` array in the config file with the name of the packages: | ||
|
||
``` | ||
{ | ||
... | ||
"ignore": ["pkg-a", "pkg-b"] | ||
... | ||
} | ||
``` | ||
|
||
or you can pass the package names to the `--ignore` flag when using cli: | ||
``` | ||
yarn changeset version --ignore pkg-a --ignore --pkg-b | ||
``` |
3 changes: 3 additions & 0 deletions
3
__fixtures__/simple-project-with-ignore-config/.changeset/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# We just want a file in here so git collects it | ||
|
||
For this we have deliberately not included a config file, as we want to test the defaults |
3 changes: 3 additions & 0 deletions
3
__fixtures__/simple-project-with-ignore-config/.changeset/config.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"ignore": ["pkg-a"] | ||
} |
11 changes: 11 additions & 0 deletions
11
__fixtures__/simple-project-with-ignore-config/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"private": true, | ||
"name": "simple-project", | ||
"description": "three projects, each depending on one other", | ||
"version": "1.0.0", | ||
"bolt": { | ||
"workspaces": [ | ||
"packages/*" | ||
] | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
__fixtures__/simple-project-with-ignore-config/packages/pkg-a/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "pkg-a", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"pkg-b": "1.0.0" | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
__fixtures__/simple-project-with-ignore-config/packages/pkg-b/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "pkg-b", | ||
"version": "1.0.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.