Skip to content

Commit

Permalink
Add Babel
Browse files Browse the repository at this point in the history
- Add node 0.10, 0.12, 4 to travis
- add `make build` and `npm run build`
- rename src files to `src` instead of `lib`
  • Loading branch information
hzoo committed Jun 19, 2016
1 parent a8af695 commit b4c36bf
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
npm-debug.log
out/
lib/
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ script:
npm install && npm test
node_js:
- 6
- 4
- 0.12
- 0.10
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
PATH := node_modules/.bin:$(PATH)

SRC_FILES=
SRC_FILES+= lib/*.js
SRC_FILES+= lib/**/*.js
SRC_FILES+= lib/**/**/*.js
SRC_FILES+= lib/**/**/**/*.js
SRC_FILES+= src/*.js
SRC_FILES+= src/**/*.js
SRC_FILES+= src/**/**/*.js
SRC_FILES+= src/**/**/**/*.js

SRC_FILES+= bin/gyp
SRC_FILES+= test/*.js
SRC_FILES+= test/**/*.js
SRC_FILES+= test/**/**/*.js

build:
babel src -d lib

lint:
eslint $(SRC_FILES)

format:
eslint --fix $(SRC_FILES)

.PHONY: lint format
.PHONY: build lint format
4 changes: 2 additions & 2 deletions bin/gyp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
const gyp = require('../');
var gyp = require('../');

// TEMPORARY MEASURE
process.stdout._handle.setBlocking(true);
const code = gyp.main(process.argv.slice(1));
var code = gyp.main(process.argv.slice(1));
process.exit(code);
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,22 @@
"gyp": "bin/gyp"
},
"main": "lib/gyp.js",
"files": [
"lib"
],
"scripts": {
"build": "make build",
"lint": "make lint",
"format": "make format",
"test": "mocha --reporter=spec test/*-test.js && npm run lint"
"test": "mocha --reporter=spec test/*-test.js --compilers js:babel-register && npm run lint"
},
"keywords": [],
"author": "Fedor Indutny <fedor@indutny.com>",
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-preset-es2015": "^6.9.0",
"babel-register": "^6.9.0",
"eslint": "^2.12.0",
"mocha": "^2.5.3",
"rimraf": "^2.5.2"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b4c36bf

Please sign in to comment.