Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Jun 15, 2022
2 parents eff7c63 + 2cb4915 commit 6afbfa2
Show file tree
Hide file tree
Showing 18 changed files with 452 additions and 62 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Expand Up @@ -2,7 +2,7 @@ version: 3
jobs:
test:
docker:
- image: circleci/node:10.13.0
- image: circleci/node:12.22.2
working_directory: ~/repo
steps:
- checkout
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:

typescript:
docker:
- image: circleci/node:10.13.0
- image: circleci/node:12.22.2
working_directory: ~/repo
steps:
- checkout
Expand All @@ -58,7 +58,7 @@ jobs:

lint:
docker:
- image: circleci/node:10.13.0
- image: circleci/node:12.22.2
working_directory: ~/repo
steps:
- checkout
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -72,6 +72,7 @@ To make releasing easier, you can use [this changesets github action](https://gi
- [verdaccio](https://verdaccio.org/)
- [Chakra UI](https://chakra-ui.com/)
- [Astro](https://astro.build)
- [Hydrogen] (https://hydrogen.shopify.dev)
- All tools developed by [The Guild](https://the-guild.dev/)

# Thanks/Inspiration
Expand Down
2 changes: 1 addition & 1 deletion docs/command-line-options.md
Expand Up @@ -87,7 +87,7 @@ This command is used to allow you to skip packages from being published. This al
1. If the package is mentioned in a changeset that also includes a package that is not ignored, publishing will fail.
2. If the package requires one of its dependencies to be updated as part of a publish.

These restrictions exist to ensure your repository or published code do not end up in a broken state. For a more detailed intricacies of publishing, check out our guide on [problems publishing in monorepos](./problems-publishing-in-monorepos).
These restrictions exist to ensure your repository or published code do not end up in a broken state. For a more detailed intricacies of publishing, check out our guide on [problems publishing in monorepos](./problems-publishing-in-monorepos.md).

```
changeset version --snapshot
Expand Down
6 changes: 3 additions & 3 deletions docs/dictionary.md
Expand Up @@ -16,8 +16,8 @@ Several of these have associated type definitions, which you can find in [our ty
- **single-package repo** - A repository which only contains a single package which is at the root of the repo
- **multi-package repo/monorepo** - A repository which contains multiple packages, generally managed by [Bolt](https://github.com/boltpkg/bolt) or [Yarn Workspaces](https://yarnpkg.com/lang/en/docs/workspaces/).
- **release line generators** - The `getReleaseLine` and `getDependencyReleaseLine` functions which are responsible for creating the lines inserted into changelog. A changelog entry for a particular release can be thought of as `releaseLineGenerators(changesets)`
- **fixed packages** - Fixed packages share a semver categorisation, such that all fixed packages have the same semver version and are always published together. The logistics of this are best left to our [./fixed-packages.md] documentation.
- **linked packages** - Linked packages share a semver categorisation, such that all published linked packages have consistent new semver ranges. The logistics of this are best left to our [./linked-packages.md] documentation.
- **fixed packages** - Fixed packages share a semver categorisation, such that all fixed packages have the same semver version and are always published together. The logistics of this are best left to our [fixed-packages](./fixed-packages.md) documentation.
- **linked packages** - Linked packages share a semver categorisation, such that all published linked packages have consistent new semver ranges. The logistics of this are best left to our [linked-packages](./linked-packages.md) documentation.
- **release instruction** An object containing an intent to release a single package, consisting of the package name and a bump type
- **release plan** - A calculated object that shows everything a collection of changesets will release, and at what version, and how. This object includes a calculation of dependencies, and considerations for `linked` packages.
- **absolutely correct semver** - making semver versioning decisions to ensure nothing less than major is capable of breaking a consumer's code. Because literally any change is technically capable of breaking a user's code, absolutely correct semver requires that all changes are major changes.
Expand All @@ -27,7 +27,7 @@ Several of these have associated type definitions, which you can find in [our ty
- **release** - The combination of versioning and publishing a package or packages which may include a build process before publishing
- **prereleases** - A pre-release is a release that uses a tag, and is not published as `latest` on npm. This is designed for when you want to share code, but are not yet ready for it to be the main package used by everyone. Pre-releases for packages are common, but pre-releases within a monorepo presents unique problems. You can see our exhaustive pre-release documentation [in our prereleases documentation](./prereleases.md). In addition, there are two different approaches to pre-releases which are defined for use separately.
- **Release Candidate (RC) prerelease** - An RC prerelease is done before an intended important release, likely a major release. It includes semver information about what the next intended release version is, a tag, and an iterated number for the prerelease. The output of this is intended to be committed, and then further work done on the branch. An example would be if I am on `1.0.0` of a package, and I want to do an RC for the next `major` version we would have: `package-one@2.0.0-my-tag.0`, and then the next publish is `package-one@2.0.0-my-tag.1`.
- **snapshot prerelease** - A snapshot pre-release is intended to make it easy to test all changes at a particular git commit. It is published at `0.0.0` and uses the git hash as the tag. This should be used as a less formal method than a release candidate to make it easy to install and test changes. An example, if we have a package at `1.0.0`, and have a changeset for it to be `major` bumpred, a snapshot release will be at `0.0.0-ABCDEFGH` (the last github hash). If we add more commits, the next snapshot would be `0.0.0-HIJKLMNOP`.
- **snapshot prerelease** - A snapshot pre-release is intended to make it easy to test all changes at a particular git commit. It is published at `0.0.0` and uses the git hash as the tag. This should be used as a less formal method than a release candidate to make it easy to install and test changes. An example, if we have a package at `1.0.0`, and have a changeset for it to be `major` bumped, a snapshot release will be at `0.0.0-ABCDEFGH` (the last github hash). If we add more commits, the next snapshot would be `0.0.0-HIJKLMNOP`.

## Things that we haven't figured out how to explain well yet

Expand Down
6 changes: 6 additions & 0 deletions packages/assemble-release-plan/CHANGELOG.md
@@ -1,5 +1,11 @@
# @changesets/assemble-release-plan

## 5.1.3

### Patch Changes

- [#767](https://github.com/changesets/changesets/pull/767) [`d6bfcc5`](https://github.com/changesets/changesets/commit/d6bfcc5052dcba18c521a20d62e2e67a81819112) Thanks [@Andarist](https://github.com/Andarist)! - Improve the error message when a package referenced in a changeset can't be found. The message will now also include the changeset's ID.

## 5.1.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/assemble-release-plan/package.json
@@ -1,6 +1,6 @@
{
"name": "@changesets/assemble-release-plan",
"version": "5.1.2",
"version": "5.1.3",
"description": "Reads changesets and adds information on dependents that need bumping",
"main": "dist/assemble-release-plan.cjs.js",
"module": "dist/assemble-release-plan.esm.js",
Expand Down
4 changes: 3 additions & 1 deletion packages/assemble-release-plan/src/flatten-releases.ts
Expand Up @@ -21,7 +21,9 @@ export default function flattenReleases(
let release = releases.get(name);
let pkg = packagesByName.get(name);
if (!pkg) {
throw new Error(`Could not find package information for ${name}`);
throw new Error(
`"${changeset.id}" changeset mentions a release for a package "${name}" but such a package could not be found.`
);
}
if (!release) {
release = {
Expand Down
9 changes: 9 additions & 0 deletions packages/changelog-github/CHANGELOG.md
@@ -1,5 +1,14 @@
# @changesets/changelog-github

## 0.4.5

### Patch Changes

- [#820](https://github.com/changesets/changesets/pull/820) [`a22eb8c`](https://github.com/changesets/changesets/commit/a22eb8c93fff7912323aa8f3d534066ce2a578fa) Thanks [@Andarist](https://github.com/Andarist)! - Errors resulting from the GitHub API calls should now be properly raised.

- Updated dependencies [[`a22eb8c`](https://github.com/changesets/changesets/commit/a22eb8c93fff7912323aa8f3d534066ce2a578fa)]:
- @changesets/get-github-info@0.5.1

## 0.4.4

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/changelog-github/package.json
@@ -1,13 +1,13 @@
{
"name": "@changesets/changelog-github",
"version": "0.4.4",
"version": "0.4.5",
"description": "A changelog entry generator for GitHub that links to commits, PRs and users",
"main": "dist/changelog-github.cjs.js",
"module": "dist/changelog-github.esm.js",
"license": "MIT",
"repository": "https://github.com/changesets/changesets/tree/main/packages/changelog-github",
"dependencies": {
"@changesets/get-github-info": "^0.5.0",
"@changesets/get-github-info": "^0.5.1",
"@changesets/types": "^5.0.0",
"dotenv": "^8.1.0"
},
Expand Down
16 changes: 16 additions & 0 deletions packages/cli/CHANGELOG.md
@@ -1,5 +1,21 @@
# @changesets/cli

## 2.23.0

### Minor Changes

- [#796](https://github.com/changesets/changesets/pull/796) [`745b771`](https://github.com/changesets/changesets/commit/745b7713f6ab18c8f5ec0500ddcf1ce5db2377cf) Thanks [@JakeGinnivan](https://github.com/JakeGinnivan)! - Upgraded `tty-table` to fix deprecation warnings coming from its transitive dependency.

### Patch Changes

- [#811](https://github.com/changesets/changesets/pull/811) [`c54c25d`](https://github.com/changesets/changesets/commit/c54c25d7bbbdc055d2df97396c3b73e66f8b3b78) Thanks [@samrose3](https://github.com/samrose3)! - Improved accessibility of the CLI prompts by using selected/unselected indicators that don't rely solely on the colors.

* [#767](https://github.com/changesets/changesets/pull/767) [`d6bfcc5`](https://github.com/changesets/changesets/commit/d6bfcc5052dcba18c521a20d62e2e67a81819112) Thanks [@Andarist](https://github.com/Andarist)! - Improve the error message when a package referenced in a changeset can't be found. The message will now also include the changeset's ID.

* Updated dependencies [[`d6bfcc5`](https://github.com/changesets/changesets/commit/d6bfcc5052dcba18c521a20d62e2e67a81819112)]:
- @changesets/assemble-release-plan@5.1.3
- @changesets/get-release-plan@3.0.9

## 2.22.0

### Minor Changes
Expand Down
9 changes: 5 additions & 4 deletions packages/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@changesets/cli",
"version": "2.22.0",
"version": "2.23.0",
"description": "Organise your package versioning and publishing to make both contributors and maintainers happy",
"bin": {
"changeset": "bin.js"
Expand Down Expand Up @@ -32,12 +32,12 @@
"dependencies": {
"@babel/runtime": "^7.10.4",
"@changesets/apply-release-plan": "^6.0.0",
"@changesets/assemble-release-plan": "^5.1.2",
"@changesets/assemble-release-plan": "^5.1.3",
"@changesets/changelog-git": "^0.1.11",
"@changesets/config": "^2.0.0",
"@changesets/errors": "^0.1.4",
"@changesets/get-dependents-graph": "^1.3.2",
"@changesets/get-release-plan": "^3.0.8",
"@changesets/get-release-plan": "^3.0.9",
"@changesets/git": "^1.3.2",
"@changesets/logger": "^0.0.5",
"@changesets/pre": "^1.0.11",
Expand All @@ -47,6 +47,7 @@
"@manypkg/get-packages": "^1.1.3",
"@types/is-ci": "^3.0.0",
"@types/semver": "^6.0.0",
"ansi-colors": "^4.1.3",
"chalk": "^2.1.0",
"enquirer": "^2.3.0",
"external-editor": "^3.1.0",
Expand All @@ -61,7 +62,7 @@
"semver": "^5.4.1",
"spawndamnit": "^2.0.0",
"term-size": "^2.1.0",
"tty-table": "^2.8.10"
"tty-table": "^4.1.5"
},
"devDependencies": {
"@changesets/parse": "*",
Expand Down
10 changes: 9 additions & 1 deletion packages/cli/src/utils/cli-utilities.ts
Expand Up @@ -3,6 +3,7 @@ import termSize from "term-size";
import { error, prefix, success } from "@changesets/logger";
import { prompt } from "enquirer";
import { edit } from "external-editor";
import { symbols } from "ansi-colors";

// those types are not exported from `enquirer` so we extract them here
// so we can make type assertions using them because `enquirer` types do no support `prefix` right now
Expand Down Expand Up @@ -60,7 +61,14 @@ async function askCheckboxPlus(
choices,
format,
limit,
onCancel: cancelFlow
onCancel: cancelFlow,
symbols: {
indicator: symbols.radioOff,
checked: symbols.radioOn
},
indicator(state: any, choice: any) {
return choice.enabled ? state.symbols.checked : state.symbols.indicator;
}
} as ArrayPromptOptions)
.then((responses: any) => responses[name])
.catch((err: unknown) => {
Expand Down
6 changes: 6 additions & 0 deletions packages/get-github-info/CHANGELOG.md
@@ -1,5 +1,11 @@
# @changesets/get-github-info

## 0.5.1

### Patch Changes

- [#820](https://github.com/changesets/changesets/pull/820) [`a22eb8c`](https://github.com/changesets/changesets/commit/a22eb8c93fff7912323aa8f3d534066ce2a578fa) Thanks [@Andarist](https://github.com/Andarist)! - Errors resulting from the GitHub API calls should now be properly raised.

## 0.5.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/get-github-info/package.json
@@ -1,6 +1,6 @@
{
"name": "@changesets/get-github-info",
"version": "0.5.0",
"version": "0.5.1",
"description": "Get the GitHub username and PR number from a commit. Intended for use with changesets.",
"main": "dist/get-github-info.cjs.js",
"module": "dist/get-github-info.esm.js",
Expand Down
12 changes: 11 additions & 1 deletion packages/get-github-info/src/index.ts
Expand Up @@ -58,7 +58,7 @@ function makeQuery(repos: ReposWithCommitsAndPRsToFetch) {
mergeCommit {
commitUrl
abbreviatedOid
}
}
}`
)
.join("\n")}
Expand Down Expand Up @@ -100,6 +100,16 @@ const GHDataLoader = new DataLoader(async (requests: RequestData[]) => {
body: JSON.stringify({ query: makeQuery(repos) })
}).then((x: any) => x.json());

if (data.errors) {
throw new Error(
`An error occurred when fetching data from GitHub\n${JSON.stringify(
data.errors,
null,
2
)}`
);
}

// this is mainly for the case where there's an authentication problem
if (!data.data) {
throw new Error(
Expand Down
7 changes: 7 additions & 0 deletions packages/get-release-plan/CHANGELOG.md
@@ -1,5 +1,12 @@
# @changesets/get-release-plan

## 3.0.9

### Patch Changes

- Updated dependencies [[`d6bfcc5`](https://github.com/changesets/changesets/commit/d6bfcc5052dcba18c521a20d62e2e67a81819112)]:
- @changesets/assemble-release-plan@5.1.3

## 3.0.8

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/get-release-plan/package.json
@@ -1,14 +1,14 @@
{
"name": "@changesets/get-release-plan",
"version": "3.0.8",
"version": "3.0.9",
"description": "Reads changesets and adds information on dependents that need bumping",
"main": "dist/get-release-plan.cjs.js",
"module": "dist/get-release-plan.esm.js",
"license": "MIT",
"repository": "https://github.com/changesets/changesets/tree/main/packages/get-release-plan",
"dependencies": {
"@babel/runtime": "^7.10.4",
"@changesets/assemble-release-plan": "^5.1.2",
"@changesets/assemble-release-plan": "^5.1.3",
"@changesets/config": "^2.0.0",
"@changesets/pre": "^1.0.11",
"@changesets/read": "^0.5.5",
Expand Down

0 comments on commit 6afbfa2

Please sign in to comment.