edr
edr copied to clipboard
Add CLI for building npm packages
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:
- change the version from
major.minor.patch-dev
tomajor.minor.patch
- cross-compile binaries for all supported target triples (see)
- auto-generate a JS wrapper that select the correct binary
- publish packages to
npm
- 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
- Create a CLI that supports commands 1 through 5 (listed above)
- Share as much of the common code between EDR and Slang (and potentially external crates)