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

Add Babel #15

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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: 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"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only need lib on npm?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess yes.

],
"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 <fedor@indutny.com>",
"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.