Graphiql: Proposal: Switch from Conventional Commits/ Lerna Publish to Changesets

Created on 17 May 2020  路  4Comments  路  Source: graphql/graphiql

I've found that lerna publish, including inbuilt lerna version options, despite being powerful, contains some inflexibilities and issues that have caused us some problems

  • conventional commits adds another hurdle to users when creating commit messages
  • if there is an auth issue, lerna will still push tags and gh releases without pushing npm packages :(. this is messy!
  • changelogs are so automated that they become more difficult to use, let alone customize

so, to solve this, without ridding ourselves of automation, we can give this a try:

https://github.com/atlassian/changesets

housekeeping proposal

Most helpful comment

It's been a pleasure to use with remirror and I'd strongly recommend it. I used lerna before, and manually managing the repository wide changelog was not fun.

Tips

  • Automate your releases with the changesets/action. It will save you a lot of time and the pull request it generates makes it easy to see exactly what changes are being published when merging the PR. e.g. https://github.com/remirror/remirror/pull/297
  • If you like locking all the packages to the same version you can also do the same with changesets. I wasn't aware of this when I first set it up. The docs have improved a lot since then.
  • Install the bot to prompt when a patch, minor or major change is missing the required changeset in a PR.

Pitfalls

  • One potential downside when compared with lerna is a big increase in the number of releases in the releases tab. This can become noisy. You have 10 packages and maybe 8 are mainly internal and only 2 are actually used by the public. Your releases tab will show updates to all 10 even if you and your users are only interested in changes from the main two. With lerna one release adds one entry to the releases tab (on tag). With changesets a release will add up to 10.
  • Users will need to be educated when making PR's to also add changesets. The bot can help with a prompt but it might be daunting for first time contributors.

All 4 comments

@benjie I think you'll like this :)

Yes; @ifiokjr uses it on the remirror repo, it looks really nice. I've been considering adopting it for Graphile. I can't personally recommend it yet (due to not having used it), but maybe Ifi will chime in.

It's been a pleasure to use with remirror and I'd strongly recommend it. I used lerna before, and manually managing the repository wide changelog was not fun.

Tips

  • Automate your releases with the changesets/action. It will save you a lot of time and the pull request it generates makes it easy to see exactly what changes are being published when merging the PR. e.g. https://github.com/remirror/remirror/pull/297
  • If you like locking all the packages to the same version you can also do the same with changesets. I wasn't aware of this when I first set it up. The docs have improved a lot since then.
  • Install the bot to prompt when a patch, minor or major change is missing the required changeset in a PR.

Pitfalls

  • One potential downside when compared with lerna is a big increase in the number of releases in the releases tab. This can become noisy. You have 10 packages and maybe 8 are mainly internal and only 2 are actually used by the public. Your releases tab will show updates to all 10 even if you and your users are only interested in changes from the main two. With lerna one release adds one entry to the releases tab (on tag). With changesets a release will add up to 10.
  • Users will need to be educated when making PR's to also add changesets. The bot can help with a prompt but it might be daunting for first time contributors.

@ifiokjr thank you so much for the very thorough analysis!

Was this page helpful?
0 / 5 - 0 ratings