From 443ea5fdf2e9c5fc47f87e10cc05d96608a5ca4b Mon Sep 17 00:00:00 2001 From: "Guilherme J. Tramontina" Date: Tue, 21 Nov 2017 17:41:25 +1100 Subject: [PATCH] build: ditch transpilation process BREAKING CHANGE: drop support for Node 5 --- .gitignore | 1 - .npmignore | 1 - .travis.yml | 6 +++++- appveyor.yml | 6 ++++-- bin/install | 23 +---------------------- package.json | 19 ++++--------------- 6 files changed, 14 insertions(+), 42 deletions(-) diff --git a/.gitignore b/.gitignore index 1683dd3..ca9febb 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ coverage .idea .opt-in .opt-out -dist diff --git a/.npmignore b/.npmignore index 9c4ba58..e2d9997 100644 --- a/.npmignore +++ b/.npmignore @@ -4,7 +4,6 @@ coverage .idea .opt-in .opt-out -lib test .editorconfig .eslintrc diff --git a/.travis.yml b/.travis.yml index e49692c..f66fe3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,11 @@ branches: notifications: email: false node_js: + - 'lts/*' + - '9' + - '8' + - '7' + - '6' - '5' - '4' before_install: @@ -21,7 +26,6 @@ before_script: script: - npm run test - npm run check-coverage - - npm run build after_success: - 'curl -Lo travis_after_all.py https://git.io/travis_after_all' - python travis_after_all.py diff --git a/appveyor.yml b/appveyor.yml index 9403550..ac89453 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,11 @@ environment: matrix: + - nodejs_version: "9" + - nodejs_version: "8" + - nodejs_version: "7" + - nodejs_version: "6" - nodejs_version: "5" - nodejs_version: "4" - - nodejs_version: "0.12" - - nodejs_version: "0.10" cache: - node_modules diff --git a/bin/install b/bin/install index 5e8873c..f830144 100755 --- a/bin/install +++ b/bin/install @@ -1,23 +1,2 @@ #!/usr/bin/env node -const exists = require('path-exists') -const exec = require('execa') - -function isBuilt() { - return exists('./dist') -} - -function build() { - return exec('npm', ['run', 'build']) -} - -function install() { - require('../dist/install')() -} - -isBuilt().then(function built(yes) { - if (yes) { - install() - } else { - build().then(install) - } -}) +require('../lib/install')() diff --git a/package.json b/package.json index 65b77d5..9854398 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "ghooks", "description": "Simple git hooks", "version": "0.0.0-semantically-released", - "main": "./dist/runner.js", + "main": "./lib/runner.js", "keywords": [ "git", "hooks", @@ -19,12 +19,10 @@ "url": "https://github.com/gtramontina/ghooks/issues" }, "scripts": { - "prebuild": "rm -rf dist && mkdir dist", - "build": "babel lib --out-dir dist && babel lib/hook.template.raw --out-file dist/hook.template.raw", "lint": "eslint bin/* lib/* test/", - "test:unit": "mocha --compilers js:babel-register", + "test:unit": "mocha", "test": "npm run lint && npm run coverage", - "coverage": "nyc --require babel-register --reporter=lcov --reporter=text mocha", + "coverage": "nyc --reporter=lcov --reporter=text mocha", "check-coverage": "nyc check-coverage --statements 100 --branches 100 --functions 100 --lines 100", "report-coverage": "cat ./coverage/lcov.info | node_modules/.bin/codecov", "validate": "npm t && npm run check-coverage", @@ -33,7 +31,6 @@ "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "dependencies": { - "execa": "0.5.0", "findup": "0.1.5", "lodash.clone": "4.5.0", "manage-path": "2.0.0", @@ -42,9 +39,6 @@ "spawn-command": "0.0.2" }, "devDependencies": { - "babel-cli": "6.18.0", - "babel-preset-es2015": "6.18.0", - "babel-register": "6.18.0", "chai": "3.5.0", "chai-string": "1.3.0", "codecov": "1.0.1", @@ -56,7 +50,7 @@ "eslint-plugin-mocha": "4.7.0", "ghooks": "*", "mocha": "3.2.0", - "mock-fs": "3.12.1", + "mock-fs": "4.4.2", "nyc": "10.0.0", "proxyquire": "1.7.10", "semantic-release": "6.3.2", @@ -65,11 +59,6 @@ "travis-after-all": "1.4.4", "validate-commit-msg": "2.8.2" }, - "babel": { - "presets": [ - "es2015" - ] - }, "nyc": { "extension": [ ".raw"