NomicFoundation / edr

An Ethereum development runtime implementation that can be reused to build new developer tools.
MIT License
53 stars 10 forks source link

Add CLI for building npm packages #198

Open agostbiro opened 1 year ago

agostbiro commented 1 year ago

The release workflow was implemented in https://github.com/NomicFoundation/hardhat/pull/4415 based on the NAPI CLI generated project scaffolding. The result has a lot of code duplication and thus is prone to error. Another downside of the workflow being encoded in the GitHub CI instead of a Rust CLI app is that it cannot be reproduced locally. We should move the release workflow to a Rust CLI app similar to Slang.

When releasing EDR as an npm package, we need to:

  1. change the version from major.minor.patch-dev to major.minor.patch
  2. cross-compile binaries for all supported target triples (see)
  3. auto-generate a JS wrapper that select the correct binary
  4. publish packages to npm
  5. bump the version to the next semver version and append the dev suffix

Slang has already implemented a CLI tool to achieve (most) of these, which we can likely reuse. The PR implementing this CLI can be found here. The files of interest are in crates/infra/cli.

We want a similar CLI tool for EDR. EDR-specific commands can live as duplicate code within our repository, but it would be good to create or use a general-purpose crate wherever possible.

Definiton of Done

agostbiro commented 11 months ago

It's important to allow releasing locally to improve our agility and in case of failures in Github Actions.

Releasing from local CLI has these downsides besides the obvious upsides: