Skip to content

use changesets#3070

Open
boneskull wants to merge 4 commits intomasterfrom
boneskull/changesets
Open

use changesets#3070
boneskull wants to merge 4 commits intomasterfrom
boneskull/changesets

Conversation

@boneskull
Copy link
Member

@boneskull boneskull commented Feb 2, 2026

Overview

This PR adopts Changesets for versioning and releasing.

Changesets are a solution to the problem of versioning and updating release notes. Unlike other solutions which generate release notes from Conventional Commits, Changesets do not prescribe a commit message format and provide more granular control over the contents of release notes. Instead, it keeps information about versions and release notes in a temporary file-based "database". These files are committed to version control, then "flushed" upon release.

Adding Changesets

To add a Changeset to your PR, you'll interface with @changesets/cli, which will ask you to choose whether the Changeset represents a patch, minor, or major version bump. It will also ask you to provide a changelog entry. That entry replaces our current convention for updating a NEWS.md file.

Once complete, you'll be reminded to commit the Changeset (which will be a unique .md file in .changeset/), which you'll then push up to your PR.

Note

  • Changesets don't need their own commit.
  • Not all PRs need changesets--only those which impact the end user.
  • changeset-bot will automatically detect Changesets (or the lack thereof) and comment on any PR containing them with info about the version bump and the contents of the Changelog entry.

Releasing

The Changesets Release Action runs after every push to master. It creates and maintains a PR which uses the Changeset files it finds to bump packages and update CHANGELOG.md files. Once merged, this PR will create appropriate tags for all updated packages & GitHub Releases for each tag.

Publishing

To publish to npm, a maintainer will pull down the changes, then publish via lerna publish from-package or laverna (depending; see "MAYBE TODO" below).

TODO

An incomplete list of TODOs:

  • Strongly recommend installing changeset-bot to automatically nag contributors to create Changesets and display information about Changesets it detects. This requires it to be added to the Endo org, however.
  • Update CONTRIBUTING.md to reflect the new processes.
  • We likely need to enable Allow GitHub Actions to create and approve pull requests in the Actions settings

MAYBE TODO

This work could be in this PR, or in a subsequent PR.

  • Replace lerna with @lavamoat/laverna. Since lerna will no longer handle versioning, it would only provide lerna publish from-package ... which happens to be exactly the thing @lavamoat/laverna provides. If we do this in a separate PR, we'll likely incur another change to the publishing workflow (even if slight). I could go either way on this.

@boneskull boneskull self-assigned this Feb 2, 2026
@boneskull boneskull added technical-debt tooling github_actions Pull requests that update GitHub Actions code labels Feb 2, 2026
@boneskull boneskull force-pushed the boneskull/changesets branch from 316be6d to 3a10de7 Compare February 2, 2026 22:40
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"access": "public",
"baseBranch": "master",
"bumpVersionsWithWorkspaceProtocolOnly": true,
Copy link
Member Author

@boneskull boneskull Feb 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assumes we're using those odious workspace:^ version entries everywhere we should.

Comment on lines +6 to +11
"changelog": [
"@changesets/changelog-github",
{
"repo": "endojs/endo"
}
],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we don't like this, it's pretty trivial to write our own changelog-generating plugin.

"repo": "endojs/endo"
}
],
"commit": false,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means "don't automatically commit after adding a Changeset". If enabled, we can specify what the commit message should look like. I don't have an opinion about this.

@boneskull boneskull force-pushed the boneskull/changesets branch from 3a10de7 to 845e07b Compare February 2, 2026 23:07
Comment on lines +16 to +19
"privatePackages": {
"tag": true,
"version": true
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a lot of private packages. I figure we want to version and tag them and add release notes like any other (why not?).

"tag": true,
"version": true
},
"updateInternalDependencies": "patch"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see docs

"baseBranch": "master",
"bumpVersionsWithWorkspaceProtocolOnly": true,
"changelog": [
"@changesets/changelog-github",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this changelog-generator plugin adds references to GitHub PRs, commits, etc. the default generator does not.

@boneskull boneskull force-pushed the boneskull/changesets branch from 845e07b to a858b45 Compare February 2, 2026 23:12
Comment on lines +10 to +12
permissions:
contents: write
pull-requests: write
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is sufficient.

Copy link
Member

@kriskowal kriskowal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting. Let’s give this a hearing at the Endo meeting and move toward a first release with this process soon.

@changeset-bot
Copy link

changeset-bot bot commented Feb 4, 2026

⚠️ No Changeset found

Latest commit: c38e716

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@boneskull boneskull marked this pull request as ready for review February 4, 2026 00:16
Comment on lines +3 to +6
on:
push:
branches:
- master
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we’re going to always have a release PR ready to go?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not always, but as long as there are changesets sitting in .changeset/.

- name: Install Dependencies
run: yarn

- name: Create Release Pull Request
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create or create and update?

@boneskull
Copy link
Member Author

We'll have to stick with lerna until We implement support for workspace:^ when publishing.

Ref: LavaMoat/LavaMoat#1883

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code technical-debt tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants