Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Re-add husky as dev dependency and require Node 6.x for building
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <ys@uber.com>
  • Loading branch information
Yuri Shkuro committed Feb 26, 2018
1 parent 15b92ab commit f925ad7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required
language: node_js

node_js:
- '4'
- '6'

cache:
directories:
Expand Down Expand Up @@ -43,17 +43,19 @@ before_install:
- if [ "$CROSSDOCK" = "1" ]; then make install_docker_ci ; fi
# Install the Node version to test against
- nvm install $TEST_NODE_VERSION
# Switch back to build-time Node version
- nvm use $TRAVIS_NODE_VERSION

before_script:
- make build-node
- nvm use $TEST_NODE_VERSION
- node --version
- rm -rf ./node_modules package-lock.json
- grep -v husky package.json > package.json-no-jusky
- mv package.json-no-jusky package.json
- npm install --no-optional
- if nvm ls-remote --lts | grep "$(nvm current)"; then echo "running on a LTS node version, linting"; npm run lint; else echo "running on a non-LTS node version, skipping linting"; fi


script:
- if [ "$CROSSDOCK" != "1" ]; then make test-without-build; fi
- if [ "$COVER" = "1" ]; then npm run coveralls; fi
Expand Down
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
-include crossdock/rules.mk

NODE_VER=$(shell node -v)
ifeq ($(patsubst v6.%,v6,$(NODE_VER)), v6)
NODE_6=true
else
NODE_6=false
endif

.PHONY: publish
publish: build-node
npm version $(shell ./scripts/version_prompt.sh)
Expand All @@ -17,8 +24,13 @@ test-without-build:
npm run test-all
npm run check-license

.PHONY: check-node-6
check-node-6:
@$(NODE_6) || echo Build requires Node 6.x
@$(NODE_6) && echo Building using Node 6.x

.PHONY: build-node
build-node: node_modules
build-node: check-node-6 node_modules
rm -rf ./dist/
node_modules/.bin/babel --presets env --plugins transform-class-properties --source-maps -d dist/src/ src/
node_modules/.bin/babel --presets env --plugins transform-class-properties --source-maps -d dist/test/ test/
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"express": "^4.14.0",
"flow-bin": "^0.30.0",
"gulp-sourcemaps": "1.7.x",
"husky": "^0.14.3",
"lint-staged": "^6.0.0",
"lodash": "^4.15.0",
"minimist": "1.2.0",
Expand Down

0 comments on commit f925ad7

Please sign in to comment.