diff --git a/.travis.yml b/.travis.yml index 4ef29e6..cdd3201 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ cache: - node_modules node_js: - - "6" - "8" - "10" - "11" diff --git a/dist/getFilepathsFromGlob.js b/dist/getFilepathsFromGlob.js index 6874589..2da721f 100644 --- a/dist/getFilepathsFromGlob.js +++ b/dist/getFilepathsFromGlob.js @@ -10,9 +10,11 @@ var _fastGlob = _interopRequireDefault(require("fast-glob")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function getFilepathsFromGlob(baseDir, options) { - const extensions = options.extensions, - include = options.include, - exclude = options.exclude; + const { + extensions, + include, + exclude + } = options; const patterns = include.map(inc => `${inc}/*.+(${extensions.join('|')})`); return _fastGlob.default.sync(patterns, { cwd: baseDir, diff --git a/dist/getWriter.js b/dist/getWriter.js index 0d1ba4d..4a29052 100644 --- a/dist/getWriter.js +++ b/dist/getWriter.js @@ -11,12 +11,14 @@ var _RelayIRTransforms = _interopRequireDefault(require("relay-compiler/lib/Rela function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const commonTransforms = _RelayIRTransforms.default.commonTransforms, - codegenTransforms = _RelayIRTransforms.default.codegenTransforms, - fragmentTransforms = _RelayIRTransforms.default.fragmentTransforms, - printTransforms = _RelayIRTransforms.default.printTransforms, - queryTransforms = _RelayIRTransforms.default.queryTransforms, - schemaExtensions = _RelayIRTransforms.default.schemaExtensions; +const { + commonTransforms, + codegenTransforms, + fragmentTransforms, + printTransforms, + queryTransforms, + schemaExtensions +} = _RelayIRTransforms.default; var _default = (baseDir, languagePlugin, noFutureProofEnums, outputDir) => ({ onlyValidate, diff --git a/dist/index.js b/dist/index.js index 61d40d5..dafdc2b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -20,10 +20,6 @@ var _getFilepathsFromGlob = _interopRequireDefault(require("./getFilepathsFromGl function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } - -function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } - function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -152,30 +148,26 @@ class RelayCompilerWebpackPlugin { }; } - compile(issuer, request) { - var _this = this; - - return _asyncToGenerator(function* () { - const errors = []; - - try { - // Can this be set up in constructor and use same instance every time? - const runner = new _relayCompiler.Runner({ - parserConfigs: _this.parserConfigs, - writerConfigs: _this.writerConfigs, - reporter: new RaiseErrorsReporter(), - onlyValidate: false, - skipPersist: true - }); - return runner.compile(_this.languagePlugin.outputExtension); - } catch (error) { - errors.push(error); - } + async compile(issuer, request) { + const errors = []; + + try { + // Can this be set up in constructor and use same instance every time? + const runner = new _relayCompiler.Runner({ + parserConfigs: this.parserConfigs, + writerConfigs: this.writerConfigs, + reporter: new RaiseErrorsReporter(), + onlyValidate: false, + skipPersist: true + }); + return runner.compile(this.languagePlugin.outputExtension); + } catch (error) { + errors.push(error); + } - if (errors.length) { - throw errors[0]; - } - })(); + if (errors.length) { + throw errors[0]; + } } cachedCompiler() { diff --git a/package.json b/package.json index a5c6a24..aee48fb 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "@babel/preset-env", { "targets": { - "node": "6.1" + "node": "8.0" } } ],