Run babel before publishing

This commit is contained in:
Rico Sta. Cruz
2016-02-02 01:37:33 +08:00
parent 55e2498133
commit 177210cbc8
3 changed files with 20 additions and 7 deletions

View File

@@ -1,14 +1,15 @@
language: node_js
node_js:
- '4'
- '0.10'
- '4.2.6'
cache:
directories:
- node_modules
sudo: false
script:
- npm test
- npm run test:babel
- rm -rf .tmp
- ./node_modules/.bin/docpress build
- if [ "$(node -v)" = "v4.2.6" ]; then ./node_modules/.bin/docpress build; fi
after_success:
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then ./node_modules/.bin/git-update-ghpages -e; fi
env:

View File

@@ -15,12 +15,14 @@
"bin"
],
"dependencies": {
"babel-cli": "6.4.5",
"babel-preset-es2015": "6.3.13",
"bluebird": "3.2.1",
"byline": "4.2.1",
"chalk": "1.1.1",
"commondir": "1.0.1",
"debug": "2.2.0",
"got": "6.1.1",
"got": "5.4.1",
"gunzip-maybe": "1.3.1",
"meow": "3.7.0",
"mkdirp": "0.5.1",
@@ -41,11 +43,13 @@
"throat": "2.0.2"
},
"devDependencies": {
"babel-cli": "6.4.5",
"docpress": "0.6.10",
"eslint": "1.10.3",
"eslint-config-standard": "4.4.0",
"eslint-plugin-standard": "1.3.1",
"git-update-ghpages": "1.3.0",
"in-publish": "2.0.0",
"nixt": "0.5.0",
"npm": "3.6.0",
"sepia": "2.0.1",
@@ -69,7 +73,15 @@
"url": "git+https://github.com/rstacruz/pnpm.git"
},
"scripts": {
"lol": "which node-gyp",
"test": "node test | tap-spec"
"build": "if [ ! -d lib~ ]; then mv lib lib~; babel -D lib~ -d lib; fi",
"test": "node test | tap-spec",
"test:babel": "babel-node test | tap-spec",
"prepublish": "if in-publish; then npm run build; fi",
"postpublish": "rm -rf lib; mv lib~ lib"
},
"babel": {
"presets": [
"es2015"
]
}
}

View File

@@ -21,7 +21,7 @@ test('small with dependencies (rimraf)', function (t) {
t.ok(stat.isSymbolicLink(), '.bin/rimraf symlink is available')
stat = fs.statSync(join(process.cwd(), 'node_modules', 'rimraf', 'bin.js'))
t.equal(stat.mode, 0o100755, 'rimraf is executable')
t.equal(stat.mode, parseInt('100755', 8), 'rimraf is executable')
t.ok(stat.isFile(), '.bin/rimraf refers to a file')
t.end()