Skip to content

Commit

Permalink
New tighter node versions supported
Browse files Browse the repository at this point in the history
  • Loading branch information
danielholmes committed Jan 30, 2019
1 parent ccf7f2e commit d7e2f9b
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 38 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ cache:
- node_modules

node_js:
- "6"
- "8"
- "10"
- "11"
Expand Down
8 changes: 5 additions & 3 deletions dist/getFilepathsFromGlob.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 8 additions & 6 deletions dist/getWriter.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
46 changes: 19 additions & 27 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"@babel/preset-env",
{
"targets": {
"node": "6.1"
"node": "8.0"
}
}
],
Expand Down

0 comments on commit d7e2f9b

Please sign in to comment.