ethers.js/docs.wrm/contributing.wrm
2020-06-12 03:38:55 -04:00

75 lines
2.3 KiB
Plaintext

_section: Contributing and Hacking
The ethers.js library is something that I've written out of necessity,
and has grown somewhat organically over time.
Many things are the way they are for good (at the time, at least) reasons,
but I always welcome criticism, and am completely willing to have my mind
changed on things.
So, pull requests are always welcome, but please keep a few points in mind:
- Backwards-compatibility-breaking changes will not be accepted; they may be
considered for the next major version
- Security is important; adding dependencies require fairly convincing
arguments as to why
- The library aims to be lean, so keep an eye on the dist/ethers.min.js
file size before and after your changes
- Add test cases for both expected and unexpected input
- Any new features need to be supported by me (future issues, documentation,
testing, migration), so anything that is overly complicated or specific
may not be accepted
In general, **please start an issue //before// beginning a pull request**, so we can
have a public discussion and figure out the best way to address to problem/feature.
**:)**
_subsection: Building
If you wish to modify the source code, there are a few steps involved in setting up
your environment.
_code: Preparing the Package @lang<shell>
# Clone the REPO
/home/ricmoo> git clone git@github.com:ethers-io/ethers.js.git
/home/ricmoo> cd ethers.js
# Install the base dependencies
/home/ricmoo/ethers.js> npm install
# Install each module's dependencies and link the libraries
# internally, so they reference each other
/home/ricmoo/ethers.js> npm run bootstrap
_code: Watching and Building @lang<shell>
# Begin watching the files and re-building whenever they change
/home/ricmoo/ethers.js> npm run auto-build
# Sometimes the issue only affects the ESM modules
/home/ricmoo/ethers.js> npm run auto-build-esm
# Or if you only need to run a single build
/home/ricmoo/ethers.js> npm run _build-cjs
/home/ricmoo/ethers.js> npm run _build-esm
_code: Testing @lang<shell>
# Rebuilds all files and bundles testcases up for testing
/home/ricmoo/ethers.js> npm test
# Often you don't need the full CI experience
/home/ricmoo/ethers.js> npm run _test-node
_code: Preparing the Distribution @lang<shell>
/home/ricmoo/ethers.js> npm run update-version