Skip to content

SiennaNetwork/siennajs

Repository files navigation

SiennaJS

Official API client for Sienna Network.

Install

SiennaJS does not depend on NPM. The official way to install latest SiennaJS is from the tarballs published on GitHub, e.g:

See the SiennaJS releases page for a list of available versions.

npm i --save https://github.com/SiennaNetwork/siennajs/releases/download/X.Y.Z/siennajs-X.Y.Z.tgz
# now you can `import "siennajs"` using your regular toolchain

See the API documentation for the last released version for usage details.

This way, SiennaJS will appear in your node_modules as any other NPM package, and will be available in your usual TS/ESM/CJS context.

Developing

PNPM is recommended

  • npm install -g pnpm if PNPM is not installed.
  • Subsequent examples are given with PNPM.

Setting up

  • pnpm i

Checking types

  • pnpm check to see if the types all check out

Generating documentation

  • pnpm typedoc to generate typedoc in ./docs

The pre-commit linter

  • With great reluctance I introduce husky and lint-staged.
  • Adding prettier or other linters that rewrite code is discouraged.
  • Loose ends from multiple simultaneous refactors can add up to 500 type errors real quick though.
    • 500 type errors means you can't publish until you fix them, because there's no point releasing invalid typings, incomplete builds, etc. (TS is annoying enough as it is.)
    • It also means that if your environment doesn't support ignoring TypeScript errors at some stage of the workflow, you're stuck, sometimes unable to even run your code, until they get fixed.
    • This wasted an absolutely awful lot of my time as I fixed the 500 type errors and then realized that the code was still broken in the exat same way as before.
    • So, as of now, every commit should have valid types.

Using SiennaJS as a Git submodule

  • In a downstream project: git submodule add https://github.com/SiennaNetwork/siennajs

The CI

  • FIXME TODO write docs

Upgrading Fadroma/Toolbox dependencies:

  • FIXME TODO write docs