setup lint/build
ADD
. npmignore
+node_modules
\ No newline at end of file

ADD
.babelrc
+{
+ "presets": ["@babel/preset-env"],
+ "plugins": ["add-module-exports"]
+}

ADD
.eslintrc.js
+module.exports = {
+ parser: "babel-eslint",
+ extends: "eslint:recommended",
+ rules: {
+ "space-before-function-paren": ["error", "never"],
+ semi: ["error", "never"],
+ "no-underscore-dangle": 0
+ }
+}

ADD
.gitignore
+node_modules
+lib
+.DS_Store
+*.log
\ No newline at end of file

ADD
.nvmrc
+v6.10
\ No newline at end of file

ADD
.travis.yml
+dist: trusty
+sudo: required
+group: beta
+language: node_js
+node_js:
+ - "8"
+cache:
+ directories:
+ - node_modules
+matrix:
+ fast_finish: true
+script:
+ - npm run lint
\ No newline at end of file

MODIFY
README.md
README.md
# Matic SDK
+[![Build Status](https://travis-ci.org/maticnetwork/matic.js.svg?branch=master)](https://travis-ci.org/maticnetwork/matic.js)
+
This repository contains the `matic.js` client interaction libraries. `matic.js` makes it easy for developers who may not be deeply familiar with smart contract development to interact with the various components of Matic Network.
This library will help developers to move assets from Ethereum chain to Matic chain, and withdraw from Matic to Ethereum using fraud proofs.

ADD
package.json
+{
+ "name": "matic.js",
+ "version": "0.0.1",
+ "description": "Javascript developer library for interacting with Matic Network",
+ "main": "index.js",
+ "directories": {
+ "lib": "./lib"
+ },
+ "scripts": {
+ "clean": "rm -rf lib",
+ "build": "npm run lint && npm run clean && babel src/ --out-dir lib/ && npm run pack",
+ "lint": "eslint src/**/*.js test/**/*.spec.js",
+ "test": "mocha --require @babel/register --colors ./test/**/*.spec.js",
+ "test:watch": "mocha --require @babel/register --colors -w ./test/**/*.spec.js",
+ "prepublish": "npm run build",
+ "pack": "webpack && webpack --env build"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/maticnetwork/matic.js.git"
+ },
+ "keywords": [
+ "ethereum",
+ "web3",
+ "ethers",
+ "matic"
+ ],
+ "author": "Jaynti Kanani <jd@matic.network>",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/maticnetwork/matic.js/issues"
+ },
+ "homepage": "https://github.com/maticnetwork/matic.js#readme",
+ "dependencies": {
+ "@babel/polyfill": "7.0.0-beta.54"
+ },
+ "devDependencies": {
+ "@babel/cli": "7.0.0-beta.54",
+ "@babel/core": "7.0.0-beta.54",
+ "@babel/preset-env": "7.0.0-beta.54",
+ "@babel/register": "^7.0.0-beta.56",
+ "babel-eslint": "7.2.3",
+ "babel-loader": "^8.0.0-beta.0",
+ "babel-plugin-add-module-exports": "^0.2.1",
+ "chai": "3.5.0",
+ "eslint": "3.19.0",
+ "eslint-config-airbnb": "^15.1.0",
+ "eslint-config-standard": "^11.0.0-beta.0",
+ "eslint-loader": "2.0.0",
+ "eslint-plugin-import": "^2.8.0",
+ "eslint-plugin-jsx-a11y": "^5.0.1",
+ "eslint-plugin-node": "^6.0.0",
+ "eslint-plugin-promise": "^3.6.0",
+ "eslint-plugin-react": "^7.2.0",
+ "eslint-plugin-standard": "^3.0.1",
+ "mocha": "3.3.0",
+ "webpack": "4.1.0",
+ "webpack-cli": "2.0.10",
+ "yargs": "^8.0.2"
+ }
+}

ADD
src/index.js
+export default class Matic {
+ constructor() {}
+}

ADD
webpack.config.js
+/* global __dirname, require, module */
+const path = require("path");
+const env = require("yargs").argv.env; // use --env with webpack 2
+const packageJSON = require("./package.json");
+
+const libraryName = packageJSON.name;
+
+let mode = "development";
+let outputFile;
+
+if (env === "build") {
+ mode = "production";
+ outputFile = `${libraryName}.min.js`;
+} else {
+ outputFile = `${libraryName}.js`;
+}
+
+const config = {
+ mode,
+ entry: `${__dirname}/src/index.js`,
+ devtool: "source-map",
+ output: {
+ path: `${__dirname}/lib`,
+ filename: outputFile,
+ library: libraryName,
+ libraryTarget: "umd",
+ umdNamedDefine: true
+ },
+ module: {
+ rules: [
+ {
+ test: /(\.js)$/,
+ loader: "babel-loader",
+ exclude: /(node_modules|bower_components)/
+ },
+ {
+ test: /(\.js)$/,
+ loader: "eslint-loader",
+ exclude: /node_modules/
+ }
+ ]
+ },
+ resolve: {
+ modules: [path.resolve("./node_modules"), path.resolve("./src")],
+ extensions: [".json", ".js"]
+ }
+};
+
+module.exports = config;

setup lint/build