From 9e368a2823c82c9269557bf418c03d6d4acfae8f Mon Sep 17 00:00:00 2001 From: Jeff Reiner Date: Fri, 25 Jun 2021 12:42:35 +0200 Subject: [PATCH] Fix size-limit, adjust package size limit to 35kb, will want to slim this down. (#19) * Update package.json * Adjust ci: * Update node engine * Adding CI status badges * Update module --- .github/workflows/main.yml | 4 ++-- README.md | 8 +++++++- package.json | 13 +++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 22afb98..1910b7b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/README.md b/README.md index d1e9181..7d4a983 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,13 @@ # 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 ``` @@ -11,6 +15,7 @@ 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: @@ -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 @@ -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(); ``` diff --git a/package.json b/package.json index 399bbb1..0df15ec 100644 --- a/package.json +++ b/package.json @@ -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'", @@ -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" @@ -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",