Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: ditch transpilation #218

Merged
merged 4 commits into from
Nov 25, 2017
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ coverage
.idea
.opt-in
.opt-out
dist
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ coverage
.idea
.opt-in
.opt-out
lib
test
.editorconfig
.eslintrc
Expand Down
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ branches:
notifications:
email: false
node_js:
- 'lts/*'
- '9'
- '8'
- '7'
- '6'
- '5'
- '4'
before_install:
Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 1 addition & 22 deletions bin/install
Original file line number Diff line number Diff line change
@@ -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')()
3 changes: 2 additions & 1 deletion lib/hook.template.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const fs = require('fs')
const {resolve, join} = require('path')
const resolve = require('path').resolve
const join = require('path').join

exports.generatedMessage = 'Generated by ghooks. Do not edit this file.'

Expand Down
3 changes: 2 additions & 1 deletion lib/runner.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const {resolve, basename} = require('path')
const resolve = require('path').resolve
const basename = require('path').basename
const fs = require('fs')
const clone = require('lodash.clone')
const managePath = require('manage-path')
Expand Down
21 changes: 6 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -42,21 +39,20 @@
"spawn-command": "0.0.2"
},
"devDependencies": {
"babel-cli": "6.18.0",
"babel-preset-es2015": "6.18.0",
"babel-register": "6.18.0",
"babel-eslint": "8.0.2",
"chai": "3.5.0",
"chai-string": "1.3.0",
"codecov": "1.0.1",
"commitizen": "2.9.2",
"cz-conventional-changelog": "1.2.0",
"eslint": "3.12.2",
"eslint-config-kentcdodds": "11.1.0",
"eslint-plugin-babel": "4.1.2",
"eslint-plugin-import": "2.2.0",
"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",
Expand All @@ -65,11 +61,6 @@
"travis-after-all": "1.4.4",
"validate-commit-msg": "2.8.2"
},
"babel": {
"presets": [
"es2015"
]
},
"nyc": {
"extension": [
".raw"
Expand Down