-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix changelog generator options not being provided to changelog generators * First iteration of docs on prereleases * i don't know why this exists on this branch * Implement prerelease command(I know things aren't in the ideal places probably, I want to have an implement that works and is what we want first and things in the right places second) * Publish things implemented. Easy parts are done! * It maybe works * A thing that I want to commit because I want to change branches * things * I should really write tests for this * A bunch of stuff * Various things * Fix some stuff * Await the things * A lot of stuff * so... yes. tests are in fact a Good Thing * Move a thing * It works 🦋🎉 + rdom other changes because i'm bad and don't split up PRs enough * Fix TS things * Actually use the thing I wrote * these things might work * Fix all the linting errors * Some things * More things * another * Store used changesets and filter them out when doing successive prereleases * Consistently use PreState | undefined instead of making PreState optional * More tests and some little changes * Linting * It's not flakey 🎉 * Warnings for things * Remove verdaccio because I didn't end up writing those publish tests and don't want to block this PR on them * This is why tests are good * Add changesets and a README to pre * Docs and some logging * And this is why you should run tests rather than assuming that the change you made fixed them * Tests * Linting * Add another test * Always publish packages if they don't exist on npm rather than only if they are a greater version than the latest version on npm * Don't use snapshots in some places because I think they're gonna be annoying * Remove the .only * Fix bugs and independent pre versions except for linked packages * Update docs * Fix TS, linting and an opinion * Fix pre warning to only show up when actually in pre and make important end lines red
- Loading branch information
Showing
69 changed files
with
1,420 additions
and
271 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,7 @@ | ||
--- | ||
"@changesets/assemble-release-plan": minor | ||
"@changesets/apply-release-plan": minor | ||
"@changesets/get-release-plan": minor | ||
--- | ||
|
||
Add support for prereleases. For more information, see [the docs on prereleases](https://github.com/atlassian/changesets/blob/master/docs/prereleases.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,5 @@ | ||
--- | ||
"@changesets/types": minor | ||
--- | ||
|
||
Add `PreState` type and `preState` property to `ReleasePlan` |
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/cli": patch | ||
"@changesets/errors": patch | ||
--- | ||
|
||
Add `InternalError` for errors which are unexpected and if they occur, an issue should be opened. The CLI catches the error and logs a link for users to open an issue with the error and versions of Node and Changesets filled in |
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,5 @@ | ||
--- | ||
"@changesets/cli": minor | ||
--- | ||
|
||
Add support for prereleases. Prereleases work with two new commands, `pre enter` and `pre exit` along with changes to `version` and `exit`. For more information, see [the docs on prereleases](https://github.com/atlassian/changesets/blob/master/docs/prereleases.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,6 @@ | ||
--- | ||
"@changesets/errors": patch | ||
"@changesets/pre": patch | ||
--- | ||
|
||
Add `PreExitButNotInPreModeError` and `PreEnterButInPreModeError` |
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,5 @@ | ||
--- | ||
"@changesets/cli": patch | ||
--- | ||
|
||
Always publish packages if they don't exist on npm rather than only if they are a greater version than the latest version on npm |
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,5 @@ | ||
--- | ||
"@changesets/pre": minor | ||
--- | ||
|
||
Initial release |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,137 @@ | ||
# Prereleases | ||
|
||
You might want to release a version of your packages before you do an actual release, Changesets lets you do this but there are some caveats because of the complexity that monorepos add that are important to understand. | ||
|
||
When you want to do a prerelease, you need to enter prerelease mode. You can do that with the `pre enter <tag>`. The tag that you need to pass is used in versions(e.g. `1.0.0-beta.0`) and for the npm dist tag. | ||
|
||
A prerelease workflow might look something like this: | ||
|
||
```bash | ||
yarn changeset pre enter next | ||
yarn changeset version | ||
git add . | ||
git commit -m "Enter prerelease mode and version packages" | ||
yarn changeset publish | ||
git push --follow-tags | ||
``` | ||
|
||
Let's go through what's happening here. For this example, let's say you have a repo that looks like this: | ||
|
||
``` | ||
packages/ | ||
pkg-a@1.0.0 has dep on pkg-b@^2.0.0 | ||
pkg-b@2.0.0 has no deps | ||
pkg-c@3.0.0 has no deps | ||
.changeset/ | ||
pkg-b@minor | ||
``` | ||
|
||
``` | ||
yarn changeset prerelease next | ||
``` | ||
|
||
This command changes Changesets into prerelease mode which creates a `pre.json` file in the `.changeset` directory which stores information about the state the prerelease is in. For the specific data stored in the `pre.json` file, see the type definition of `PreState` in [`@changesets/types`](https://github.com/atlassian/changesets/tree/master/packages/types). | ||
|
||
``` | ||
yarn changeset version | ||
``` | ||
|
||
This command will version packages as you would normally expect but append `-next.0`. An important note is that this will bump dependent packages that wouldn't be bumped in normal releases because prerelease versions are not satisfied by most semver ranges.(e.g. `^5.0.0` is not satisfied by `5.1.0-next.0`) | ||
|
||
The repo would now look like this: | ||
|
||
``` | ||
packages/ | ||
pkg-a@1.0.1-next.0 has dep on pkg-b@^2.0.1 | ||
pkg-b@2.1.0-next.0 has no deps | ||
pkg-c@3.0.0 has no deps | ||
.changeset/ | ||
``` | ||
|
||
``` | ||
yarn changeset publish | ||
``` | ||
|
||
This command will publish to npm as the publish command normally does though it will set the dist tag to the tag you specified when running the prerelease command. | ||
|
||
When you want to do another prerelease, your workflow would look something like this: | ||
|
||
```bash | ||
yarn changeset version | ||
git add . | ||
git commit -m "Version packages" | ||
yarn changeset publish | ||
git push --follow-tags | ||
``` | ||
|
||
Let's say we add some changesets and a new package so our repo looks like this | ||
|
||
``` | ||
packages/ | ||
pkg-a@1.0.1-next.0 has dep on pkg-b@^2.0.1 | ||
pkg-b@2.1.0-next.0 has no deps | ||
pkg-c@3.0.0 has no deps | ||
pkg-d@0.0.0 has no deps | ||
.changeset/ | ||
pkg-a@minor | ||
pkg-c@patch | ||
pkg-d@major | ||
``` | ||
|
||
``` | ||
yarn changeset version | ||
``` | ||
|
||
The version command will behave just like it does for the first versioning of a prerelease except the number at the end will be updated. The repo would now look like this: | ||
|
||
``` | ||
packages/ | ||
pkg-a@1.1.0-next.1 has dep on pkg-b@^2.0.1 | ||
pkg-b@2.1.0-next.0 has no deps | ||
pkg-c@3.0.1-next.0 has no deps | ||
pkg-d@1.0.0-next.0 has no deps | ||
``` | ||
|
||
``` | ||
yarn changeset publish | ||
``` | ||
|
||
This command will publish to npm just like it does for the first prerelease except because we're adding a new package(we need to define this, is it new to the repo or new to npm? I'm thinking new to npm), the new package will be published with the `latest` dist tag rather than the `next` tag because it's the first time it's being published which means it will be on `latest` anyway. For future publishes until pkg-d is out of prerelease, it will also be published to `latest`. | ||
|
||
When you're ready to do the final release, your workflow would look something like this: | ||
|
||
```bash | ||
yarn changeset pre exit | ||
yarn changeset version | ||
git add . | ||
git commit -m "Exit prerelease mode and version packages" | ||
yarn changeset publish | ||
git push --follow-tags | ||
``` | ||
|
||
``` | ||
yarn changeset pre exit | ||
``` | ||
|
||
This command will set an intent to exit prerelease mode in the `pre.json` file though it won't do any actual versioning. | ||
|
||
``` | ||
yarn changeset version | ||
``` | ||
|
||
The version command will apply any changesets currently in the repo and then remove the prerelease tag from the versions. The repo would now look like this: | ||
|
||
``` | ||
packages/ | ||
pkg-a@1.1.0 has dep on pkg-b@^2.0.1 | ||
pkg-b@2.1.0 has no deps | ||
pkg-c@3.0.1 has no deps | ||
pkg-d@1.0.0 has no deps | ||
``` | ||
|
||
``` | ||
yarn changeset publish | ||
``` | ||
|
||
The publish command will publish everything to the `latest` dist tag as normal. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
fixtures/pinned-caret-tilde-dependents/packages/caret-dep/package.json
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
fixtures/pinned-caret-tilde-dependents/packages/depended-upon/package.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
fixtures/pinned-caret-tilde-dependents/packages/pinned-dep/package.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
fixtures/pinned-caret-tilde-dependents/packages/tilde-dep/package.json
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
fixtures/simple-tilde-peer-dep/packages/depended-upon/package.json
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
fixtures/simple-tilde-peer-dep/packages/has-peer-dep/package.json
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -95,5 +95,8 @@ | |
"packages": [ | ||
"packages/*" | ||
] | ||
}, | ||
"jest": { | ||
"clearMocks": true | ||
} | ||
} |
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.