0.0.7 • Published 2 years ago

solana-toolkit v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Solana Toolkit

Solana Toolkit aims to provide Solana developers with some utilities

Usage

  • Inspector : inspect encoded message to Solana message / transaction

    import { inspectMessage } from `solana-toolkit`
  • prettyLog : beatify program logs like Solscan

    import { prettyProgramLogs } from `solana-toolkit`

Contribution

Getting Started

# Install dependencies
yarn install

# Now you can run various yarn commands:
yarn cli
yarn lint
yarn test
yarn build
...
  • Take a look at all the scripts in package.json
  • For publishing to npm, use yarn publish (or npm publish)

esbuild

esbuild is an extremely fast bundler that supports a large part of the TypeScript syntax. This project uses it to bundle for browsers (and Node.js if you want).

# Build for browsers
yarn esbuild-browser:dev
yarn esbuild-browser:watch

# Build the cli for node
yarn esbuild-node:dev
yarn esbuild-node:watch

You can generate a full clean build with yarn build-all (which uses both tsc and esbuild).

  • package.json includes scripts for various esbuild commands: see here
  • esbuild has a --global-name=xyz flag, to store the exports from the entry point in a global variable. See also the esbuild "Global name" docs.
  • Read more about the esbuild setup here.
  • esbuild for the browser uses the IIFE (immediately-invoked function expression) format, which executes the bundled code on load (see also https://github.com/evanw/esbuild/issues/29)

Tests with Jest

You can write Jest tests like this:

Run the tests with yarn test, no separate compile step is necessary.

Documentation, published with CI

You can auto-generate API documentation from the TyoeScript source files using TypeDoc. The generated documentation can be published to GitHub / GitLab pages through the CI.

Generate the documentation, using src/main.ts as entrypoint (configured in package.json):

yarn docs

The resulting HTML is saved in docs/.

You can publish the documentation through CI:

Feedback

Reach out with feedback and ideas:

0.0.7

2 years ago

0.0.6-beta

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4-alpha-1

2 years ago

0.0.4-alpha

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago