Skip to content

Commit

Permalink
src: babel
Browse files Browse the repository at this point in the history
  • Loading branch information
hzoo authored and indutny committed Mar 17, 2017
1 parent 7885e7f commit 1ad257b
Show file tree
Hide file tree
Showing 18 changed files with 41 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
npm-debug.log
out/
coverage/
lib/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
global:
- NINJA=../../../ninja/ninja
script:
npm install && npm test
npm install && npm run build && npm test
node_js:
- 4
- 5
Expand Down
18 changes: 12 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
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
Expand All @@ -12,14 +12,20 @@ SRC_FILES+= test/**/**/*.js
BINDIR=./node_modules/.bin
COVERAGEDIR=./coverage

build:
@$(BINDIR)/babel src -d lib

build-watch:
@$(BINDIR)/babel -w src -d lib

lint:
@$(BINDIR)/eslint $(SRC_FILES)

format:
@$(BINDIR)/eslint --fix $(SRC_FILES)

check:
@$(BINDIR)/mocha --reporter=spec test/*-test.js
@$(BINDIR)/mocha --reporter=spec test/*-test.js --compilers js:babel-register

coverage:
@-rm -rf $(COVERAGEDIR)
Expand All @@ -29,4 +35,4 @@ coverage:

test: check

.PHONY: lint format check test coverage
.PHONY: build build-watch lint format check test coverage
27 changes: 24 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@
"gyp": "bin/gyp"
},
"main": "lib/gyp.js",
"files": [
"lib"
],
"scripts": {
"build": "make build",
"watch": "make build-watch",
"lint": "make lint",
"format": "make format",
"test": "make check && make lint",
"coverage": "make coverage"
"coverage": "make coverage",
"prepublish": "npm run build"
},
"keywords": [],
"author": "Fedor Indutny <[email protected]>",
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-preset-env": "^1.2.2",
"babel-register": "^6.9.0",
"eslint": "^2.12.0",
"mocha": "^2.5.3",
"ninja.js": "^1.1.0",
Expand All @@ -25,9 +34,21 @@
"ninja.js": "^1.1.0"
},
"dependencies": {
"istanbul": "^0.4.5",
"mkdirp": "^0.5.1",
"parser-base": "^1.0.0",
"yargs-parser": "^2.4.0",
"istanbul": "^0.4.5"
"yargs-parser": "^2.4.0"
},
"babel": {
"presets": [
[
"env",
{
"targets": {
"node": 4
}
}
]
]
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ NinjaMain.prototype.rulesAndTargets = function rulesAndTargets() {
main.sectionEnd('targets');
};

NinjaMain.prototype.defaults = function defaults() {
NinjaMain.prototype.defaults = function defaults2() {
const main = this.n;
const ninjas = this.ninjas;

Expand Down Expand Up @@ -742,7 +742,7 @@ NinjaMain.prototype.defaults = function defaults() {
main.finalize();
};

NinjaMain.prototype.build = function build() {
NinjaMain.prototype.build = function build2() {
try {
// Check that ninja is present
// NOTE: Windows will attempt to execute `ninja.js`, if won't specify
Expand Down Expand Up @@ -772,7 +772,7 @@ NinjaMain.prototype.build = function build() {
execSync('ninja -C ' + this.configDir, { stdio: 'inherit' });
};

exports.generateOutput = function generateOutput(targetList, targetDicts, data,
exports.generateOutput = function generateOutput2(targetList, targetDicts, data,
params) {
if (targetList.length === 0)
throw new Error('No targets to build!');
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.

0 comments on commit 1ad257b

Please sign in to comment.