diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..0b425ec --- /dev/null +++ b/.babelrc @@ -0,0 +1,10 @@ +{ + "plugins": [ + "transform-flow-strip-types", + "transform-runtime" + ], + "presets": [ + "es2015", + "stage-2" + ] +} diff --git a/package.json b/package.json index 531be5e..180742f 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/scripts/mocha-bootload.js b/scripts/mocha-bootload.js index 7fd28ea..f8c1564 100644 --- a/scripts/mocha-bootload.js +++ b/scripts/mocha-bootload.js @@ -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'); diff --git a/scripts/watch.js b/scripts/watch.js index 359bf98..55bf803 100644 --- a/scripts/watch.js +++ b/scripts/watch.js @@ -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) { @@ -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) ]);