Skip to content

Commit

Permalink
Fix size-limit, adjust package size limit to 35kb, will want to slim …
Browse files Browse the repository at this point in the history
…this down. (#19)

* Update package.json

* Adjust ci:

* Update node engine

* Adding CI status badges

* Update module
  • Loading branch information
mirshko authored Jun 25, 2021
1 parent 2ad73bf commit 9e368a2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]
node: ['14.x', '16.x']
os: [ubuntu-latest]

steps:
- name: Checkout repo
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# weiroll.js

[![CI](https://github.com/weiroll/weiroll.js/actions/workflows/main.yml/badge.svg)](https://github.com/weiroll/weiroll.js/actions/workflows/main.yml)[![size](https://github.com/weiroll/weiroll.js/actions/workflows/size.yml/badge.svg)](https://github.com/weiroll/weiroll.js/actions/workflows/size.yml)

weiroll.js is a planner for the operation-chaining/scripting language [weiroll](https://github.com/weiroll/weiroll).

It provides an easy-to-use API for generating weiroll programs that can then be passed to any compatible implementation.

## Installation

```
npm install --save @weiroll/weiroll.js
```

## Usage

### Wrapping contracts

Weiroll programs consist of a sequence of delegatecalls to library functions in external contracts. Before you can start creating a weiroll program, you will need to create interfaces for at least one library contract you intend to use.

The easiest way to do this is by wrapping ethers.js contract instances:
Expand All @@ -23,6 +28,7 @@ const contract = weiroll.Contract.fromEthersContract(ethersContract);
You can repeat this for each library contract you wish to use. A weiroll `Contract` object can be reused across as many planner instances as you wish; there is no need to construct them again for each new program.

### Planning programs

First, instantiate a planner:

```javascript
Expand All @@ -46,5 +52,5 @@ Remember to wrap each call to a contract in `planner.add`. Attempting to pass th
Once you are done planning operations, generate the program:

```javascript
const {commands, state} = planner.plan();
const { commands, state } = planner.plan();
```
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"src"
],
"engines": {
"node": ">=10"
"node": ">=14"
},
"scripts": {
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha -r ts-node/register 'tests/**/*.ts'",
Expand All @@ -26,7 +26,8 @@
"type": "git",
"url": "git+https://github.com/weiroll/weiroll.js.git"
},
"author": "",
"author": "@weiroll",
"module": "dist/weiroll.js.esm.js",
"license": "MIT",
"bugs": {
"url": "https://github.com/weiroll/weiroll.js/issues"
Expand All @@ -41,12 +42,12 @@
},
"size-limit": [
{
"path": "dist/weiroll.cjs.production.min.js",
"limit": "10 KB"
"path": "dist/weiroll.js.cjs.production.min.js",
"limit": "35 KB"
},
{
"path": "dist/weiroll.esm.js",
"limit": "10 KB"
"path": "dist/weiroll.js.esm.js",
"limit": "35 KB"
}
],
"homepage": "https://github.com/weiroll/weiroll.js#readme",
Expand Down

0 comments on commit 9e368a2

Please sign in to comment.