Skip to content

Commit

Permalink
Build with Babel 6. Allow graphql-js 0.5.0 through ^0.6.0 as a peer d…
Browse files Browse the repository at this point in the history
…ependency. Closes #87.
  • Loading branch information
steveluscher committed May 27, 2016
1 parent b8c362b commit e4e7ddd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 25 deletions.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"plugins": [
"transform-flow-strip-types",
"transform-runtime"
],
"presets": [
"es2015",
"stage-2"
]
}
38 changes: 18 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,42 +27,40 @@
"options": {
"mocha": "--require scripts/mocha-bootload src/**/__tests__/**/*.js"
},
"babel": {
"optional": [
"runtime",
"es7.asyncFunctions",
"es7.objectRestSpread"
]
},
"scripts": {
"prepublish": "npm test && npm run build",
"test": "npm run lint && npm run check && mocha $npm_package_options_mocha",
"testonly": "mocha $npm_package_options_mocha",
"lint": "eslint src",
"check": "flow check",
"build": "rm -rf lib/* && babel src --ignore __tests__ --optional runtime --out-dir lib",
"watch": "babel --optional runtime scripts/watch.js | node",
"build": "rm -rf lib/* && babel src --ignore __tests__ --out-dir lib",
"watch": "babel-node scripts/watch.js",
"cover": "babel-node node_modules/.bin/isparta cover --root src --report html node_modules/.bin/_mocha -- $npm_package_options_mocha",
"cover:lcov": "babel-node node_modules/.bin/isparta cover --root src --report lcovonly node_modules/.bin/_mocha -- $npm_package_options_mocha"
},
"dependencies": {
"babel-runtime": "~5.8.3"
"babel-runtime": "^6.9.0"
},
"peerDependencies": {
"graphql": "~0.6.0"
"graphql": "^0.5.0 || ^0.6.0"
},
"devDependencies": {
"babel": "5.8.3",
"babel-core": "5.8.3",
"babel-eslint": "5.0.0",
"babel-cli": "6.9.0",
"babel-core": "6.9.0",
"babel-eslint": "6.0.4",
"babel-plugin-transform-flow-strip-types": "6.8.0",
"babel-plugin-transform-runtime": "6.9.0",
"babel-preset-es2015": "6.9.0",
"babel-preset-stage-2": "6.5.0",
"babel-register": "6.9.0",
"chai": "3.5.0",
"chai-as-promised": "5.3.0",
"coveralls": "2.11.8",
"eslint": "2.2.0",
"flow-bin": "0.22.1",
"coveralls": "2.11.9",
"eslint": "2.10.2",
"flow-bin": "0.25.0",
"graphql": "0.6.0",
"isparta": "3.0.3",
"mocha": "2.2.5",
"sane": "1.1.3"
"isparta": "4.0.0",
"mocha": "2.5.3",
"sane": "1.3.4"
}
}
4 changes: 1 addition & 3 deletions scripts/mocha-bootload.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/

require('babel/register')({
optional: ['runtime']
});
require('babel-register');

var chai = require('chai');

Expand Down
3 changes: 1 addition & 2 deletions scripts/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import flowBinPath from 'flow-bin';
process.env.PATH += ':./node_modules/.bin';

var cmd = resolvePath(__dirname);
var srcDir = resolvePath(cmd, './src');
var srcDir = resolvePath(cmd, '../src');

function exec(command, options) {
return new Promise(function (resolve, reject) {
Expand Down Expand Up @@ -119,7 +119,6 @@ function parseFiles(filepaths) {
return Promise.all(filepaths.map(filepath => {
if (isJS(filepath) && !isTest(filepath)) {
return exec('babel', [
'--optional', 'runtime',
'--out-file', '/dev/null',
srcPath(filepath)
]);
Expand Down

0 comments on commit e4e7ddd

Please sign in to comment.