ethereum-optimism / smock

[Optimism] Solidity mock contracts in JavaScript
73 stars 15 forks source link

Explore adding support for changeset #12

Open krzkaczor opened 3 years ago

krzkaczor commented 3 years ago

Thelast NPM release is from 4 months ago. Maybe it's time to cut a new release? I am particularly interested in new types in types.ts as in the current NPM version mock is typed as any.

Btw. I use changeset for automated releases for TypeChain and it's excellent. Since employing I started cutting new releases MUCH often. I am happy to help you set it up or if you have any questions :)

smartcontracts commented 3 years ago

Would love to try changeset :-). I've been experimenting with stuff over on the v1 branch (https://github.com/ethereum-optimism/smock/tree/v1) but I will likely take those learnings and apply it the main branch instead of publishing something completely new.

smartcontracts commented 3 years ago

Definitely interested in making a new release soon! What's the best way to set up changeset?

krzkaczor commented 3 years ago

As for changesets, first of all it's important to realize that commit messages are NOT the right way to write changelogs. A changeset is an aux file that sums up changes in a given PR (text description and type like patch/minor/major). You gather all smaller changeset and make one release and its version is calculated using changeset description.

There are at least 3 parts to using changesets:

  1. Setting up changeset CLI - It will make a changeset dir in the project and you can easily add new changeset using it.

  2. There is a GitHub App that summarizes changesets in a given PR It's not that useful IMO. But there is also a GitHub Action which makes automatic releases trivial. It automatically creates "release" PR which takes all pending changesets (from master branch) and applies them, bumping version of the package and triggering npm publish. After merging it, it publishes new version to npm and creates a GH release.

  3. NPM bot. Probably you don't want to use your private account but rather setup npm bot for automatic releases.

Here's GHA config that I use: https://github.com/ethereum-ts/TypeChain/blob/master/.github/workflows/release.yml

smartcontracts commented 3 years ago

I haven't had the change to set up changeset but we're getting ready to make a release of 1.0.0-rc.1. Exciting!