augustdigital
v0.0.1-alpha.0
Published
August Digital JS SDK Monorepo
Readme
August Digital JS/TS Monorepo
This monorepo is used to maintain all shared pieces of the August Digital JS stack used across various repositories including the web app and telegram bot.
Table of Contents
Available Packages
@augustdigital/abis: August-related contract ABIs@augustdigital/pools: includes read and write functions to interact with August Lending Pools@augustdigital/sdk: aggregates and exports all subpackages to create one big SDK to be imported@augustdigital/types: contains all relevant August Digital interfaces used throughout@augustdigital/utils: includes all constants and helper functions
Getting Started
Installation
To get started, first run pnpm install from the root directory, then pnpm build to compile the TS in all subpackages from the root directory.
Monorepo Development
When performing any changes, packages must be compiled to JS with:
pnpm build # compiles all subpackages to jsor
pnpm build:<PACKAGE_NAME> # compiles only that one package to jsTo link subpackages to each other, you can run:
pnpm add <PACKAGE_TO_ADD> --filter <PACKAGE_TO_ADD_TO> --workspaceClient Development
When working on both this monorepo together with a client like a react app, we recommend linking the monorepo to the client.
In the monorepo subpackage directory (like
js-sdk/packages/pools), runpnpm link --globalIn the client repo root directory, run
pnpm link --global @augustdigital/<SUBPACAKGE_NAME>(i.e.pnpm link --global @augustdigital/pools)
Now, any changes done in the monorepo will be reflected in the client after building the changed files with pnpm build from the monorepo root directory.
Testing
- Run a local blockchain node, specifically on Arbitrum unless other environment variables are used (see what env vars can be passed by looking in the
/packages/<SUBPACKAGE>/testsfiles)
anvil --fork-url https://arbitrum-mainnet.infura.io/v3/<INFURA_API_KEY>- Run the testing script against the local blockchain node that will test any subpackage containing jest unit tests
pnpm testContributions
When you're happy with changes locally (using pnpm link if necessary), you can create a pull request with a Changeset to main which will then auto-publish to NPM. See below how publishing to NPM works.
Publishing to NPM
When wanting to publish a new version to NPM, all that is required is a changeset which you can generate with:
pnpm changesetThen create a PR to main. After the appropriate status checks are run and the PR is merged to main, changeset-bot will create another PR to main that, when merged, will automatically bump the version and publish to August Digital's npm organization.
Note: if there is no new changeset file found, a PR will not be created by the bot and nothing will be published to NPM
