diff --git a/.gitignore b/.gitignore index 28f1ba756..d25344b07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules -.DS_Store \ No newline at end of file +.DS_Store +build +npm-debug.log diff --git a/.npmignore b/.npmignore index 88746ae67..644963b96 100644 --- a/.npmignore +++ b/.npmignore @@ -2,3 +2,5 @@ .travis.yml appveyor.yml test +lib +npm-debug.log diff --git a/.travis.yml b/.travis.yml index e076df293..27e689a34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ os: osx_image: xcode7.3 language: node_js node_js: +- '0.10' +- '0.12' - '4' - '5' - '6' @@ -14,3 +16,9 @@ cache: branches: only: - master +before_install: + - nvm install stable +script: + - npm run lint + - nvm use $TRAVIS_NODE_VERSION + - npm run unit-tests diff --git a/appveyor.yml b/appveyor.yml index 0e64c7dfa..b35382558 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -4,14 +4,22 @@ branches: only: - master +environment: + matrix: + - nodejs_version: "0.10" + - nodejs_version: "0.12" + - nodejs_version: "4" + - nodejs_version: "5" + - nodejs_version: "6" + skip_tags: true install: - - ps: Install-Product node LTS + - ps: Install-Product node $env:nodejs_version - npm install npm - .\node_modules\.bin\npm install test_script: - node --version - .\node_modules\.bin\npm --version - - .\node_modules\.bin\npm test + - .\node_modules\.bin\npm run unit-tests diff --git a/cli.js b/lib/cli.js similarity index 100% rename from cli.js rename to lib/cli.js diff --git a/index.js b/lib/index.js similarity index 100% rename from index.js rename to lib/index.js diff --git a/package.json b/package.json index df5b78646..30b48bc30 100644 --- a/package.json +++ b/package.json @@ -2,12 +2,15 @@ "name": "electron-download", "version": "2.2.0", "description": "download electron prebuilt binary zips from github releases", - "main": "index.js", + "main": "build/index.js", "bin": { - "electron-download": "cli.js" + "electron-download": "build/cli.js" }, "scripts": { - "test": "tape test/*.js && eslint ." + "prepublish": "babel --out-dir build lib", + "lint": "eslint lib test", + "unit-tests": "tape -r babel-register test/*.js", + "test": "npm run unit-tests && npm run lint" }, "repository": { "type": "git", @@ -25,12 +28,15 @@ "home-path": "^1.0.1", "minimist": "^1.2.0", "nugget": "^2.0.0", - "path-exists": "^3.0.0", + "path-exists": "^2.1.0", "rc": "^1.1.2", "semver": "^5.3.0", - "sumchecker": "^1.1.0" + "sumchecker": "^1.2.0" }, "devDependencies": { + "babel-cli": "^6.14.0", + "babel-preset-es2015": "^6.14.0", + "babel-register": "^6.14.0", "eslint": "^3.2.0", "eslint-config-standard": "^5.2.0", "eslint-plugin-promise": "^2.0.0", @@ -48,5 +54,10 @@ ] } }, + "babel": { + "presets": [ + "es2015" + ] + }, "keywords": [] } diff --git a/test/test.js b/test/test.js index ccaf6f397..1cd7979e8 100644 --- a/test/test.js +++ b/test/test.js @@ -1,6 +1,6 @@ 'use strict' -const download = require('..') +const download = require('../lib/index') const test = require('tape') const verifyDownloadedZip = require('./helpers').verifyDownloadedZip diff --git a/test/test_404.js b/test/test_404.js index 28e1dba3a..0f2a43285 100644 --- a/test/test_404.js +++ b/test/test_404.js @@ -1,6 +1,6 @@ 'use strict' -const download = require('..') +const download = require('../lib/index') const fs = require('fs') const test = require('tape') diff --git a/test/test_symbols.js b/test/test_symbols.js index 9f43770ac..f5919d9c8 100644 --- a/test/test_symbols.js +++ b/test/test_symbols.js @@ -1,6 +1,6 @@ 'use strict' -const download = require('..') +const download = require('../lib/index') const test = require('tape') const verifyDownloadedZip = require('./helpers').verifyDownloadedZip diff --git a/test/test_with_checksum.js b/test/test_with_checksum.js index 9c5a042d8..84ceaa170 100644 --- a/test/test_with_checksum.js +++ b/test/test_with_checksum.js @@ -1,6 +1,6 @@ 'use strict' -const download = require('..') +const download = require('../lib/index') const test = require('tape') const verifyDownloadedZip = require('./helpers').verifyDownloadedZip