2.0.7 • Published 3 months ago

@readyio/ready-lib v2.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

Ready Lib

Installing Ready Lib for a project

  • Add ready lib dependencies via gitlab: Modify package.json as

    "dependencies": {
        "ready-lib": "git+https://git.cystack.org/ready/ready-lib.git"
    }
  • Install with npm

    npm install

    or with yarn

    yarn
  • Reintall library when there's new version

    npm install ready-lib -f

Usage

  • TODO: update docs to docs folder with jsdoc

Get started for developing Ready Lib

Prerequisite:

  1. Node.js
  2. Yarn/Npm
  3. pre-commit

Steps

  1. Download dependencies with yarn or npm

    yarn
    • Note that, as a library's perspective, package.json is the single source of truth and developers should not rely on package-lock.json or yarn.lock to re-create the same environment. A good practice is to delete those lock files & node_modules and then reinstall dependencies to test if package.json is good to go.
  2. Installing pre-commit hooks (for god's sake, we should avoid commiting & pushing those stealthy secrets asap)

    pre-commit install

Quick Nodes (todo: categorize these notes)

  • Use *.spec.ts for quickly testing our modules. We will add more cases in the future. The code base now is not in good coverage yet.
  • Put secrets concentrating in a place for easier ignoring pushing them.
  • For mock data that we're afraid of being catched by gitleaks, use .gitleaksignore

TODO:

Features (most of these features are implemented already by chauntm and thangnx, but we need to re-add them again but this time is slowly with carefully testing)

  1. approve, check allowance, swap, wrap/unwrap
  2. get usd prices (calling directly from lib, instead of calling to Ready api)
  3. support basic functions for tron
  4. support basic functions for solana
  5. pack library & publish it to npm / yarn registry

Development Helpers

  1. add more tests (both happy & unhappy cases)
  2. generate doc folders and host them
  3. auto install pre-commit hooks between team members
  4. config example folder for a greater usability
  5. add dependency bot for real-time alert

CI/CD

  1. run all unit tests before merging
  2. run examples as a test pipeline