diff --git a/.babelrc b/.babelrc new file mode 100644 index 00000000..65f62059 --- /dev/null +++ b/.babelrc @@ -0,0 +1,7 @@ +{ + "presets": [ + [ + "env" + ] + ] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 61126031..510ac8af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,69 @@ +### App ### + +.cachedb + + +# Created by https://www.gitignore.io/api/osx,node + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + + +### Node ### +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directory +# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git node_modules +package-lock.json + +# Build folder +dist -npm-debug.log diff --git a/.travis.yml b/.travis.yml index 435ed79e..bb8143e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: node_js node_js: + - "4" - "6" - "8" env: diff --git a/package.json b/package.json index c1fcea31..956d6197 100644 --- a/package.json +++ b/package.json @@ -2,15 +2,19 @@ "name": "ethereumjs-util", "version": "5.1.3", "description": "a collection of utility functions for Ethereum", - "main": "index.js", + "main": "dist/index.js", + "files": [ + "dist" + ], "scripts": { - "coverage": "istanbul cover _mocha", + "coverage": "npm run build:dist && istanbul cover _mocha", "coveralls": "npm run coverage && coveralls ./docs/index.md" }, "browserify": { @@ -120,6 +124,7 @@ "secp256k1": "^3.0.1" }, "devDependencies": { + "babel-cli": "^6.26.0", "babel-preset-env": "^1.6.1", "babelify": "^8.0.0", "browserify": "^14.0.0", @@ -141,6 +146,9 @@ "globals": [ "describe", "it" + ], + "ignore": [ + "dist/**" ] } } diff --git a/test/defineFields.js b/test/defineFields.js index 1cf2fabf..9e7ef0c3 100644 --- a/test/defineFields.js +++ b/test/defineFields.js @@ -1,5 +1,5 @@ var assert = require('assert') -var ethUtil = require('../index.js') +var ethUtil = require('../dist/index.js') describe('define', function () { const fields = [{ diff --git a/test/index.js b/test/index.js index 966a6f36..1b22a886 100644 --- a/test/index.js +++ b/test/index.js @@ -1,5 +1,5 @@ var assert = require('assert') -var ethUtils = require('../index.js') +var ethUtils = require('../dist/index.js') var BN = require('bn.js') describe('zeros function', function () {