Shared JS libraries for various Mainframe projects.
🌐 browser ⚛️ electron ⚙️ node
Name | Version | Platform | Description |
---|---|---|---|
RPC clients | |||
@mainframe/rpc-base |
🌐 ⚛️ ⚙️ | Base class for RPC clients | |
@mainframe/rpc-browser |
🌐 ⚛️ | RPC client factory for browser | |
@mainframe/rpc-electron |
⚛️ | RPC client factory for Electron | |
@mainframe/rpc-http-browser |
🌐 ⚛️ | RPC client for browser over HTTP | |
@mainframe/rpc-http-node |
⚙️ | RPC client for node over HTTP | |
@mainframe/rpc-ipc |
⚙️ | RPC client for node using IPC | |
@mainframe/rpc-node |
⚙️ | RPC client factory for node | |
@mainframe/rpc-request |
🌐 ⚛️ ⚙️ | Request-based (stateless) RPC client | |
@mainframe/rpc-stream |
🌐 ⚛️ ⚙️ | Stream-based (stateful) RPC client | |
@mainframe/rpc-ws-browser |
🌐 ⚛️ | RPC client for browser using WebSockets | |
@mainframe/rpc-ws-node |
⚙️ | RPC client for node using WebSockets | |
Transports | |||
@mainframe/transport-electron |
⚛️ | Electron transport | |
@mainframe/transport-http-browser |
🌐 ⚛️ | HTTP transport for browser | |
@mainframe/transport-http-node |
⚙️ | HTTP transport for node | |
@mainframe/transport-ipc |
⚙️ | IPC transport (node only) | |
@mainframe/transport-web3 |
🌐 | Web3 transport (browser only) | |
@mainframe/transport-ws-browser |
🌐 | WebSocket transport for browser | |
@mainframe/transport-ws-node |
⚙️ | WebSocket transport for node | |
Security | |||
@mainframe/secure-file |
⚛️ ⚙️ | Cryptographic utilities for files | |
Utilities | |||
@mainframe/rpc-error |
🌐 ⚛️ ⚙️ | RPC error class and utilities | |
@mainframe/rpc-handler |
⚙️ | RPC requests handler factory and utilities | |
@mainframe/utils-crypto |
🌐 ⚛️ ⚙️ | Cryptographic primitives | |
@mainframe/utils-time |
🌐 ⚛️ ⚙️ | Time-related utilities. |
This repository uses Lerna and Yarn workspaces to manage multiple packages and their dependencies.
Code is written in TypeScript and compiled to CommonJS and ESM when targetting Node.js and browser environments, or CommonJS only when targetting Node.js only.
After pulling the repository,
- Run
yarn install
to install the dependencies - Run
yarn start
to compile the packages and run the tests
In the package you want to work on, you can run the local commands such as yarn build
and yarn test
getting applied for this package.
These scripts affect the entire project rather than individual packages:
build
: runs thebuild
script of each packagelint
: runs ESLint in all packageslint:fix
: fixes possible ESLint rulestest:types
: runs thetest:types
script of each packagetest:unit
: runs Jest in the entire projecttest
: runslint
,test:types
andtest:unit
start
: runsbuild
andtest
- Create a new folder in
packages
with a similar setup to the others (notably make sure to providebuild
andtest:types
scripts in the new package'spackage.json
) yarn add
the dependencies you need in the new package
MIT
See LICENSE file.