Skip to content

Commit e4e7ddd

Browse files
committed
Build with Babel 6. Allow graphql-js 0.5.0 through ^0.6.0 as a peer dependency. Closes #87.
1 parent b8c362b commit e4e7ddd

File tree

4 files changed

+30
-25
lines changed

4 files changed

+30
-25
lines changed

.babelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"plugins": [
3+
"transform-flow-strip-types",
4+
"transform-runtime"
5+
],
6+
"presets": [
7+
"es2015",
8+
"stage-2"
9+
]
10+
}

package.json

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,42 +27,40 @@
2727
"options": {
2828
"mocha": "--require scripts/mocha-bootload src/**/__tests__/**/*.js"
2929
},
30-
"babel": {
31-
"optional": [
32-
"runtime",
33-
"es7.asyncFunctions",
34-
"es7.objectRestSpread"
35-
]
36-
},
3730
"scripts": {
3831
"prepublish": "npm test && npm run build",
3932
"test": "npm run lint && npm run check && mocha $npm_package_options_mocha",
4033
"testonly": "mocha $npm_package_options_mocha",
4134
"lint": "eslint src",
4235
"check": "flow check",
43-
"build": "rm -rf lib/* && babel src --ignore __tests__ --optional runtime --out-dir lib",
44-
"watch": "babel --optional runtime scripts/watch.js | node",
36+
"build": "rm -rf lib/* && babel src --ignore __tests__ --out-dir lib",
37+
"watch": "babel-node scripts/watch.js",
4538
"cover": "babel-node node_modules/.bin/isparta cover --root src --report html node_modules/.bin/_mocha -- $npm_package_options_mocha",
4639
"cover:lcov": "babel-node node_modules/.bin/isparta cover --root src --report lcovonly node_modules/.bin/_mocha -- $npm_package_options_mocha"
4740
},
4841
"dependencies": {
49-
"babel-runtime": "~5.8.3"
42+
"babel-runtime": "^6.9.0"
5043
},
5144
"peerDependencies": {
52-
"graphql": "~0.6.0"
45+
"graphql": "^0.5.0 || ^0.6.0"
5346
},
5447
"devDependencies": {
55-
"babel": "5.8.3",
56-
"babel-core": "5.8.3",
57-
"babel-eslint": "5.0.0",
48+
"babel-cli": "6.9.0",
49+
"babel-core": "6.9.0",
50+
"babel-eslint": "6.0.4",
51+
"babel-plugin-transform-flow-strip-types": "6.8.0",
52+
"babel-plugin-transform-runtime": "6.9.0",
53+
"babel-preset-es2015": "6.9.0",
54+
"babel-preset-stage-2": "6.5.0",
55+
"babel-register": "6.9.0",
5856
"chai": "3.5.0",
5957
"chai-as-promised": "5.3.0",
60-
"coveralls": "2.11.8",
61-
"eslint": "2.2.0",
62-
"flow-bin": "0.22.1",
58+
"coveralls": "2.11.9",
59+
"eslint": "2.10.2",
60+
"flow-bin": "0.25.0",
6361
"graphql": "0.6.0",
64-
"isparta": "3.0.3",
65-
"mocha": "2.2.5",
66-
"sane": "1.1.3"
62+
"isparta": "4.0.0",
63+
"mocha": "2.5.3",
64+
"sane": "1.3.4"
6765
}
6866
}

scripts/mocha-bootload.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*/
99

10-
require('babel/register')({
11-
optional: ['runtime']
12-
});
10+
require('babel-register');
1311

1412
var chai = require('chai');
1513

scripts/watch.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import flowBinPath from 'flow-bin';
1616
process.env.PATH += ':./node_modules/.bin';
1717

1818
var cmd = resolvePath(__dirname);
19-
var srcDir = resolvePath(cmd, './src');
19+
var srcDir = resolvePath(cmd, '../src');
2020

2121
function exec(command, options) {
2222
return new Promise(function (resolve, reject) {
@@ -119,7 +119,6 @@ function parseFiles(filepaths) {
119119
return Promise.all(filepaths.map(filepath => {
120120
if (isJS(filepath) && !isTest(filepath)) {
121121
return exec('babel', [
122-
'--optional', 'runtime',
123122
'--out-file', '/dev/null',
124123
srcPath(filepath)
125124
]);

0 commit comments

Comments
 (0)