A universal Javascript client library for the Enigma Network
- Webpack 4 based.
- ES6 as a source.
- Exports in a umd format so the library works everywhere.
- ES6 test setup with Jest.
- Linting with ESLint.
ES6 source files
|
|
webpack
|
+--- babel, eslint
|
ready to use
library
in umd format
Have in mind that you have to build the library before publishing. The files under the lib
folder are the ones that should be distributed.
-
Install the following packages globally:
yarn global add ganache-cli truffle
-
Install the package dependencies
- On the parent folder, run
yarn install
to install the project dependencies.
- On the parent folder, run
-
Install the client library dependencies
- Run
yarn install
to get the client library dependencies on the current folder
- Run
-
[OPTIONAL] Development mode
- Having all the dependencies installed run
yarn dev
. This command will generate an non-minified version of the library and will run a watcher so you get the compilation on file change.
- Having all the dependencies installed run
-
Running the tests
- Open one terminal at the root of the parent folder
enigma-contract
run the following:
$ ganache-cli -p 9545 -i 4447 &
- And once Ganache-cli has started, run:
$ truffle migrate --reset
- On a separate terminal run:
yarn test
- Open one terminal at the root of the parent folder
-
Build the library
- Run
yarn build
to produce minified version of the library. It will check code quality before building (ESLint) and it will also run all tests afterwards (see prior step) and output a code coverage report.
- Run
yarn build
- produces production version of the library under thelib
folderyarn dev
- produces development version of the library and runs a watcheryarn test
- well ... it runs the tests :)yarn test:watch
- same as above but in a watch mode