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. :)
If you wish to modify the source code, there are a few steps involved in setting up your environment.
Since the library uses a monorepo, you must install an initial required set of libraries, which can then be used to install the remaining libraries used within each package, as well as link all the packages within the repo with each other.
TODO: Add more information here.
The documents are generated using Flatworm documentation generation tool, which was written for the purpose of writing the documentation for ethers.
Style Guide (this section will have much more coming):
- Try to keep lines no longer than around 80 characters
- Avoid inline links in the source; use the
externalLinksfield in the config.js
- Prefix external links with
- Changing an anchor name must be well justified, as it will break all existing links to that section; flatworm will support symblinks in the future
- In general, I aim for xonsistency; look to similar situations throughout the documentation
To build the documentation, you should first follow the above steps to build the ethers library.
Building the docs will generate several types of output:
- A full set of HTML pages, linking across each other
- A single one-page HTML page with all pages linking to local anchors
- A full set of README.md pages organized to be browsable and linkable in GitHub
- A metadata dump for tool ingestion (still needs more work)
- (@TODO; only half done) The documentation as a LaTeX and generated PDF
However, this can be a bit of a headache when making many small changes, so to build the documentation faster, you can skip the evaluation step, which will inject the code directly.
To preview the changes locally, you can use any standard web server and run from the
/docs/ folder, or use the built-in web server.
The same caveats as normal web development apply, such flushing browser caches after changing (and re-building) the docs.