Skip to content

Commit

Permalink
Merge branch 'main' into cleanup-test-output
Browse files Browse the repository at this point in the history
# Conflicts:
#	packages/get-dependents-graph/src/get-dependency-graph.test.ts
  • Loading branch information
Andarist committed Feb 13, 2022
2 parents 1db4ec9 + c2b9d44 commit 7181c05
Show file tree
Hide file tree
Showing 72 changed files with 804 additions and 430 deletions.
5 changes: 0 additions & 5 deletions .changeset/few-olives-shake.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/friendly-mugs-drive.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/poor-wolves-film.md

This file was deleted.

6 changes: 6 additions & 0 deletions .changeset/quiet-trainers-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@changesets/apply-release-plan": patch
"@changesets/cli": patch
---

Fixed an issue that caused **created** CHANGELOG files not being formatted in the same way as the **updated** ones (this could happen when calling `changeset version` for the very first time for a package).
12 changes: 6 additions & 6 deletions .github/workflows/changeset-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
# https://github.com/actions/checkout
uses: actions/checkout@v2

- name: Setup Node.js 12.x
uses: actions/setup-node@master
# https://github.com/actions/setup-node
uses: actions/setup-node@v2
with:
node-version: 12.x

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request or Publish to npm
uses: changesets/action@master
# https://github.com/changesets/action
uses: changesets/action@v1
with:
# this expects you to have a script called release which does a build for your packages and calls changeset publish
publish: yarn release
Expand Down
1 change: 1 addition & 0 deletions __fixtures__/dependant-with-tag-range/.changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# We just want a file in here so git collects it
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "example-a",
"version": "1.0.0",
"dependencies": {
"pkg-a": "latest"
}
}
10 changes: 10 additions & 0 deletions __fixtures__/dependant-with-tag-range/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"private": true,
"name": "dependant-with-tag-range",
"description": "example depending on latest tag",
"version": "1.0.0",
"workspaces": [
"examples/*",
"packages/*"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "pkg-a",
"version": "1.0.0"
}
2 changes: 1 addition & 1 deletion docs/automating-changesets.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ In some cases, you may want to make CI fail if not changeset is present, to ensu
In your CI process add a step that runs:

```bash
changeset status --sinceMaster
changeset status --since=main
```

This will exit with the exit code 1 if there have been no new changesets since master.
Expand Down
2 changes: 1 addition & 1 deletion docs/common-questions.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ When `changeset version` or equivalent command is run, all the changeset folders

The two parts of the file are for different purposes. You should feel free to edit both parts as much as you want.

- The markdown text is a summary of the changes you've will be prepended to your changelog when you next run your version command.
- The markdown text is a summary of the changes that will be prepended to your changelog when you next run your version command.
- The YAML front matter describes what should be versioned by the version command

## I want to edit the summary or package bump types - is it safe to do that?
Expand Down
12 changes: 9 additions & 3 deletions docs/config-file-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ This argument sets whether the `changeset add` command and the `changeset publis

## `access` (`restricted` | `public`)

This sets how packages are published - if `access: "restricted"`, packages will be published as private, requiring log in to an npm account with access to install. If `access: "public", the packages will be made available on the public registry.
This sets how packages are published - if `access: "restricted"`, packages will be published as private, requiring log in to an npm account with access to install. If `access: "public"`, the packages will be made available on the public registry.

By default, npm publishes scoped npm packages as `restricted` - so to ensure you do not accidentally publish code publicly, we default to `restricted`. For most cases you will want to set this to `public`.

This can be overridden in specific packages by setting the `access` in a package's `package.json`.

If you want a package from being published to npm at all, set `private: true` in that package's `package.json`
If you want to prevent a package from being published to npm, set `private: true` in that package's `package.json`

## `baseBranch` (git branch name)

Expand Down Expand Up @@ -114,6 +114,12 @@ This option is for setting how the changelog for packages should be generated. I

As well as the default one, you can use `@changesets/changelog-git`, which adds links to commits into changelogs, or `@changesets/changelog-github`, which requires github authentication, and includes a thankyou message to the person who added the changeset as well as a link to the relevant PR.

You would specify our github changelog generator with: `"changelog": "@changesets/changelog-github"`
You would specify our github changelog generator with:

```json
{
"changelog": ["@changesets/changelog-github", { "repo": "<org>/<repo>" }]
}
```

For more details on these functions and information on how to write your own see [changelog-functions](./modifying-changelog-format.md)
3 changes: 2 additions & 1 deletion docs/detailed-explanation.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ A changeset is a Markdown file with YAML front matter. The contents of the Markd

```md
---
"@changesets/cli": major
"@myproject/cli": major
"@myproject/core": minor
---

Change all the things
Expand Down
6 changes: 3 additions & 3 deletions docs/intro-to-using-changesets.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Using Changesets

Changesets are designed to make your workflows easier, by allowing the person making contributions to make key decisions when they are making their contribution. They hold two key bits of information, a version type (following [semver](https://semver.org/)), and change information to be added to a changelog.
Changesets are designed to make your workflows easier, by allowing the person making contributions to make key decisions when they are making their contribution. Changesets hold two key bits of information: a version type (following [semver](https://semver.org/)), and change information to be added to a changelog.

In addition, changesets were original designed for implementation in [bolt monorepos](https://github.com/boltpkg/bolt). As such, in a mono-repo context, changesets will handle bumping dependencies of changed packages if that is required.
In addition, changesets were originally designed for implementation in [bolt monorepos](https://github.com/boltpkg/bolt). As such, in a monorepo context, changesets will handle bumping dependencies of changed packages, if that is required.

This guide is aimed at package maintainers adding changesets as a tool. For the information relevant to contributors, see [adding a changeset](./adding-a-changeset.md).

Expand Down Expand Up @@ -38,7 +38,7 @@ or
yarn changeset
```

> Note: You can run `changeset add` to add a changeset if you want to but running Changesets without any command works as well.
> Note: You can run `changeset add` to add a changeset if you want to, but running Changesets without any command works as well.
## Versioning and publishing

Expand Down
2 changes: 1 addition & 1 deletion docs/linked-packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Linked packages allow you to specify a group or groups of packages that should be versioned together. There are some complex cases, so some examples are shown below to demonstrate various cases.

- Linked packages will still only bumped when there is a changeset for them (this can mean because you explicitly choose to add a changeset for it or because it's a dependant of something being released)
- Linked packages will still only bumped when there is a changeset for them (this can mean because you explicitly choose to add a changeset for it or because it's a dependent of something being released)
- Packages that have changesets and are in a set of linked packages will **always** be versioned to the highest current version in the set of linked packages + the highest bump type from changesets in the set of linked packages

## Examples
Expand Down
8 changes: 4 additions & 4 deletions docs/modifying-changelog-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ async function getReleaseLine() {}

async function getDependencyReleaseLine() {}

module.exports {
getReleaseLine,
getDependencyReleaseLine
}
module.exports = {
getReleaseLine,
getDependencyReleaseLine
};
```

These functions are run during the `changeset version` and are expected to return a string (or a promise with a string).
Expand Down
12 changes: 9 additions & 3 deletions docs/snapshot-releases.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Snapshot Releases

Snapshot releases are a way to release your changes for testing without updating the versions. It involves both a modified `version` and a modified `publish` command are used to do this. After this, you will have a published version of packages in changesets with a version of `0.0.0-{tag}-DATETIMESTAMP`.
Snapshot releases are a way to release your changes for testing without updating the versions. Both a modified `version` and a modified `publish` command are used to do accomplish a snapshot release. After both processes run, you will have a published version of packages in changesets with a version of `0.0.0-{tag}-DATETIMESTAMP`.

## Starting Off

Create changesets as normal, and then when, you are ready to release a snapshot, you should make a branch from which to do so.
Create changesets as normal, as described in [adding a changeset](./adding-a-changeset.md). When you are ready to release a snapshot, you should make a dedicated branch for doing so.

## Versioning your packages

Expand All @@ -24,7 +24,13 @@ This will instead update versions to `0.0.0-bulbasaur-THE_TIME_YOU_DID_THIS`

## Publishing your packages

After running version, you can use the `changeset publish --tag bulbasaur` command to releases the packages. By using the `--tag` flag, you will not add it to the `latest` flag on npm. This is REALLY IMPORTANT because if you do not include a tag, people installing your package using `yarn add your-package-name` will install the snapshot version.
After running the `yarn changeset version` command, you can use the `changeset publish --tag bulbasaur` command to releases the packages. By using the `--tag` flag, you will not add it to the `latest` flag on npm. This is REALLY IMPORTANT because if you do not include a tag, people installing your package using `yarn add your-package-name` will install the snapshot version.

## Using the `--no-git-tag` flag

You can use the `--no-git-tag` CLI flag when running `changeset publish` if you plan to publish snapshot releases locally or you are pushing [git tags](http://npm.github.io/publishing-pkgs-docs/updating/using-tags.html) to a remote from your CI environment.

When you run `changeset publish --no-git-tag --snapshot`, changesets will skip creating git tags for published snapshot packages. That means that git tags can still be created whenever pushing stable versions (with a regular `changeset publish`), and you can safely publish snapshot releases locally, without creating unnecessary tags.

## Using a snapshot version

Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
"workspaces": [
"packages/*"
],
"author": "Ben Conolly",
"author": "Changesets Contributors",
"contributors": [
"Ben Conolly",
"Mitchell Hamilton",
"Mateusz Burzyński <mateuszburzynski@gmail.com> (https://github.com/Andarist)"
],
"license": "MIT",
"dependencies": {
"@babel/cli": "^7.10.4",
Expand Down
32 changes: 20 additions & 12 deletions packages/apply-release-plan/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @changesets/apply-release-plan

## 5.0.4

### Patch Changes

- Updated dependencies [[`77c1cef`](https://github.com/changesets/changesets/commit/77c1ceff402f390c1ededec358d914ba68a31d0d)]:
- @changesets/git@1.3.0
- @changesets/config@1.6.4

## 5.0.3

### Patch Changes
Expand Down Expand Up @@ -98,10 +106,10 @@
- [`6d0790a`](https://github.com/changesets/changesets/commit/6d0790a7aa9f00e350e9394f419e4b3c7ee7ca6a) [#359](https://github.com/changesets/changesets/pull/359) Thanks [@ajaymathur](https://github.com/ajaymathur)! - Add support for snapshot flag to version command. Usage: `changeset version --snapshot [tag]`. The updated version of the packages looks like `0.0.0[-tag]-YYYYMMDDHHMMSS` where YYYY, MM, DD, HH, MM, and SS is the date and time of when the snapshot version is created. You can use this feature with the tag option in the publish command to publish packages under experimental tags from feature branches. To publish a snapshot version of a package under an experimental tag you can do:

```
$ # Version packages to snapshot version
$ changeset version --snapshot
$ # Publish packages under exprimental tag, keeping next and latest tag clean
$ changeset publish --tag exprimental
# Version packages to snapshot version
changeset version --snapshot
# Publish packages under experimental tag, keeping next and latest tag clean
changeset publish --tag experimental
```

## 3.0.3
Expand Down Expand Up @@ -139,7 +147,7 @@

### Patch Changes

- [`3dbab2e`](https://github.com/changesets/changesets/commit/3dbab2e80d9a8a0cccc02d74c6d8150f603219e6) [#343](https://github.com/changesets/changesets/pull/343) Thanks [@zkochan](https://github.com/zkochan)! - Self-references should be skipped when bumping versions. A self-reference is a dev dep that has the same name as the package. Some projects use self-references as a convinient way to require files using relative paths from the root directory.
- [`3dbab2e`](https://github.com/changesets/changesets/commit/3dbab2e80d9a8a0cccc02d74c6d8150f603219e6) [#343](https://github.com/changesets/changesets/pull/343) Thanks [@zkochan](https://github.com/zkochan)! - Self-references should be skipped when bumping versions. A self-reference is a dev dep that has the same name as the package. Some projects use self-references as a convenient way to require files using relative paths from the root directory.

## 2.0.1

Expand All @@ -161,9 +169,9 @@

This is a pretty big "quality of life" update, which means we will do fewer releases of packages overall, as there is no change of installed packages.

This has been made a breaking chage as it changes the behaviour of what will be published. It should only be for the better, but we didn't want to surprise you with it.
This has been made a breaking change as it changes the behavior of what will be published. It should only be for the better, but we didn't want to surprise you with it.

* [`011d57f`](https://github.com/changesets/changesets/commit/011d57f1edf9e37f75a8bef4f918e72166af096e) [#313](https://github.com/changesets/changesets/pull/313) Thanks [@zkochan](https://github.com/zkochan)! - Updates to devDependencies are not affecting the end users of a package. So we are not listing these changes in the changelog file.
- [`011d57f`](https://github.com/changesets/changesets/commit/011d57f1edf9e37f75a8bef4f918e72166af096e) [#313](https://github.com/changesets/changesets/pull/313) Thanks [@zkochan](https://github.com/zkochan)! - Updates to devDependencies are not affecting the end users of a package. So we are not listing these changes in the changelog file.

### Minor Changes

Expand All @@ -184,9 +192,9 @@

- [`04ddfd7`](https://github.com/changesets/changesets/commit/04ddfd7c3acbfb84ef9c92873fe7f9dea1f5145c) [#305](https://github.com/changesets/changesets/pull/305) Thanks [@Noviny](https://github.com/Noviny)! - Add link to changelog in readme

* [`b49e1cf`](https://github.com/changesets/changesets/commit/b49e1cff65dca7fe9e341a35aa91704aa0e51cb3) [#306](https://github.com/changesets/changesets/pull/306) Thanks [@Andarist](https://github.com/Andarist)! - Ignore `node_modules` when glob searching for packages. This fixes an issue with package cycles.
- [`b49e1cf`](https://github.com/changesets/changesets/commit/b49e1cff65dca7fe9e341a35aa91704aa0e51cb3) [#306](https://github.com/changesets/changesets/pull/306) Thanks [@Andarist](https://github.com/Andarist)! - Ignore `node_modules` when glob searching for packages. This fixes an issue with package cycles.

* Updated dependencies [[`04ddfd7`](https://github.com/changesets/changesets/commit/04ddfd7c3acbfb84ef9c92873fe7f9dea1f5145c), [`e56928b`](https://github.com/changesets/changesets/commit/e56928bbd6f9096def06ac37487bdbf28efec9d1), [`b49e1cf`](https://github.com/changesets/changesets/commit/b49e1cff65dca7fe9e341a35aa91704aa0e51cb3)]:
- Updated dependencies [[`04ddfd7`](https://github.com/changesets/changesets/commit/04ddfd7c3acbfb84ef9c92873fe7f9dea1f5145c), [`e56928b`](https://github.com/changesets/changesets/commit/e56928bbd6f9096def06ac37487bdbf28efec9d1), [`b49e1cf`](https://github.com/changesets/changesets/commit/b49e1cff65dca7fe9e341a35aa91704aa0e51cb3)]:
- @changesets/config@1.0.1
- @changesets/get-version-range-type@0.3.1
- @changesets/git@1.0.1
Expand Down Expand Up @@ -229,9 +237,9 @@

- [`ef6402c9`](https://github.com/changesets/changesets/commit/ef6402c9d8dc1832126732dbbafb015b71f57f83) [#252](https://github.com/changesets/changesets/pull/252) Thanks [@Andarist](https://github.com/Andarist)! - Ensure there is a newline between release lines so the final markdown preserves correct formatting.

* [`503154db`](https://github.com/changesets/changesets/commit/503154db39fe8ab88a1176e4569c48078bcf5569) [#257](https://github.com/changesets/changesets/pull/257) Thanks [@Noviny](https://github.com/Noviny)! - Move catch statement so errors are less spammy
- [`503154db`](https://github.com/changesets/changesets/commit/503154db39fe8ab88a1176e4569c48078bcf5569) [#257](https://github.com/changesets/changesets/pull/257) Thanks [@Noviny](https://github.com/Noviny)! - Move catch statement so errors are less spammy

* Updated dependencies [[`fe0d9192`](https://github.com/changesets/changesets/commit/fe0d9192544646e1a755202b87dfe850c1c200a3), [`fe0d9192`](https://github.com/changesets/changesets/commit/fe0d9192544646e1a755202b87dfe850c1c200a3)]:
- Updated dependencies [[`fe0d9192`](https://github.com/changesets/changesets/commit/fe0d9192544646e1a755202b87dfe850c1c200a3), [`fe0d9192`](https://github.com/changesets/changesets/commit/fe0d9192544646e1a755202b87dfe850c1c200a3)]:
- get-workspaces@0.6.0
- @changesets/git@0.4.0

Expand Down Expand Up @@ -293,7 +301,7 @@

- [1ff73b7](https://github.com/changesets/changesets/commit/1ff73b74f414031e49c6fd5a0f68e9974900d381) [#156](https://github.com/changesets/changesets/pull/156) Thanks [@mitchellhamilton](https://github.com/mitchellhamilton)! - Fix commits not being obtained for old changesets

* [8c43fa0](https://github.com/changesets/changesets/commit/8c43fa061e2a5a01e4f32504ed351d261761c8dc) [#155](https://github.com/changesets/changesets/pull/155) Thanks [@Noviny](https://github.com/Noviny)! - Add Readme
- [8c43fa0](https://github.com/changesets/changesets/commit/8c43fa061e2a5a01e4f32504ed351d261761c8dc) [#155](https://github.com/changesets/changesets/pull/155) Thanks [@Noviny](https://github.com/Noviny)! - Add Readme

- [0320391](https://github.com/changesets/changesets/commit/0320391699a73621d0e51ce031062a06cbdefadc) [#163](https://github.com/changesets/changesets/pull/163) Thanks [@Noviny](https://github.com/Noviny)! - Reordered dependencies in the package json (this should have no impact)

Expand Down
6 changes: 3 additions & 3 deletions packages/apply-release-plan/package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "@changesets/apply-release-plan",
"version": "5.0.3",
"version": "5.0.4",
"description": "Takes a release plan and applies it to packages",
"main": "dist/apply-release-plan.cjs.js",
"module": "dist/apply-release-plan.esm.js",
"license": "MIT",
"repository": "https://github.com/changesets/changesets/tree/main/packages/apply-release-plan",
"dependencies": {
"@babel/runtime": "^7.10.4",
"@changesets/config": "^1.6.3",
"@changesets/config": "^1.6.4",
"@changesets/get-version-range-type": "^0.3.2",
"@changesets/git": "^1.2.1",
"@changesets/git": "^1.3.0",
"@changesets/types": "^4.0.2",
"@manypkg/get-packages": "^1.1.3",
"detect-indent": "^6.0.0",
Expand Down
Loading

0 comments on commit 7181c05

Please sign in to comment.