-
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.
Merge in v2 update of the changesets cli
- Loading branch information
Showing
90 changed files
with
1,933 additions
and
3,240 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"changelog": "./getChangelogEntry.js", | ||
"commit": false | ||
} |
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/get-release-plan": minor | ||
--- | ||
|
||
Initial Release |
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,42 @@ | ||
require("dotenv").config(); | ||
const { getInfo } = require("@changesets/get-github-info"); | ||
|
||
const getReleaseLine = async (changeset, type) => { | ||
const [firstLine, ...futureLines] = changeset.summary | ||
.split("\n") | ||
.map(l => l.trimRight()); | ||
|
||
if (changeset.commit) { | ||
let { links } = await getInfo({ | ||
repo: "atlassian/changesets", | ||
commit: changeset.commit | ||
}); | ||
return `- ${links.commit}${links.pull === null ? "" : ` ${links.pull}`}${ | ||
links.user === null ? "" : ` Thanks ${links.user}!` | ||
} - ${firstLine}\n${futureLines.map(l => ` ${l}`).join("\n")}`; | ||
} else { | ||
return `- ${firstLine}\n${futureLines.map(l => ` ${l}`).join("\n")}`; | ||
} | ||
}; | ||
|
||
const getDependencyReleaseLine = async (changesets, dependenciesUpdated) => { | ||
if (dependenciesUpdated.length === 0) return ""; | ||
|
||
changesets.map(cs => cs.commit).filter(_ => _); | ||
|
||
const changesetLink = `- Updated dependencies [${changesets | ||
.map(cs => cs.commit) | ||
.filter(_ => _) | ||
.join(", ")}]:`; | ||
|
||
const updatedDepenenciesList = dependenciesUpdated.map( | ||
dependency => ` - ${dependency.name}@${dependency.newVersion}` | ||
); | ||
|
||
return [changesetLink, ...updatedDepenenciesList].join("\n"); | ||
}; | ||
|
||
module.exports = { | ||
getDependencyReleaseLine, | ||
getReleaseLine | ||
}; |
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 @@ | ||
--- | ||
"bolt-check": patch | ||
--- | ||
|
||
Use `@changesets/get-version-range-type` to get version range type, to avoid having this function duplicated |
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,16 @@ | ||
--- | ||
"@changesets/cli": major | ||
--- | ||
|
||
#### Changed command line argument names | ||
|
||
We have removed command line arguments that overrwrite the config. The following commands can no longer | ||
be passed in: | ||
|
||
- `updateChangelog` | ||
- `isPublic` | ||
- `skipCI` | ||
- `commit` | ||
|
||
This has been done to avoid overloading the number of ways you can pass options, as within any single | ||
repository, there should be a single consistent way in which these values are always provided. |
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,28 @@ | ||
--- | ||
"@changesets/cli": major | ||
--- | ||
|
||
#### Changed how Config works | ||
|
||
The Changesets config is now written in JSON with fewer options. The new defaults are shown below. | ||
|
||
```json | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/config/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"linked": [], | ||
"access": "private" | ||
} | ||
``` | ||
|
||
**Reasoning**: Having a JSON config makes it easier to build other tools on changesets because the config can be read without executing user code that could potentially be unsafe. It also means we can have easy autocompletion and descriptions in editors that don't go out of date like the comments in the JS config along with being able to packagise changelog entry generators. | ||
|
||
##### Migrating | ||
|
||
1. Run `yarn changeset init` to create a config file in the new format at `.changeset/config.json` | ||
1. If you're using changelogs, move `getReleaseLine` and `getDependencyReleaseLine` to their own module and set the changelog option to the path to the module. If you're not using changelogs, set the changelog option to `false`. In the future, we will be providing packages to write changelogs for common use cases | ||
1. Set `access` to `"public"` if `publishOptions.public` is `true`, otherwise set it to `"private"` | ||
1. If you use `linked`, copy your linked package groups from the JS config to the the JSON file | ||
1. If you use `commit` and `skipCI` in `versionOptions` or `publishOptions`, set commit to `true`, all commits will include a skip ci message. if you have a use case for only using commit on one command or not including a skip ci message by default | ||
1. Delete `.changeset/config.js` |
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,21 @@ | ||
--- | ||
"@changesets/cli": major | ||
--- | ||
|
||
#### Changelog generation functions have minor changes | ||
|
||
In addition to how these functions are defined (see changes to config), the data that is passed through | ||
to these functions is notably different to what it was before. For the most part, the changelog functions | ||
simply receive richer information, based on the new changelog format. | ||
|
||
**BREAKING**: The release objects and dependency release objects now use `release.newVersion` for the latest | ||
version, instead of the previous `release.version`. | ||
|
||
The `@changesets/types` package includes exports for both `GetReleaseLine` as well as `GetDependencyReleaseLine`. | ||
|
||
If you were using the default changelog generation scripts, you won't need to worry. Otherwise, we recommend updating | ||
your command and manually running `version` to ensure you are still getting the changelogs you expect. | ||
|
||
**Looking further forward** We are already aware that we want to change how people write these generation functions, | ||
including opening up more flexibility, and access to things such as the underlying release plan. This will likely require | ||
a breaking change in the future, but we thought we were changing enough this release that we didn't want too much turmoil. 😁 |
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,16 @@ | ||
--- | ||
"@changesets/cli": major | ||
--- | ||
|
||
#### Renamed commands | ||
|
||
- `bump` has been renamed to `version` | ||
- `release` has been renamed to `publish` | ||
|
||
This is a reversion to the changes made in `1.0.0`. | ||
|
||
**Reasoning**: We switched the names because we wanted to avoid confusion with the related | ||
tasks in npm. While technically it removed confusion that this was doing the same thing as | ||
`npm version`, or `npm publish`, the new terms did not convey easily grokkable meanings. As | ||
we weren't benefiting from the new names, we have decided to revert to names that have more | ||
meaning within the community, even though these commands do slightly more than this. |
4 changes: 4 additions & 0 deletions
4
__fixtures__/simple-project-custom-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,4 @@ | ||
{ | ||
"commit": true, | ||
"changelog": "./getChangelogEntry.js" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
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 @@ | ||
--- | ||
"pkga-a": minor | ||
--- | ||
|
||
This is a pretty bogus changeset |
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.