diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 000000000..b020e4e64 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,2 @@ +tasks: + - init: yarn install && yarn run build diff --git a/README.md b/README.md index 8617d5823..9177d0d5a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/EOSIO/eosjs) + # eosjs ![npm](https://img.shields.io/npm/dw/eosjs.svg) Javascript API for integration with EOSIO-based blockchains using [EOSIO RPC API](https://developers.eos.io/eosio-nodeos/reference). @@ -10,7 +12,7 @@ Documentation can be found [here](https://eosio.github.io/eosjs) The official distribution package can be found at [npm](https://www.npmjs.com/package/eosjs). -### NodeJS Dependency +### Add dependency to your project `yarn add eosjs` @@ -22,7 +24,7 @@ Clone this repository locally then run `yarn build-web`. The browser distributi ### ES Modules -Importing using ES6 module syntax in the browser is supported if you have a transpiler, such as Babel. +Importing using ESM syntax is supported using TypeScript, [webpack](https://webpack.js.org/api/module-methods), or [Node.js with `--experimental-modules` flag](https://nodejs.org/api/esm.html) ```js import { Api, JsonRpc, RpcError } from 'eosjs'; import { JsSignatureProvider } from 'eosjs/dist/eosjs-jssig'; // development only @@ -30,7 +32,7 @@ import { JsSignatureProvider } from 'eosjs/dist/eosjs-jssig'; // devel ### CommonJS -Importing using commonJS syntax is supported by NodeJS out of the box. +Importing using commonJS syntax is supported by Node.js out of the box. ```js const { Api, JsonRpc, RpcError } = require('eosjs'); const { JsSignatureProvider } = require('eosjs/dist/eosjs-jssig'); // development only @@ -54,7 +56,7 @@ const signatureProvider = new JsSignatureProvider([defaultPrivateKey]); ### JSON-RPC -Open a connection to JSON-RPC, include `fetch` when on NodeJS. +Open a connection to JSON-RPC, include `fetch` when on Node.js. ```js const rpc = new JsonRpc('http://127.0.0.1:8888', { fetch }); ``` diff --git a/package.json b/package.json index 438db7756..60708892e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eosjs", - "version": "20.0.0", + "version": "20.0.2", "description": "Talk to eos API", "main": "dist/index.js", "scripts": { @@ -12,7 +12,7 @@ "test": "jest src/tests/*eosjs*", "test-node": "jest src/tests/*node*", "test-all": "yarn test && yarn test-node && yarn cypress", - "build": "tsc -p ./tsconfig.json && cp src/ripemd.es5.js dist/ripemd.js", + "build": "tsc -p ./tsconfig.json && node scripts/copy-ripe-md.js", "build-web": "webpack --config webpack.prod.js && webpack --config webpack.debug.js", "build-production": "yarn build && yarn build-web && yarn test-all", "clean": "rm -rf dist", @@ -29,7 +29,7 @@ }, "dependencies": { "babel-runtime": "6.26.0", - "eosjs-ecc": "4.0.4", + "eosjs-ecc": "4.0.7", "text-encoding": "0.7.0" }, "devDependencies": { diff --git a/scripts/copy-ripe-md.js b/scripts/copy-ripe-md.js new file mode 100644 index 000000000..c047379c7 --- /dev/null +++ b/scripts/copy-ripe-md.js @@ -0,0 +1,8 @@ +var fs = require('fs'); +var path = require('path'); +var root = __dirname.replace('scripts', ''); + +if(!fs.existsSync(path.join(root + 'dist'))) + fs.mkdirSync(path.join(root + 'dist')); + +fs.copyFileSync(path.join(root + 'src/ripemd.es5.js'), path.join(root + 'dist/ripemd.js')); \ No newline at end of file