boilerplate-server
Advanced tools
Comparing version 0.11.8 to 0.12.0
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _path = require('path'); | ||
@@ -25,7 +19,13 @@ | ||
var _libraryUtilitiesConfiguration = require('../../../library/utilities/configuration'); | ||
var _configuration = require('../../../library/utilities/configuration'); | ||
var _libraryUtilitiesConfiguration2 = _interopRequireDefault(_libraryUtilitiesConfiguration); | ||
var _configuration2 = _interopRequireDefault(_configuration); | ||
exports['default'] = { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
exports.default = { | ||
after: ['application:before'], | ||
@@ -38,112 +38,70 @@ | ||
configure: _asyncToGenerator(function* (application) { | ||
application.configuration = {}; | ||
this.configuration = (0, _lodash.merge)({}, this.defaults, { | ||
path: (0, _path.resolve)(application.runtime.base, this.defaults.path) | ||
}); | ||
return this; | ||
}), | ||
configure: function configure(application) { | ||
var _this = this; | ||
start: _asyncToGenerator(function* (application) { | ||
// Load boilerplate-server core configuration | ||
var core = (0, _libraryUtilitiesConfiguration2['default'])((0, _path.resolve)((0, _findRoot2['default'])(__dirname), this.configuration.path), this.configuration.filter, application.runtime.env); | ||
return _asyncToGenerator(function* () { | ||
application.configuration = {}; | ||
_this.configuration = (0, _lodash.merge)({}, _this.defaults, { | ||
path: (0, _path.resolve)(application.runtime.base, _this.defaults.path) | ||
}); | ||
return _this; | ||
})(); | ||
}, | ||
start: function start(application) { | ||
var _this2 = this; | ||
// Load package.jsons | ||
var corePkgPath = (0, _path.resolve)(application.runtime.base, 'package.json'); | ||
var pkgPath = (0, _path.resolve)(application.runtime.cwd, 'package.json'); | ||
return _asyncToGenerator(function* () { | ||
// Load boilerplate-server core configuration | ||
const core = (0, _configuration2.default)((0, _path.resolve)((0, _findRoot2.default)(__dirname), _this2.configuration.path), _this2.configuration.filter, application.runtime.env); | ||
var corePkg = require(corePkgPath); | ||
var userPkg = require(pkgPath); | ||
var pkg = (0, _lodash.merge)({}, corePkg, pkg, userPkg); | ||
// Load package.jsons | ||
const corePkgPath = (0, _path.resolve)(application.runtime.base, 'package.json'); | ||
const pkgPath = (0, _path.resolve)(application.runtime.cwd, 'package.json'); | ||
// Allow user to override core behaviour via cli and *rc files | ||
(0, _lodash.merge)(core, { pkg: pkg }, application.runtime.api); | ||
const corePkg = require(corePkgPath); | ||
const userPkg = require(pkgPath); | ||
const pkg = (0, _lodash.merge)({}, corePkg, userPkg); | ||
// Find all node modules on the way from here to the top | ||
var modulePaths = [(0, _path.dirname)(module.filename)]; | ||
var moduleRoot = module; | ||
while (moduleRoot.parent) { | ||
moduleRoot = moduleRoot.parent; | ||
modulePaths.push((0, _path.dirname)(moduleRoot.filename)); | ||
} | ||
// Allow user to override core behaviour via cli and *rc files | ||
(0, _lodash.merge)(core, { pkg: pkg }, application.runtime.api); | ||
modulePaths = [].concat(_toConsumableArray(new Set(modulePaths))); | ||
modulePaths = modulePaths.filter(function (modulePath) { | ||
return !modulePath.includes((0, _findRoot2['default'])(__dirname)); | ||
}); | ||
// Find all node modules on the way from here to the top | ||
let modulePaths = [(0, _path.dirname)(module.filename)]; | ||
let moduleRoot = module; | ||
while (moduleRoot.parent) { | ||
moduleRoot = moduleRoot.parent; | ||
modulePaths.push((0, _path.dirname)(moduleRoot.filename)); | ||
} | ||
var existingModulePaths = []; | ||
modulePaths = [].concat(_toConsumableArray(new Set(modulePaths))); | ||
modulePaths = modulePaths.filter(function (modulePath) { | ||
return !modulePath.includes((0, _findRoot2.default)(__dirname)); | ||
}); | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
const existingModulePaths = []; | ||
try { | ||
for (var _iterator = modulePaths[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var modulePath = _step.value; | ||
for (let modulePath of modulePaths) { | ||
// eslint-disable-line | ||
var _moduleRoot = modulePath; | ||
while ((yield (0, _pathExists2['default'])((0, _path.resolve)(_moduleRoot, 'package.json'))) === false) { | ||
_moduleRoot = (0, _path.dirname)(_moduleRoot); | ||
let moduleRoot = modulePath; | ||
while ((yield (0, _pathExists2.default)((0, _path.resolve)(moduleRoot, 'package.json'))) === false) { | ||
// eslint-disable-line | ||
moduleRoot = (0, _path.dirname)(moduleRoot); | ||
} | ||
existingModulePaths.push(_moduleRoot); | ||
existingModulePaths.push(moduleRoot); | ||
} | ||
// Set application runtime cwds | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator['return']) { | ||
_iterator['return'](); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
application.runtime.cwds = [].concat(_toConsumableArray(new Set([application.runtime.cwd].concat(existingModulePaths, [process.cwd()])))); | ||
application.runtime.cwds = [].concat(_toConsumableArray(new Set([application.runtime.cwd].concat(existingModulePaths, [process.cwd()])))); | ||
// Check which user config paths exist | ||
var existingConfigPaths = []; | ||
var _iteratorNormalCompletion2 = true; | ||
var _didIteratorError2 = false; | ||
var _iteratorError2 = undefined; | ||
try { | ||
for (var _iterator2 = core.paths.configuration[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { | ||
var configPath = _step2.value; | ||
var _iteratorNormalCompletion4 = true; | ||
var _didIteratorError4 = false; | ||
var _iteratorError4 = undefined; | ||
try { | ||
for (var _iterator4 = application.runtime.cwds[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { | ||
var cwd = _step4.value; | ||
var _arr = ['', userPkg.name]; | ||
for (var _i = 0; _i < _arr.length; _i++) { | ||
var suffix = _arr[_i]; | ||
var userPath = (0, _path.resolve)(cwd, configPath, suffix); | ||
if (yield (0, _pathExists2['default'])(userPath)) { | ||
existingConfigPaths.push(userPath); | ||
} | ||
// Check which user config paths exist | ||
let existingConfigPaths = []; | ||
for (const configPath of core.paths.configuration) { | ||
for (const cwd of application.runtime.cwds) { | ||
for (const suffix of ['', userPkg.name]) { | ||
const userPath = (0, _path.resolve)(cwd, configPath, suffix); | ||
if (yield (0, _pathExists2.default)(userPath)) { | ||
// eslint-disable-line | ||
existingConfigPaths.push(userPath); | ||
} | ||
} | ||
} catch (err) { | ||
_didIteratorError4 = true; | ||
_iteratorError4 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion4 && _iterator4['return']) { | ||
_iterator4['return'](); | ||
} | ||
} finally { | ||
if (_didIteratorError4) { | ||
throw _iteratorError4; | ||
} | ||
} | ||
} | ||
@@ -154,42 +112,20 @@ } | ||
// Check if paths have siblings that contain them completely, thus are sub directories / more specific configuration folders | ||
} catch (err) { | ||
_didIteratorError2 = true; | ||
_iteratorError2 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion2 && _iterator2['return']) { | ||
_iterator2['return'](); | ||
} | ||
} finally { | ||
if (_didIteratorError2) { | ||
throw _iteratorError2; | ||
} | ||
} | ||
} | ||
existingConfigPaths = existingConfigPaths.filter(function (configPath) { | ||
var match = existingConfigPaths.filter(function (subConfigPath) { | ||
return subConfigPath.includes(configPath) && subConfigPath !== configPath; | ||
existingConfigPaths = existingConfigPaths.filter(function (configPath) { | ||
const match = existingConfigPaths.filter(function (subConfigPath) { | ||
return subConfigPath.includes(configPath) && subConfigPath !== configPath; | ||
}); | ||
return match.length === 0; | ||
}); | ||
return match.length === 0; | ||
}); | ||
// Load dem configs from filtered paths | ||
var user = {}; | ||
var _iteratorNormalCompletion3 = true; | ||
var _didIteratorError3 = false; | ||
var _iteratorError3 = undefined; | ||
// Load dem configs from filtered paths | ||
let user = {}; | ||
for (const userPath of existingConfigPaths) { | ||
_this2.log.debug(`Loading configuration from '${ userPath }'`); | ||
try { | ||
for (var _iterator3 = existingConfigPaths[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { | ||
var userPath = _step3.value; | ||
this.log.info('Loading configuration from \'' + userPath + '\''); | ||
try { | ||
var userPathConfig = (0, _libraryUtilitiesConfiguration2['default'])(userPath, this.configuration.filter, application.runtime.env); | ||
const userPathConfig = (0, _configuration2.default)(userPath, _this2.configuration.filter, application.runtime.env); | ||
user = (0, _lodash.merge)(user, userPathConfig); | ||
} catch (err) { | ||
this.log.error('Error while reading configuration from ' + userPath + '.'); | ||
this.log.error(err); | ||
_this2.log.error(`Error while reading configuration from ${ userPath }.`); | ||
_this2.log.error(err); | ||
err.message = 'Failed loading configuration from ${userPath}'; | ||
@@ -199,29 +135,16 @@ throw err; | ||
} | ||
} catch (err) { | ||
_didIteratorError3 = true; | ||
_iteratorError3 = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion3 && _iterator3['return']) { | ||
_iterator3['return'](); | ||
(0, _lodash.merge)(application.configuration, core, user, application.runtime.api, function (a, b) { | ||
if (Array.isArray(b) && typeof a === 'string') { | ||
return b; | ||
} | ||
} finally { | ||
if (_didIteratorError3) { | ||
throw _iteratorError3; | ||
} | ||
} | ||
} | ||
}); | ||
(0, _lodash.merge)(application.configuration, core, user, application.runtime.api, function (a, b) { | ||
if (Array.isArray(b) && typeof a === 'string') { | ||
return b; | ||
} | ||
}); | ||
application.runtime.prefix = application.runtime.prefix || '/'; | ||
application.runtime.mode = application.runtime.mode || 'server'; | ||
return this; | ||
}) | ||
application.runtime.prefix = application.runtime.prefix || '/'; | ||
application.runtime.mode = application.runtime.mode || 'server'; | ||
return _this2; | ||
})(); | ||
} | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9jb25maWd1cmUvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O29CQUdPLE1BQU07O3NCQUdOLFFBQVE7O3dCQUNNLFdBQVc7Ozs7MEJBQ2IsYUFBYTs7Ozs2Q0FFZiwwQ0FBMEM7Ozs7cUJBRTVDO0FBQ2QsTUFBSyxFQUFFLENBQUMsb0JBQW9CLENBQUM7O0FBRTdCLFNBQVEsRUFBRTtBQUNULE1BQUksRUFBRSxpQkFBaUI7QUFDdkIsUUFBTSxFQUFFLGlCQUFpQjtFQUN6Qjs7QUFFRCxBQUFNLFVBQVMsb0JBQUEsV0FBQyxXQUFXLEVBQUU7QUFDNUIsYUFBVyxDQUFDLGFBQWEsR0FBRyxFQUFFLENBQUM7QUFDL0IsTUFBSSxDQUFDLGFBQWEsR0FBRyxtQkFDcEIsRUFBRSxFQUNGLElBQUksQ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yR7dXNlclBhdGh9J2ApO1xuXG5cdFx0XHR0cnkge1xuXHRcdFx0XHRjb25zdCB1c2VyUGF0aENvbmZpZyA9IGxvYWQodXNlclBhdGgsIHRoaXMuY29uZmlndXJhdGlvbi5maWx0ZXIsIGFwcGxpY2F0aW9uLnJ1bnRpbWUuZW52KTtcblx0XHRcdFx0dXNlciA9IG1lcmdlKHVzZXIsIHVzZXJQYXRoQ29uZmlnKTtcblx0XHRcdH0gY2F0Y2ggKGVycikge1xuXHRcdFx0XHR0aGlzLmxvZy5lcnJvcihgRXJyb3Igd2hpbGUgcmVhZGluZyBjb25maWd1cmF0aW9uIGZyb20gJHt1c2VyUGF0aH0uYCk7XG5cdFx0XHRcdHRoaXMubG9nLmVycm9yKGVycik7XG5cdFx0XHRcdGVyci5tZXNzYWdlID0gJ0ZhaWxlZCBsb2FkaW5nIGNvbmZpZ3VyYXRpb24gZnJvbSAke3VzZXJQYXRofSc7XG5cdFx0XHRcdHRocm93IGVycjtcblx0XHRcdH1cblx0XHR9XG5cblx0XHRtZXJnZShhcHBsaWNhdGlvbi5jb25maWd1cmF0aW9uLCBjb3JlLCB1c2VyLCBhcHBsaWNhdGlvbi5ydW50aW1lLmFwaSwgKGEsIGIpID0+IHtcblx0XHRcdGlmIChBcnJheS5pc0FycmF5KGIpICYmIHR5cGVvZiBhID09PSAnc3RyaW5nJykge1xuXHRcdFx0XHRyZXR1cm4gYjtcblx0XHRcdH1cblx0XHR9KTtcblxuXHRcdGFwcGxpY2F0aW9uLnJ1bnRpbWUucHJlZml4ID0gYXBwbGljYXRpb24ucnVudGltZS5wcmVmaXggfHwgJy8nO1xuXHRcdGFwcGxpY2F0aW9uLnJ1bnRpbWUubW9kZSA9IGFwcGxpY2F0aW9uLnJ1bnRpbWUubW9kZSB8fCAnc2VydmVyJztcblx0XHRyZXR1cm4gdGhpcztcblx0fVxufTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _bind = Function.prototype.bind; | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
const nameSpace = new WeakMap(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
class TaskConsole { | ||
constructor(application, options) { | ||
const tasks = options.tasks; | ||
var nameSpace = new WeakMap(); | ||
nameSpace.set(this, { application: application, options: options, tasks: tasks }); | ||
} | ||
var TaskConsole = (function () { | ||
function TaskConsole(application, options) { | ||
_classCallCheck(this, TaskConsole); | ||
run(taskName, options) { | ||
var _this = this; | ||
nameSpace.set(this, { application: application, options: options, 'tasks': options.tasks }); | ||
} | ||
return _asyncToGenerator(function* () { | ||
var _nameSpace$get = nameSpace.get(_this); | ||
_createClass(TaskConsole, [{ | ||
key: 'run', | ||
value: _asyncToGenerator(function* (taskName, options) { | ||
var _nameSpace$get = nameSpace.get(this); | ||
const application = _nameSpace$get.application; | ||
const tasks = _nameSpace$get.tasks; | ||
var application = _nameSpace$get.application; | ||
var tasks = _nameSpace$get.tasks; | ||
@@ -38,16 +35,20 @@ if (typeof taskName !== 'string') { | ||
if (!tasks[taskName]) { | ||
throw new Error('Task "' + taskName + '" is not available. Available tasks: ' + Object.keys(tasks)); | ||
const taskNames = Object.keys(tasks).join(', '); | ||
const taskTerm = taskNames.length > 1 ? 'task' : 'tasks'; | ||
const message = taskNames.length ? `Task "${ taskName }" is not available. Available ${ taskTerm }: ${ taskNames }` : `No tasks available`; | ||
throw new Error(message); | ||
} | ||
if (tasks[taskName] && typeof tasks[taskName].index !== 'function') { | ||
throw new Error('Task "' + taskName + '" is available but invalid.'); | ||
throw new Error(`Task "${ taskName }" is available but invalid.`); | ||
} | ||
application.log.info('[console:run] Starting taskName "' + taskName + '"...'); | ||
application.log.info(`Starting taskName "${ taskName }"...`); | ||
var task = tasks[taskName].index; | ||
var taskConfiguration = _extends({}, application.configuration.tasks[taskName], options); | ||
const task = tasks[taskName].index; | ||
const taskConfiguration = _extends({}, application.configuration.tasks[taskName], options); | ||
if (!taskConfiguration) { | ||
application.log.warn('[console:run] Starting taskName "' + taskName + '" without configuration...'); | ||
application.log.info(`Starting taskName "${ taskName }" without configuration...`); | ||
} | ||
@@ -57,12 +58,10 @@ | ||
yield task(application, taskConfiguration); | ||
application.log.info('[console:run] taskName "' + taskName + '" executed successfully'); | ||
application.log.info(`taskName "${ taskName }" executed successfully`); | ||
} catch (err) { | ||
throw err; | ||
} | ||
}) | ||
}]); | ||
})(); | ||
} | ||
} | ||
return TaskConsole; | ||
})(); | ||
function consoleFactory() { | ||
@@ -73,7 +72,7 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return new (_bind.apply(TaskConsole, [null].concat(args)))(); | ||
return new (Function.prototype.bind.apply(TaskConsole, [null].concat(args)))(); | ||
} | ||
exports['default'] = consoleFactory; | ||
exports.default = consoleFactory; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9jb25zb2xlL2NvbnNvbGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsSUFBSSxTQUFTLEdBQUcsSUFBSSxPQUFPLEVBQUUsQ0FBQzs7SUFFeEIsV0FBVztBQUNKLFVBRFAsV0FBVyxDQUNGLFdBQVcsRUFBRSxPQUFPLEVBQUc7d0JBRGhDLFdBQVc7O0FBRWYsV0FBUyxDQUFDLEdBQUcsQ0FBRSxJQUFJLEVBQUUsRUFBRSxXQUFXLEVBQVgsV0FBVyxFQUFFLE9BQU8sRUFBUCxPQUFPLEVBQUUsT0FBTyxFQUFFLE9BQU8sQ0FBQyxLQUFLLEVBQUUsQ0FBRSxDQUFDO0VBQ3hFOztjQUhJLFdBQVc7OzJCQUtOLFdBQUUsUUFBUSxFQUFFLE9BQU8sRUFBRzt3QkFDQSxTQUFTLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQzs7T0FBMUMsV0FBVyxrQkFBWCxXQUFXO09BQUUsS0FBSyxrQkFBTCxLQUFLOztBQUUxQixPQUFLLE9BQU8sUUFBUSxLQUFLLFFBQVEsRUFBRztBQUNuQyxVQUFNLElBQUksS0FBSyxDQUFFLDZCQUE2QixDQUFFLENBQUM7SUFDakQ7O0FBRUQsT0FBSyxDQUFDLEtBQUssQ0FBQyxRQUFRLENBQUMsRUFBRztBQUN2QixVQUFNLElBQUksS0FBSyxZQUFXLFFBQVEsNkNBQXdDLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUksQ0FBQzt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0YXNrc1t0YXNrTmFtZV0uaW5kZXggIT09ICdmdW5jdGlvbicpIHtcblx0XHRcdHRocm93IG5ldyBFcnJvcihgVGFzayBcIiR7dGFza05hbWV9XCIgaXMgYXZhaWxhYmxlIGJ1dCBpbnZhbGlkLmApO1xuXHRcdH1cblxuXHRcdGFwcGxpY2F0aW9uLmxvZy5pbmZvKGBTdGFydGluZyB0YXNrTmFtZSBcIiR7dGFza05hbWV9XCIuLi5gKTtcblxuXHRcdGNvbnN0IHRhc2sgPSB0YXNrc1t0YXNrTmFtZV0uaW5kZXg7XG5cdFx0Y29uc3QgdGFza0NvbmZpZ3VyYXRpb24gPSB7Li4uYXBwbGljYXRpb24uY29uZmlndXJhdGlvbi50YXNrc1t0YXNrTmFtZV0sIC4uLm9wdGlvbnN9O1xuXG5cdFx0aWYgKCF0YXNrQ29uZmlndXJhdGlvbikge1xuXHRcdFx0YXBwbGljYXRpb24ubG9nLmluZm8oYFN0YXJ0aW5nIHRhc2tOYW1lIFwiJHt0YXNrTmFtZX1cIiB3aXRob3V0IGNvbmZpZ3VyYXRpb24uLi5gKTtcblx0XHR9XG5cblx0XHR0cnkge1xuXHRcdFx0YXdhaXQgdGFzayhhcHBsaWNhdGlvbiwgdGFza0NvbmZpZ3VyYXRpb24pO1xuXHRcdFx0YXBwbGljYXRpb24ubG9nLmluZm8oYHRhc2tOYW1lIFwiJHt0YXNrTmFtZX1cIiBleGVjdXRlZCBzdWNjZXNzZnVsbHlgKTtcblx0XHR9IGNhdGNoIChlcnIpIHtcblx0XHRcdHRocm93IGVycjtcblx0XHR9XG5cdH1cbn1cblxuZnVuY3Rpb24gY29uc29sZUZhY3RvcnkoLi4uYXJncykge1xuXHRyZXR1cm4gbmV3IFRhc2tDb25zb2xlKC4uLmFyZ3MpO1xufVxuXG5leHBvcnQgZGVmYXVsdCBjb25zb2xlRmFjdG9yeTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _path = require('path'); | ||
var _libraryUtilitiesFs = require('../../../library/utilities/fs'); | ||
var _fs = require('../../../library/utilities/fs'); | ||
@@ -23,72 +19,63 @@ var _requireAll = require('require-all'); | ||
exports['default'] = { | ||
'after': ['hooks:log:start:after'], | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
'start': _asyncToGenerator(function* (application) { | ||
var _this = this; | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
var taskPaths = application.runtime.cwds.map(function (loadPath) { | ||
return (0, _path.resolve)(loadPath, _this.configuration.path); | ||
}).filter(function (item, index, list) { | ||
return list.lastIndexOf(item) !== index || list.indexOf(item) === index; | ||
}); | ||
exports.default = { | ||
'after': ['hooks:log:start:after'], | ||
var existingtaskPaths = []; | ||
'start': (() => { | ||
var _ref = _asyncToGenerator(function* (application) { | ||
var _this = this; | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
let taskPaths = application.runtime.cwds.map(function (loadPath) { | ||
return (0, _path.resolve)(loadPath, _this.configuration.path); | ||
}).filter(function (item, index, list) { | ||
return list.lastIndexOf(item) !== index || list.indexOf(item) === index; | ||
}); | ||
try { | ||
for (var _iterator = taskPaths[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var taskPath = _step.value; | ||
let existingtaskPaths = []; | ||
if (yield (0, _libraryUtilitiesFs.exists)(taskPath)) { | ||
for (let taskPath of taskPaths) { | ||
if (yield (0, _fs.exists)(taskPath)) { | ||
existingtaskPaths.push(taskPath); | ||
} | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator['return']) { | ||
_iterator['return'](); | ||
let tasks = existingtaskPaths.map(function (tasksPath) { | ||
return (0, _requireAll2.default)(tasksPath); | ||
}).reduce(function (results, task) { | ||
return Object.assign(results, task); | ||
}, {}); | ||
// load module tasks | ||
let moduleTasks = Object.keys(this.configuration).filter(function (taskName) { | ||
return typeof _this.configuration[taskName].enabled === 'string'; | ||
}).reduce(function (result, taskName) { | ||
let taskModuleName = _this.configuration.enabled[taskName].enabled; | ||
try { | ||
result[taskName] = require(taskModuleName); | ||
_this.log.debug(`Required module route '${ taskName }' from module '${ taskModuleName }'`); | ||
} catch (err) { | ||
_this.log.warn(`Could not require module route '${ taskName }' from module '${ taskModuleName }'`); | ||
_this.log.debug(err); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
var tasks = existingtaskPaths.map(function (tasksPath) { | ||
return (0, _requireAll2['default'])(tasksPath); | ||
}).reduce(function (results, task) { | ||
return Object.assign(results, task); | ||
}, {}); | ||
return result; | ||
}, {}); | ||
// load module tasks | ||
var moduleTasks = Object.keys(this.configuration).filter(function (taskName) { | ||
return typeof _this.configuration[taskName].enabled === 'string'; | ||
}).reduce(function (result, taskName) { | ||
var taskModuleName = _this.configuration.enabled[taskName].enabled; | ||
Object.assign(tasks, moduleTasks); | ||
application.console = (0, _console2.default)(application, Object.assign({}, this.configuration, { tasks: tasks })); | ||
return this; | ||
}); | ||
try { | ||
result[taskName] = require(taskModuleName); | ||
_this.log.debug('Required module route \'' + taskName + '\' from module \'' + taskModuleName + '\''); | ||
} catch (err) { | ||
_this.log.warn('Could not require module route \'' + taskName + '\' from module \'' + taskModuleName + '\''); | ||
_this.log.debug(err); | ||
} | ||
function startConsoleHook(_x) { | ||
return _ref.apply(this, arguments); | ||
} | ||
return result; | ||
}, {}); | ||
Object.assign(tasks, moduleTasks); | ||
application.console = (0, _console2['default'])(application, Object.assign({}, this.configuration, { tasks: tasks })); | ||
return this; | ||
}) | ||
return startConsoleHook; | ||
})() | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9jb25zb2xlL2luZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7b0JBQXdCLE1BQU07O2tDQUNQLCtCQUErQjs7MEJBRS9CLGFBQWE7Ozs7dUJBQ1QsV0FBVzs7OztxQkFFdkI7QUFDZCxRQUFPLEVBQUUsQ0FBRSx1QkFBdUIsQ0FBRTs7QUFFcEMsUUFBTyxvQkFBRSxXQUFrQyxXQUFXLEVBQUc7OztBQUN4RCxNQUFJLFNBQVMsR0FBRyxXQUFXLENBQUMsT0FBTyxDQUFDLElBQUksQ0FDdEMsR0FBRyxDQUFFLFVBQUUsUUFBUTtVQUFNLG1CQUFTLFFBQVEsRUFBRSxNQUFLLGFBQWEsQ0FBQyxJQUFJLENBQUU7R0FBQSxDQUFFLENBQ25FLE1BQU0sQ0FBRSxVQUFFLElBQUksRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFNO0FBQ2pDLFVBQU8sSUFBSSxDQUFDLFdBQVcsQ0FBRSxJQUFJLENBQUUsS0FBSyxLQUFLLElBQUksSUFBSSxDQUFDLE9BQU8sQ0FBRSxJQUFJLENBQUUsS0FBSyxLQUFLLENBQUM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bIHRhc2tOYW1lIF0gPSByZXF1aXJlKCB0YXNrTW9kdWxlTmFtZSApO1xuXHRcdFx0XHRcdHRoaXMubG9nLmRlYnVnKCBgUmVxdWlyZWQgbW9kdWxlIHJvdXRlICcke3Rhc2tOYW1lfScgZnJvbSBtb2R1bGUgJyR7dGFza01vZHVsZU5hbWV9J2AgKTtcblx0XHRcdFx0fSBjYXRjaCAoIGVyciApIHtcblx0XHRcdFx0XHR0aGlzLmxvZy53YXJuKCBgQ291bGQgbm90IHJlcXVpcmUgbW9kdWxlIHJvdXRlICcke3Rhc2tOYW1lfScgZnJvbSBtb2R1bGUgJyR7dGFza01vZHVsZU5hbWV9J2AgKTtcblx0XHRcdFx0XHR0aGlzLmxvZy5kZWJ1ZyggZXJyICk7XG5cdFx0XHRcdH1cblxuXHRcdFx0cmV0dXJuIHJlc3VsdDtcblx0XHR9LCB7fSApO1xuXG5cdFx0T2JqZWN0LmFzc2lnbih0YXNrcywgbW9kdWxlVGFza3MpO1xuXHRcdGFwcGxpY2F0aW9uLmNvbnNvbGUgPSBjb25zb2xlRmFjdG9yeSggYXBwbGljYXRpb24sIE9iamVjdC5hc3NpZ24oIHt9LCB0aGlzLmNvbmZpZ3VyYXRpb24sIHsgdGFza3MgfSApICk7XG5cdFx0cmV0dXJuIHRoaXM7XG5cdH1cbn07XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _bind = Function.prototype.bind; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _koa = require('koa'); | ||
@@ -20,54 +15,54 @@ | ||
var _koaRouter = require('koa-router'); | ||
var _lodash = require('lodash'); | ||
var _koaRouter2 = _interopRequireDefault(_koaRouter); | ||
var _ports = require('../../../library/utilities/ports'); | ||
var _lodash = require('lodash'); | ||
var _ports2 = _interopRequireDefault(_ports); | ||
var _libraryUtilitiesPorts = require('../../../library/utilities/ports'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _libraryUtilitiesPorts2 = _interopRequireDefault(_libraryUtilitiesPorts); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
function engineBlueprint() { | ||
var nameSpace = new WeakMap(); | ||
const nameSpace = new WeakMap(); | ||
return (function () { | ||
function Engine(application) { | ||
_classCallCheck(this, Engine); | ||
var fuel = (0, _koa2['default'])(); | ||
return class Engine { | ||
constructor(application) { | ||
const fuel = (0, _koa2.default)(); | ||
fuel.experimental = true; | ||
this.env = fuel.env; | ||
nameSpace.set(this, { application: application, fuel: fuel, 'mounts': {} }); | ||
nameSpace.set(this, { application: application, fuel: fuel, mounts: {} }); | ||
} | ||
_createClass(Engine, [{ | ||
key: 'start', | ||
value: _asyncToGenerator(function* (host, port) { | ||
var _nameSpace$get = nameSpace.get(this); | ||
start(host, port) { | ||
var _this = this; | ||
var fuel = _nameSpace$get.fuel; | ||
var application = _nameSpace$get.application; | ||
return _asyncToGenerator(function* () { | ||
var _nameSpace$get = nameSpace.get(_this); | ||
var server = application.configuration.server; | ||
const fuel = _nameSpace$get.fuel; | ||
const application = _nameSpace$get.application; | ||
const server = application.configuration.server; | ||
const env = application.configuration.environment; | ||
if (application.router) { | ||
application.log.info('[application]', 'Kicking off router ...'); | ||
application.log.debug('[application]', `Kicking off router ...`); | ||
fuel.use(application.router.routes()); | ||
fuel.use(application.router.allowedMethods()); | ||
application.log.info('[application]', 'Kicked off router ...'); | ||
application.log.debug('[application]', `Kicked off router ...`); | ||
} | ||
if (application.runtime.env === 'development') { | ||
if ((yield _libraryUtilitiesPorts2['default'].test(port, host)) !== true) { | ||
if ((yield _ports2.default.test(port, host)) !== true) { | ||
if (server.autoPort !== true) { | ||
throw new Error('Port ' + port + ' is taken and server.autPort is disabled, could not start server.'); | ||
throw new Error(`Port ${ port } is taken and server.autPort is disabled, could not start server.`); | ||
} | ||
application.log.warn('[application] Port ' + port + ' is taken, trying to obtain next open port... '); | ||
server.port = yield _libraryUtilitiesPorts2['default'].find(server.port + 1, server.port + 51, server.host); | ||
application.log.warn(`Port ${ port } is taken, trying to obtain next open port... `); | ||
server.port = yield _ports2.default.find(server.port + 1, server.port + 51, server.host); | ||
application.subs.forEach(function (sub) { | ||
application.log.info('[application:subapplication] Changing configuration of subapplications ' + sub.name); | ||
application.log.debug(`Changing configuration of subapplications ${ sub.name }`); | ||
@@ -80,4 +75,4 @@ sub.mountable.configuration.server = server; | ||
application.log.silly('[application:subapplication] ' + sub.mountable.name + '.configuration.server: ' + JSON.stringify(sub.mountable.configuration.server)); | ||
application.log.silly('[application:subapplication] ' + sub.mountable.name + '.configuration.client: ' + JSON.stringify(sub.mountable.configuration.client)); | ||
application.log.silly(`${ sub.mountable.name }.configuration.server: ${ JSON.stringify(sub.mountable.configuration.server) }`); | ||
application.log.silly(`${ sub.mountable.name }.configuration.client: ${ JSON.stringify(sub.mountable.configuration.client) }`); | ||
}); | ||
@@ -87,19 +82,23 @@ } | ||
application.log.info('[application]', 'Starting engine at http://' + server.host + ':' + server.port + ' in environment \'' + application.configuration.environment + '\' ...'); | ||
var http = yield fuel.listen(server.port); | ||
application.log.info('[application]', 'Started engine at http://' + server.host + ':' + server.port + ' in environment \'' + application.configuration.environment + '\' ...'); | ||
application.log.debug(`Starting engine at http://${ server.host }:${ server.port } in environment '${ env }' ...`); | ||
const http = yield fuel.listen(server.port); | ||
application.log.info(`Started ${ env } server at http://${ server.host }:${ server.port }`); | ||
nameSpace.set(this, { http: http }); | ||
nameSpace.set(_this, { http: http }); | ||
return application; | ||
}) | ||
}, { | ||
key: 'stop', | ||
value: _asyncToGenerator(function* () { | ||
var _nameSpace$get2 = nameSpace.get(this); | ||
})(); | ||
} | ||
var http = _nameSpace$get2.http; | ||
var application = _nameSpace$get2.application; | ||
stop() { | ||
var _this2 = this; | ||
return yield http.close(function (err) { | ||
return new Promise(function fulfill(resolve, reject) { | ||
return _asyncToGenerator(function* () { | ||
return new Promise(function (resolve, reject) { | ||
var _nameSpace$get2 = nameSpace.get(_this2); | ||
const http = _nameSpace$get2.http; | ||
const application = _nameSpace$get2.application; | ||
http.close(function (err) { | ||
if (err) { | ||
@@ -111,119 +110,93 @@ return reject(err); | ||
}); | ||
}) | ||
}, { | ||
key: 'mount', | ||
value: function mount(mountable) { | ||
var path = arguments.length <= 1 || arguments[1] === undefined ? '/' : arguments[1]; | ||
})(); | ||
} | ||
var _nameSpace$get3 = nameSpace.get(this); | ||
mount(mountable) { | ||
let path = arguments.length <= 1 || arguments[1] === undefined ? '/' : arguments[1]; | ||
var fuel = _nameSpace$get3.fuel; | ||
var application = _nameSpace$get3.application; | ||
var _nameSpace$get3 = nameSpace.get(this); | ||
var fragments = path.split('/'); | ||
var hostFragments = application.runtime.prefix.split('/'); | ||
var depth = fragments.length; | ||
const fuel = _nameSpace$get3.fuel; | ||
const application = _nameSpace$get3.application; | ||
application.log.info('[application:subapplication] Mounting ' + mountable.name + ' on ' + path); | ||
const fragments = path.split('/'); | ||
const hostFragments = application.runtime.prefix.split('/'); | ||
if (path !== '/') { | ||
mountable.router.prefix(path); | ||
} else { | ||
mountable.router.stack.routes.forEach(function (route) { | ||
var match = application.router.route(route.name); | ||
if (match) { | ||
var index = application.router.stack.routes.indexOf(match); | ||
application.router.stack.routes.splice(index, 1); | ||
application.log.info('[applications:subapplication] Route "' + route.name + '" of "' + mountable.name + '" overwrites ' + application.name + '\'s route with same name.'); | ||
} | ||
}); | ||
application.log.debug(`[application:subapplication] Mounting ${ mountable.name } on ${ path }`); | ||
application.router.stack.routes = application.router.stack.routes.concat(mountable.router.stack.routes); | ||
} | ||
application.router.stack.middleware.forEach(function (middleware) { | ||
var match = mountable.router.stack.middleware.filter(function (mountMiddleware) { | ||
return mountMiddleware.name === middleware.name; | ||
})[0]; | ||
if (path === '/') { | ||
mountable.router.stack.routes.forEach(route => { | ||
const match = application.router.route(route.name); | ||
if (match) { | ||
return; | ||
const index = application.router.stack.routes.indexOf(match); | ||
application.router.stack.routes.splice(index, 1); | ||
application.log.debug(`Route "${ route.name }" of "${ mountable.name }" overwrites ${ application.name }'s route with same name.`); | ||
} | ||
mountable.router.stack.middleware.push(middleware); | ||
}); | ||
mountable.configuration.middlewares = mountable.configuration.middlewares || {}; | ||
application.router.stack.routes = application.router.stack.routes.concat(mountable.router.stack.routes); | ||
} else { | ||
mountable.router.prefix(path); | ||
} | ||
// Override middleware config on mountable by host middleware config | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
application.router.stack.middleware.forEach(middleware => { | ||
var _mountable$router$sta = mountable.router.stack.middleware.filter(mountMiddleware => mountMiddleware.name === middleware.name); | ||
try { | ||
for (var _iterator = Object.keys(application.configuration.middlewares.enabled || {})[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var middlewareName = _step.value; | ||
var _mountable$router$sta2 = _slicedToArray(_mountable$router$sta, 1); | ||
var config = application.configuration.middlewares.enabled[middlewareName]; | ||
var mountableConfig = mountable.configuration.middlewares.enabled[middlewareName]; | ||
const match = _mountable$router$sta2[0]; | ||
mountableConfig = typeof mountableConfig === 'undefined' ? config : mountableConfig; | ||
if (match) { | ||
return; | ||
} | ||
mountable.router.stack.middleware.push(middleware); | ||
}); | ||
if (typeof config === 'object') { | ||
(0, _lodash.merge)(mountableConfig, config); | ||
} else { | ||
mountableConfig = config; | ||
} | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator['return']) { | ||
_iterator['return'](); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
mountable.configuration.middlewares = mountable.configuration.middlewares || {}; | ||
// Override middleware config on mountable by host middleware config | ||
for (const middlewareName of Object.keys(application.configuration.middlewares.enabled || {})) { | ||
const config = application.configuration.middlewares.enabled[middlewareName]; | ||
let mountableConfig = mountable.configuration.middlewares.enabled[middlewareName]; | ||
mountableConfig = typeof mountableConfig === 'undefined' ? config : mountableConfig; | ||
if (typeof config === 'object') { | ||
(0, _lodash.merge)(mountableConfig, config); | ||
} else { | ||
mountableConfig = config; | ||
} | ||
} | ||
fuel.use(mountable.router.routes()); | ||
fuel.use(mountable.router.allowedMethods()); | ||
fuel.use(mountable.router.routes()); | ||
fuel.use(mountable.router.allowedMethods()); | ||
application.router.subs = application.router.subs || []; | ||
application.router.subs.push(mountable.router); | ||
application.router.subs = application.router.subs || []; | ||
application.router.subs.push(mountable.router); | ||
mountable.runtime.prefix = '/' + fragments.concat(hostFragments).filter(function (item) { | ||
return item; | ||
}).join('/'); | ||
const prefix = fragments.concat(hostFragments).filter(Boolean).join('/'); | ||
mountable.runtime.prefix = [`/${ prefix }`]; | ||
application.subs.push({ path: path, mountable: mountable }); | ||
application.subs.push({ path: path, mountable: mountable }); | ||
mountable.configuration.server = Object.assign({}, mountable.configuration.server, application.configuration.server); | ||
mountable.configuration.client = Object.assign({}, mountable.configuration.client, application.configuration.server); | ||
mountable.configuration.server = _extends({}, mountable.configuration.server, application.configuration.server); | ||
mountable.configuration.client = _extends({}, mountable.configuration.client, application.configuration.server); | ||
application.log.info('[application:subapplication] Changing configuration of subapplications ' + mountable.name); | ||
application.log.info('[application:subapplication] ' + mountable.name + '.configuration.server: ' + JSON.stringify(mountable.configuration.server)); | ||
application.log.info('[application:subapplication] ' + mountable.name + '.configuration.client: ' + JSON.stringify(mountable.configuration.client)); | ||
application.log.debug(`Changing configuration of subapplications ${ mountable.name }`); | ||
application.log.silly(`${ mountable.name }.configuration.server: ${ JSON.stringify(mountable.configuration.server) }`); | ||
application.log.silly(`${ mountable.name }.configuration.client: ${ JSON.stringify(mountable.configuration.client) }`); | ||
return application; | ||
} | ||
}, { | ||
key: 'use', | ||
value: function use() { | ||
var _nameSpace$get4 = nameSpace.get(this); | ||
return application; | ||
} | ||
var fuel = _nameSpace$get4.fuel; | ||
var application = _nameSpace$get4.application; | ||
use() { | ||
var _nameSpace$get4 = nameSpace.get(this); | ||
fuel.use.apply(fuel, arguments); | ||
return application; | ||
} | ||
}]); | ||
const fuel = _nameSpace$get4.fuel; | ||
const application = _nameSpace$get4.application; | ||
return Engine; | ||
})(); | ||
fuel.use.apply(fuel, arguments); | ||
return application; | ||
} | ||
}; | ||
} | ||
@@ -236,7 +209,7 @@ | ||
return new (_bind.apply(engineBlueprint(), [null].concat(args)))(); | ||
return new (Function.prototype.bind.apply(engineBlueprint(), [null].concat(args)))(); | ||
} | ||
exports['default'] = engineFactory; | ||
exports.default = engineFactory; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9lbmdpbmUvZW5naW5lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7OzttQkFBZ0IsS0FBSzs7Ozt5QkFDRixZQUFZOzs7O3NCQUNYLFFBQVE7O3FDQUVWLGtDQUFrQzs7OztBQUVwRCxTQUFTLGVBQWUsR0FBSTtBQUMzQixLQUFJLFNBQVMsR0FBRyxJQUFJLE9BQU8sRUFBRSxDQUFDOztBQUU5QjtBQUNhLFdBREEsTUFBTSxDQUNKLFdBQVcsRUFBRzt5QkFEaEIsTUFBTTs7QUFFakIsT0FBSSxJQUFJLEdBQUcsdUJBQUssQ0FBQztBQUNqQixPQUFJLENBQUMsWUFBWSxHQUFHLElBQUksQ0FBQzs7QUFFekIsT0FBSSxDQUFDLEdBQUcsR0FBRyxJQUFJLENBQUMsR0FBRyxDQUFDO0FBQ3BCLFlBQVMsQ0FBQyxHQUFHLENBQUUsSUFBSSxFQUFFLEVBQUUsV0FBVyxFQUFYLFdBQVcsRUFBRSxJQUFJLEVBQUosSUFBSSxFQUFFLFFBQVEsRUFBRSxFQUFFLEVBQUUsQ0FBRSxDQUFDO0dBQzNEOztlQVBXLE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1xufVxuXG5leHBvcnQgZGVmYXVsdCBlbmdpbmVGYWN0b3J5O1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _engine = require('./engine'); | ||
@@ -15,12 +11,24 @@ | ||
exports['default'] = { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
exports.default = { | ||
'after': ['hooks:log:start:after'], | ||
'modes': ['server'], | ||
'start': _asyncToGenerator(function* (application) { | ||
application.engine = (0, _engine2['default'])(application); | ||
return this; | ||
}) | ||
'start': (() => { | ||
var _ref = _asyncToGenerator(function* (application) { | ||
application.engine = (0, _engine2.default)(application); | ||
return this; | ||
}); | ||
function startEngineHook(_x) { | ||
return _ref.apply(this, arguments); | ||
} | ||
return startEngineHook; | ||
})() | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9lbmdpbmUvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7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zQkFBUUQsV0FBUixDQUFyQjtBQUNBLFVBQU8sSUFBUDtBQUNBLEdBSEQ7O0FBQUEsV0FBd0JFLGVBQXhCO0FBQUE7QUFBQTs7QUFBQSxTQUF3QkEsZUFBeEI7QUFBQTtBQUpjLEMiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgZW5naW5lIGZyb20gJy4vZW5naW5lJztcblxuZXhwb3J0IGRlZmF1bHQge1xuXHQnYWZ0ZXInOiBbICdob29rczpsb2c6c3RhcnQ6YWZ0ZXInIF0sXG5cdCdtb2Rlcyc6IFsgJ3NlcnZlcicgXSxcblxuXHQnc3RhcnQnOiBhc3luYyBmdW5jdGlvbiBzdGFydEVuZ2luZUhvb2sgKCBhcHBsaWNhdGlvbiApIHtcblx0XHRhcHBsaWNhdGlvbi5lbmdpbmUgPSBlbmdpbmUoIGFwcGxpY2F0aW9uICk7XG5cdFx0cmV0dXJuIHRoaXM7XG5cdH1cbn07XG4iXX0= |
@@ -1,18 +0,9 @@ | ||
/*eslint-disable no-console */ | ||
/** | ||
* Log Hook | ||
* Abstract: Provides logging facilities on application.log | ||
* Configuration: configuration/log.js | ||
**/ | ||
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _logger = require('./logger'); | ||
@@ -22,14 +13,15 @@ | ||
exports['default'] = { | ||
'after': ['hooks:user-hooks:start:after'], | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
'configure': _asyncToGenerator(function* (application) { | ||
this.configuration = Object.assign(this.configuration, this.defaults, application.configuration[this.name]); | ||
exports.default = { | ||
after: ['hooks:user-hooks:start:after'], | ||
configure: function configure(application) { | ||
this.configuration = _extends({}, this.configuration, this.defaults, application.configuration[this.name]); | ||
this.configuration.level = application.runtime.api.loglevel || this.configuration.level; | ||
return this; | ||
}), | ||
}, | ||
start: function start(application) { | ||
const logger = (0, _logger2.default)(`[${ application.name }]`, this.configuration); | ||
'start': _asyncToGenerator(function* (application) { | ||
var logger = (0, _logger2['default'])('[' + application.name + ']', this.configuration); | ||
application.log.silly('Draining boot logger queue...'); | ||
@@ -42,5 +34,5 @@ application.log.drain(logger); | ||
return this; | ||
}) | ||
} | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9sb2cvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7c0JBT3dCLFVBQVU7Ozs7cUJBRW5CO0FBQ2QsUUFBTyxFQUFFLENBQUUsOEJBQThCLENBQUU7O0FBRTNDLFlBQVcsb0JBQUUsV0FBa0MsV0FBVyxFQUFHO0FBQzVELE1BQUksQ0FBQyxhQUFhLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBRSxJQUFJLENBQUMsYUFBYSxFQUFFLElBQUksQ0FBQyxRQUFRLEVBQUUsV0FBVyxDQUFDLGFBQWEsQ0FBRSxJQUFJLENBQUMsSUFBSSxDQUFFLENBQUUsQ0FBQztBQUNoSCxNQUFJLENBQUMsYUFBYSxDQUFDLEtBQUssR0FB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1ob29rczpzdGFydDphZnRlciddLFxuXG5cdGNvbmZpZ3VyZShhcHBsaWNhdGlvbikge1xuXHRcdHRoaXMuY29uZmlndXJhdGlvbiA9IHsuLi50aGlzLmNvbmZpZ3VyYXRpb24sIC4uLnRoaXMuZGVmYXVsdHMsIC4uLmFwcGxpY2F0aW9uLmNvbmZpZ3VyYXRpb25bdGhpcy5uYW1lXX07XG5cdFx0dGhpcy5jb25maWd1cmF0aW9uLmxldmVsID0gYXBwbGljYXRpb24ucnVudGltZS5hcGkubG9nbGV2ZWwgfHwgdGhpcy5jb25maWd1cmF0aW9uLmxldmVsO1xuXHRcdHJldHVybiB0aGlzO1xuXHR9LFxuXG5cdHN0YXJ0KGFwcGxpY2F0aW9uKSB7XG5cdFx0Y29uc3QgbG9nZ2VyID0gc3RhcnRMb2dnZXIoYFske2FwcGxpY2F0aW9uLm5hbWV9XWAsIHRoaXMuY29uZmlndXJhdGlvbik7XG5cblx0XHRhcHBsaWNhdGlvbi5sb2cuc2lsbHkoJ0RyYWluaW5nIGJvb3QgbG9nZ2VyIHF1ZXVlLi4uJyk7XG5cdFx0YXBwbGljYXRpb24ubG9nLmRyYWluKGxvZ2dlcik7XG5cblx0XHRsb2dnZXIuc2lsbHkoJ0RlcGxveWluZyBhcHBsaWNhdGlvbiBsb2dnZXIuLi4nKTtcblx0XHRhcHBsaWNhdGlvbi5sb2cuZGVwbG95KGxvZ2dlcik7XG5cblx0XHRyZXR1cm4gdGhpcztcblx0fVxufTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _bind = Function.prototype.bind; | ||
exports.Logger = undefined; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _winston = require('winston'); | ||
var privates = new WeakMap(); | ||
const privates = new WeakMap(); | ||
var Logger = (function () { | ||
function Logger(prefix, options) { | ||
_classCallCheck(this, Logger); | ||
var engine = new _winston.Logger(options); | ||
class Logger { | ||
constructor(prefix, options) { | ||
const engine = new _winston.Logger(options); | ||
engine.add(_winston.transports.Console, options); | ||
@@ -25,65 +19,55 @@ privates.set(this, { prefix: prefix, options: options, engine: engine }); | ||
_createClass(Logger, [{ | ||
key: 'log', | ||
value: function log(method) { | ||
var _privates$get = privates.get(this); | ||
log(method) { | ||
var _privates$get = privates.get(this); | ||
var engine = _privates$get.engine; | ||
var prefix = _privates$get.prefix; | ||
const engine = _privates$get.engine; | ||
const prefix = _privates$get.prefix; | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
engine[method].apply(engine, [prefix].concat(args)); | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
}, { | ||
key: 'error', | ||
value: function error() { | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
this.log.apply(this, ['error'].concat(args)); | ||
engine[method].apply(engine, [prefix].concat(args)); | ||
} | ||
error() { | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
}, { | ||
key: 'warn', | ||
value: function warn() { | ||
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
args[_key3] = arguments[_key3]; | ||
} | ||
this.log.apply(this, ['warn'].concat(args)); | ||
this.log.apply(this, ['error'].concat(args)); | ||
} | ||
warn() { | ||
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
args[_key3] = arguments[_key3]; | ||
} | ||
}, { | ||
key: 'info', | ||
value: function info() { | ||
for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
args[_key4] = arguments[_key4]; | ||
} | ||
this.log.apply(this, ['info'].concat(args)); | ||
this.log.apply(this, ['warn'].concat(args)); | ||
} | ||
info() { | ||
for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
args[_key4] = arguments[_key4]; | ||
} | ||
}, { | ||
key: 'debug', | ||
value: function debug() { | ||
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { | ||
args[_key5] = arguments[_key5]; | ||
} | ||
this.log.apply(this, ['debug'].concat(args)); | ||
this.log.apply(this, ['info'].concat(args)); | ||
} | ||
debug() { | ||
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { | ||
args[_key5] = arguments[_key5]; | ||
} | ||
}, { | ||
key: 'silly', | ||
value: function silly() { | ||
for (var _len6 = arguments.length, args = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { | ||
args[_key6] = arguments[_key6]; | ||
} | ||
this.log.apply(this, ['silly'].concat(args)); | ||
this.log.apply(this, ['debug'].concat(args)); | ||
} | ||
silly() { | ||
for (var _len6 = arguments.length, args = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { | ||
args[_key6] = arguments[_key6]; | ||
} | ||
}]); | ||
return Logger; | ||
})(); | ||
this.log.apply(this, ['silly'].concat(args)); | ||
} | ||
} | ||
@@ -95,7 +79,7 @@ function loggerFactory() { | ||
return new (_bind.apply(Logger, [null].concat(args)))(); | ||
return new (Function.prototype.bind.apply(Logger, [null].concat(args)))(); | ||
} | ||
exports['default'] = loggerFactory; | ||
exports.default = loggerFactory; | ||
exports.Logger = Logger; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9sb2cvbG9nZ2VyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7O3VCQUF5RSxTQUFTOztBQUVsRixJQUFNLFFBQVEsR0FBRyxJQUFJLE9BQU8sRUFBRSxDQUFDOztJQUV6QixNQUFNO0FBQ0MsVUFEUCxNQUFNLENBQ0UsTUFBTSxFQUFFLE9BQU8sRUFBRTt3QkFEekIsTUFBTTs7QUFFVixNQUFJLE1BQU0sR0FBRyxvQkFBa0IsT0FBTyxDQUFDLENBQUM7QUFDeEMsUUFBTSxDQUFDLEdBQUcsQ0FBQyxvQkFBa0IsT0FBTyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0FBQy9DLFVBQVEsQ0FBQyxHQUFHLENBQUMsSUFBSSxFQUFFLEVBQUUsTUFBTSxFQUFOLE1BQU0sRUFBRSxPQUFPLEVBQVAsT0FBTyxFQUFFLE1BQU0sRUFBTixNQUFNLEVBQUUsQ0FBQyxDQUFDO0VBQ2hEOztjQUxJLE1BQU07O1NBT1AsYUFBQyxNQUFNLEVBQVc7dUJBQ0ksUUFBUSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUM7O09BQXJDLE1BQU0saUJBQU4sTUFBTTtPQUFFLE1BQU0saUJBQU4sTUFBTTs7cUNBREwsSUFBSTtBQUFKLFFBQUk7OztBQUVuQixTQUFNLENBQUMsTUFBTSxPQUFDLENBQWQsTUFBTSxHQUFhLE1BQU0sU0FBSyxJQUFJLEVBQUUsQ0FBQztHQUNyQzs7O1NBRUssaUJBQVU7c0NBQU4sSUFBSTtBQUFKLFFBQUk7OztBQUNiLE9BQUksQ0FBQyxHQUFHLE1BQUEsQ0FB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XG5cdFx0cHJpdmF0ZXMuc2V0KHRoaXMsIHtwcmVmaXgsIG9wdGlvbnMsIGVuZ2luZX0pO1xuXHR9XG5cblx0bG9nKG1ldGhvZCwgLi4uYXJncykge1xuXHRcdGNvbnN0IHtlbmdpbmUsIHByZWZpeH0gPSBwcml2YXRlcy5nZXQodGhpcyk7XG5cdFx0ZW5naW5lW21ldGhvZF0oLi4uW3ByZWZpeCwgLi4uYXJnc10pO1xuXHR9XG5cblx0ZXJyb3IoLi4uYXJncykge1xuXHRcdHRoaXMubG9nKCdlcnJvcicsIC4uLmFyZ3MpO1xuXHR9XG5cblx0d2FybiguLi5hcmdzKSB7XG5cdFx0dGhpcy5sb2coJ3dhcm4nLCAuLi5hcmdzKTtcblx0fVxuXG5cdGluZm8oLi4uYXJncykge1xuXHRcdHRoaXMubG9nKCdpbmZvJywgLi4uYXJncyk7XG5cdH1cblxuXHRkZWJ1ZyguLi5hcmdzKSB7XG5cdFx0dGhpcy5sb2coJ2RlYnVnJywgLi4uYXJncyk7XG5cdH1cblxuXHRzaWxseSguLi5hcmdzKSB7XG5cdFx0dGhpcy5sb2coJ3NpbGx5JywgLi4uYXJncyk7XG5cdH1cbn1cblxuZnVuY3Rpb24gbG9nZ2VyRmFjdG9yeSguLi5hcmdzKSB7XG5cdHJldHVybiBuZXcgTG9nZ2VyKC4uLmFyZ3MpO1xufVxuXG5leHBvcnQgZGVmYXVsdCBsb2dnZXJGYWN0b3J5O1xuZXhwb3J0IHtMb2dnZXIgYXMgTG9nZ2VyfTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _path = require('path'); | ||
@@ -17,35 +13,29 @@ | ||
var _libraryUtilitiesFs = require('../../../library/utilities/fs'); | ||
var _fs = require('../../../library/utilities/fs'); | ||
exports['default'] = { | ||
'after': ['hooks:routes:start:after'], | ||
'modes': ['server'], | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
'start': _asyncToGenerator(function* (application) { | ||
var _this = this; | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
// Load physical core middlewares | ||
var coreMiddlewares = (0, _requireAll2['default'])((0, _path.resolve)(application.runtime.base, application.configuration.paths.middlewares)); | ||
exports.default = { | ||
after: ['hooks:routes:start:after'], | ||
modes: ['server'], | ||
// Load physical user middlewares | ||
var userMiddlewares = {}; | ||
start: (() => { | ||
var _ref = _asyncToGenerator(function* (application) { | ||
var _this = this; | ||
this.configuration.path = Array.isArray(this.configuration.path) ? this.configuration.path : [this.configuration.path]; | ||
const coreMiddlewares = (0, _requireAll2.default)((0, _path.resolve)(application.runtime.base, application.configuration.paths.middlewares)); | ||
const userMiddlewares = {}; | ||
this.configuration.path = Array.isArray(this.configuration.path) ? this.configuration.path : [this.configuration.path]; | ||
var middlewarePaths = this.configuration.path.reduce(function (items, item) { | ||
return items.concat(application.runtime.cwds.map(function (cwd) { | ||
return (0, _path.resolve)(cwd, item); | ||
})); | ||
}, []); | ||
const middlewarePaths = this.configuration.path.reduce(function (items, item) { | ||
return items.concat(application.runtime.cwds.map(function (cwd) { | ||
return (0, _path.resolve)(cwd, item); | ||
})); | ||
}, []); | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
try { | ||
for (var _iterator = middlewarePaths[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var middlewarePath = _step.value; | ||
if (yield (0, _libraryUtilitiesFs.exists)(middlewarePath)) { | ||
Object.assign(userMiddlewares, (0, _requireAll2['default'])(middlewarePath)); | ||
for (const middlewarePath of middlewarePaths) { | ||
if (yield (0, _fs.exists)(middlewarePath)) { | ||
Object.assign(userMiddlewares, (0, _requireAll2.default)(middlewarePath)); | ||
} | ||
@@ -55,77 +45,71 @@ } | ||
// Load module middlewares | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator['return']) { | ||
_iterator['return'](); | ||
const moduleMiddlewares = Object.keys(this.configuration.enabled).filter(function (middlewareName) { | ||
return typeof _this.configuration.enabled[middlewareName].enabled === 'string'; | ||
}).reduce(function (result, middlewareName) { | ||
const middlewareModuleName = _this.configuration.enabled[middlewareName].enabled; | ||
try { | ||
result[middlewareName] = require(middlewareModuleName); | ||
_this.log.silly(`Required module middleware '${ middlewareName }' from module '${ middlewareModuleName }'`); | ||
} catch (err) { | ||
_this.log.warn(`Could not require module middleware '${ middlewareName }' from module '${ middlewareModuleName }'`); | ||
_this.log.error(err); | ||
throw err; | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
var moduleMiddlewares = Object.keys(this.configuration.enabled).filter(function (middlewareName) { | ||
return typeof _this.configuration.enabled[middlewareName].enabled === 'string'; | ||
}).reduce(function (result, middlewareName) { | ||
var middlewareModuleName = _this.configuration.enabled[middlewareName].enabled; | ||
return result; | ||
}, {}); | ||
try { | ||
result[middlewareName] = require(middlewareModuleName); | ||
_this.log.debug('Required module middleware \'' + middlewareName + '\' from module \'' + middlewareModuleName + '\''); | ||
} catch (err) { | ||
_this.log.warn('Could not require module middleware \'' + middlewareName + '\' from module \'' + middlewareModuleName + '\''); | ||
_this.log.debug(err); | ||
} | ||
const middlewares = Object.assign({}, coreMiddlewares, userMiddlewares, moduleMiddlewares); | ||
return result; | ||
}, {}); | ||
// Check if required modules are functions, bind to engine | ||
Object.keys(middlewares).forEach(function (middlewareName) { | ||
const middlewareFactoryFunction = middlewares[middlewareName]; | ||
const middlewareConfig = _this.configuration.enabled[middlewareName]; | ||
var middlewares = Object.assign({}, coreMiddlewares, userMiddlewares, moduleMiddlewares); | ||
if (typeof middlewareFactoryFunction !== 'function') { | ||
_this.log.warn(`'${ middlewareName }' is no valid middleware factory`); | ||
return; | ||
} | ||
// Check if required modules are functions, bind to engine | ||
Object.keys(middlewares).forEach(function (middlewareName) { | ||
var middlewareFactoryFunction = middlewares[middlewareName]; | ||
var middlewareConfig = _this.configuration.enabled[middlewareName]; | ||
const isObject = typeof middlewareConfig === 'object'; | ||
if (typeof middlewareFactoryFunction !== 'function') { | ||
_this.log.warn('\'' + middlewareName + '\' is no valid middleware factory'); | ||
return; | ||
} | ||
if (middlewareConfig === false || isObject && middlewareConfig.enabled !== true) { | ||
_this.log.debug(`Middleware '${ middlewareName }' is explicitly disabled.`); | ||
return; | ||
} | ||
var isObject = typeof middlewareConfig === 'object'; | ||
if (typeof middlewareConfig === 'undefined') { | ||
_this.log.debug(`Middleware '${ middlewareName }' is not configured, will not mount.`); | ||
return; | ||
} | ||
if (middlewareConfig === false || isObject && middlewareConfig.enabled !== true) { | ||
_this.log.debug('Middleware \'' + middlewareName + '\' is explicitly disabled.'); | ||
return; | ||
} | ||
const fn = middlewareFactoryFunction(application, middlewareConfig); | ||
if (typeof middlewareConfig === 'undefined') { | ||
_this.log.warn('Middleware \'' + middlewareName + '\' is not configured, will not mount.'); | ||
return; | ||
} | ||
if (typeof fn !== 'function') { | ||
_this.log.warn(`'${ middlewareName }' middleware factory does not produce valid middlewares, will not mount.`); | ||
return; | ||
} | ||
var fn = middlewareFactoryFunction(application, middlewareConfig); | ||
try { | ||
application.router.use(fn); | ||
_this.log.debug(`Middleware '${ middlewareName }' mounted.`); | ||
} catch (err) { | ||
_this.log.error(`Binding '${ middlewareName }' to engine failed`); | ||
_this.log.debug(err); | ||
throw err; | ||
} | ||
}); | ||
if (typeof fn !== 'function') { | ||
_this.log.warn('\'' + middlewareName + '\' middleware factory does not produce valid middlewares, will not mount.'); | ||
return; | ||
} | ||
try { | ||
application.router.use(fn); | ||
_this.log.debug('Middleware \'' + middlewareName + '\' mounted.'); | ||
} catch (err) { | ||
_this.log.error('Binding \'' + middlewareName + '\' to engine failed'); | ||
_this.log.debug(err); | ||
} | ||
return application; | ||
}); | ||
return application; | ||
}) | ||
function startMiddlewareHook(_x) { | ||
return _ref.apply(this, arguments); | ||
} | ||
return startMiddlewareHook; | ||
})() | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9taWRkbGV3YXJlcy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O29CQUF3QixNQUFNOzswQkFFUCxhQUFhOzs7O2tDQUViLCtCQUErQjs7cUJBRXZDO0FBQ2QsUUFBTyxFQUFFLENBQUUsMEJBQTBCLENBQUU7QUFDdkMsUUFBTyxFQUFFLENBQUUsUUFBUSxDQUFFOztBQUVyQixRQUFPLG9CQUFFLFdBQXFDLFdBQVcsRUFBRzs7OztBQUUzRCxNQUFJLGVBQWUsR0FBRyw2QkFBWSxtQkFBUyxXQUFXLENBQUMsT0FBTyxDQUFDLElBQUksRUFBRSxXQUFXLENBQUMsYUFBYSxDQUFDLEtBQUssQ0FBQyxXQUFXLENBQUUsQ0FBRSxDQUFDOzs7QUFHckgsTUFBSSxlQUFlLEdBQUcsRUFBRSxDQUFDOztBQUV6QixNQUFJLENBQUMsYU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yb3V0ZXIudXNlKGZuKTtcblx0XHRcdFx0dGhpcy5sb2cuZGVidWcoYE1pZGRsZXdhcmUgJyR7bWlkZGxld2FyZU5hbWV9JyBtb3VudGVkLmApO1xuXHRcdFx0fSBjYXRjaCAoZXJyKSB7XG5cdFx0XHRcdHRoaXMubG9nLmVycm9yKGBCaW5kaW5nICcke21pZGRsZXdhcmVOYW1lfScgdG8gZW5naW5lIGZhaWxlZGApO1xuXHRcdFx0XHR0aGlzLmxvZy5kZWJ1ZyhlcnIpO1xuXHRcdFx0XHR0aHJvdyBlcnI7XG5cdFx0XHR9XG5cdFx0fSk7XG5cblx0XHRyZXR1cm4gYXBwbGljYXRpb247XG5cdH1cbn07XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _path = require('path'); | ||
@@ -23,93 +19,105 @@ | ||
var _libraryUtilitiesFs = require('../../../library/utilities/fs'); | ||
var _fs = require('../../../library/utilities/fs'); | ||
exports['default'] = { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
exports.default = { | ||
after: ['hooks:engine:start:after'], | ||
start: _asyncToGenerator(function* (application) { | ||
start: function start(application) { | ||
var _this = this; | ||
application.router = (0, _koaRouter2['default'])(); | ||
return _asyncToGenerator(function* () { | ||
application.router = (0, _koaRouter2.default)(); | ||
if (application.mode === 'console') { | ||
return; | ||
} | ||
if (application.mode === 'console') { | ||
return application; | ||
} | ||
// load physical core routes | ||
var coreRoutes = (0, _requireAll2['default'])((0, _path.resolve)(application.runtime.base, application.configuration.paths.routes)); | ||
// load physical core routes | ||
const coreRoutes = (0, _requireAll2.default)((0, _path.resolve)(application.runtime.base, application.configuration.paths.routes)); | ||
// load physical user routes | ||
this.configuration.path = Array.isArray(this.configuration.path) ? this.configuration.path : [this.configuration.path]; | ||
// load physical user routes | ||
_this.configuration.path = Array.isArray(_this.configuration.path) ? _this.configuration.path : [_this.configuration.path]; | ||
var routePaths = yield Promise.all(this.configuration.path.reduce(function (items, item) { | ||
return items.concat(application.runtime.cwds.map(function (cwd) { | ||
return (0, _path.resolve)(cwd, item); | ||
})); | ||
}, []).map(_asyncToGenerator(function* (routePath) { | ||
return { | ||
path: routePath, | ||
exists: yield (0, _libraryUtilitiesFs.exists)(routePath) | ||
}; | ||
}))); | ||
const routePaths = yield Promise.all(_this.configuration.path.reduce(function (items, item) { | ||
return items.concat(application.runtime.cwds.map(function (cwd) { | ||
return (0, _path.resolve)(cwd, item); | ||
})); | ||
}, []).map((() => { | ||
var _ref = _asyncToGenerator(function* (routePath) { | ||
return { | ||
path: routePath, | ||
exists: yield (0, _fs.exists)(routePath) | ||
}; | ||
}); | ||
var userRoutes = routePaths.reduce(function (registry, entry) { | ||
return entry.exists ? (0, _lodash.merge)(registry, (0, _requireAll2['default'])(entry.path)) : registry; | ||
}, {}); | ||
return function (_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})())); | ||
// load module routes | ||
var moduleRoutes = Object.keys(this.configuration.enabled).filter(function (routeName) { | ||
return typeof _this.configuration.enabled[routeName].enabled === 'string'; | ||
}).reduce(function (result, routeName) { | ||
var routeModuleName = _this.configuration.enabled[routeName].enabled; | ||
const userRoutes = routePaths.reduce(function (registry, entry) { | ||
return entry.exists ? (0, _lodash.merge)(registry, (0, _requireAll2.default)(entry.path)) : registry; | ||
}, {}); | ||
try { | ||
result[routeName] = require(routeModuleName); | ||
_this.log.debug('Required module route \'' + routeName + '\' from module \'' + routeModuleName + '\''); | ||
} catch (err) { | ||
_this.log.warn('Could not require module route \'' + routeName + '\' from module \'' + routeModuleName + '\''); | ||
_this.log.debug(err); | ||
} | ||
return result; | ||
}, {}); | ||
// load module routes | ||
const moduleRoutes = Object.keys(_this.configuration.enabled).filter(function (routeName) { | ||
return typeof _this.configuration.enabled[routeName].enabled === 'string'; | ||
}).reduce(function (result, routeName) { | ||
const routeModuleName = _this.configuration.enabled[routeName].enabled; | ||
var routes = (0, _lodash.merge)({}, coreRoutes, moduleRoutes, userRoutes); | ||
try { | ||
result[routeName] = require(routeModuleName); | ||
_this.log.debug(`Required module route '${ routeName }' from module '${ routeModuleName }'`); | ||
} catch (err) { | ||
_this.log.warn(`Could not require module route '${ routeName }' from module '${ routeModuleName }'`); | ||
_this.log.debug(err); | ||
} | ||
return result; | ||
}, {}); | ||
// Check if required modules are functions, bind to router | ||
Object.keys(routes).forEach(function (routeName) { | ||
var routeFactoryFunction = routes[routeName]; | ||
var routeConfig = _this.configuration.enabled[routeName]; | ||
const routes = (0, _lodash.merge)({}, coreRoutes, moduleRoutes, userRoutes); | ||
if (typeof routeFactoryFunction !== 'function') { | ||
throw new Error('\'' + routeName + '\' is no valid route factory'); | ||
} | ||
// Check if required modules are functions, bind to router | ||
Object.keys(routes).forEach(function (routeName) { | ||
const routeFactoryFunction = routes[routeName]; | ||
const routeConfig = _this.configuration.enabled[routeName]; | ||
if (routeConfig === false || routeConfig && routeConfig.enabled === false) { | ||
_this.log.debug('\'' + routeName + '\' is explicitly disabled.'); | ||
return; | ||
} | ||
if (typeof routeFactoryFunction !== 'function') { | ||
throw new Error(`'${ routeName }' is no valid route factory`); | ||
} | ||
if (typeof routeConfig === 'undefined') { | ||
_this.log.debug('\'' + routeName + '\' is not configured, will not mount.'); | ||
return; | ||
} | ||
if (routeConfig === false || routeConfig && routeConfig.enabled === false) { | ||
_this.log.debug(`'${ routeName }' is explicitly disabled.`); | ||
return; | ||
} | ||
var methods = routeConfig.methods || ['GET', 'POST', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']; | ||
var fn = routeFactoryFunction(application, routeConfig); | ||
if (typeof routeConfig === 'undefined') { | ||
_this.log.debug(`'${ routeName }' is not configured, will not mount.`); | ||
return; | ||
} | ||
if (typeof fn !== 'function') { | ||
_this.log.info(routeName + ' factory returned no valid route for ' + routeConfig.path); | ||
return; | ||
} | ||
const methods = routeConfig.methods || ['GET', 'POST', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS']; | ||
const fn = routeFactoryFunction(application, routeConfig); | ||
_this.log.info('Mounting ' + routeName + ' on ' + routeConfig.path); | ||
if (typeof fn !== 'function') { | ||
_this.log.warn(`${ routeName } factory returned no valid route for ${ routeConfig.path }`); | ||
return; | ||
} | ||
application.router.register(routeName, routeConfig.path, methods, function* runRoute(next) { | ||
yield fn.bind(this)(next); | ||
_this.log.debug(`Mounting ${ routeName } on ${ routeConfig.path }`); | ||
application.router.register(routeName, routeConfig.path, methods, function* runRoute(next) { | ||
yield fn.bind(this)(next); | ||
}); | ||
}); | ||
}); | ||
return application; | ||
}) | ||
return application; | ||
})(); | ||
} | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy9yb3V0ZXMvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztvQkFBc0IsTUFBTTs7eUJBRVQsWUFBWTs7OzswQkFDUixhQUFhOzs7O3NCQUNoQixRQUFROztrQ0FFUCwrQkFBK0I7O3FCQUVyQztBQU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LnJlZ2lzdGVyKHJvdXRlTmFtZSwgcm91dGVDb25maWcucGF0aCwgbWV0aG9kcywgZnVuY3Rpb24gKiBydW5Sb3V0ZShuZXh0KSB7XG5cdFx0XHRcdHlpZWxkIGZuLmJpbmQodGhpcykobmV4dCk7XG5cdFx0XHR9KTtcblx0XHR9KTtcblxuXHRcdHJldHVybiBhcHBsaWNhdGlvbjtcblx0fVxufTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _path = require('path'); | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
var _fs = require('../../../library/utilities/fs'); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _getHookTree = require('../../../library/hooks/get-hook-tree'); | ||
var _path = require('path'); | ||
var _getHookTree2 = _interopRequireDefault(_getHookTree); | ||
var _libraryUtilitiesFs = require('../../../library/utilities/fs'); | ||
var _load = require('../../../library/hooks/load'); | ||
var _libraryHooksGetHookTree = require('../../../library/hooks/get-hook-tree'); | ||
var _load2 = _interopRequireDefault(_load); | ||
var _libraryHooksGetHookTree2 = _interopRequireDefault(_libraryHooksGetHookTree); | ||
var _runHookTree = require('../../../library/hooks/run-hook-tree'); | ||
var _libraryHooksLoad = require('../../../library/hooks/load'); | ||
var _runHookTree2 = _interopRequireDefault(_runHookTree); | ||
var _libraryHooksLoad2 = _interopRequireDefault(_libraryHooksLoad); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var _libraryHooksRunHookTree = require('../../../library/hooks/run-hook-tree'); | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
var _libraryHooksRunHookTree2 = _interopRequireDefault(_libraryHooksRunHookTree); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
exports['default'] = { | ||
exports.default = { | ||
configurationKey: 'hooks', | ||
after: ['hooks:configure:start:after'], | ||
start: _asyncToGenerator(function* (application) { | ||
var coreHookPath = (0, _path.resolve)(application.runtime.base, application.configuration.paths.hooks); | ||
this.configuration.path = Array.isArray(this.configuration.path) ? this.configuration.path : [this.configuration.path]; | ||
start: function start(application) { | ||
var _this = this; | ||
var userHookPaths = [].concat(_toConsumableArray(this.configuration.path.reduce(function (items, item) { | ||
return [].concat(_toConsumableArray(items), _toConsumableArray(application.runtime.cwds.map(function (cwd) { | ||
return (0, _path.resolve)(cwd, item); | ||
return _asyncToGenerator(function* () { | ||
const coreHookPath = (0, _path.resolve)(application.runtime.base, application.configuration.paths.hooks); | ||
_this.configuration.path = Array.isArray(_this.configuration.path) ? _this.configuration.path : [_this.configuration.path]; | ||
const userHookPaths = [].concat(_toConsumableArray(_this.configuration.path.reduce(function (items, item) { | ||
return [].concat(_toConsumableArray(items), _toConsumableArray(application.runtime.cwds.map(function (cwd) { | ||
return (0, _path.resolve)(cwd, item); | ||
}))); | ||
}, []).filter(function (item) { | ||
return item !== coreHookPath; | ||
}))); | ||
}, []).filter(function (item) { | ||
return item !== coreHookPath; | ||
}))); | ||
var userHooks = []; | ||
let userHooks = []; | ||
// load user hooks | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
try { | ||
for (var _iterator = userHookPaths[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var userHookPath = _step.value; | ||
if ((yield (0, _libraryUtilitiesFs.exists)(userHookPath)) === false) { | ||
// load user hooks | ||
for (const userHookPath of userHookPaths) { | ||
if ((yield (0, _fs.exists)(userHookPath)) === false) { | ||
// eslint-disable-line | ||
continue; | ||
} else { | ||
application.log.info('Loading user hooks from ' + userHookPath + '...'); | ||
application.log.debug(`Loading user hooks from ${ userHookPath }...`); | ||
} | ||
try { | ||
var loadedHooks = (0, _libraryHooksLoad2['default'])(application, userHookPath, true); | ||
const loadedHooks = (0, _load2.default)(application, userHookPath, true); | ||
userHooks = userHooks.concat(loadedHooks); | ||
application.log.info('Loaded ' + loadedHooks.length + ' user hooks: ' + loadedHooks.map(function (loadedHook) { | ||
application.log.debug(`Loaded ${ loadedHooks.length } user hooks: ${ loadedHooks.map(function (loadedHook) { | ||
return loadedHook.name; | ||
})); | ||
}) }`); | ||
} catch (error) { | ||
application.log.error('Failed loading hooks from ' + userHookPath + ': ' + error.message); | ||
application.log.error(`Failed loading hooks from ${ userHookPath }: ${ error.message }`); | ||
if (error.stack) { | ||
application.log.error('' + error.stack); | ||
application.log.error(`${ error.stack }`); | ||
} | ||
@@ -77,40 +74,27 @@ throw error; | ||
// Let the last user hook with a given name reign | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator['return']) { | ||
_iterator['return'](); | ||
userHooks = [].concat(_toConsumableArray(new Set(userHooks.reverse()))).reverse(); | ||
userHooks = userHooks.map(function (userHook) { | ||
// Detect hooks conflicting with core hooks | ||
const conflictingCoreHook = application.hooks.filter(function (coreHook) { | ||
return coreHook.name === userHook.name; | ||
})[0]; | ||
if (conflictingCoreHook) { | ||
throw new Error(`Hook "${ userHook.name }" from ${ userHook.requirePath } conflicts with core hook "${ conflictingCoreHook.name }", will not load.`); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
return userHook; | ||
}).filter(Boolean); | ||
userHooks = [].concat(_toConsumableArray(new Set(userHooks.reverse()))).reverse(); | ||
const registered = [].concat(_toConsumableArray(application.hooks), _toConsumableArray(userHooks)).map(function (hook) { | ||
return hook.register(application); | ||
}); | ||
userHooks = userHooks.map(function (userHook) { | ||
// Detect hooks conflicting with core hooks | ||
var conflictingCoreHook = application.hooks.filter(function (coreHook) { | ||
return coreHook.name === userHook.name; | ||
})[0]; | ||
if (conflictingCoreHook) { | ||
throw new Error('Hook "' + userHook.name + '" from ' + userHook.requirePath + ' conflicts with core hook "' + conflictingCoreHook.name + '", will not load.'); | ||
} | ||
return userHook; | ||
}).filter(Boolean); | ||
var registered = [].concat(_toConsumableArray(application.hooks), _toConsumableArray(userHooks)).map(function (hook) { | ||
return hook.register(application); | ||
}); | ||
yield Promise.all((0, _libraryHooksRunHookTree2['default'])((0, _libraryHooksGetHookTree2['default'])(registered), registered, application, {})); | ||
application.hooks = registered; | ||
return this; | ||
}) | ||
const jobs = (0, _runHookTree2.default)((0, _getHookTree2.default)(registered), registered, application, {}); | ||
yield Promise.all(jobs); | ||
application.hooks = registered; | ||
return _this; | ||
})(); | ||
} | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9ob29rcy91c2VyLWhvb2tzL2luZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7OztvQkFFTyxNQUFNOztrQ0FJTiwrQkFBK0I7O3VDQUVkLHNDQUFzQzs7OztnQ0FDN0MsNkJBQTZCOz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dFx0XHRcdHJldHVybiB1c2VySG9vaztcblx0XHRcdH0pXG5cdFx0XHQuZmlsdGVyKEJvb2xlYW4pO1xuXG5cdFx0Y29uc3QgcmVnaXN0ZXJlZCA9IFtcblx0XHRcdC4uLmFwcGxpY2F0aW9uLmhvb2tzLFxuXHRcdFx0Li4udXNlckhvb2tzXG5cdFx0XS5tYXAoaG9vayA9PiBob29rLnJlZ2lzdGVyKGFwcGxpY2F0aW9uKSk7XG5cblx0XHRjb25zdCBqb2JzID0gcnVuSG9va1RyZWUoZ2V0SG9va1RyZWUocmVnaXN0ZXJlZCksIHJlZ2lzdGVyZWQsIGFwcGxpY2F0aW9uLCB7fSk7XG5cdFx0YXdhaXQgUHJvbWlzZS5hbGwoam9icyk7XG5cdFx0YXBwbGljYXRpb24uaG9va3MgPSByZWdpc3RlcmVkO1xuXHRcdHJldHVybiB0aGlzO1xuXHR9XG59O1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _koaBasicAuth = require('koa-basic-auth'); | ||
@@ -13,6 +11,8 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function basicAuthMiddlewareFactory(application) { | ||
return function* basicAuthMiddleware(next) { | ||
var config = application.configuration.middlewares.enabled.basicauth; | ||
let config = application.configuration.middlewares.enabled.basicauth; | ||
@@ -22,7 +22,7 @@ if (config.enabled === false) { | ||
} else { | ||
var authorization = (0, _koaBasicAuth2['default'])(config.credentials); | ||
var excluded = false; | ||
let authorization = (0, _koaBasicAuth2.default)(config.credentials); | ||
let excluded = false; | ||
if (config.exclude) { | ||
var matcher = new RegExp(config.exclude, 'g'); | ||
let matcher = new RegExp(config.exclude, 'g'); | ||
excluded = matcher.test(this.path); | ||
@@ -32,3 +32,3 @@ } | ||
if (!excluded) { | ||
var authorize = authorization.bind(this); | ||
let authorize = authorization.bind(this); | ||
try { | ||
@@ -45,3 +45,3 @@ yield authorize(next); | ||
this['throw'](error.status); | ||
this.throw(error.status); | ||
} | ||
@@ -55,4 +55,4 @@ } else { | ||
exports['default'] = basicAuthMiddlewareFactory; | ||
exports.default = basicAuthMiddlewareFactory; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9iYXNpY2F1dGguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7NEJBQWlCLGdCQUFnQjs7OztBQUVqQyxTQUFTLDBCQUEwQixDQUFFLFdBQVcsRUFBRTs7QUFFakQsUUFBTyxVQUFXLG1CQUFtQixDQUFFLElBQUksRUFBRTtBQUM1QyxNQUFJLE1BQU0sR0FBRyxXQUFXLENBQUMsYUFBYSxDQUFDLFdBQVcsQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDOztBQUVyRSxNQUFJLE1BQU0sQ0FBQyxPQUFPLEtBQUssS0FBSyxFQUFFO0FBQzdCLFNBQU0sSUFBSSxDQUFDO0dBQ1gsTUFBTTtBQUNOLE9BQUksYUFBYSxHQUFHLCtCQUFLLE1BQU0sQ0FBQyxXQUFXLENBQUMsQ0FBQztBQUM3QyxPQUFJLFFBQVEsR0FBRyxLQUFLLENBQUM7O0FBRXJCLE9BQUksTUFBTSxDQUFDLE9BQU8sRUFBRTtBQUNuQixRQUFJLE9BQU8sR0FBRyxJQUFJLE1BQU0sQ0FBQyxNQUFNLENBQUMsT0FBTyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0FBQzlDLFlBQVEsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUNuQzs7QUFFRCxPQUFJLENBQUMsUUFBUSxFQUFFO0FBQ2QsUUFBS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Zy5leGNsdWRlKSB7XG5cdFx0XHRcdGxldCBtYXRjaGVyID0gbmV3IFJlZ0V4cChjb25maWcuZXhjbHVkZSwgJ2cnKTtcblx0XHRcdFx0ZXhjbHVkZWQgPSBtYXRjaGVyLnRlc3QodGhpcy5wYXRoKTtcblx0XHRcdH1cblxuXHRcdFx0aWYgKCFleGNsdWRlZCkge1xuXHRcdFx0XHRsZXQgYXV0aG9yaXplID0gYXV0aG9yaXphdGlvbi5iaW5kKHRoaXMpO1xuXHRcdFx0XHR0cnkge1xuXHRcdFx0XHRcdHlpZWxkIGF1dGhvcml6ZShuZXh0KTtcblx0XHRcdFx0fSBjYXRjaCAoZXJyb3IpIHtcblx0XHRcdFx0XHRpZiAoZXJyb3Iuc3RhdHVzID09PSA0MDEpIHtcblx0XHRcdFx0XHRcdHRoaXMuc3RhdHVzID0gNDAxO1xuXHRcdFx0XHRcdFx0dGhpcy5zZXQoJ1dXVy1BdXRoZW50aWNhdGUnLCAnQmFzaWMnKTtcblx0XHRcdFx0XHRcdHRoaXMuYm9keSA9ICdVbmF1dGhvcml6ZWQnO1xuXHRcdFx0XHRcdFx0Ly90aGlzLnRocm93KDQwMSk7XG5cdFx0XHRcdFx0XHRyZXR1cm47XG5cdFx0XHRcdFx0fVxuXG5cdFx0XHRcdFx0dGhpcy50aHJvdyhlcnJvci5zdGF0dXMpO1xuXHRcdFx0XHR9XG5cdFx0XHR9IGVsc2Uge1xuXHRcdFx0XHR5aWVsZCBuZXh0O1xuXHRcdFx0fVxuXHRcdH1cblx0fTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgYmFzaWNBdXRoTWlkZGxld2FyZUZhY3Rvcnk7XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = startEnvironmentMiddleware; | ||
exports.default = startEnvironmentMiddleware; | ||
function startEnvironmentMiddleware(application) { | ||
@@ -15,4 +14,3 @@ return function* environmentMiddleware(next) { | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9lbnZpcm9ubWVudC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztxQkFBd0IsMEJBQTBCOztBQUFuQyxTQUFTLDBCQUEwQixDQUFHLFdBQVcsRUFBRztBQUNsRSxRQUFPLFVBQVcscUJBQXFCLENBQUcsSUFBSSxFQUFHO0FBQ2hELE1BQUksQ0FBQyxHQUFHLENBQUUsUUFBUSxFQUFFLFdBQVcsQ0FBQyxJQUFJLENBQUUsQ0FBQztBQUN2QyxNQUFJLENBQUMsR0FBRyxDQUFFLGVBQWUsRUFBRSxXQUFXLENBQUMsYUFBYSxDQUFDLFdBQVcsQ0FBRSxDQUFDO0FBQ25FLFFBQU0sSUFBSSxDQUFDO0VBQ1gsQ0FBQztDQUNGIiwiZmlsZSI6ImVudmlyb25tZW50LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gc3RhcnRFbnZpcm9ubWVudE1pZGRsZXdhcmUgKCBhcHBsaWNhdGlvbiApIHtcblx0cmV0dXJuIGZ1bmN0aW9uICogZW52aXJvbm1lbnRNaWRkbGV3YXJlICggbmV4dCApIHtcblx0XHR0aGlzLnNldCggJ1gtTmFtZScsIGFwcGxpY2F0aW9uLm5hbWUgKTtcblx0XHR0aGlzLnNldCggJ1gtRW52aXJvbm1lbnQnLCBhcHBsaWNhdGlvbi5jb25maWd1cmF0aW9uLmVudmlyb25tZW50ICk7XG5cdFx0eWllbGQgbmV4dDtcblx0fTtcbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9lbnZpcm9ubWVudC5qcyJdLCJuYW1lcyI6WyJzdGFydEVudmlyb25tZW50TWlkZGxld2FyZSIsImFwcGxpY2F0aW9uIiwiZW52aXJvbm1lbnRNaWRkbGV3YXJlIiwibmV4dCIsInNldCIsIm5hbWUiLCJjb25maWd1cmF0aW9uIiwiZW52aXJvbm1lbnQiXSwibWFwcGluZ3MiOiI7Ozs7O2tCQUF3QkEsMEI7QUFBVCxTQUFTQSwwQkFBVCxDQUFzQ0MsV0FBdEMsRUFBb0Q7QUFDbEUsUUFBTyxVQUFXQyxxQkFBWCxDQUFtQ0MsSUFBbkMsRUFBMEM7QUFDaEQsT0FBS0MsR0FBTCxDQUFVLFFBQVYsRUFBb0JILFlBQVlJLElBQWhDO0FBQ0EsT0FBS0QsR0FBTCxDQUFVLGVBQVYsRUFBMkJILFlBQVlLLGFBQVosQ0FBMEJDLFdBQXJEO0FBQ0EsUUFBTUosSUFBTjtBQUNBLEVBSkQ7QUFLQSIsImZpbGUiOiJlbnZpcm9ubWVudC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHN0YXJ0RW52aXJvbm1lbnRNaWRkbGV3YXJlICggYXBwbGljYXRpb24gKSB7XG5cdHJldHVybiBmdW5jdGlvbiAqIGVudmlyb25tZW50TWlkZGxld2FyZSAoIG5leHQgKSB7XG5cdFx0dGhpcy5zZXQoICdYLU5hbWUnLCBhcHBsaWNhdGlvbi5uYW1lICk7XG5cdFx0dGhpcy5zZXQoICdYLUVudmlyb25tZW50JywgYXBwbGljYXRpb24uY29uZmlndXJhdGlvbi5lbnZpcm9ubWVudCApO1xuXHRcdHlpZWxkIG5leHQ7XG5cdH07XG59XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = startEtagsMiddleware; | ||
exports.default = startEtagsMiddleware; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _koaConditionalGet = require('koa-conditional-get'); | ||
@@ -18,4 +16,6 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function startEtagsMiddleware(application) { | ||
application.engine.use((0, _koaConditionalGet2['default'])()); | ||
application.engine.use((0, _koaConditionalGet2.default)()); | ||
@@ -26,6 +26,5 @@ application.engine.use(function* test(next) { | ||
return (0, _koaEtag2['default'])(); | ||
return (0, _koaEtag2.default)(); | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9ldGFncy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztxQkFHd0Isb0JBQW9COzs7O2lDQUhwQixxQkFBcUI7Ozs7dUJBQzVCLFVBQVU7Ozs7QUFFWixTQUFTLG9CQUFvQixDQUFHLFdBQVcsRUFBRztBQUM1RCxZQUFXLENBQUMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxxQ0FBYSxDQUFDLENBQUM7O0FBRXRDLFlBQVcsQ0FBQyxNQUFNLENBQUMsR0FBRyxDQUFDLFVBQVcsSUFBSSxDQUFDLElBQUksRUFBRTtBQUM1QyxRQUFNLElBQUksQ0FBQztFQUNYLENBQUMsQ0FBQzs7QUFFSCxRQUFPLDJCQUFNLENBQUM7Q0FDZCIsImZpbGUiOiJldGFncy5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBjb25kaXRpb25hbCBmcm9tICdrb2EtY29uZGl0aW9uYWwtZ2V0JztcbmltcG9ydCBldGFnIGZyb20gJ2tvYS1ldGFnJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gc3RhcnRFdGFnc01pZGRsZXdhcmUgKCBhcHBsaWNhdGlvbiApIHtcblx0YXBwbGljYXRpb24uZW5naW5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IHRlc3QobmV4dCkge1xuXHRcdHlpZWxkIG5leHQ7XG5cdH0pO1xuXG5cdHJldHVybiBldGFnKCk7XG59XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
@@ -18,3 +18,3 @@ }); | ||
var message = ['Error', error.pattern ? 'in "' + error.pattern + '"' : '', error.transform ? 'during transform "' + error.transform + '" of' : '', error.file ? '"' + error.file + '":' : 'unknown file:', error.message ? error.message : ''].filter(function (item) { | ||
var message = ['Error', error.pattern ? `in "${ error.pattern }"` : '', error.transform ? `during transform "${ error.transform }" of` : '', error.file ? `"${ error.file }":` : 'unknown file:', error.message ? error.message : ''].filter(function (item) { | ||
return item; | ||
@@ -47,4 +47,4 @@ }).join(' '); | ||
exports['default'] = JSONErrorFactory; | ||
exports.default = JSONErrorFactory; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9qc29uZXJyb3IuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxTQUFTLGdCQUFnQixDQUFHLFdBQVcsRUFBRztBQUN6QyxRQUFPLFVBQVcsb0JBQW9CLENBQUcsSUFBSSxFQUFHO0FBQy9DLE1BQUk7QUFDSCxTQUFNLElBQUksQ0FBQztHQUNYLENBQUMsT0FBUSxLQUFLLEVBQUc7QUFDakIsUUFBSyxDQUFDLE1BQU0sR0FBRyxJQUFJLENBQUM7QUFDcEIsT0FBSSxDQUFDLFFBQVEsQ0FBQyxNQUFNLEdBQUcsS0FBSyxDQUFDLE1BQU0sSUFBSSxHQUFHLENBQUM7O0FBRTNDLE9BQUssS0FBSyxDQUFDLE1BQU0sS0FBSyxHQUFHLEVBQUc7QUFDM0IsUUFBSSxDQUFDLEdBQUcsQ0FBRSxrQkFBa0IsR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HRcdFx0J1BhdHRlcm46ICcgKyBlcnJvci5wYXR0ZXJuLFxuXHRcdFx0XHRcdFx0J1RyYW5zZm9ybTogJyArIGVycm9yLnRyYW5zZm9ybSxcblx0XHRcdFx0XHRcdCdGaWxlOiAnICsgZXJyb3IuZmlsZSxcblx0XHRcdFx0XHRcdGVycm9yLnN0YWNrXS5qb2luKCdcXG4nKTtcblxuXHRcdFx0XHRcdHRoaXMuYm9keSA9IHRleHQ7XG5cdFx0XHRcdFx0YnJlYWs7XG5cdFx0XHR9XG5cdFx0fVxuXHR9O1xufVxuXG5leHBvcnQgZGVmYXVsdCBKU09ORXJyb3JGYWN0b3J5O1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = startLogMiddleware; | ||
exports.default = startLogMiddleware; | ||
function startLogMiddleware(application) { | ||
return function* logMiddleware(next) { | ||
var start = new Date(); | ||
let start = new Date(); | ||
yield next; | ||
var delta = new Date() - start; | ||
application.log.debug('[application:request]', start + ' - ' + this.method + ' ' + this.url + ' - ' + this.response.status + ' ' + this.response.message + ' - ' + delta + 'ms'); | ||
let delta = new Date() - start; | ||
application.log.debug('[application:request]', `${ start } - ${ this.method } ${ this.url } - ${ this.response.status } ${ this.response.message } - ${ delta }ms`); | ||
}; | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9sb2cuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7cUJBQXdCLGtCQUFrQjs7QUFBM0IsU0FBUyxrQkFBa0IsQ0FBRyxXQUFXLEVBQUc7QUFDMUQsUUFBTyxVQUFXLGFBQWEsQ0FBRyxJQUFJLEVBQUc7QUFDeEMsTUFBSSxLQUFLLEdBQUcsSUFBSSxJQUFJ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pcy5tZXRob2R9ICR7dGhpcy51cmx9IC0gJHt0aGlzLnJlc3BvbnNlLnN0YXR1c30gJHt0aGlzLnJlc3BvbnNlLm1lc3NhZ2V9IC0gJHtkZWx0YX1tc2AgKTtcblx0fTtcbn1cbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = responseTimeMiddlewareFactory; | ||
exports.default = responseTimeMiddlewareFactory; | ||
function responseTimeMiddlewareFactory() { | ||
return function* responseTimeMiddleware(next) { | ||
var start = new Date(); | ||
let start = new Date(); | ||
yield next; | ||
var responseTime = new Date() - start; | ||
this.set('X-Response-Time', responseTime + 'ms'); | ||
let responseTime = new Date() - start; | ||
this.set('X-Response-Time', `${ responseTime }ms`); | ||
}; | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9yZXNwb25zZS10aW1lLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O3FCQUF3Qiw2QkFBNkI7O0FBQXRDLFNBQVMsNkJBQTZCLEdBQUk7QUFDeEQsUUFBTyxVQUFXLHNCQUFzQixDQUFHLElBQUksRUFBRztBQUNqRCxNQUFJLEtBQUssR0FBRyxJQUFJLElBQUksRUFBRSxDQUFDO0FBQ3ZCLFFBQU0sSUFBSSxDQUFDOztBQUVYLE1BQUksWUFBWSxHQUFHLElBQUksSUFBSSxFQUFFLEdBQUcsS0FBSyxDQUFDO0FBQ3RDLE1BQUksQ0FBQyxHQUFHLENBQUUsaUJBQWlCLEVBQUssWUFBWSxRQUFNLENBQUM7RUFDbkQsQ0FBQztDQUNGIiwiZmlsZSI6InJlc3BvbnNlLXRpbWUuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmd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ZGRsZXdhcmVGYWN0b3J5ICgpIHtcblx0cmV0dXJuIGZ1bmN0aW9uICogcmVzcG9uc2VUaW1lTWlkZGxld2FyZSAoIG5leHQgKSB7XG5cdFx0bGV0IHN0YXJ0ID0gbmV3IERhdGUoKTtcblx0XHR5aWVsZCBuZXh0O1xuXG5cdFx0bGV0IHJlc3BvbnNlVGltZSA9IG5ldyBEYXRlKCkgLSBzdGFydDtcblx0XHR0aGlzLnNldCggJ1gtUmVzcG9uc2UtVGltZScsIGAke3Jlc3BvbnNlVGltZX1tc2AgKTtcblx0fTtcbn1cbiJdfQ== |
@@ -6,4 +6,3 @@ "use strict"; | ||
}); | ||
exports["default"] = startRevisionMiddleware; | ||
exports.default = startRevisionMiddleware; | ||
function startRevisionMiddleware(application) { | ||
@@ -14,4 +13,3 @@ return function* revisionMiddleWare(next) { | ||
} | ||
module.exports = exports["default"]; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9yZXZpc2lvbi5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztxQkFDd0IsdUJBQXVCOztBQUFoQyxTQUFTLHVCQUF1QixDQUFHLFdBQVcsRUFBRztBQUMvRCxRQUFPLFVBQVcsa0JBQWtCLENBQUcsSUFBSSxFQUFHO0FBQzdDLFFBQU0sSUFBSSxDQUFDO0VBQ1gsQ0FBQztDQUNGIiwiZmlsZSI6InJldmlzaW9uLmpzIiwic291cmNlc0NvbnRlbnQiOlsiXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBzdGFydFJldmlzaW9uTWlkZGxld2FyZSAoIGFwcGxpY2F0aW9uICkge1xuXHRyZXR1cm4gZnVuY3Rpb24gKiByZXZpc2lvbk1pZGRsZVdhcmUgKCBuZXh0ICkge1xuXHRcdHlpZWxkIG5leHQ7XG5cdH07XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcy9yZXZpc2lvbi5qcyJdLCJuYW1lcyI6WyJzdGFydFJldmlzaW9uTWlkZGxld2FyZSIsImFwcGxpY2F0aW9uIiwicmV2aXNpb25NaWRkbGVXYXJlIiwibmV4dCJdLCJtYXBwaW5ncyI6Ijs7Ozs7a0JBQ3dCQSx1QjtBQUFULFNBQVNBLHVCQUFULENBQW1DQyxXQUFuQyxFQUFpRDtBQUMvRCxRQUFPLFVBQVdDLGtCQUFYLENBQWdDQyxJQUFoQyxFQUF1QztBQUM3QyxRQUFNQSxJQUFOO0FBQ0EsRUFGRDtBQUdBIiwiZmlsZSI6InJldmlzaW9uLmpzIiwic291cmNlc0NvbnRlbnQiOlsiXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBzdGFydFJldmlzaW9uTWlkZGxld2FyZSAoIGFwcGxpY2F0aW9uICkge1xuXHRyZXR1cm4gZnVuY3Rpb24gKiByZXZpc2lvbk1pZGRsZVdhcmUgKCBuZXh0ICkge1xuXHRcdHlpZWxkIG5leHQ7XG5cdH07XG59XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = healthRouteFactory; | ||
exports.default = healthRouteFactory; | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
function healthRouteFactory(application) { | ||
return _asyncToGenerator(function* () { | ||
this.body = { | ||
'name': application.name, | ||
'healthy': true | ||
}; | ||
}); | ||
return (() => { | ||
var _ref = _asyncToGenerator(function* () { | ||
this.body = { | ||
'name': application.name, | ||
'healthy': true | ||
}; | ||
}); | ||
function healthRoute() { | ||
return _ref.apply(this, arguments); | ||
} | ||
return healthRoute; | ||
})(); | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9yb3V0ZXMvaGVhbHRoLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O3FCQUF3QixrQkFBa0I7Ozs7QUFBM0IsU0FBUyxrQkFBa0IsQ0FBRyxXQUFXLEVBQUc7QUFDMUQsMEJBQU8sYUFBOEI7QUFDcEMsTUFBSSxDQUFDLElBQUksR0FBRztBQUNYLFNBQU0sRUFBRSxXQUFXLENBQUMsSUFBSTtBQUN4QixZQUFTLEVBQUUsSUFBSTtHQUNmLENBQUM7RUFDRixFQUFDO0NBQ0YiLCJmaWxlIjoiaGVhbHRoLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gaGVhbHRoUm91dGVGYWN0b3J5ICggYXBwbGljYXRpb24gKSB7XG5cdHJldHVybiBhc3luYyBmdW5jdGlvbiBoZWFsdGhSb3V0ZSAoKSB7XG5cdFx0dGhpcy5ib2R5ID0ge1xuXHRcdFx0J25hbWUnOiBhcHBsaWNhdGlvbi5uYW1lLFxuXHRcdFx0J2hlYWx0aHknOiB0cnVlXG5cdFx0fTtcblx0fTtcbn1cbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9yb3V0ZXMvaGVhbHRoLmpzIl0sIm5hbWVzIjpbImhlYWx0aFJvdXRlRmFjdG9yeSIsImFwcGxpY2F0aW9uIiwiYm9keSIsIm5hbWUiLCJoZWFsdGhSb3V0ZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7a0JBQXdCQSxrQjs7OztBQUFULFNBQVNBLGtCQUFULENBQThCQyxXQUE5QixFQUE0QztBQUMxRDtBQUFBLCtCQUFPLGFBQThCO0FBQ3BDLFFBQUtDLElBQUwsR0FBWTtBQUNYLFlBQVFELFlBQVlFLElBRFQ7QUFFWCxlQUFXO0FBRkEsSUFBWjtBQUlBLEdBTEQ7O0FBQUEsV0FBc0JDLFdBQXRCO0FBQUE7QUFBQTs7QUFBQSxTQUFzQkEsV0FBdEI7QUFBQTtBQU1BIiwiZmlsZSI6ImhlYWx0aC5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIGhlYWx0aFJvdXRlRmFjdG9yeSAoIGFwcGxpY2F0aW9uICkge1xuXHRyZXR1cm4gYXN5bmMgZnVuY3Rpb24gaGVhbHRoUm91dGUgKCkge1xuXHRcdHRoaXMuYm9keSA9IHtcblx0XHRcdCduYW1lJzogYXBwbGljYXRpb24ubmFtZSxcblx0XHRcdCdoZWFsdGh5JzogdHJ1ZVxuXHRcdH07XG5cdH07XG59XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = indexRouteFactory; | ||
exports.default = indexRouteFactory; | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
function indexRouteFactory() { | ||
return _asyncToGenerator(function* () { | ||
this.body = 'You are up and running! Place a custom index route in ./application/routes.'; | ||
}); | ||
return (() => { | ||
var _ref = _asyncToGenerator(function* () { | ||
this.body = 'You are up and running! Place a custom index route in ./application/routes.'; | ||
}); | ||
function indexRoute() { | ||
return _ref.apply(this, arguments); | ||
} | ||
return indexRoute; | ||
})(); | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9yb3V0ZXMvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7cUJBQXdCLGlCQUFpQjs7OztBQUExQixTQUFTLGlCQUFpQixHQUFJO0FBQzVDLDBCQUFPLGFBQTZCO0FBQ25DLE1BQUksQ0FBQyxJQUFJLEdBQUcsNkVBQTZFLENBQUM7RUFDMUYsRUFBQztDQUNGIiwiZmlsZSI6ImluZGV4LmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gaW5kZXhSb3V0ZUZhY3RvcnkgKCkge1xuXHRyZXR1cm4gYXN5bmMgZnVuY3Rpb24gaW5kZXhSb3V0ZSAoKSB7XG5cdFx0dGhpcy5ib2R5ID0gJ1lvdSBhcmUgdXAgYW5kIHJ1bm5pbmchIFBsYWNlIGEgY3VzdG9tIGluZGV4IHJvdXRlIGluIC4vYXBwbGljYXRpb24vcm91dGVzLic7XG5cdH07XG59XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9yb3V0ZXMvaW5kZXguanMiXSwibmFtZXMiOlsiaW5kZXhSb3V0ZUZhY3RvcnkiLCJib2R5IiwiaW5kZXhSb3V0ZSJdLCJtYXBwaW5ncyI6Ijs7Ozs7a0JBQXdCQSxpQjs7OztBQUFULFNBQVNBLGlCQUFULEdBQThCO0FBQzVDO0FBQUEsK0JBQU8sYUFBNkI7QUFDbkMsUUFBS0MsSUFBTCxHQUFZLDZFQUFaO0FBQ0EsR0FGRDs7QUFBQSxXQUFzQkMsVUFBdEI7QUFBQTtBQUFBOztBQUFBLFNBQXNCQSxVQUF0QjtBQUFBO0FBR0EiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBpbmRleFJvdXRlRmFjdG9yeSAoKSB7XG5cdHJldHVybiBhc3luYyBmdW5jdGlvbiBpbmRleFJvdXRlICgpIHtcblx0XHR0aGlzLmJvZHkgPSAnWW91IGFyZSB1cCBhbmQgcnVubmluZyEgUGxhY2UgYSBjdXN0b20gaW5kZXggcm91dGUgaW4gLi9hcHBsaWNhdGlvbi9yb3V0ZXMuJztcblx0fTtcbn1cbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = staticRouteFactory; | ||
exports.default = staticRouteFactory; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
var _path = require('path'); | ||
@@ -18,10 +14,12 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
function staticRouteFactory(application, configuration) { | ||
var root = (0, _path.resolve)(application.runtime.base, application.configuration.paths['static']); | ||
var roots = Array.isArray(configuration.options.root) ? configuration.options.root : [configuration.options.root]; | ||
let root = (0, _path.resolve)(application.runtime.base, application.configuration.paths.static); | ||
let roots = Array.isArray(configuration.options.root) ? configuration.options.root : [configuration.options.root]; | ||
roots = [(0, _path.resolve)(process.cwd(), application.configuration.paths['static'])].concat(_toConsumableArray(roots)); | ||
roots = roots.map(function (item) { | ||
return (0, _path.resolve)(application.runtime.cwd, item); | ||
}); | ||
roots = [(0, _path.resolve)(process.cwd(), application.configuration.paths.static)].concat(_toConsumableArray(roots)); | ||
roots = roots.map(item => (0, _path.resolve)(application.runtime.cwd, item)); | ||
roots.push(root); | ||
@@ -32,37 +30,15 @@ | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
for (let root of roots) { | ||
yield (0, _koaSend2.default)(this, this.params.path, { root: root }); | ||
try { | ||
for (var _iterator = roots[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var _root = _step.value; | ||
yield (0, _koaSend2['default'])(this, this.params.path, { root: _root }); | ||
if (this.status === 200) { | ||
application.log.info('[application:request] Matched ' + this.params.path + ' on ' + _root); | ||
break; | ||
} else { | ||
application.log.info('[application:request] No match for ' + this.params.path + ' on ' + _root); | ||
} | ||
if (this.status === 200) { | ||
application.log.debug(`[application:request] Matched ${ this.params.path } on ${ root }`); | ||
break; | ||
} else { | ||
application.log.debug(`[application:request] No match for ${ this.params.path } on ${ root }`); | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator['return']) { | ||
_iterator['return'](); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
}; | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9hcHBsaWNhdGlvbi9yb3V0ZXMvc3RhdGljLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O3FCQUd3QixrQkFBa0I7Ozs7OztvQkFIcEIsTUFBTTs7dUJBQ1gsVUFBVTs7OztBQUVaLFNBQVMsa0JBQWtCLENBQUUsV0FBVyxFQUFFLGFBQWEsRUFBRTtBQUN2RSxLQUFJLElBQUksR0FBRyxtQkFBUyxXQUFXLENBQUMsT0FBTyxDQUFDLElBQUksRUFBRSxXQUFXLENBQUMsYUFBYSxDQUFDLEtBQUssVUFBTyxDQUFFLENBQUM7QUFDdkYsS0FBSSxLQUFLLEdBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxhQUFhLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxHQUFHLGFBQWEsQ0FBQyxPQUFPLENBQUMsSUFBSSxHQUFHLENBQUMsYUFBYSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQzs7QUFFbEgsTUFBSyxJQUFJLG1CQUFRLE9BQU8sQ0FBQyxHQUFHLEVBQUUsRUFBRSxXQUFXLENBQUMsYUFBYSxDQUFDLEtBQUssVUFBTyxDQUFDLDRCQUFLLEtBQUssRUFBQyxDQUFDO0FBQ25GLE1BQUssR0FBRyxLQUFLLENBQUMsR0FBRyxDQUFDLFVBQUMsSUFBSTtTQUFLLG1CQUFRLFdBQVcsQ0FBQyxPQUFPLENBQUMsR0FBRyxFQUFFLElBQUksQ0FBQztFQUFBLENBQUMsQ0FBQztBQUNwRSxNQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFDOztBQUVqQixRQUFPLFVBQV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cmF0aW9uLm9wdGlvbnMucm9vdF07XG5cblx0cm9vdHMgPSBbcmVzb2x2ZShwcm9jZXNzLmN3ZCgpLCBhcHBsaWNhdGlvbi5jb25maWd1cmF0aW9uLnBhdGhzLnN0YXRpYyksIC4uLnJvb3RzXTtcblx0cm9vdHMgPSByb290cy5tYXAoKGl0ZW0pID0+IHJlc29sdmUoYXBwbGljYXRpb24ucnVudGltZS5jd2QsIGl0ZW0pKTtcblx0cm9vdHMucHVzaChyb290KTtcblxuXHRyZXR1cm4gZnVuY3Rpb24gKiBzdGF0aWNSb3V0ZSAoKSB7XG5cdFx0dGhpcy5hc3NlcnQodGhpcy5wYXJhbXMucGF0aCwgNDA0KTtcblxuXHRcdGZvciAobGV0IHJvb3Qgb2Ygcm9vdHMpIHtcblx0XHRcdHlpZWxkIHNlbmQodGhpcywgdGhpcy5wYXJhbXMucGF0aCwge3Jvb3R9KTtcblxuXHRcdFx0aWYgKHRoaXMuc3RhdHVzID09PSAyMDApIHtcblx0XHRcdFx0YXBwbGljYXRpb24ubG9nLmRlYnVnKGBbYXBwbGljYXRpb246cmVxdWVzdF0gTWF0Y2hlZCAke3RoaXMucGFyYW1zLnBhdGh9IG9uICR7cm9vdH1gKTtcblx0XHRcdFx0YnJlYWs7XG5cdFx0XHR9IGVsc2Uge1xuXHRcdFx0XHRhcHBsaWNhdGlvbi5sb2cuZGVidWcoYFthcHBsaWNhdGlvbjpyZXF1ZXN0XSBObyBtYXRjaCBmb3IgJHt0aGlzLnBhcmFtcy5wYXRofSBvbiAke3Jvb3R9YCk7XG5cdFx0XHR9XG5cdFx0fVxuXHR9O1xufVxuIl19 |
#!/usr/bin/env node | ||
'use strict'; | ||
var main = _asyncToGenerator(function* (options) { | ||
var application = yield (0, _2['default'])(options); | ||
return yield application.run(options.command, options); | ||
}); | ||
let main = (() => { | ||
var _ref = _asyncToGenerator(function* (options) { | ||
const application = yield (0, _library2.default)(options); | ||
return yield application.run(options.command, options); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
return function main(_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})(); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
require('babel-polyfill'); | ||
var _ = require('../'); | ||
var _library = require('../library'); | ||
var _2 = _interopRequireDefault(_); | ||
var _library2 = _interopRequireDefault(_library); | ||
var _libraryUtilitiesExecute = require('../library/utilities/execute'); | ||
var _execute = require('../library/utilities/execute'); | ||
var _libraryUtilitiesExecute2 = _interopRequireDefault(_libraryUtilitiesExecute); | ||
var _execute2 = _interopRequireDefault(_execute); | ||
(0, _libraryUtilitiesExecute2['default'])(main, { mode: 'console' }); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
(0, _execute2.default)(main, { mode: 'console' }); | ||
// Catch unhandled rejections globally | ||
process.on('unhandledRejection', function (reason, promise) { | ||
process.on('unhandledRejection', (reason, promise) => { | ||
console.log('Unhandled Rejection at: Promise ', promise, ' reason: ', reason); | ||
throw reason; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9iaW5hcnkvYm9pbGVycGxhdGUtY29uc29sZS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztJQUllLElBQUkscUJB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IlxuaW1wb3J0ICdiYWJlbC1wb2x5ZmlsbCc7XG5pbXBvcnQgYm9pbGVycGxhdGUgZnJvbSAnLi4vbGlicmFyeSc7XG5pbXBvcnQgZXhlY3V0ZSBmcm9tICcuLi9saWJyYXJ5L3V0aWxpdGllcy9leGVjdXRlJztcblxuYXN5bmMgZnVuY3Rpb24gbWFpbihvcHRpb25zKSB7XG5cdGNvbnN0IGFwcGxpY2F0aW9uID0gYXdhaXQgYm9pbGVycGxhdGUob3B0aW9ucyk7XG5cdHJldHVybiBhd2FpdCBhcHBsaWNhdGlvbi5ydW4ob3B0aW9ucy5jb21tYW5kLCBvcHRpb25zKTtcbn1cblxuZXhlY3V0ZShtYWluLCB7bW9kZTogJ2NvbnNvbGUnfSk7XG5cbi8vIENhdGNoIHVuaGFuZGxlZCByZWplY3Rpb25zIGdsb2JhbGx5XG5wcm9jZXNzLm9uKCd1bmhhbmRsZWRSZWplY3Rpb24nLCAocmVhc29uLCBwcm9taXNlKSA9PiB7XG5cdGNvbnNvbGUubG9nKCdVbmhhbmRsZWQgUmVqZWN0aW9uIGF0OiBQcm9taXNlICcsIHByb21pc2UsICcgcmVhc29uOiAnLCByZWFzb24pO1xuXHR0aHJvdyByZWFzb247XG59KTtcbiJdfQ== |
#!/usr/bin/env node | ||
'use strict'; | ||
var main = _asyncToGenerator(function* () { | ||
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
let main = (() => { | ||
var _ref = _asyncToGenerator(function* () { | ||
let options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
var application = yield (0, _2['default'])(options); | ||
return yield application.start(); | ||
}); | ||
const application = yield (0, _library2.default)(options); | ||
return yield application.start(); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
return function main(_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})(); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
require('babel-polyfill'); | ||
var _ = require('../'); | ||
var _library = require('../library'); | ||
var _2 = _interopRequireDefault(_); | ||
var _library2 = _interopRequireDefault(_library); | ||
var _libraryUtilitiesExecute = require('../library/utilities/execute'); | ||
var _execute = require('../library/utilities/execute'); | ||
var _libraryUtilitiesExecute2 = _interopRequireDefault(_libraryUtilitiesExecute); | ||
var _execute2 = _interopRequireDefault(_execute); | ||
(0, _libraryUtilitiesExecute2['default'])(main, { mode: 'server' }); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
(0, _execute2.default)(main, { mode: 'server' }); | ||
// Catch unhandled rejections globally | ||
process.on('unhandledRejection', function (reason, promise) { | ||
process.on('unhandledRejection', (reason, promise) => { | ||
console.log('Unhandled Rejection at: Promise ', promise, ' reason: ', reason); | ||
throw reason; | ||
}); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9iaW5hcnkvYm9pbGVycGxhdGUtc2VydmVyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0lBSWUsSUFBSSxxQkFBbkIsYUFBa0M7S0FBZCxPQUFPLHlEQUFHLEVBQUU7O0FBQy9CLEtBQU0sV0FBVyxHQUFHLE1BQU0sbUJBQVksT0FBTyxDQUFDLENBQUM7QUFDL0MsUUFBTyxNQUFNL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pIHtcblx0Y29uc3QgYXBwbGljYXRpb24gPSBhd2FpdCBib2lsZXJwbGF0ZShvcHRpb25zKTtcblx0cmV0dXJuIGF3YWl0IGFwcGxpY2F0aW9uLnN0YXJ0KCk7XG59XG5cbmV4ZWN1dGUobWFpbiwge21vZGU6ICdzZXJ2ZXInfSk7XG5cbi8vIENhdGNoIHVuaGFuZGxlZCByZWplY3Rpb25zIGdsb2JhbGx5XG5wcm9jZXNzLm9uKCd1bmhhbmRsZWRSZWplY3Rpb24nLCAocmVhc29uLCBwcm9taXNlKSA9PiB7XG5cdGNvbnNvbGUubG9nKCdVbmhhbmRsZWQgUmVqZWN0aW9uIGF0OiBQcm9taXNlICcsIHByb21pc2UsICcgcmVhc29uOiAnLCByZWFzb24pO1xuXHR0aHJvdyByZWFzb247XG59KTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = { | ||
exports.default = { | ||
'path': './application/tasks' | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2NvbnNvbGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7cUJBQWU7QUFDZCxPQUFNLEVBQUUscUJBQXFCO0NBQzdCIiwiZmlsZSI6ImNvbnNvbGUuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCB7XG5cdCdwYXRoJzogJy4vYXBwbGljYXRpb24vdGFza3MnXG59O1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2NvbnNvbGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7a0JBQWU7QUFDZCxTQUFRO0FBRE0sQyIsImZpbGUiOiJjb25zb2xlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQge1xuXHQncGF0aCc6ICcuL2FwcGxpY2F0aW9uL3Rhc2tzJ1xufTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var routes = { | ||
const routes = { | ||
'enabled': { | ||
@@ -16,4 +16,4 @@ 'static': { | ||
exports['default'] = routes; | ||
exports.default = routes; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2Vudmlyb25tZW50cy9kZXZlbG9wbWVudC9yb3V0ZXMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxJQUFNLE1BQU0sR0FBRztBQUNkLFVBQVMsRUFBRTtBQUNWLFVBQVEsRUFBRTtBQUNULFlBQVMsRUFBRTtBQUNWLFlBQVEsRUFBRSxDQUFDO0lBQ1g7R0FDRDtFQUNEO0NBQ0QsQ0FBQzs7cUJBRWEsTUFBTSIsImZpbGUiOiJyb3V0ZXMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCByb3V0ZXMgPSB7XG5cdCdlbmFibGVkJzoge1xuXHRcdCdzdGF0aWMnOiB7XG5cdFx0XHQnb3B0aW9ucyc6IHtcblx0XHRcdFx0J21heGFnZSc6IDBcblx0XHRcdH1cblx0XHR9XG5cdH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IHJvdXRlcztcbiJdfQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2Vudmlyb25tZW50cy9kZXZlbG9wbWVudC9yb3V0ZXMuanMiXSwibmFtZXMiOlsicm91dGVzIl0sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE1BQU1BLFNBQVM7QUFDZCxZQUFXO0FBQ1YsWUFBVTtBQUNULGNBQVc7QUFDVixjQUFVO0FBREE7QUFERjtBQURBO0FBREcsQ0FBZjs7a0JBVWVBLE0iLCJmaWxlIjoicm91dGVzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiY29uc3Qgcm91dGVzID0ge1xuXHQnZW5hYmxlZCc6IHtcblx0XHQnc3RhdGljJzoge1xuXHRcdFx0J29wdGlvbnMnOiB7XG5cdFx0XHRcdCdtYXhhZ2UnOiAwXG5cdFx0XHR9XG5cdFx0fVxuXHR9XG59O1xuXG5leHBvcnQgZGVmYXVsdCByb3V0ZXM7XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var middlewares = { | ||
const middlewares = { | ||
'enabled': { | ||
@@ -14,4 +14,4 @@ 'environment': false, | ||
exports['default'] = middlewares; | ||
exports.default = middlewares; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2Vudmlyb25tZW50cy9wcm9kdWN0aW9uL21pZGRsZXdhcmVzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsSUFBTSxXQUFXLEdBQUc7QUFDbkIsVUFBUyxFQUFFO0FBQ1YsZUFBYSxFQUFFLEtBQUs7QUFDcEIsaUJBQWUsRUFBRSxLQUFLO0FBQ3RCLFlBQVUsRUFBRSxLQUFLO0VBQ2pCO0NBQ0QsQ0FBQzs7cUJBRWEsV0FBVyIsImZpbGUiOiJtaWRkbGV3YXJlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImNvbnN0IG1pZGRsZXdhcmVzID0ge1xuXHQnZW5hYmxlZCc6IHtcblx0XHQnZW52aXJvbm1lbnQnOiBmYWxzZSxcblx0XHQncmVzcG9uc2UtdGltZSc6IGZhbHNlLFxuXHRcdCdyZXZpc2lvbic6IGZhbHNlXG5cdH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IG1pZGRsZXdhcmVzO1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2Vudmlyb25tZW50cy9wcm9kdWN0aW9uL21pZGRsZXdhcmVzLmpzIl0sIm5hbWVzIjpbIm1pZGRsZXdhcmVzIl0sIm1hcHBpbmdzIjoiOzs7OztBQUFBLE1BQU1BLGNBQWM7QUFDbkIsWUFBVztBQUNWLGlCQUFlLEtBREw7QUFFVixtQkFBaUIsS0FGUDtBQUdWLGNBQVk7QUFIRjtBQURRLENBQXBCOztrQkFRZUEsVyIsImZpbGUiOiJtaWRkbGV3YXJlcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImNvbnN0IG1pZGRsZXdhcmVzID0ge1xuXHQnZW5hYmxlZCc6IHtcblx0XHQnZW52aXJvbm1lbnQnOiBmYWxzZSxcblx0XHQncmVzcG9uc2UtdGltZSc6IGZhbHNlLFxuXHRcdCdyZXZpc2lvbic6IGZhbHNlXG5cdH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IG1pZGRsZXdhcmVzO1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = { | ||
exports.default = { | ||
'autoPort': false | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2Vudmlyb25tZW50cy9wcm9kdWN0aW9uL3NlcnZlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztxQkFBZTtBQUNkLFdBQVUsRUFBRSxLQUFLO0NBQ2pCIiwiZmlsZSI6InNlcnZlci5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IHtcblx0J2F1dG9Qb3J0JzogZmFsc2Vcbn07XG4iXX0= | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2Vudmlyb25tZW50cy9wcm9kdWN0aW9uL3NlcnZlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztrQkFBZTtBQUNkLGFBQVk7QUFERSxDIiwiZmlsZSI6InNlcnZlci5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IHtcblx0J2F1dG9Qb3J0JzogZmFsc2Vcbn07XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = { | ||
exports.default = { | ||
'path': './application/hooks', | ||
@@ -19,2 +19,2 @@ 'enabled': { | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2hvb2tzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O3FCQUFlO0FBQ2QsT0FBTSxFQUFFLHFCQUFxQjtBQUM3QixVQUFTLEVBQUU7QUFDVixpQkFBZSxFQUFFLElBQUk7QUFDckIsT0FBSyxFQUFFLElBQUk7QUFDWCxVQUFRLEVBQUUsSUFBSTtBQUNkLGNBQVksRUFBRSxJQUFJO0FBQ2xCLGVBQWEsRUFBRSxJQUFJO0FBQ25CLFVBQVEsRUFBRSxJQUFJO0FBQ2QsV0FBUyxFQUFFLElBQUk7RUFDZjtDQUN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Vcblx0fVxufTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var log = { | ||
'level': process.env.BOILERPLATESERVER_LOG_LEVEL || process.env.BOILERPLATE_LOG_LEVEL || process.env.NODE_LOG_LEVEL || process.env.LOG_LEVEL || 'silly', | ||
'colorize': true, | ||
'timestamp': true, | ||
'showLevel': true, | ||
'colors': { | ||
'trace': 'magenta', | ||
'input': 'grey', | ||
'verbose': 'cyan', | ||
'prompt': 'grey', | ||
'debug': 'blue', | ||
'info': 'green', | ||
'data': 'grey', | ||
'help': 'cyan', | ||
'warn': 'yellow', | ||
'error': 'red' | ||
const level = process.env.BOILERPLATESERVER_LOG_LEVEL || process.env.BOILERPLATE_LOG_LEVEL || process.env.NODE_LOG_LEVEL || process.env.LOG_LEVEL || 'info'; | ||
const log = { | ||
level: level, | ||
colorize: true, | ||
timestamp: true, | ||
showLevel: true, | ||
colors: { | ||
trace: 'magenta', | ||
input: 'grey', | ||
verbose: 'cyan', | ||
prompt: 'grey', | ||
debug: 'blue', | ||
info: 'green', | ||
data: 'grey', | ||
help: 'cyan', | ||
warn: 'yellow', | ||
error: 'red' | ||
} | ||
}; | ||
exports['default'] = log; | ||
exports.default = log; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL2xvZy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLElBQU0sR0FBRyxHQUFHO0FBQ1gsUUFBTyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsMkJBQTJCLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxxQkFBcUIsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLGNBQWMsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFDLFNBQVMsSUFBSSx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FBTztBQVZBO0FBTEcsQ0FBWjs7a0JBbUJlZCxHIiwiZmlsZSI6ImxvZy5qcyIsInNvdXJjZXNDb250ZW50IjpbImNvbnN0IGxldmVsID0gcHJvY2Vzcy5lbnYuQk9JTEVSUExBVEVTRVJWRVJfTE9HX0xFVkVMIHx8XG5cdHByb2Nlc3MuZW52LkJPSUxFUlBMQVRFX0xPR19MRVZFTCB8fFxuXHRwcm9jZXNzLmVudi5OT0RFX0xPR19MRVZFTCB8fFxuXHRwcm9jZXNzLmVudi5MT0dfTEVWRUwgfHxcblx0J2luZm8nO1xuXG5jb25zdCBsb2cgPSB7XG5cdGxldmVsLFxuXHRjb2xvcml6ZTogdHJ1ZSxcblx0dGltZXN0YW1wOiB0cnVlLFxuXHRzaG93TGV2ZWw6IHRydWUsXG5cdGNvbG9yczoge1xuXHRcdHRyYWNlOiAnbWFnZW50YScsXG5cdFx0aW5wdXQ6ICdncmV5Jyxcblx0XHR2ZXJib3NlOiAnY3lhbicsXG5cdFx0cHJvbXB0OiAnZ3JleScsXG5cdFx0ZGVidWc6ICdibHVlJyxcblx0XHRpbmZvOiAnZ3JlZW4nLFxuXHRcdGRhdGE6ICdncmV5Jyxcblx0XHRoZWxwOiAnY3lhbicsXG5cdFx0d2FybjogJ3llbGxvdycsXG5cdFx0ZXJyb3I6ICdyZWQnXG5cdH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IGxvZztcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var middlewares = { | ||
const middlewares = { | ||
'path': './application/middlewares', | ||
@@ -26,4 +26,4 @@ 'enabled': { | ||
exports['default'] = middlewares; | ||
exports.default = middlewares; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL21pZGRsZXdhcmVzLmpzIl0sIm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QVNTIHx8ICdib2lsZXJwbGF0ZS1zZXJ2ZXInXG5cdFx0XHR9LFxuXHRcdFx0J2V4Y2x1ZGUnOiAnL2hlYWx0aCdcblx0XHR9XG5cdH1cbn07XG5cbmV4cG9ydCBkZWZhdWx0IG1pZGRsZXdhcmVzO1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = { | ||
exports.default = { | ||
'roots': [], | ||
@@ -17,2 +17,2 @@ 'hooks': './application/hooks', | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL3BhdGhzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O3FCQUFlO0FBQ2QsUUFBTyxFQUFFLEVBQUU7QUFDWCxRQUFPLEVBQUUscUJBQXFCO0FBQzlCLGNBQWEsRUFBRSwyQkFBMkI7QUFDMUMsU0FBUSxFQUFFLHNCQUFzQjtBQUNoQyxnQkFBZSxFQUFFLENBQUUsaUJBQWlCLENBQUU7QUFDdEMsU0FBUSxFQUFFLFVBQVU7QUFDcEIsUUFBTyxFQUFFLFNBQVM7QUFDbEIsZUFBYyxFQUFFLGdCQUFnQjtDQUNoQyIsImZpbGUiOiJwYXRocy5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IHtcblx0J3Jvb3RzJzogW10sXG5cdCdob29rcyc6ICcuL2FwcGxpY2F0aW9uL2hvb2tzJyxcblx0J21pZGRsZXdhcmVzJzogJy4vYXBwbGljYXRpb24vbWlkZGxld2FyZXMnLFxuXHQncm91dGVzJzogJy4vYXBwbGljYXRpb24vcm91dGVzJyxcblx0J2NvbmZpZ3VyYXRpb24nOiBbICcuL2NvbmZpZ3VyYXRpb24nIF0sXG5cdCdzdGF0aWMnOiAnLi9zdGF0aWMnLFxuXHQnYnVpbGQnOiAnLi9idWlsZCcsXG5cdCdkaXN0cmlidXRpb24nOiAnLi9kaXN0cmlidXRpb24nXG59O1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL3BhdGhzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O2tCQUFlO0FBQ2QsVUFBUyxFQURLO0FBRWQsVUFBUyxxQkFGSztBQUdkLGdCQUFlLDJCQUhEO0FBSWQsV0FBVSxzQkFKSTtBQUtkLGtCQUFpQixDQUFFLGlCQUFGLENBTEg7QUFNZCxXQUFVLFVBTkk7QUFPZCxVQUFTLFNBUEs7QUFRZCxpQkFBZ0I7QUFSRixDIiwiZmlsZSI6InBhdGhzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQge1xuXHQncm9vdHMnOiBbXSxcblx0J2hvb2tzJzogJy4vYXBwbGljYXRpb24vaG9va3MnLFxuXHQnbWlkZGxld2FyZXMnOiAnLi9hcHBsaWNhdGlvbi9taWRkbGV3YXJlcycsXG5cdCdyb3V0ZXMnOiAnLi9hcHBsaWNhdGlvbi9yb3V0ZXMnLFxuXHQnY29uZmlndXJhdGlvbic6IFsgJy4vY29uZmlndXJhdGlvbicgXSxcblx0J3N0YXRpYyc6ICcuL3N0YXRpYycsXG5cdCdidWlsZCc6ICcuL2J1aWxkJyxcblx0J2Rpc3RyaWJ1dGlvbic6ICcuL2Rpc3RyaWJ1dGlvbidcbn07XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var routes = { | ||
const routes = { | ||
'path': './application/routes', | ||
@@ -30,4 +30,4 @@ 'enabled': { | ||
exports['default'] = routes; | ||
exports.default = routes; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,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UsXG5cdFx0XHQnbWV0aG9kJzogJ0dFVCcsXG5cdFx0XHQncGF0aCc6ICcvc3RhdGljLzpwYXRoKicsXG5cdFx0XHQnb3B0aW9ucyc6IHtcblx0XHRcdFx0J3Jvb3QnOiAnLi9zdGF0aWMnXG5cdFx0XHR9XG5cdFx0fSxcblx0XHQnaGVhbHRoJzoge1xuXHRcdFx0J2VuYWJsZWQnOiB0cnVlLFxuXHRcdFx0J21ldGhvZCc6ICdHRVQnLFxuXHRcdFx0J3BhdGgnOiAnL2hlYWx0aC8nXG5cdFx0fVxuXHR9XG59O1xuXG5leHBvcnQgZGVmYXVsdCByb3V0ZXM7XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = { | ||
exports.default = { | ||
'port': process.env.BOILERPLATESERVER_PORT || process.env.BOILERPLATE_PORT || process.env.NODE_PORT || process.env.PORT || 1337, | ||
@@ -12,2 +12,2 @@ 'host': process.env.BOILERPLATESERVER_HOST || process.env.BOILERPLATE_HOST || process.env.NODE_HOST || process.env.HOST || 'localhost', | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL3NlcnZlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztxQkFBZTtBQUNkLE9BQU0sRUFBRSxPQUFPLENBQUMsR0FBRyxDQUFDLHNCQUFzQixJQUFJLE9BQU8sQ0FBQyxHQUFHLENBQUMsZ0JBQWdCLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxTQUFTLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxJQUFJLElBQUksSUFBSTtBQUMvSCxPQUFNLEVBQUUsT0FBTyxDQUFDLEdBQUcsQ0FBQyxzQkFBc0IsSUFBSSxPQUFPLENBQUMsR0FBRyxDQUFD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ELElBQXNFSCxRQUFRQyxHQUFSLENBQVlHLFNBQWxGLElBQStGSixRQUFRQyxHQUFSLENBQVlJLElBQTNHLElBQW1ILElBRDdHO0FBRWQsU0FBUUwsUUFBUUMsR0FBUixDQUFZSyxzQkFBWixJQUFzQ04sUUFBUUMsR0FBUixDQUFZTSxnQkFBbEQsSUFBc0VQLFFBQVFDLEdBQVIsQ0FBWU8sU0FBbEYsSUFBK0ZSLFFBQVFDLEdBQVIsQ0FBWVEsSUFBM0csSUFBbUgsV0FGN0c7QUFHZCxhQUFZO0FBSEUsQyIsImZpbGUiOiJzZXJ2ZXIuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCB7XG5cdCdwb3J0JzogcHJvY2Vzcy5lbnYuQk9JTEVSUExBVEVTRVJWRVJfUE9SVCB8fCBwcm9jZXNzLmVudi5CT0lMRVJQTEFURV9QT1JUIHx8IHByb2Nlc3MuZW52Lk5PREVfUE9SVCB8fCBwcm9jZXNzLmVudi5QT1JUIHx8IDEzMzcsXG5cdCdob3N0JzogcHJvY2Vzcy5lbnYuQk9JTEVSUExBVEVTRVJWRVJfSE9TVCB8fCBwcm9jZXNzLmVudi5CT0lMRVJQTEFURV9IT1NUIHx8IHByb2Nlc3MuZW52Lk5PREVfSE9TVCB8fCBwcm9jZXNzLmVudi5IT1NUIHx8ICdsb2NhbGhvc3QnLFxuXHQnYXV0b1BvcnQnOiB0cnVlXG59O1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = { | ||
exports.default = { | ||
'test': { | ||
@@ -12,2 +12,2 @@ 'message': 'Hello, i am the test task' | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL3Rhc2tzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O3FCQUFlO0FBQ2QsT0FBTSxFQUFFO0FBQ1AsV0FBUyxFQUFFLDJCQUEyQjtFQUN0QztDQUNEIiwiZmlsZSI6InRhc2tzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGRlZmF1bHQge1xuXHQndGVzdCc6IHtcblx0XHQnbWVzc2FnZSc6ICdIZWxsbywgaSBhbSB0aGUgdGVzdCB0YXNrJ1xuXHR9XG59O1xuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9jb25maWd1cmF0aW9uL3Rhc2tzLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O2tCQUFlO0FBQ2QsU0FBUTtBQUNQLGFBQVc7QUFESjtBQURNLEMiLCJmaWxlIjoidGFza3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCB7XG5cdCd0ZXN0Jzoge1xuXHRcdCdtZXNzYWdlJzogJ0hlbGxvLCBpIGFtIHRoZSB0ZXN0IHRhc2snXG5cdH1cbn07XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _get = function get(_x3, _x4, _x5) { var _again = true; _function: while (_again) { var object = _x3, property = _x4, receiver = _x5; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x3 = parent; _x4 = property; _x5 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; | ||
var boot = _asyncToGenerator(function* (options) { | ||
var application = new BoilerPlateServer(options); | ||
try { | ||
var result = yield (0, _hooks2['default'])(application); | ||
return result; | ||
} catch (error) { | ||
application.log.error(error); | ||
// Drain the logging queue in case of an error | ||
if (application.log.deploy) { | ||
application.log.drain(emergencyLogger); | ||
let boot = (() => { | ||
var _ref = _asyncToGenerator(function* (options) { | ||
const application = new BoilerPlateServer(options); | ||
try { | ||
const result = yield (0, _hooks2.default)(application); | ||
return result; | ||
} catch (error) { | ||
application.log.error(error); | ||
// Drain the logging queue in case of an error | ||
if (application.log.deploy) { | ||
application.log.drain(emergencyLogger); | ||
} | ||
throw error; | ||
} | ||
throw error; | ||
} | ||
}); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
return function boot(_x3) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})(); | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } | ||
var _events = require('events'); | ||
@@ -44,5 +36,5 @@ | ||
var _utilitiesQueuedLogger = require('../utilities/queued-logger'); | ||
var _queuedLogger = require('../utilities/queued-logger'); | ||
var _utilitiesQueuedLogger2 = _interopRequireDefault(_utilitiesQueuedLogger); | ||
var _queuedLogger2 = _interopRequireDefault(_queuedLogger); | ||
@@ -53,4 +45,12 @@ var _hooks = require('../hooks'); | ||
var emergencyLogger = { | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
const emergencyLogger = { | ||
log: function log(level) { | ||
var _console; | ||
for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
@@ -60,3 +60,3 @@ rest[_key - 1] = arguments[_key]; | ||
console.log.apply(console, [level].concat(rest)); | ||
(_console = console).log.apply(_console, [level].concat(_toConsumableArray(rest))); | ||
}, | ||
@@ -68,3 +68,3 @@ error: function error() { | ||
emergencyLogger.log.apply(emergencyLogger, ['error'].concat(message)); | ||
emergencyLogger.log.apply(emergencyLogger, ['error'].concat(_toConsumableArray(message))); | ||
}, | ||
@@ -76,3 +76,3 @@ warn: function warn() { | ||
emergencyLogger.log.apply(emergencyLogger, ['message'].concat(message)); | ||
emergencyLogger.log.apply(emergencyLogger, ['message'].concat(_toConsumableArray(message))); | ||
}, | ||
@@ -84,3 +84,3 @@ info: function info() { | ||
emergencyLogger.log.apply(emergencyLogger, ['info'].concat(message)); | ||
emergencyLogger.log.apply(emergencyLogger, ['info'].concat(_toConsumableArray(message))); | ||
}, | ||
@@ -92,3 +92,3 @@ debug: function debug() { | ||
emergencyLogger.log.apply(emergencyLogger, ['debug'].concat(message)); | ||
emergencyLogger.log.apply(emergencyLogger, ['debug'].concat(_toConsumableArray(message))); | ||
}, | ||
@@ -100,14 +100,10 @@ silly: function silly() { | ||
emergencyLogger.log.apply(emergencyLogger, ['silly'].concat(message)); | ||
emergencyLogger.log.apply(emergencyLogger, ['silly'].concat(_toConsumableArray(message))); | ||
} | ||
}; | ||
var BoilerPlateServer = (function (_EventEmitter) { | ||
_inherits(BoilerPlateServer, _EventEmitter); | ||
class BoilerPlateServer extends _events.EventEmitter { | ||
constructor(options) { | ||
super(); | ||
function BoilerPlateServer(options) { | ||
_classCallCheck(this, BoilerPlateServer); | ||
_get(Object.getPrototypeOf(BoilerPlateServer.prototype), 'constructor', this).call(this); | ||
this.name = options.name; | ||
@@ -121,59 +117,62 @@ this.subs = options.subs || []; | ||
cwds: [], | ||
cwd: _appRootPath2['default'].path | ||
cwd: _appRootPath2.default.path | ||
}, options); | ||
this.log = (0, _utilitiesQueuedLogger2['default'])(this.name); | ||
this.log = (0, _queuedLogger2.default)(this.name); | ||
} | ||
_createClass(BoilerPlateServer, [{ | ||
key: 'start', | ||
value: _asyncToGenerator(function* () { | ||
var host = arguments.length <= 0 || arguments[0] === undefined ? this.configuration.server.host : arguments[0]; | ||
var port = arguments.length <= 1 || arguments[1] === undefined ? this.configuration.server.port : arguments[1]; | ||
start() { | ||
var _this = this; | ||
yield this.engine.start(host, port); | ||
return this; | ||
}) | ||
}, { | ||
key: 'stop', | ||
value: _asyncToGenerator(function* () { | ||
this.log.info('\n[application:stop] Stopping server gracefully...'); | ||
yield this.engine.stop(); | ||
this.log.info('\n[application:stop] Stopped server gracefully...'); | ||
return this; | ||
}) | ||
}, { | ||
key: 'mount', | ||
value: function mount() { | ||
var _sub$runtime$cwds, _engine; | ||
let host = arguments.length <= 0 || arguments[0] === undefined ? this.configuration.server.host : arguments[0]; | ||
let port = arguments.length <= 1 || arguments[1] === undefined ? this.configuration.server.port : arguments[1]; | ||
return _asyncToGenerator(function* () { | ||
yield _this.engine.start(host, port); | ||
return _this; | ||
})(); | ||
} | ||
for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { | ||
args[_key7] = arguments[_key7]; | ||
} | ||
stop() { | ||
var _this2 = this; | ||
var sub = args[0]; | ||
return _asyncToGenerator(function* () { | ||
_this2.log.info('\nStopping server gracefully...'); | ||
yield _this2.engine.stop(); | ||
_this2.log.info('\nStopped server gracefully...'); | ||
return _this2; | ||
})(); | ||
} | ||
(_sub$runtime$cwds = sub.runtime.cwds).splice.apply(_sub$runtime$cwds, [1, 0].concat(_toConsumableArray(this.runtime.cwds))); | ||
sub.runtime.cwds = [].concat(_toConsumableArray(new Set(sub.runtime.cwds))); | ||
(_engine = this.engine).mount.apply(_engine, args); | ||
return this; | ||
mount() { | ||
var _sub$runtime$cwds, _engine; | ||
for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { | ||
args[_key7] = arguments[_key7]; | ||
} | ||
}, { | ||
key: 'run', | ||
value: _asyncToGenerator(function* (command, options) { | ||
if (!this.console) { | ||
this.log.warn('[application:stop] application.console is not avaiable. Aborting.'); | ||
return this; | ||
const sub = args[0]; | ||
(_sub$runtime$cwds = sub.runtime.cwds).splice.apply(_sub$runtime$cwds, [1, 0].concat(_toConsumableArray(this.runtime.cwds))); | ||
sub.runtime.cwds = [].concat(_toConsumableArray(new Set(sub.runtime.cwds))); | ||
(_engine = this.engine).mount.apply(_engine, args); | ||
return this; | ||
} | ||
run(command, options) { | ||
var _this3 = this; | ||
return _asyncToGenerator(function* () { | ||
if (!_this3.console) { | ||
_this3.log.warn('application.console is not avaiable. Aborting.'); | ||
return _this3; | ||
} | ||
yield this.console.run(command, options); | ||
return this; | ||
}) | ||
}]); | ||
yield _this3.console.run(command, options); | ||
return _this3; | ||
})(); | ||
} | ||
} | ||
return BoilerPlateServer; | ||
})(_events.EventEmitter); | ||
exports['default'] = boot; | ||
exports.default = boot; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L2Jvb3QvaW5kZXguanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7OztJQWtGZSxJQUFJLHFCQUFuQixXQUFvQixPQUFPLEVBQUU7QUFDNUIsS0FBTSxXQUFXLEdBQUcsSUFBSSxpQkFBaUIsQ0FBQyxPQUFPLENBQUMsQ0FBQztBQUNuRCxLQUFJO0FBQ0gsTUFBTSxNQUFNLEdBQUcsTUFBTSx3QkFBTSxXQUFXLENBQUMsQ0FBQztBQUN4QyxTQUFPLE1BQU0sQ0FBQztFQUNkLENBQUMsT0FBTyxLQUFLLEVBQUU7QUFDZixhQUFXLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxLQUFLLENBQUMsQ0FBQzs7QUFFN0IsTUFBSSxXQUFXLENBQUMsR0FBRyxDQUFDLE1BQU0sRUFBRTtBQUMzQixjQUFXLENBQUMsR0FBRyxDQUFDLEtBQUssQ0FBQyxlQUFlLENBQUMsQ0FBQztHQUN2QztBQUNELFFBQU0sS0FBSyxDQUFDO0VBQ1o7Q0FDRDs7Ozs7Ozs7Ozs7O3NCQTdGTSxRQUFROzsyQkFFUyxlQUFlOzs7O3NCQUdoQyxRQUFROztxQ0FFVSw0QkFBNEI7Ozs7cUJBQ25DLFVBQVU7Ozs7QUFFNUIsSUFBTSxlQUFlLEdBQUc7QUFDdkIsSUFBRyxFQUFBLGFBQUMsS0FBSyxFQUFXO29DQUFOLElBQUk7QUFBSixPQUFJOzs7QUFDakIsU0FBTyxDQUFD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x0XHRzdWIucnVudGltZS5jd2RzID0gWy4uLm5ldyBTZXQoc3ViLnJ1bnRpbWUuY3dkcyldO1xuXHRcdHRoaXMuZW5naW5lLm1vdW50KC4uLmFyZ3MpO1xuXHRcdHJldHVybiB0aGlzO1xuXHR9XG5cblx0YXN5bmMgcnVuKGNvbW1hbmQsIG9wdGlvbnMpIHtcblx0XHRpZiAoIXRoaXMuY29uc29sZSkge1xuXHRcdFx0dGhpcy5sb2cud2FybignYXBwbGljYXRpb24uY29uc29sZSBpcyBub3QgYXZhaWFibGUuIEFib3J0aW5nLicpO1xuXHRcdFx0cmV0dXJuIHRoaXM7XG5cdFx0fVxuXG5cdFx0YXdhaXQgdGhpcy5jb25zb2xlLnJ1bihjb21tYW5kLCBvcHRpb25zKTtcblx0XHRyZXR1cm4gdGhpcztcblx0fVxufVxuXG5hc3luYyBmdW5jdGlvbiBib290KG9wdGlvbnMpIHtcblx0Y29uc3QgYXBwbGljYXRpb24gPSBuZXcgQm9pbGVyUGxhdGVTZXJ2ZXIob3B0aW9ucyk7XG5cdHRyeSB7XG5cdFx0Y29uc3QgcmVzdWx0ID0gYXdhaXQgaG9va3MoYXBwbGljYXRpb24pO1xuXHRcdHJldHVybiByZXN1bHQ7XG5cdH0gY2F0Y2ggKGVycm9yKSB7XG5cdFx0YXBwbGljYXRpb24ubG9nLmVycm9yKGVycm9yKTtcblx0XHQvLyBEcmFpbiB0aGUgbG9nZ2luZyBxdWV1ZSBpbiBjYXNlIG9mIGFuIGVycm9yXG5cdFx0aWYgKGFwcGxpY2F0aW9uLmxvZy5kZXBsb3kpIHtcblx0XHRcdGFwcGxpY2F0aW9uLmxvZy5kcmFpbihlbWVyZ2VuY3lMb2dnZXIpO1xuXHRcdH1cblx0XHR0aHJvdyBlcnJvcjtcblx0fVxufVxuXG5leHBvcnQgZGVmYXVsdCBib290O1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _bind = Function.prototype.bind; | ||
exports.Hook = undefined; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _lodash = require('lodash'); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
var _lodash = require('lodash'); | ||
var lifecycle = { | ||
const lifecycle = { | ||
configure: ['hookWillConfigure', 'hookDidConfigure'], | ||
@@ -21,6 +17,5 @@ start: ['hookWillStart', 'hookDidStart'] | ||
var Hook = (function () { | ||
function Hook(application, name, extender) { | ||
_classCallCheck(this, Hook); | ||
class Hook { | ||
constructor(application, name, extender) { | ||
this.wait = true; | ||
@@ -47,104 +42,117 @@ this.disabled = false; | ||
_createClass(Hook, [{ | ||
key: 'register', | ||
value: function register(application) { | ||
this.hookWillRegister(application); | ||
register(application) { | ||
this.hookWillRegister(application); | ||
this.log.silly('Registering hook \'' + this.name + '\''); | ||
this.log.silly(`Registering hook '${ this.name }'`); | ||
var hasModes = this.modes.length > 0; | ||
var matchesModes = hasModes && this.modes.indexOf(application.runtime.mode) > -1; | ||
const hasModes = this.modes.length > 0; | ||
const matchesModes = hasModes && this.modes.indexOf(application.runtime.mode) > -1; | ||
if (hasModes && !matchesModes) { | ||
this.log.debug('Hook ' + this.name + ' is disabled in mode ' + application.runtime.mode + '.'); | ||
this.disable(application); | ||
return this; | ||
} | ||
this.hookDidRegister(application); | ||
this.stages.register = true; | ||
if (hasModes && !matchesModes) { | ||
this.log.debug(`Hook ${ this.name } is disabled in mode ${ application.runtime.mode }.`); | ||
this.disable(application); | ||
return this; | ||
} | ||
}, { | ||
key: 'disable', | ||
value: function disable() { | ||
if (!this.disabled) { | ||
this.disabled = true; | ||
} | ||
return this; | ||
this.hookDidRegister(application); | ||
this.stages.register = true; | ||
return this; | ||
} | ||
disable() { | ||
if (!this.disabled) { | ||
this.disabled = true; | ||
} | ||
}, { | ||
key: 'hookWillRegister', | ||
value: function hookWillRegister() { | ||
return this; | ||
} | ||
}, { | ||
key: 'hookDidRegister', | ||
value: function hookDidRegister() { | ||
return this; | ||
} | ||
}, { | ||
key: 'stage', | ||
value: _asyncToGenerator(function* (stageName, application) { | ||
if (this.stages[stageName] || this.disabled) { | ||
return this; | ||
return this; | ||
} | ||
hookWillRegister() { | ||
return this; | ||
} | ||
hookDidRegister() { | ||
return this; | ||
} | ||
stage(stageName, application) { | ||
var _this = this; | ||
return _asyncToGenerator(function* () { | ||
if (_this.stages[stageName] || _this.disabled) { | ||
return _this; | ||
} | ||
this.stages[stageName] = true; | ||
this.log.debug('Running stage \'' + stageName + '\' on hook \'' + this.name + '\''); | ||
_this.stages[stageName] = true; | ||
_this.log.debug(`Running stage '${ stageName }' on hook '${ _this.name }'`); | ||
try { | ||
yield this[lifecycle[stageName][0]](application); | ||
yield this[stageName](application); | ||
this.log.debug('Ran stage \'' + stageName + '\' on hook \'' + this.name + '\''); | ||
yield this[lifecycle[stageName][1]](application); | ||
return this; | ||
yield _this[lifecycle[stageName][0]](application); | ||
yield _this[stageName](application); | ||
_this.log.debug(`Ran stage '${ stageName }' on hook '${ _this.name }'`); | ||
yield _this[lifecycle[stageName][1]](application); | ||
return _this; | ||
} catch (error) { | ||
this.log.error('An error ocurred on stage ' + stageName + ' of hook \'' + this.name + '\''); | ||
_this.log.error(`An error ocurred on stage ${ stageName } of hook '${ _this.name }'`); | ||
if (error.stack) { | ||
this.log.error(error.stack); | ||
_this.log.error(error.stack); | ||
} | ||
throw error; | ||
} | ||
}) | ||
}, { | ||
key: 'configure', | ||
value: _asyncToGenerator(function* (application) { | ||
if (this.disabled) { | ||
return this; | ||
})(); | ||
} | ||
configure(application) { | ||
var _this2 = this; | ||
return _asyncToGenerator(function* () { | ||
if (_this2.disabled) { | ||
return _this2; | ||
} | ||
this.configuration = (0, _lodash.merge)(this.configuration, this.defaults, application.configuration[this.configurationKey]); | ||
return this; | ||
}) | ||
}, { | ||
key: 'hookWillConfigure', | ||
value: _asyncToGenerator(function* () { | ||
return this; | ||
}) | ||
}, { | ||
key: 'hookDidConfigure', | ||
value: _asyncToGenerator(function* () { | ||
return this; | ||
}) | ||
}, { | ||
key: 'start', | ||
value: _asyncToGenerator(function* () { | ||
return this; | ||
}) | ||
}, { | ||
key: 'hookWillStart', | ||
value: _asyncToGenerator(function* () { | ||
return this; | ||
}) | ||
}, { | ||
key: 'hookDidStart', | ||
value: _asyncToGenerator(function* () { | ||
return this; | ||
}) | ||
}]); | ||
_this2.configuration = (0, _lodash.merge)(_this2.configuration, _this2.defaults, application.configuration[_this2.configurationKey]); | ||
return _this2; | ||
})(); | ||
} | ||
return Hook; | ||
})(); | ||
hookWillConfigure() { | ||
var _this3 = this; | ||
return _asyncToGenerator(function* () { | ||
return _this3; | ||
})(); | ||
} | ||
hookDidConfigure() { | ||
var _this4 = this; | ||
return _asyncToGenerator(function* () { | ||
return _this4; | ||
})(); | ||
} | ||
start() { | ||
var _this5 = this; | ||
return _asyncToGenerator(function* () { | ||
return _this5; | ||
})(); | ||
} | ||
hookWillStart() { | ||
var _this6 = this; | ||
return _asyncToGenerator(function* () { | ||
return _this6; | ||
})(); | ||
} | ||
hookDidStart() { | ||
var _this7 = this; | ||
return _asyncToGenerator(function* () { | ||
return _this7; | ||
})(); | ||
} | ||
} | ||
function hookFactory() { | ||
@@ -155,7 +163,7 @@ for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
return new (_bind.apply(Hook, [null].concat(args)))(); | ||
return new (Function.prototype.bind.apply(Hook, [null].concat(args)))(); | ||
} | ||
exports['default'] = hookFactory; | ||
exports.default = hookFactory; | ||
exports.Hook = Hook; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L2hvb2tzL2RlZmF1bHQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztzQkFFTyxRQUFROztBQUVmLElBQU0sU0FBUyxHQUFHO0FBQ2pCLFVBQVMsRUFBRSxDQUFDLG1CQUFtQixFQUFFLGtCQUFrQixDQUFDO0FBQ3BELE1BQUssRUFBRSxDQUFDLGVBQWUsRUFBRSxjQUFjLENBQUM7Q0FDeEMsQ0FBQzs7SUFFSSxJQUFJO0FBaUJFLFVBakJOLElBQUksQ0FpQkcsV0FBVyxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUU7d0JBakJwQyxJQUFJOztPQUNULElBQUksR0FBRyxJQUFJO09BQ1gsUUFBUSxHQUFHLEtBQUs7T0FDaEIsS0FBSyxHQUFHLEVBQUU7T0FFVixLQUFLLEdBQUcsQ0FBQyxtQkFBbUIsQ0FBQztPQUM3QixRQUFRLEdBQUcsRUFBRTtPQUNiLGFBQWEsR0FBRyxFQUFFO09BRWxCLFNBQVMsR0FBRyxNQUFNO09BRWxCLE1BQU0sR0FBRztBQUNSLFdBQVEsRUFBRSxLQUFLO0FBQ2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xuXHRcdFx0dGhyb3cgZXJyb3I7XG5cdFx0fVxuXHR9XG5cblx0YXN5bmMgY29uZmlndXJlKGFwcGxpY2F0aW9uKSB7XG5cdFx0aWYgKHRoaXMuZGlzYWJsZWQpIHtcblx0XHRcdHJldHVybiB0aGlzO1xuXHRcdH1cblxuXHRcdHRoaXMuY29uZmlndXJhdGlvbiA9IG1lcmdlKFxuXHRcdFx0dGhpcy5jb25maWd1cmF0aW9uLFxuXHRcdFx0dGhpcy5kZWZhdWx0cyxcblx0XHRcdGFwcGxpY2F0aW9uLmNvbmZpZ3VyYXRpb25bdGhpcy5jb25maWd1cmF0aW9uS2V5XVxuXHRcdCk7XG5cdFx0cmV0dXJuIHRoaXM7XG5cdH1cblxuXHRhc3luYyBob29rV2lsbENvbmZpZ3VyZSgpIHtcblx0XHRyZXR1cm4gdGhpcztcblx0fVxuXG5cdGFzeW5jIGhvb2tEaWRDb25maWd1cmUoKSB7XG5cdFx0cmV0dXJuIHRoaXM7XG5cdH1cblxuXHRhc3luYyBzdGFydCgpIHtcblx0XHRyZXR1cm4gdGhpcztcblx0fVxuXG5cdGFzeW5jIGhvb2tXaWxsU3RhcnQoKSB7XG5cdFx0cmV0dXJuIHRoaXM7XG5cdH1cblxuXHRhc3luYyBob29rRGlkU3RhcnQoKSB7XG5cdFx0cmV0dXJuIHRoaXM7XG5cdH1cbn1cblxuZnVuY3Rpb24gaG9va0ZhY3RvcnkoLi4uYXJncykge1xuXHRyZXR1cm4gbmV3IEhvb2soLi4uYXJncyk7XG59XG5cbmV4cG9ydCBkZWZhdWx0IGhvb2tGYWN0b3J5O1xuZXhwb3J0IHtcblx0SG9vayBhcyBIb29rXG59O1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })(); | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
exports['default'] = getHookDependencies; | ||
exports.default = getHookDependencies; | ||
var _lodash = require('lodash'); | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
var _lodash = require('lodash'); | ||
function getHookDependencies(hookName, registered) { | ||
var hook = (0, _lodash.find)(registered, { name: hookName }); | ||
const hook = (0, _lodash.find)(registered, { name: hookName }); | ||
if (!hook) { | ||
throw new Error('Could not find hook ' + hookName); | ||
throw new Error(`Could not find hook ${ hookName }`); | ||
} | ||
return hook.after.reduce(function (dependencies, after) { | ||
return hook.after.reduce((dependencies, after) => { | ||
var _after$split = after.split(':'); | ||
@@ -27,7 +27,8 @@ | ||
var nameSpace = _after$split2[0]; | ||
var dependencyName = _after$split2[1]; | ||
const nameSpace = _after$split2[0]; | ||
const dependencyName = _after$split2[1]; | ||
if (nameSpace === 'hooks' && !(0, _lodash.find)(registered, { name: dependencyName })) { | ||
throw new Error('Could not find hook dependency ' + dependencyName + ' for ' + hookName); | ||
throw new Error(`Could not find hook dependency ${ dependencyName } for ${ hookName }`); | ||
} | ||
@@ -38,4 +39,3 @@ | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L2hvb2tzL2dldC1ob29rLWRlcGVuZGVuY2llcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7OztxQkFFd0IsbUJBQW1COzs7O3NCQUZ4QixRQUFROztBQUVaLFNBQVMsbUJBQW1CLENBQUMsUUFBUSxFQUFFLFVBQVUsRUFBRTtBQUNqRSxLQUFNLElBQUksR0FBRyxrQkFBSyxVQUFVLEVBQUUsRUFBQyxJQUFJLEVBQUUsUUFBUSxFQUFDLENBQUMsQ0FBQzs7QUFFaEQsS0FBSSxDQUFDLElBQUksRUFBRTtBQUNWLFFBQU0sSUFBSSxLQUFLLDBCQUF3QixRQUFRLENBQUcsQ0FBQztFQUNuRDs7QUFFRCxRQUFPLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFDLFVBQUMsWUFBWSxFQUFFLEtBQUssRUFBSztxQkFDYixLQUFLLENBQUMsS0FBSyxDQUFDLEdBQUcsQ0FBQzs7OztNQUE3QyxTQUFTO01BQUUsY0FBYzs7QUFFaEMsTUFBSSxTQUFTLEtBQUssT0FBTyxJQUFJLENBQUMsa0JBQUssVUFBVSxFQUFFLEVBQUMsSUFBSSxFQUFFLGNBQWMsRUFBQyxDQUFDLEVBQUU7QUFDdkUsU0FBTSxJQUFJLEtBQUsscUNBQW1DLGNBQWMsYUFBUSxRQUFRLENBQUcsQ0FBQztHQUNwRjs7QUFFRCxTQUFPLFNBQVMsS0FBSyxPQUFPLEdBQUcsWUFBWSxDQUFDLE1BQU0sOEJBQzlDLG1CQUFtQixDQUFDLGNBQWMsRUFBRSxVQUFVL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rcycgPyBkZXBlbmRlbmNpZXMuY29uY2F0KFtcblx0XHRcdC4uLmdldEhvb2tEZXBlbmRlbmNpZXMoZGVwZW5kZW5jeU5hbWUsIHJlZ2lzdGVyZWQpLFxuXHRcdFx0ZGVwZW5kZW5jeU5hbWVcblx0XHRdKSA6IGRlcGVuZGVuY2llcztcblx0fSwgW10pO1xufVxuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
@@ -9,8 +9,4 @@ }); | ||
exports['default'] = getHookTree; | ||
exports.default = getHookTree; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
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; } | ||
var _getHookDependencies = require('./get-hook-dependencies'); | ||
@@ -20,10 +16,13 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function getHookTree(registered) { | ||
return registered.reduce(function (registry, hook) { | ||
var amend = _defineProperty({}, hook.name, (0, _getHookDependencies2['default'])(hook.name, registered)); | ||
return registered.reduce((registry, hook) => { | ||
const amend = { | ||
[hook.name]: (0, _getHookDependencies2.default)(hook.name, registered) | ||
}; | ||
return _extends({}, registry, amend); | ||
}, {}); | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L2hvb2tzL2dldC1ob29rLXRyZWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7cUJBRXdCLFdBQVc7Ozs7OzttQ0FGSCx5QkFBeUI7Ozs7QUFFMUMsU0FBUyxXQUFXLENBQUMsVUFBVSxFQUFFO0FBQy9DLFFBQU8sVUFBVSxDQUNmLE1BQU0sQ0FBQyxVQUFDLFFB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CQyxVQUFyQixFQUFpQztBQUMvQyxRQUFPQSxXQUNMQyxNQURLLENBQ0UsQ0FBQ0MsUUFBRCxFQUFXQyxJQUFYLEtBQW9CO0FBQzNCLFFBQU1DLFFBQVE7QUFDYixJQUFDRCxLQUFLRSxJQUFOLEdBQWEsbUNBQW9CRixLQUFLRSxJQUF6QixFQUErQkwsVUFBL0I7QUFEQSxHQUFkO0FBR0Esc0JBQ0lFLFFBREosRUFFSUUsS0FGSjtBQUlBLEVBVEssRUFTSCxFQVRHLENBQVA7QUFVQSIsImZpbGUiOiJnZXQtaG9vay10cmVlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IGdldEhvb2tEZXBlbmRlbmNpZXMgZnJvbSAnLi9nZXQtaG9vay1kZXBlbmRlbmNpZXMnO1xuXG5leHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBnZXRIb29rVHJlZShyZWdpc3RlcmVkKSB7XG5cdHJldHVybiByZWdpc3RlcmVkXG5cdFx0LnJlZHVjZSgocmVnaXN0cnksIGhvb2spID0+IHtcblx0XHRcdGNvbnN0IGFtZW5kID0ge1xuXHRcdFx0XHRbaG9vay5uYW1lXTogZ2V0SG9va0RlcGVuZGVuY2llcyhob29rLm5hbWUsIHJlZ2lzdGVyZWQpXG5cdFx0XHR9O1xuXHRcdFx0cmV0dXJuIHtcblx0XHRcdFx0Li4ucmVnaXN0cnksXG5cdFx0XHRcdC4uLmFtZW5kXG5cdFx0XHR9O1xuXHRcdH0sIHt9KTtcbn1cbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _path = require('path'); | ||
@@ -25,22 +21,41 @@ | ||
exports['default'] = _asyncToGenerator(function* (application) { | ||
// load the system hooks | ||
var hooks = yield (0, _load2['default'])(application, (0, _path.resolve)(application.runtime.base, 'application', 'hooks')); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// allow access to all the hooks | ||
application.hooks = hooks; | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
// register them | ||
var registered = yield Promise.all(hooks.map(_asyncToGenerator(function* (hook) { | ||
return hook.register(application); | ||
}))); | ||
exports.default = (() => { | ||
var _ref = _asyncToGenerator(function* (application) { | ||
// load the system hooks | ||
const hooks = yield (0, _load2.default)(application, (0, _path.resolve)(application.runtime.base, 'application', 'hooks')); | ||
// get interpendence tree | ||
var tree = (0, _getHookTree2['default'])(registered); | ||
// allow access to all the hooks | ||
application.hooks = hooks; | ||
// run the tree, wait for all dependencies | ||
yield Promise.all((0, _runHookTree2['default'])(tree, registered, application, {})); | ||
return application; | ||
}); | ||
// register them | ||
const registered = yield Promise.all(hooks.map((() => { | ||
var _ref2 = _asyncToGenerator(function* (hook) { | ||
return hook.register(application); | ||
}); | ||
return function (_x2) { | ||
return _ref2.apply(this, arguments); | ||
}; | ||
})())); | ||
// get interpendence tree | ||
const tree = (0, _getHookTree2.default)(registered); | ||
// run the tree, wait for all dependencies | ||
const jobs = (0, _runHookTree2.default)(tree, registered, application, {}); | ||
yield Promise.all(jobs); | ||
return application; | ||
}); | ||
return function (_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})(); | ||
module.exports = exports['default']; |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aW9uKSB7XG5cdC8vIGxvYWQgdGhlIHN5c3RlbSBob29rc1xuXHRjb25zdCBob29rcyA9IGF3YWl0IGxvYWQoYXBwbGljYXRpb24sIHJlc29sdmUoYXBwbGljYXRpb24ucnVudGltZS5iYXNlLCAnYXBwbGljYXRpb24nLCAnaG9va3MnKSk7XG5cblx0Ly8gYWxsb3cgYWNjZXNzIHRvIGFsbCB0aGUgaG9va3Ncblx0YXBwbGljYXRpb24uaG9va3MgPSBob29rcztcblxuXHQvLyByZWdpc3RlciB0aGVtXG5cdGNvbnN0IHJlZ2lzdGVyZWQgPSBhd2FpdCBQcm9taXNlLmFsbChob29rcy5tYXAoYXN5bmMgaG9vayA9PiBob29rLnJlZ2lzdGVyKGFwcGxpY2F0aW9uKSkpO1xuXG5cdC8vIGdldCBpbnRlcnBlbmRlbmNlIHRyZWVcblx0Y29uc3QgdHJlZSA9IGdldEhvb2tUcmVlKHJlZ2lzdGVyZWQpO1xuXG5cdC8vIHJ1biB0aGUgdHJlZSwgd2FpdCBmb3IgYWxsIGRlcGVuZGVuY2llc1xuXHRjb25zdCBqb2JzID0gcnVuSG9va1RyZWUodHJlZSwgcmVnaXN0ZXJlZCwgYXBwbGljYXRpb24sIHt9KTtcblx0YXdhaXQgUHJvbWlzZS5hbGwoam9icyk7XG5cblx0cmV0dXJuIGFwcGxpY2F0aW9uO1xufTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports['default'] = loadHooks; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
exports.default = loadHooks; | ||
var _path = require('path'); | ||
@@ -20,44 +23,40 @@ | ||
function loadHooks(application, path) { | ||
var modules = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
var hooks = (0, _requireAll2['default'])(path); | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
hooks = Object.keys(hooks).map(function (name) { | ||
return Object.assign(hooks[name].index ? hooks[name].index : hooks[name], { name: name }); | ||
}).map(function (hook) { | ||
return Object.assign(hook, { 'requirePath': (0, _path.resolve)(path, hook.name) }); | ||
}); | ||
function loadHooks(application, path) { | ||
let modules = arguments.length <= 2 || arguments[2] === undefined ? false : arguments[2]; | ||
if (modules && application.configuration) { | ||
var moduleHookNames = Object.keys(application.configuration.hooks.enabled).filter(function (key) { | ||
return typeof application.configuration.hooks.enabled[key] === 'string'; | ||
}); | ||
const rawAppHooks = (0, _requireAll2.default)(path); | ||
const enabledHooks = selectEnabledHooks(application); | ||
var moduleHooks = moduleHookNames.map(function requireHookModules(moduleHookName) { | ||
var moduleName = application.configuration.hooks.enabled[moduleHookName]; | ||
const appHooks = Object.entries(rawAppHooks).map(entry => { | ||
var _entry = _slicedToArray(entry, 2); | ||
try { | ||
var moduleHook = require(moduleName); | ||
moduleHook.name = moduleHookName; | ||
moduleHook.requirePath = require.resolve(moduleName); | ||
application.log.debug('[application:hooks]', 'Required module hook \'' + moduleHookName + '\' from module \'' + moduleName + '\''); | ||
} catch (err) { | ||
application.log.warn('[application:hooks]', 'Could not require module hook \'' + moduleHookName + '\' from module \'' + moduleName + '\''); | ||
} | ||
}); | ||
const name = _entry[0]; | ||
const hook = _entry[1]; | ||
hooks = hooks.concat(moduleHooks); | ||
} | ||
const mod = hook.index || hook; | ||
const requirePath = (0, _path.resolve)(path, name); | ||
return _extends({}, mod, { name: name, requirePath: requirePath }); | ||
}).map(hook => Object.assign(hook, { requirePath: (0, _path.resolve)(path, hook.name) })); | ||
hooks = hooks.filter(function (hook) { | ||
return hook; | ||
}).map(function hookCallback(hook) { | ||
return (0, _default2['default'])(application, hook.name, hook); | ||
}); | ||
const moduleHooks = modules ? Object.values(enabledHooks).filter(moduleName => typeof moduleName === 'string').map(moduleName => { | ||
const requirePath = require.resolve(moduleName); | ||
const mod = require(moduleName); | ||
mod.requirePath = requirePath; | ||
return mod; | ||
}) : []; | ||
return hooks; | ||
return [].concat(_toConsumableArray(appHooks), _toConsumableArray(moduleHooks)).filter(Boolean).map(hook => (0, _default2.default)(application, hook.name, hook)); | ||
} | ||
function selectEnabledHooks(application) { | ||
const config = application.configuration || {}; | ||
const hooks = config.hooks || {}; | ||
const enabled = hooks.enabled || {}; | ||
return enabled; | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L2hvb2tzL2xvYWQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7cUJBS3dCLFNBQVM7Ozs7b0JBTFQsTUFBTTs7MEJBRVAsYUFBYTs7Ozt1QkFDWixXQUFXOzs7O0FBRXBCLFNBQVMsU0FBUyxDQUFHLFdBQVcsRUFBRSxJQUFJLEVBQW9CO0tBQWxCLE9BQU8seURBQUcsS0FBSzs7QUFDckUsS0FBSSxLQUFLLEdBQUcsNkJBQVksSUFBSSxD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Wx0ZXIoQm9vbGVhbikubWFwKGhvb2sgPT4gaG9va0ZhY3RvcnkoYXBwbGljYXRpb24sIGhvb2submFtZSwgaG9vaykpO1xufVxuXG5mdW5jdGlvbiBzZWxlY3RFbmFibGVkSG9va3MoYXBwbGljYXRpb24pIHtcblx0Y29uc3QgY29uZmlnID0gYXBwbGljYXRpb24uY29uZmlndXJhdGlvbiB8fCB7fTtcblx0Y29uc3QgaG9va3MgPSBjb25maWcuaG9va3MgfHwge307XG5cdGNvbnN0IGVuYWJsZWQgPSBob29rcy5lbmFibGVkIHx8IHt9O1xuXHRyZXR1cm4gZW5hYmxlZDtcbn1cbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })(); | ||
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); | ||
exports['default'] = runHookTree; | ||
exports.default = runHookTree; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _lodash = require('lodash'); | ||
@@ -23,24 +17,32 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
function runHookTree(tree, registered, application, checklist) { | ||
return Object.entries(tree).map(_asyncToGenerator(function* (entry) { | ||
var _entry = _slicedToArray(entry, 2); | ||
return Object.entries(tree).map((() => { | ||
var _ref = _asyncToGenerator(function* (entry) { | ||
var _entry = _slicedToArray(entry, 2); | ||
var entryName = _entry[0]; | ||
var entryDependencies = _entry[1]; | ||
const entryName = _entry[0]; | ||
const entryDependencies = _entry[1]; | ||
var _arr = [].concat(_toConsumableArray(entryDependencies), [entryName]); | ||
for (const dependencyName of [].concat(_toConsumableArray(entryDependencies), [entryName])) { | ||
if (!checklist[dependencyName]) { | ||
const hook = (0, _lodash.find)(registered, { name: dependencyName }); | ||
checklist[dependencyName] = hook.stages.start ? Promise.resolve() : (0, _runHook2.default)(hook, application); | ||
} | ||
yield checklist[dependencyName]; | ||
} | ||
return checklist[entryName]; | ||
}); | ||
for (var _i = 0; _i < _arr.length; _i++) { | ||
var dependencyName = _arr[_i]; | ||
if (!checklist[dependencyName]) { | ||
var hook = (0, _lodash.find)(registered, { name: dependencyName }); | ||
checklist[dependencyName] = hook.stages.start ? Promise.resolve() : (0, _runHook2['default'])(hook, application); | ||
} | ||
yield checklist[dependencyName]; | ||
} | ||
return checklist[entryName]; | ||
})); | ||
return function (_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})()); | ||
} | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L2hvb2tzL3J1bi1ob29rLXRyZWUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7cUJBTXdCLFdBQVc7Ozs7Ozs7O3NCQUo1QixRQUFROzt1QkFFSyxZQUFZOzs7O0FBRWpCLFNBQVMsV0FBVyxDQUFDLElBQUksRUFBRSxVQUFVLEVBQUUsV0FBVyxFQUFFLFNBQVMsRUFBRTtBQUM3RSxRQUFPLE1BQU0sQ0FBQyxPQUFPLENBQUMsSUFBSSxDQUFDLENBQ3pCLEdBQUcsbUJBQUMsV0FBTSxLQUFLLEVBQUk7OEJBQ29CLEtBQUs7O01BQXJDLFNBQVM7TUFBRSxpQkFBaUI7OzBDQUNGLGlCQUFpQixJQUFFLFNBQVM7O0FBQTdELDJDQUFnRTtBQUEzRCxPQUFNLGNBQWMsV0FBQSxDQUFBO0FBQ3hCLE9BQUksQ0FBQyxTQUFTLENBQUMsY0FBYyxDQUFDLEVBQUU7QUFDL0IsUUFBTSxJQUFJLEdBQUcsa0JBQUssVUFBVSxFQUFFLEVBQUMsSUFBSSxFQUFFLGNBQWMsRUFBQyxDQUFDLENBQUM7QUFD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XHRcdFx0Y2hlY2tsaXN0W2RlcGVuZGVuY3lOYW1lXSA9IGhvb2suc3RhZ2VzLnN0YXJ0ID9cblx0XHRcdFx0XHRcdFByb21pc2UucmVzb2x2ZSgpIDpcblx0XHRcdFx0XHRcdHJ1bkhvb2soaG9vaywgYXBwbGljYXRpb24pO1xuXHRcdFx0XHR9XG5cdFx0XHRcdGF3YWl0IGNoZWNrbGlzdFtkZXBlbmRlbmN5TmFtZV07XG5cdFx0XHR9XG5cdFx0XHRyZXR1cm4gY2hlY2tsaXN0W2VudHJ5TmFtZV07XG5cdFx0fSk7XG59XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
exports['default'] = _asyncToGenerator(function* (hook, application) { | ||
yield hook.stage.bind(hook)('configure', application); | ||
yield hook.stage.bind(hook)('start', application); | ||
}); | ||
exports.default = (() => { | ||
var _ref = _asyncToGenerator(function* (hook, application) { | ||
yield hook.stage.bind(hook)('configure', application); | ||
yield hook.stage.bind(hook)('start', application); | ||
}); | ||
function runHook(_x, _x2) { | ||
return _ref.apply(this, arguments); | ||
} | ||
return runHook; | ||
})(); | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uI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LQUFLRSxLQUFMLENBQVdDLElBQVgsQ0FBZ0JILElBQWhCLEVBQXNCLE9BQXRCLEVBQStCQyxXQUEvQixDQUFOO0FBQ0EsRTs7VUFINkJHLE87Ozs7UUFBQUEsTyIsImZpbGUiOiJydW4taG9vay5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBkZWZhdWx0IGFzeW5jIGZ1bmN0aW9uIHJ1bkhvb2soaG9vaywgYXBwbGljYXRpb24pIHtcblx0YXdhaXQgaG9vay5zdGFnZS5iaW5kKGhvb2spKCdjb25maWd1cmUnLCBhcHBsaWNhdGlvbik7XG5cdGF3YWl0IGhvb2suc3RhZ2UuYmluZChob29rKSgnc3RhcnQnLCBhcHBsaWNhdGlvbik7XG59XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var boilerplate = _asyncToGenerator(function* () { | ||
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
let boilerplate = (() => { | ||
var _ref = _asyncToGenerator(function* () { | ||
let options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0]; | ||
/*eslint-disable no-process-env */ | ||
/*eslint-disable no-process-env */ | ||
var augmented = Object.assign({}, { | ||
'cwd': process.cwd(), | ||
'base': options.base || (0, _path.resolve)(__dirname, '../'), | ||
'env': process.env.NODE_ENV || 'development', | ||
'name': options.name || 'boilerplate-server' | ||
}, options, { 'api': options }); | ||
let augmented = Object.assign({}, { | ||
'cwd': process.cwd(), | ||
'base': options.base || (0, _path.resolve)(__dirname, '../'), | ||
'env': process.env.NODE_ENV || 'development', | ||
'name': options.name || 'boilerplate-server' | ||
}, options, { 'api': options }); | ||
return yield (0, _boot2['default'])(augmented); | ||
}); | ||
return yield (0, _boot2.default)(augmented); | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
return function boilerplate(_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
})(); | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(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(callNext, callThrow); } } callNext(); }); }; } | ||
var _path = require('path'); | ||
@@ -32,4 +34,8 @@ | ||
exports['default'] = boilerplate; | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { return step("next", value); }, function (err) { return step("throw", err); }); } } return step("next"); }); }; } | ||
exports.default = boilerplate; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9saWJyYXJ5L2luZGV4LmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztJQUllLFdBQVcscUJBQTFCLGFBQTRDO0tBQWYsT0FBTyx5REFBRyxFQUFFOzs7O0FBR3hDLEtBQUksU0FBUyxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUUsRUFBRSxFQUFFO0FBQ2pDLE9BQUssRUFBRSxPQUFPLENBQUMsR0FBRyxFQUFFO0FBQ3BCLFFBQU0sRUFBRSxPQUFPLENBQUMsSUFBSSxJQUFJLG1CQUFTLFNBQVMsRUFBRSxLQUFLLENBQUU7QUFDbkQsT0FBSyxFQUFFLE9BQU8sQ0FBQyxHQUFHLENBQUMsUUFBUSxJQUFJLGFBQWE7QUFDNUMsUUFBTSxFQUFFLE9BQU8sQ0FBQyxJQUFJLElBQUksb0JBQW9CO0VBQzVDLEVBQUUsT0FBT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XHQnZW52JzogcHJvY2Vzcy5lbnYuTk9ERV9FTlYgfHwgJ2RldmVsb3BtZW50Jyxcblx0XHRcdCduYW1lJzogb3B0aW9ucy5uYW1lIHx8ICdib2lsZXJwbGF0ZS1zZXJ2ZXInXG5cdFx0fSwgb3B0aW9ucywgeyAnYXBpJzogb3B0aW9ucyB9ICk7XG5cblx0cmV0dXJuIGF3YWl0IGJvb3QoIGF1Z21lbnRlZCApO1xufVxuXG5leHBvcnQgZGVmYXVsdCBib2lsZXJwbGF0ZTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
var _lodash = require('lodash'); | ||
@@ -15,7 +13,9 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function loadConfiguration(dirname) { | ||
var filter = arguments.length <= 1 || arguments[1] === undefined ? /(.*).(js|json)$/ : arguments[1]; | ||
var env = arguments.length <= 2 || arguments[2] === undefined ? 'development' : arguments[2]; | ||
let filter = arguments.length <= 1 || arguments[1] === undefined ? /(.*).(js|json)$/ : arguments[1]; | ||
let env = arguments.length <= 2 || arguments[2] === undefined ? 'development' : arguments[2]; | ||
var rawConfiguration = (0, _requireAll2['default'])({ | ||
const rawConfiguration = (0, _requireAll2.default)({ | ||
dirname: dirname, | ||
@@ -26,3 +26,3 @@ filter: filter | ||
rawConfiguration.environments = rawConfiguration.environments || {}; | ||
var envConfiguration = rawConfiguration.environments[env] || {}; | ||
const envConfiguration = rawConfiguration.environments[env] || {}; | ||
@@ -32,4 +32,4 @@ return (0, _lodash.merge)({}, rawConfiguration, envConfiguration, { environment: env }); | ||
exports['default'] = loadConfiguration; | ||
exports.default = loadConfiguration; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4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S0FBc0MsRUFBL0Q7O0FBRUEsUUFBTyxtQkFDTixFQURNLEVBRU5DLGdCQUZNLEVBR05FLGdCQUhNLEVBSU4sRUFBQ0MsYUFBYUosR0FBZCxFQUpNLENBQVA7QUFNQTs7a0JBRWNILGlCIiwiZmlsZSI6ImNvbmZpZ3VyYXRpb24uanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge21lcmdlfSBmcm9tICdsb2Rhc2gnO1xuaW1wb3J0IHJlcXVpcmVBbGwgZnJvbSAncmVxdWlyZS1hbGwnO1xuXG5mdW5jdGlvbiBsb2FkQ29uZmlndXJhdGlvbihkaXJuYW1lLCBmaWx0ZXIgPSAvKC4qKS4oanN8anNvbikkLywgZW52ID0gJ2RldmVsb3BtZW50Jykge1xuXHRjb25zdCByYXdDb25maWd1cmF0aW9uID0gcmVxdWlyZUFsbCh7XG5cdFx0ZGlybmFtZSxcblx0XHRmaWx0ZXJcblx0fSk7XG5cblx0cmF3Q29uZmlndXJhdGlvbi5lbnZpcm9ubWVudHMgPSByYXdDb25maWd1cmF0aW9uLmVudmlyb25tZW50cyB8fCB7fTtcblx0Y29uc3QgZW52Q29uZmlndXJhdGlvbiA9IHJhd0NvbmZpZ3VyYXRpb24uZW52aXJvbm1lbnRzW2Vudl0gfHwge307XG5cblx0cmV0dXJuIG1lcmdlKFxuXHRcdHt9LFxuXHRcdHJhd0NvbmZpZ3VyYXRpb24sXG5cdFx0ZW52Q29uZmlndXJhdGlvbixcblx0XHR7ZW52aXJvbm1lbnQ6IGVudn1cblx0KTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgbG9hZENvbmZpZ3VyYXRpb247XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
@@ -9,6 +9,2 @@ }); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } | ||
require('babel-core/polyfill'); | ||
var _path = require('path'); | ||
@@ -22,8 +18,10 @@ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// Assemble augmented minimist options | ||
var args = (0, _minimist2['default'])(process.argv.slice(1)); | ||
var entry = process.argv[1]; | ||
var raw = args._; | ||
const args = (0, _minimist2.default)(process.argv.slice(1)); | ||
const entry = process.argv[1]; | ||
const raw = args._; | ||
var options = _extends({}, args, { | ||
const options = _extends({}, args, { | ||
command: raw.slice(1).join(' '), | ||
@@ -40,3 +38,3 @@ entry: (0, _path.basename)(entry, (0, _path.extname)(entry)) | ||
if (instance && instance.log) { | ||
instance.log.info('[application] ' + options.entry + ' executed sucessfully.'); | ||
// instance.log.info(`[application] ${options.entry} executed sucessfully.`); | ||
} | ||
@@ -51,6 +49,6 @@ } | ||
function handleError(error) { | ||
console.log(options.entry + ' failed.'); | ||
console.log(`${ options.entry } failed.`); | ||
console.trace(error); | ||
setTimeout(function () { | ||
setTimeout(() => { | ||
throw error; | ||
@@ -68,8 +66,8 @@ }); | ||
exports['default'] = function (procedure) { | ||
var configuration = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
return procedure((0, _lodash.merge)({}, options, configuration)).then(handleSuccess)['catch'](handleError); | ||
exports.default = function (procedure) { | ||
let configuration = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
return procedure((0, _lodash.merge)({}, options, configuration)).then(handleSuccess).catch(handleError); | ||
}; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L3V0aWxpdGllcy9leGVjdXRlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7UUFBTyxxQkFBcUI7O29CQUNJLE1BQU07O3NCQUNsQixRQUFROzt3QkFDUCxVQUFVOzs7OztBQUcvQixJQUFNLElBQUksR0FBRywyQkFBUyxPQUFPLENBQUMsSUFBSSxDQ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Y2xpIGFyZ3Mgb2JqZWN0c1xuICogQHJldHVybiB7UHJvbWlzZX0gcmVzdWx0IC0gUHJvbWlzZSB3cmFwcGluZyB0aGUgcmVzdWx0IG9mIHRoZSBwcm9jZWR1cmVcbiAqIEBwcml2YXRlXG4gKi9cbmV4cG9ydCBkZWZhdWx0IChwcm9jZWR1cmUsIGNvbmZpZ3VyYXRpb24gPSB7fSkgPT5cblx0cHJvY2VkdXJlKG1lcmdlKHt9LCBvcHRpb25zLCBjb25maWd1cmF0aW9uKSlcblx0XHQudGhlbihoYW5kbGVTdWNjZXNzKVxuXHRcdC5jYXRjaChoYW5kbGVFcnJvcik7XG4iXX0= |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
@@ -11,3 +11,3 @@ }); | ||
exports['default'] = { | ||
exports.default = { | ||
'exists': function asyncExists(path) { | ||
@@ -23,2 +23,2 @@ return new Promise(function resolveExists(resolve) { | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L3V0aWxpdGllcy9mcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7a0JBQWtELElBQUk7O3dCQUM1QixVQUFVOztxQkFFckI7QUFDZCxTQUFRLEVBQUUsU0FBUyxXQUFXLENBQUcsSUFBSSxFQUFHO0FBQ3ZDLFNBQU8sSUFBSSxPQUFPLENBQUUsU0FBUyxhQUFhLENBQUcsT0FBTyxFQUFHO0FBQ3RELG1CQUFRLElBQUksRUFBRSxPQUFPLENBQUUsQ0FBQztHQUN4QixDQUFFLENBQUM7RUFDSjtBQUNELFdBQVUsRUFBRSxzQ0FBcUI7QUFDakMsWUFBVyxFQUFFLHVDQUFzQjtBQUNuQyxPQUFNLEVBQUUsa0NBQWlCO0NBQ3pCIiwiZmlsZSI6ImZzLmpzIiwic291cmNl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ZSI6ImZzLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgZXhpc3RzLCByZWFkRmlsZSwgd3JpdGVGaWxlLCBzdGF0IH0gZnJvbSAnZnMnO1xuaW1wb3J0IHsgcHJvbWlzaWZ5IH0gZnJvbSAnYmx1ZWJpcmQnO1xuXG5leHBvcnQgZGVmYXVsdCB7XG5cdCdleGlzdHMnOiBmdW5jdGlvbiBhc3luY0V4aXN0cyAoIHBhdGggKSB7XG5cdFx0cmV0dXJuIG5ldyBQcm9taXNlKCBmdW5jdGlvbiByZXNvbHZlRXhpc3RzICggcmVzb2x2ZSApIHtcblx0XHRcdGV4aXN0cyggcGF0aCwgcmVzb2x2ZSApO1xuXHRcdH0gKTtcblx0fSxcblx0J3JlYWRGaWxlJzogcHJvbWlzaWZ5KCByZWFkRmlsZSApLFxuXHQnd3JpdGVGaWxlJzogcHJvbWlzaWZ5KCB3cml0ZUZpbGUgKSxcblx0J3N0YXQnOiBwcm9taXNpZnkoIHN0YXQgKVxufTtcbiJdfQ== |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
var _portscanner = require('portscanner'); | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
class Ports { | ||
static test() { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
var _portscanner = require('portscanner'); | ||
var Ports = (function () { | ||
function Ports() { | ||
_classCallCheck(this, Ports); | ||
return new Promise(function fullfill(resolve, reject) { | ||
_portscanner.checkPortStatus.apply(undefined, [].concat(args, [function cb(error, result) { | ||
return resolve(result === 'closed'); | ||
}])); | ||
}); | ||
} | ||
_createClass(Ports, null, [{ | ||
key: 'test', | ||
value: function test() { | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
return new Promise(function fullfill(resolve, reject) { | ||
_portscanner.checkPortStatus.apply(undefined, [].concat(args, [function cb(error, result) { | ||
return resolve(result === 'closed'); | ||
}])); | ||
}); | ||
static find() { | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
}, { | ||
key: 'find', | ||
value: function find() { | ||
for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | ||
args[_key2] = arguments[_key2]; | ||
} | ||
return new Promise(function fullfill(resolve, reject) { | ||
_portscanner.findAPortNotInUse.apply(undefined, [].concat(args, [function cb(error, result) { | ||
return resolve(result); | ||
}])); | ||
}); | ||
} | ||
}]); | ||
return new Promise(function fullfill(resolve, reject) { | ||
_portscanner.findAPortNotInUse.apply(undefined, [].concat(args, [function cb(error, result) { | ||
return resolve(result); | ||
}])); | ||
}); | ||
} | ||
} | ||
return Ports; | ||
})(); | ||
exports['default'] = Ports; | ||
exports.default = Ports; | ||
module.exports = exports['default']; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L3V0aWxpdGllcy9wb3J0cy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7OzJCQUFpRSxhQUFhOztJQUV4RSxLQUFLO1VBQUwsS0FBSzt3QkFBTCxLQUFLOzs7Y0FBTCxLQUFLOztTQUNFLGdCQUFZO3FDQUFQLElBQ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xuXHRcdFx0fSBdICk7XG5cdFx0fSApO1xuXHR9XG59XG5cbmV4cG9ydCBkZWZhdWx0IFBvcnRzO1xuIl19 |
'use strict'; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _bind = Function.prototype.bind; | ||
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); | ||
function _toArray(arr) { return Array.isArray(arr) ? arr : Array.from(arr); } | ||
@@ -14,127 +11,91 @@ | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } | ||
const privates = new WeakMap(); | ||
var privates = new WeakMap(); | ||
var LogQueue = (function () { | ||
function LogQueue(prefix) { | ||
_classCallCheck(this, LogQueue); | ||
var queue = []; | ||
class LogQueue { | ||
constructor(prefix) { | ||
let queue = []; | ||
privates.set(this, { queue: queue, prefix: prefix }); | ||
} | ||
_createClass(LogQueue, [{ | ||
key: 'fill', | ||
value: function fill(level) { | ||
var _privates$get = privates.get(this); | ||
fill(level) { | ||
var _privates$get = privates.get(this); | ||
var queue = _privates$get.queue; | ||
var prefix = _privates$get.prefix; | ||
let queue = _privates$get.queue; | ||
let prefix = _privates$get.prefix; | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
var message = [prefix].concat(args); | ||
queue.push([level].concat(_toConsumableArray(message))); | ||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | ||
args[_key - 1] = arguments[_key]; | ||
} | ||
}, { | ||
key: 'drain', | ||
value: function drain(logger) { | ||
var _privates$get2 = privates.get(this); | ||
var queue = _privates$get2.queue; | ||
var _iteratorNormalCompletion = true; | ||
var _didIteratorError = false; | ||
var _iteratorError = undefined; | ||
let message = [prefix].concat(args); | ||
queue.push([level].concat(_toConsumableArray(message))); | ||
} | ||
try { | ||
drain(logger) { | ||
var _privates$get2 = privates.get(this); | ||
for (var _iterator = queue[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { | ||
var item = _step.value; | ||
let queue = _privates$get2.queue; | ||
var _item = _toArray(item); | ||
var method = _item[0]; | ||
for (let item of queue) { | ||
var _item = _toArray(item); | ||
var message = _item.slice(1); | ||
let method = _item[0]; | ||
logger[method].apply(logger, _toConsumableArray(message)); | ||
} | ||
} catch (err) { | ||
_didIteratorError = true; | ||
_iteratorError = err; | ||
} finally { | ||
try { | ||
if (!_iteratorNormalCompletion && _iterator['return']) { | ||
_iterator['return'](); | ||
} | ||
} finally { | ||
if (_didIteratorError) { | ||
throw _iteratorError; | ||
} | ||
} | ||
} | ||
let message = _item.slice(1); | ||
logger[method].apply(logger, _toConsumableArray(message)); | ||
} | ||
}, { | ||
key: 'deploy', | ||
value: function deploy(logger) { | ||
this.fill = function (level) { | ||
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
} | ||
logger[level].apply(logger, args); | ||
}; | ||
} | ||
}, { | ||
key: 'error', | ||
value: function error() { | ||
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
args[_key3] = arguments[_key3]; | ||
deploy(logger) { | ||
this.fill = function (level) { | ||
for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { | ||
args[_key2 - 1] = arguments[_key2]; | ||
} | ||
this.fill.apply(this, ['error'].concat(args)); | ||
logger[level].apply(logger, args); | ||
}; | ||
} | ||
error() { | ||
for (var _len3 = arguments.length, args = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | ||
args[_key3] = arguments[_key3]; | ||
} | ||
}, { | ||
key: 'warn', | ||
value: function warn() { | ||
for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
args[_key4] = arguments[_key4]; | ||
} | ||
this.fill.apply(this, ['warn'].concat(args)); | ||
this.fill.apply(this, ['error'].concat(args)); | ||
} | ||
warn() { | ||
for (var _len4 = arguments.length, args = Array(_len4), _key4 = 0; _key4 < _len4; _key4++) { | ||
args[_key4] = arguments[_key4]; | ||
} | ||
}, { | ||
key: 'info', | ||
value: function info() { | ||
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { | ||
args[_key5] = arguments[_key5]; | ||
} | ||
this.fill.apply(this, ['info'].concat(args)); | ||
this.fill.apply(this, ['warn'].concat(args)); | ||
} | ||
info() { | ||
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) { | ||
args[_key5] = arguments[_key5]; | ||
} | ||
}, { | ||
key: 'debug', | ||
value: function debug() { | ||
for (var _len6 = arguments.length, args = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { | ||
args[_key6] = arguments[_key6]; | ||
} | ||
this.fill.apply(this, ['debug'].concat(args)); | ||
this.fill.apply(this, ['info'].concat(args)); | ||
} | ||
debug() { | ||
for (var _len6 = arguments.length, args = Array(_len6), _key6 = 0; _key6 < _len6; _key6++) { | ||
args[_key6] = arguments[_key6]; | ||
} | ||
}, { | ||
key: 'silly', | ||
value: function silly() { | ||
for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { | ||
args[_key7] = arguments[_key7]; | ||
} | ||
this.fill.apply(this, ['silly'].concat(args)); | ||
this.fill.apply(this, ['debug'].concat(args)); | ||
} | ||
silly() { | ||
for (var _len7 = arguments.length, args = Array(_len7), _key7 = 0; _key7 < _len7; _key7++) { | ||
args[_key7] = arguments[_key7]; | ||
} | ||
}]); | ||
return LogQueue; | ||
})(); | ||
this.fill.apply(this, ['silly'].concat(args)); | ||
} | ||
} | ||
@@ -146,7 +107,7 @@ function logQueueFactory() { | ||
return new (_bind.apply(LogQueue, [null].concat(args)))(); | ||
return new (Function.prototype.bind.apply(LogQueue, [null].concat(args)))(); | ||
} | ||
exports['default'] = logQueueFactory; | ||
exports.default = logQueueFactory; | ||
exports.LogQueue = LogQueue; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWJyYXJ5L3V0aWxpdGllcy9xdWV1ZWQtbG9nZ2VyLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7OztBQUFBLElBQU0sUUFBUSxHQUFHLElBQUksT0FBTyxFQUFFLENBQUM7O0lBRXpCLFFBQVE7QUFDRCxVQURQLFFBQVEsQ0FDQyxNQUFNLEVBQUc7d0JBRGxCLFFBQVE7O0FBRVosTUFBSSxLQUFLLEdBQUcsRUFBRSxDQUFDO0FBQ2YsVUFBUSxDQUFDLEdBQUcsQ0FBQyxJQUFJLEVBQUUsRUFBRSxLQUFLLEVBQUwsS0FBSyxFQUFFLE1BQU0sRUFBTixNQUFNLEVBQUUsQ0FBQyxDQUFDO0VBQ3RDOztjQUpJLFFBQVE7O1NBTVIsY0FBQyxLQUFLLEVBQVc7dUJBQ0csUUFBUSxDQUFDLEdBQUcsQ0FBQyxJQUFJLENBQUM7O09BQXBDLEtBQUssaUJBQUwsS0FBSztPQUFFLE1BQU0saUJBQU4sTUFBTTs7cUNBREosSUFBSTtBQUFKLFFBQUk7OztBQUVuQixPQUFJLE9BQU8sSUFBSSxNQUFNLFNBQUssSUFBSSxDQUFDLENBQUM7QUFDaEMsUUFBSyxDQUFDLElBQ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guLi5hcmdzKSB7XG5cdFx0dGhpcy5maWxsKCdkZWJ1ZycsIC4uLmFyZ3MpO1xuXHR9XG5cblx0c2lsbHkgKC4uLmFyZ3MpIHtcblx0XHR0aGlzLmZpbGwoJ3NpbGx5JywgLi4uYXJncyk7XG5cdH1cbn1cblxuZnVuY3Rpb24gbG9nUXVldWVGYWN0b3J5KC4uLmFyZ3MpIHtcblx0cmV0dXJuIG5ldyBMb2dRdWV1ZSguLi5hcmdzKTtcbn1cblxuZXhwb3J0IGRlZmF1bHQgbG9nUXVldWVGYWN0b3J5O1xuZXhwb3J0IHsgTG9nUXVldWUgYXMgTG9nUXVldWUgfTtcbiJdfQ== |
{ | ||
"name": "boilerplate-server", | ||
"version": "0.11.8", | ||
"version": "0.12.0", | ||
"description": "Lean and mean server module intended to get you kicking on the edge of things real fast.", | ||
"main": "library/", | ||
"bin": { | ||
"boilerplate-server": "binary/boilerplate-server.js", | ||
"boilerplate-console": "binary/boilerplate-console.js" | ||
}, | ||
"scripts": { | ||
"start": "node binary/boilerplate-server.js", | ||
"prestart": "npm run build", | ||
"debug": "node-debug binary/boilerplate-server.js", | ||
"console": "node binary/boilerplate-console.js", | ||
"debug-console": "node-debug binary/boilerplate-console.js", | ||
"babel": "npm run clean && babel source --out-dir ./ --source-maps inline", | ||
"build": "npm run babel", | ||
"watch": "npm run babel -- --watch", | ||
"babel": "npm run clean && babel source --out-dir ./ --source-maps inline", | ||
"clean": "rm -rf application binary configuration library", | ||
"pre-publish": "npm run build && npm publish" | ||
"console": "node binary/boilerplate-console.js", | ||
"pre-publish": "npm run build && npm publish", | ||
"start": "node binary/boilerplate-server.js", | ||
"watch": "npm run babel -- --watch" | ||
}, | ||
"bin": { | ||
"boilerplate-server": "binary/boilerplate-server.js", | ||
"boilerplate-console": "binary/boilerplate-console.js" | ||
"babel": { | ||
"presets": [ | ||
"es2015-node4", | ||
"es2016-node4", | ||
"stage-0" | ||
], | ||
"plugins": [ | ||
"add-module-exports" | ||
] | ||
}, | ||
"xo": { | ||
"esnext": true | ||
}, | ||
"repository": { | ||
@@ -43,4 +53,3 @@ "type": "git", | ||
"engines": { | ||
"iojs": ">= 1.4.3", | ||
"node": ">= 0.12.0", | ||
"node": ">= 4", | ||
"npm": ">= 2.5.1" | ||
@@ -50,3 +59,2 @@ }, | ||
"app-root-path": "^1.0.0", | ||
"babel-core": "^5.2.17", | ||
"bluebird": "^2.9.24", | ||
@@ -68,10 +76,11 @@ "find-root": "^0.1.1", | ||
"devDependencies": { | ||
"babel": "^5.2.17", | ||
"babel-eslint": "^3.1.30", | ||
"eslint": "^1.10.3", | ||
"eslint-config-xo": "^0.8.0", | ||
"eslint-plugin-babel": "^3.0.0", | ||
"eslint-plugin-react": "^3.11.3", | ||
"node-inspector": "^0.12.1" | ||
"babel-cli": "^6.14.0", | ||
"babel-plugin-add-module-exports": "^0.2.1", | ||
"babel-polyfill": "^6.13.0", | ||
"babel-preset-es2015-node4": "^2.1.0", | ||
"babel-preset-es2016-node4": "^6.0.1", | ||
"babel-preset-stage-0": "^6.5.0", | ||
"eslint": "^3.4.0", | ||
"xo": "^0.16.0" | ||
} | ||
} |
@@ -50,3 +50,3 @@ import { | ||
const userPkg = require(pkgPath); | ||
const pkg = merge({}, corePkg, pkg, userPkg); | ||
const pkg = merge({}, corePkg, userPkg); | ||
@@ -71,3 +71,3 @@ // Allow user to override core behaviour via cli and *rc files | ||
let moduleRoot = modulePath; | ||
while (await exists(resolve(moduleRoot, 'package.json')) === false) { | ||
while (await exists(resolve(moduleRoot, 'package.json')) === false) { // eslint-disable-line | ||
moduleRoot = dirname(moduleRoot); | ||
@@ -93,3 +93,3 @@ } | ||
const userPath = resolve(cwd, configPath, suffix); | ||
if (await exists(userPath)) { | ||
if (await exists(userPath)) { // eslint-disable-line | ||
existingConfigPaths.push(userPath); | ||
@@ -113,3 +113,3 @@ } | ||
for (const userPath of existingConfigPaths) { | ||
this.log.info(`Loading configuration from '${userPath}'`); | ||
this.log.debug(`Loading configuration from '${userPath}'`); | ||
@@ -116,0 +116,0 @@ try { |
@@ -1,24 +0,31 @@ | ||
let nameSpace = new WeakMap(); | ||
const nameSpace = new WeakMap(); | ||
class TaskConsole { | ||
constructor ( application, options ) { | ||
nameSpace.set( this, { application, options, 'tasks': options.tasks } ); | ||
constructor(application, options) { | ||
const {tasks} = options; | ||
nameSpace.set(this, {application, options, tasks}); | ||
} | ||
async run ( taskName, options ) { | ||
const { application, tasks } = nameSpace.get(this); | ||
async run(taskName, options) { | ||
const {application, tasks} = nameSpace.get(this); | ||
if ( typeof taskName !== 'string' ) { | ||
throw new Error( 'Missing taskName parameter.' ); | ||
if (typeof taskName !== 'string') { | ||
throw new Error('Missing taskName parameter.'); | ||
} | ||
if ( !tasks[taskName] ) { | ||
throw new Error( `Task "${taskName}" is not available. Available tasks: ${Object.keys(tasks)}` ); | ||
if (!tasks[taskName]) { | ||
const taskNames = Object.keys(tasks).join(', '); | ||
const taskTerm = taskNames.length > 1 ? 'task' : 'tasks'; | ||
const message = taskNames.length ? | ||
`Task "${taskName}" is not available. Available ${taskTerm}: ${taskNames}` : | ||
`No tasks available`; | ||
throw new Error(message); | ||
} | ||
if ( tasks[taskName] && typeof tasks[taskName].index !== 'function' ) { | ||
throw new Error( `Task "${taskName}" is available but invalid.` ); | ||
if (tasks[taskName] && typeof tasks[taskName].index !== 'function') { | ||
throw new Error(`Task "${taskName}" is available but invalid.`); | ||
} | ||
application.log.info(`[console:run] Starting taskName "${taskName}"...`); | ||
application.log.info(`Starting taskName "${taskName}"...`); | ||
@@ -29,3 +36,3 @@ const task = tasks[taskName].index; | ||
if (!taskConfiguration) { | ||
application.log.warn(`[console:run] Starting taskName "${taskName}" without configuration...`); | ||
application.log.info(`Starting taskName "${taskName}" without configuration...`); | ||
} | ||
@@ -35,3 +42,3 @@ | ||
await task(application, taskConfiguration); | ||
application.log.info(`[console:run] taskName "${taskName}" executed successfully`); | ||
application.log.info(`taskName "${taskName}" executed successfully`); | ||
} catch (err) { | ||
@@ -43,6 +50,6 @@ throw err; | ||
function consoleFactory ( ...args ) { | ||
return new TaskConsole( ...args ); | ||
function consoleFactory(...args) { | ||
return new TaskConsole(...args); | ||
} | ||
export default consoleFactory; |
import koa from 'koa'; | ||
import router from 'koa-router'; | ||
import {merge} from 'lodash'; | ||
@@ -7,36 +6,37 @@ | ||
function engineBlueprint () { | ||
let nameSpace = new WeakMap(); | ||
function engineBlueprint() { | ||
const nameSpace = new WeakMap(); | ||
return class Engine { | ||
constructor ( application ) { | ||
let fuel = koa(); | ||
constructor(application) { | ||
const fuel = koa(); | ||
fuel.experimental = true; | ||
this.env = fuel.env; | ||
nameSpace.set( this, { application, fuel, 'mounts': {} } ); | ||
nameSpace.set(this, {application, fuel, mounts: {}}); | ||
} | ||
async start ( host, port ) { | ||
let { fuel, application } = nameSpace.get( this ); | ||
let server = application.configuration.server; | ||
async start(host, port) { | ||
const {fuel, application} = nameSpace.get(this); | ||
const server = application.configuration.server; | ||
const env = application.configuration.environment; | ||
if ( application.router ) { | ||
application.log.info( '[application]', `Kicking off router ...` ); | ||
if (application.router) { | ||
application.log.debug('[application]', `Kicking off router ...`); | ||
fuel.use(application.router.routes()); | ||
fuel.use(application.router.allowedMethods()); | ||
application.log.info( '[application]', `Kicked off router ...` ); | ||
application.log.debug('[application]', `Kicked off router ...`); | ||
} | ||
if ( application.runtime.env === 'development' ) { | ||
if (await ports.test( port, host ) !== true) { | ||
if ( server.autoPort !== true ) { | ||
throw new Error( `Port ${port} is taken and server.autPort is disabled, could not start server.` ); | ||
if (application.runtime.env === 'development') { | ||
if (await ports.test(port, host) !== true) { | ||
if (server.autoPort !== true) { | ||
throw new Error(`Port ${port} is taken and server.autPort is disabled, could not start server.`); | ||
} | ||
application.log.warn( `[application] Port ${port} is taken, trying to obtain next open port... ` ); | ||
server.port = await ports.find( server.port + 1, server.port + 51, server.host ); | ||
application.log.warn(`Port ${port} is taken, trying to obtain next open port... `); | ||
server.port = await ports.find(server.port + 1, server.port + 51, server.host); | ||
application.subs.forEach(function(sub){ | ||
application.log.info( `[application:subapplication] Changing configuration of subapplications ${sub.name}` ); | ||
application.subs.forEach(sub => { | ||
application.log.debug(`Changing configuration of subapplications ${sub.name}`); | ||
@@ -49,27 +49,25 @@ sub.mountable.configuration.server = server; | ||
application.log.silly( `[application:subapplication] ${sub.mountable.name}.configuration.server: ${JSON.stringify(sub.mountable.configuration.server)}` ); | ||
application.log.silly( `[application:subapplication] ${sub.mountable.name}.configuration.client: ${JSON.stringify(sub.mountable.configuration.client)}` ); | ||
application.log.silly(`${sub.mountable.name}.configuration.server: ${JSON.stringify(sub.mountable.configuration.server)}`); | ||
application.log.silly(`${sub.mountable.name}.configuration.client: ${JSON.stringify(sub.mountable.configuration.client)}`); | ||
}); | ||
} | ||
} | ||
application.log.info( '[application]', `Starting engine at http://${server.host}:${server.port} in environment '${application.configuration.environment}' ...` ); | ||
let http = await fuel.listen( server.port ); | ||
application.log.info( '[application]', `Started engine at http://${server.host}:${server.port} in environment '${application.configuration.environment}' ...` ); | ||
application.log.debug(`Starting engine at http://${server.host}:${server.port} in environment '${env}' ...`); | ||
const http = await fuel.listen(server.port); | ||
application.log.info(`Started ${env} server at http://${server.host}:${server.port}`); | ||
nameSpace.set( this, { http } ); | ||
nameSpace.set(this, {http}); | ||
return application; | ||
} | ||
async stop() { | ||
return new Promise((resolve, reject) => { | ||
const {http, application} = nameSpace.get(this); | ||
async stop () { | ||
let { http, application } = nameSpace.get(this); | ||
return await http.close( function( err ) { | ||
return new Promise( function fulfill( resolve, reject ) { | ||
if ( err ) { | ||
return reject( err ); | ||
http.close(err => { | ||
if (err) { | ||
return reject(err); | ||
} | ||
return resolve( application ); | ||
return resolve(application); | ||
}); | ||
@@ -79,19 +77,16 @@ }); | ||
mount ( mountable, path = '/' ) { | ||
let { fuel, application } = nameSpace.get(this); | ||
let fragments = path.split('/'); | ||
let hostFragments = application.runtime.prefix.split('/'); | ||
let depth = fragments.length; | ||
mount(mountable, path = '/') { | ||
const {fuel, application} = nameSpace.get(this); | ||
const fragments = path.split('/'); | ||
const hostFragments = application.runtime.prefix.split('/'); | ||
application.log.info( `[application:subapplication] Mounting ${mountable.name} on ${path}` ); | ||
application.log.debug(`[application:subapplication] Mounting ${mountable.name} on ${path}`); | ||
if (path !== '/') { | ||
mountable.router.prefix(path); | ||
} else { | ||
mountable.router.stack.routes.forEach(function(route){ | ||
let match = application.router.route(route.name); | ||
if (path === '/') { | ||
mountable.router.stack.routes.forEach(route => { | ||
const match = application.router.route(route.name); | ||
if (match) { | ||
let index = application.router.stack.routes.indexOf(match); | ||
const index = application.router.stack.routes.indexOf(match); | ||
application.router.stack.routes.splice(index, 1); | ||
application.log.info(`[applications:subapplication] Route "${route.name}" of "${mountable.name}" overwrites ${application.name}'s route with same name.`) | ||
application.log.debug(`Route "${route.name}" of "${mountable.name}" overwrites ${application.name}'s route with same name.`); | ||
} | ||
@@ -101,12 +96,12 @@ }); | ||
application.router.stack.routes = application.router.stack.routes.concat(mountable.router.stack.routes); | ||
} else { | ||
mountable.router.prefix(path); | ||
} | ||
application.router.stack.middleware.forEach(function(middleware){ | ||
let match = mountable.router.stack.middleware | ||
.filter((mountMiddleware) => mountMiddleware.name === middleware.name)[0]; | ||
application.router.stack.middleware.forEach(middleware => { | ||
const [match] = mountable.router.stack.middleware | ||
.filter(mountMiddleware => mountMiddleware.name === middleware.name); | ||
if (match) { | ||
return; | ||
} | ||
mountable.router.stack.middleware.push(middleware); | ||
@@ -118,4 +113,4 @@ }); | ||
// Override middleware config on mountable by host middleware config | ||
for (let middlewareName of Object.keys(application.configuration.middlewares.enabled || {})) { | ||
let config = application.configuration.middlewares.enabled[middlewareName]; | ||
for (const middlewareName of Object.keys(application.configuration.middlewares.enabled || {})) { | ||
const config = application.configuration.middlewares.enabled[middlewareName]; | ||
let mountableConfig = mountable.configuration.middlewares.enabled[middlewareName]; | ||
@@ -138,15 +133,13 @@ | ||
mountable.runtime.prefix = '/' + fragments | ||
.concat(hostFragments) | ||
.filter((item) => item) | ||
.join('/'); | ||
const prefix = fragments.concat(hostFragments).filter(Boolean).join('/'); | ||
mountable.runtime.prefix = [`/${prefix}`]; | ||
application.subs.push({ path, mountable }); | ||
application.subs.push({path, mountable}); | ||
mountable.configuration.server = Object.assign({}, mountable.configuration.server, application.configuration.server); | ||
mountable.configuration.client = Object.assign({}, mountable.configuration.client, application.configuration.server); | ||
mountable.configuration.server = {...mountable.configuration.server, ...application.configuration.server}; | ||
mountable.configuration.client = {...mountable.configuration.client, ...application.configuration.server}; | ||
application.log.info( `[application:subapplication] Changing configuration of subapplications ${mountable.name}` ); | ||
application.log.info( `[application:subapplication] ${mountable.name}.configuration.server: ${JSON.stringify(mountable.configuration.server)}` ); | ||
application.log.info( `[application:subapplication] ${mountable.name}.configuration.client: ${JSON.stringify(mountable.configuration.client)}` ); | ||
application.log.debug(`Changing configuration of subapplications ${mountable.name}`); | ||
application.log.silly(`${mountable.name}.configuration.server: ${JSON.stringify(mountable.configuration.server)}`); | ||
application.log.silly(`${mountable.name}.configuration.client: ${JSON.stringify(mountable.configuration.client)}`); | ||
@@ -156,4 +149,4 @@ return application; | ||
use (...args) { | ||
let { fuel, application } = nameSpace.get(this); | ||
use(...args) { | ||
const {fuel, application} = nameSpace.get(this); | ||
fuel.use(...args); | ||
@@ -165,6 +158,6 @@ return application; | ||
function engineFactory ( ...args ) { | ||
return new ( engineBlueprint() )( ...args ); | ||
function engineFactory(...args) { | ||
return new (engineBlueprint())(...args); | ||
} | ||
export default engineFactory; |
@@ -1,15 +0,8 @@ | ||
/*eslint-disable no-console */ | ||
/** | ||
* Log Hook | ||
* Abstract: Provides logging facilities on application.log | ||
* Configuration: configuration/log.js | ||
**/ | ||
import startLogger from './logger'; | ||
export default { | ||
'after': [ 'hooks:user-hooks:start:after' ], | ||
after: ['hooks:user-hooks:start:after'], | ||
'configure': async function configureLogHook ( application ) { | ||
this.configuration = Object.assign( this.configuration, this.defaults, application.configuration[ this.name ] ); | ||
configure(application) { | ||
this.configuration = {...this.configuration, ...this.defaults, ...application.configuration[this.name]}; | ||
this.configuration.level = application.runtime.api.loglevel || this.configuration.level; | ||
@@ -19,4 +12,4 @@ return this; | ||
'start': async function startLogHook ( application ) { | ||
let logger = startLogger(`[${application.name}]`, this.configuration); | ||
start(application) { | ||
const logger = startLogger(`[${application.name}]`, this.configuration); | ||
@@ -23,0 +16,0 @@ application.log.silly('Draining boot logger queue...'); |
@@ -1,2 +0,2 @@ | ||
import { Logger as WinstonLogger, transports as winstonTransports } from 'winston'; | ||
import {Logger as WinstonLogger, transports as winstonTransports} from 'winston'; | ||
@@ -6,30 +6,30 @@ const privates = new WeakMap(); | ||
class Logger { | ||
constructor (prefix, options) { | ||
let engine = new WinstonLogger(options); | ||
constructor(prefix, options) { | ||
const engine = new WinstonLogger(options); | ||
engine.add(winstonTransports.Console, options); | ||
privates.set(this, { prefix, options, engine }); | ||
privates.set(this, {prefix, options, engine}); | ||
} | ||
log (method, ...args) { | ||
let { engine, prefix } = privates.get(this); | ||
log(method, ...args) { | ||
const {engine, prefix} = privates.get(this); | ||
engine[method](...[prefix, ...args]); | ||
} | ||
error (...args) { | ||
error(...args) { | ||
this.log('error', ...args); | ||
} | ||
warn (...args) { | ||
warn(...args) { | ||
this.log('warn', ...args); | ||
} | ||
info (...args) { | ||
info(...args) { | ||
this.log('info', ...args); | ||
} | ||
debug (...args) { | ||
debug(...args) { | ||
this.log('debug', ...args); | ||
} | ||
silly (...args) { | ||
silly(...args) { | ||
this.log('silly', ...args); | ||
@@ -44,2 +44,2 @@ } | ||
export default loggerFactory; | ||
export { Logger as Logger }; | ||
export {Logger as Logger}; |
@@ -1,28 +0,24 @@ | ||
import { resolve } from 'path'; | ||
import {resolve} from 'path'; | ||
import requireAll from 'require-all'; | ||
import { exists } from '../../../library/utilities/fs'; | ||
import {exists} from '../../../library/utilities/fs'; | ||
export default { | ||
'after': [ 'hooks:routes:start:after' ], | ||
'modes': [ 'server' ], | ||
after: ['hooks:routes:start:after'], | ||
modes: ['server'], | ||
'start': async function startMiddlewareHook ( application ) { | ||
// Load physical core middlewares | ||
let coreMiddlewares = requireAll( resolve( application.runtime.base, application.configuration.paths.middlewares ) ); | ||
// Load physical user middlewares | ||
let userMiddlewares = {}; | ||
start: async function startMiddlewareHook(application) { | ||
const coreMiddlewares = requireAll(resolve(application.runtime.base, application.configuration.paths.middlewares)); | ||
const userMiddlewares = {}; | ||
this.configuration.path = Array.isArray(this.configuration.path) ? this.configuration.path : [this.configuration.path]; | ||
let middlewarePaths = this.configuration.path | ||
const middlewarePaths = this.configuration.path | ||
.reduce((items, item) => items.concat( | ||
application.runtime.cwds.map((cwd) => resolve(cwd, item)) | ||
application.runtime.cwds.map(cwd => resolve(cwd, item)) | ||
), []); | ||
for (let middlewarePath of middlewarePaths) { | ||
if ( await exists( middlewarePath ) ) { | ||
Object.assign(userMiddlewares, requireAll( middlewarePath )); | ||
for (const middlewarePath of middlewarePaths) { | ||
if (await exists(middlewarePath)) { | ||
Object.assign(userMiddlewares, requireAll(middlewarePath)); | ||
} | ||
@@ -32,46 +28,47 @@ } | ||
// Load module middlewares | ||
let moduleMiddlewares = Object.keys( this.configuration.enabled ) | ||
.filter( ( middlewareName ) => typeof this.configuration.enabled[ middlewareName ].enabled === 'string' ) | ||
.reduce( ( result, middlewareName ) => { | ||
let middlewareModuleName = this.configuration.enabled[ middlewareName ].enabled; | ||
const moduleMiddlewares = Object.keys(this.configuration.enabled) | ||
.filter(middlewareName => typeof this.configuration.enabled[middlewareName].enabled === 'string') | ||
.reduce((result, middlewareName) => { | ||
const middlewareModuleName = this.configuration.enabled[middlewareName].enabled; | ||
try { | ||
result[ middlewareName ] = require( middlewareModuleName ); | ||
this.log.debug( `Required module middleware '${middlewareName}' from module '${middlewareModuleName}'` ); | ||
} catch ( err ) { | ||
this.log.warn( `Could not require module middleware '${middlewareName}' from module '${middlewareModuleName}'` ); | ||
this.log.debug( err ); | ||
result[middlewareName] = require(middlewareModuleName); | ||
this.log.silly(`Required module middleware '${middlewareName}' from module '${middlewareModuleName}'`); | ||
} catch (err) { | ||
this.log.warn(`Could not require module middleware '${middlewareName}' from module '${middlewareModuleName}'`); | ||
this.log.error(err); | ||
throw err; | ||
} | ||
return result; | ||
}, {} ); | ||
}, {}); | ||
let middlewares = Object.assign( {}, coreMiddlewares, userMiddlewares, moduleMiddlewares ); | ||
const middlewares = Object.assign({}, coreMiddlewares, userMiddlewares, moduleMiddlewares); | ||
// Check if required modules are functions, bind to engine | ||
Object.keys( middlewares ).forEach( ( middlewareName ) => { | ||
let middlewareFactoryFunction = middlewares[ middlewareName ]; | ||
let middlewareConfig = this.configuration.enabled[ middlewareName ]; | ||
Object.keys(middlewares).forEach(middlewareName => { | ||
const middlewareFactoryFunction = middlewares[middlewareName]; | ||
const middlewareConfig = this.configuration.enabled[middlewareName]; | ||
if ( typeof middlewareFactoryFunction !== 'function' ) { | ||
this.log.warn( `'${middlewareName}' is no valid middleware factory` ); | ||
if (typeof middlewareFactoryFunction !== 'function') { | ||
this.log.warn(`'${middlewareName}' is no valid middleware factory`); | ||
return; | ||
} | ||
let isObject = typeof middlewareConfig === 'object'; | ||
const isObject = typeof middlewareConfig === 'object'; | ||
if ( middlewareConfig === false || isObject && middlewareConfig.enabled !== true ) { | ||
this.log.debug( `Middleware '${middlewareName}' is explicitly disabled.` ); | ||
if (middlewareConfig === false || isObject && middlewareConfig.enabled !== true) { | ||
this.log.debug(`Middleware '${middlewareName}' is explicitly disabled.`); | ||
return; | ||
} | ||
if ( typeof middlewareConfig === 'undefined' ) { | ||
this.log.warn( `Middleware '${middlewareName}' is not configured, will not mount.` ); | ||
if (typeof middlewareConfig === 'undefined') { | ||
this.log.debug(`Middleware '${middlewareName}' is not configured, will not mount.`); | ||
return; | ||
} | ||
let fn = middlewareFactoryFunction( application, middlewareConfig ); | ||
const fn = middlewareFactoryFunction(application, middlewareConfig); | ||
if ( typeof fn !== 'function' ) { | ||
this.log.warn( `'${middlewareName}' middleware factory does not produce valid middlewares, will not mount.` ); | ||
if (typeof fn !== 'function') { | ||
this.log.warn(`'${middlewareName}' middleware factory does not produce valid middlewares, will not mount.`); | ||
return; | ||
@@ -81,9 +78,10 @@ } | ||
try { | ||
application.router.use( fn ); | ||
this.log.debug( `Middleware '${middlewareName}' mounted.` ); | ||
} catch ( err ) { | ||
this.log.error( `Binding '${middlewareName}' to engine failed` ); | ||
this.log.debug( err ); | ||
application.router.use(fn); | ||
this.log.debug(`Middleware '${middlewareName}' mounted.`); | ||
} catch (err) { | ||
this.log.error(`Binding '${middlewareName}' to engine failed`); | ||
this.log.debug(err); | ||
throw err; | ||
} | ||
} ); | ||
}); | ||
@@ -90,0 +88,0 @@ return application; |
@@ -16,3 +16,3 @@ import {resolve} from 'path'; | ||
if (application.mode === 'console') { | ||
return; | ||
return application; | ||
} | ||
@@ -86,7 +86,7 @@ | ||
if (typeof fn !== 'function') { | ||
this.log.info(`${routeName} factory returned no valid route for ${routeConfig.path}`); | ||
this.log.warn(`${routeName} factory returned no valid route for ${routeConfig.path}`); | ||
return; | ||
} | ||
this.log.info(`Mounting ${routeName} on ${routeConfig.path}`); | ||
this.log.debug(`Mounting ${routeName} on ${routeConfig.path}`); | ||
@@ -93,0 +93,0 @@ application.router.register(routeName, routeConfig.path, methods, function * runRoute(next) { |
@@ -31,6 +31,6 @@ import { | ||
for (const userHookPath of userHookPaths) { | ||
if (await exists(userHookPath) === false) { | ||
if (await exists(userHookPath) === false) { // eslint-disable-line | ||
continue; | ||
} else { | ||
application.log.info(`Loading user hooks from ${userHookPath}...`); | ||
application.log.debug(`Loading user hooks from ${userHookPath}...`); | ||
} | ||
@@ -41,3 +41,3 @@ | ||
userHooks = userHooks.concat(loadedHooks); | ||
application.log.info(`Loaded ${loadedHooks.length} user hooks: ${loadedHooks.map(loadedHook => loadedHook.name)}`); | ||
application.log.debug(`Loaded ${loadedHooks.length} user hooks: ${loadedHooks.map(loadedHook => loadedHook.name)}`); | ||
} catch (error) { | ||
@@ -71,3 +71,4 @@ application.log.error(`Failed loading hooks from ${userHookPath}: ${error.message}`); | ||
await* runHookTree(getHookTree(registered), registered, application, {}); | ||
const jobs = runHookTree(getHookTree(registered), registered, application, {}); | ||
await Promise.all(jobs); | ||
application.hooks = registered; | ||
@@ -74,0 +75,0 @@ return this; |
@@ -19,6 +19,6 @@ import {resolve} from 'path'; | ||
if (this.status === 200) { | ||
application.log.info(`[application:request] Matched ${this.params.path} on ${root}`); | ||
application.log.debug(`[application:request] Matched ${this.params.path} on ${root}`); | ||
break; | ||
} else { | ||
application.log.info(`[application:request] No match for ${this.params.path} on ${root}`); | ||
application.log.debug(`[application:request] No match for ${this.params.path} on ${root}`); | ||
} | ||
@@ -25,0 +25,0 @@ } |
#!/usr/bin/env node | ||
import boilerplate from '../'; | ||
import 'babel-polyfill'; | ||
import boilerplate from '../library'; | ||
import execute from '../library/utilities/execute'; | ||
@@ -4,0 +5,0 @@ |
#!/usr/bin/env node | ||
import boilerplate from '../'; | ||
import 'babel-polyfill'; | ||
import boilerplate from '../library'; | ||
import execute from '../library/utilities/execute'; | ||
@@ -4,0 +5,0 @@ |
@@ -0,17 +1,23 @@ | ||
const level = process.env.BOILERPLATESERVER_LOG_LEVEL || | ||
process.env.BOILERPLATE_LOG_LEVEL || | ||
process.env.NODE_LOG_LEVEL || | ||
process.env.LOG_LEVEL || | ||
'info'; | ||
const log = { | ||
'level': process.env.BOILERPLATESERVER_LOG_LEVEL || process.env.BOILERPLATE_LOG_LEVEL || process.env.NODE_LOG_LEVEL || process.env.LOG_LEVEL || 'silly', | ||
'colorize': true, | ||
'timestamp': true, | ||
'showLevel': true, | ||
'colors': { | ||
'trace': 'magenta', | ||
'input': 'grey', | ||
'verbose': 'cyan', | ||
'prompt': 'grey', | ||
'debug': 'blue', | ||
'info': 'green', | ||
'data': 'grey', | ||
'help': 'cyan', | ||
'warn': 'yellow', | ||
'error': 'red' | ||
level, | ||
colorize: true, | ||
timestamp: true, | ||
showLevel: true, | ||
colors: { | ||
trace: 'magenta', | ||
input: 'grey', | ||
verbose: 'cyan', | ||
prompt: 'grey', | ||
debug: 'blue', | ||
info: 'green', | ||
data: 'grey', | ||
help: 'cyan', | ||
warn: 'yellow', | ||
error: 'red' | ||
} | ||
@@ -18,0 +24,0 @@ }; |
@@ -58,5 +58,5 @@ import { | ||
async stop() { | ||
this.log.info('\n[application:stop] Stopping server gracefully...'); | ||
this.log.info('\nStopping server gracefully...'); | ||
await this.engine.stop(); | ||
this.log.info('\n[application:stop] Stopped server gracefully...'); | ||
this.log.info('\nStopped server gracefully...'); | ||
return this; | ||
@@ -75,3 +75,3 @@ } | ||
if (!this.console) { | ||
this.log.warn('[application:stop] application.console is not avaiable. Aborting.'); | ||
this.log.warn('application.console is not avaiable. Aborting.'); | ||
return this; | ||
@@ -78,0 +78,0 @@ } |
@@ -23,4 +23,6 @@ import { | ||
// run the tree, wait for all dependencies | ||
await* runHookTree(tree, registered, application, {}); | ||
const jobs = runHookTree(tree, registered, application, {}); | ||
await Promise.all(jobs); | ||
return application; | ||
}; |
@@ -1,2 +0,2 @@ | ||
import { resolve } from 'path' | ||
import {resolve} from 'path'; | ||
@@ -6,37 +6,35 @@ import requireAll from 'require-all'; | ||
export default function loadHooks ( application, path, modules = false ) { | ||
let hooks = requireAll( path ); | ||
export default function loadHooks(application, path, modules = false) { | ||
const rawAppHooks = requireAll(path); | ||
const enabledHooks = selectEnabledHooks(application); | ||
hooks = Object.keys(hooks) | ||
.map((name) => Object.assign(hooks[name].index ? hooks[name].index : hooks[name], { name })) | ||
.map((hook) => Object.assign(hook, { 'requirePath': resolve(path, hook.name) })); | ||
const appHooks = Object.entries(rawAppHooks) | ||
.map(entry => { | ||
const [name, hook] = entry; | ||
const mod = hook.index || hook; | ||
const requirePath = resolve(path, name); | ||
return {...mod, name, requirePath}; | ||
}) | ||
.map(hook => Object.assign(hook, {requirePath: resolve(path, hook.name)})); | ||
if ( modules && application.configuration ) { | ||
let moduleHookNames = Object.keys( application.configuration.hooks.enabled ) | ||
.filter( ( key ) => typeof application.configuration.hooks.enabled[ key ] === 'string' ); | ||
const moduleHooks = modules ? | ||
Object.values(enabledHooks) | ||
.filter(moduleName => typeof moduleName === 'string') | ||
.map(moduleName => { | ||
const requirePath = require.resolve(moduleName); | ||
const mod = require(moduleName); | ||
mod.requirePath = requirePath; | ||
return mod; | ||
}) : | ||
[]; | ||
let moduleHooks = moduleHookNames | ||
.map( function requireHookModules ( moduleHookName ) { | ||
let moduleName = application.configuration.hooks.enabled[ moduleHookName ]; | ||
return [...appHooks, ...moduleHooks] | ||
.filter(Boolean).map(hook => hookFactory(application, hook.name, hook)); | ||
} | ||
try { | ||
let moduleHook = require( moduleName ); | ||
moduleHook.name = moduleHookName; | ||
moduleHook.requirePath = require.resolve(moduleName); | ||
application.log.debug( '[application:hooks]', `Required module hook '${moduleHookName}' from module '${moduleName}'` ); | ||
} catch (err) { | ||
application.log.warn( '[application:hooks]', `Could not require module hook '${moduleHookName}' from module '${moduleName}'` ); | ||
} | ||
}); | ||
hooks = hooks.concat(moduleHooks); | ||
} | ||
hooks = hooks | ||
.filter((hook) => hook) | ||
.map(function hookCallback (hook) { | ||
return hookFactory(application, hook.name, hook); | ||
}); | ||
return hooks; | ||
function selectEnabledHooks(application) { | ||
const config = application.configuration || {}; | ||
const hooks = config.hooks || {}; | ||
const enabled = hooks.enabled || {}; | ||
return enabled; | ||
} |
@@ -1,2 +0,1 @@ | ||
import 'babel-core/polyfill'; | ||
import {basename, extname} from 'path'; | ||
@@ -24,3 +23,3 @@ import {merge} from 'lodash'; | ||
if (instance && instance.log) { | ||
instance.log.info(`[application] ${options.entry} executed sucessfully.`); | ||
// instance.log.info(`[application] ${options.entry} executed sucessfully.`); | ||
} | ||
@@ -35,3 +34,3 @@ } | ||
function handleError(error) { | ||
console.log(`${options.entry} failed.`) | ||
console.log(`${options.entry} failed.`); | ||
console.trace(error); | ||
@@ -38,0 +37,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15
280084
8
102
3194
1
+ Addeddebug@4.4.0(transitive)
+ Addedms@2.1.3(transitive)
- Removedbabel-core@^5.2.17
- Removedacorn@5.7.4(transitive)
- Removedalign-text@0.1.4(transitive)
- Removedalter@0.2.0(transitive)
- Removedamdefine@1.0.1(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedast-traverse@0.1.1(transitive)
- Removedast-types@0.8.120.9.6(transitive)
- Removedbabel-core@5.8.38(transitive)
- Removedbabel-plugin-constant-folding@1.0.1(transitive)
- Removedbabel-plugin-dead-code-elimination@1.0.2(transitive)
- Removedbabel-plugin-eval@1.0.1(transitive)
- Removedbabel-plugin-inline-environment-variables@1.0.1(transitive)
- Removedbabel-plugin-jscript@1.0.4(transitive)
- Removedbabel-plugin-member-expression-literals@1.0.1(transitive)
- Removedbabel-plugin-property-literals@1.0.1(transitive)
- Removedbabel-plugin-proto-to-assign@1.0.4(transitive)
- Removedbabel-plugin-react-constant-elements@1.0.3(transitive)
- Removedbabel-plugin-react-display-name@1.0.3(transitive)
- Removedbabel-plugin-remove-console@1.0.1(transitive)
- Removedbabel-plugin-remove-debugger@1.0.1(transitive)
- Removedbabel-plugin-runtime@1.0.7(transitive)
- Removedbabel-plugin-undeclared-variables-check@1.0.2(transitive)
- Removedbabel-plugin-undefined-to-void@1.1.6(transitive)
- Removedbabylon@5.8.38(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedbreakable@1.0.0(transitive)
- Removedcamelcase@1.2.1(transitive)
- Removedcenter-align@0.1.3(transitive)
- Removedchalk@1.1.3(transitive)
- Removedcliui@2.1.0(transitive)
- Removedcommander@2.20.3(transitive)
- Removedcommoner@0.10.8(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedconvert-source-map@1.9.0(transitive)
- Removedcore-js@1.2.7(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddefined@1.0.1(transitive)
- Removeddefs@1.1.1(transitive)
- Removeddetect-indent@3.0.1(transitive)
- Removeddetective@4.7.1(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedesprima@2.7.33.1.3(transitive)
- Removedesprima-fb@15001.1001.0-dev-harmony-fb(transitive)
- Removedesutils@2.0.3(transitive)
- Removedfs-readdir-recursive@0.1.2(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-stdin@4.0.1(transitive)
- Removedglob@5.0.15(transitive)
- Removedglobals@6.4.1(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedhome-or-tmp@1.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinvert-kv@1.0.0(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-core-module@2.16.1(transitive)
- Removedis-finite@1.1.0(transitive)
- Removedis-integer@1.0.7(transitive)
- Removedjs-tokens@1.0.1(transitive)
- Removedjsesc@0.5.0(transitive)
- Removedjson5@0.4.0(transitive)
- Removedkind-of@3.2.2(transitive)
- Removedlazy-cache@1.0.4(transitive)
- Removedlcid@1.0.0(transitive)
- Removedleven@1.0.2(transitive)
- Removedlongest@1.0.1(transitive)
- Removedminimatch@2.0.10(transitive)
- Removedmkdirp@0.5.6(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-locale@1.4.0(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedoutput-file-sync@1.1.2(transitive)
- Removedpath-exists@1.0.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedpath-parse@1.0.7(transitive)
- Removedprivate@0.1.8(transitive)
- Removedq@1.5.1(transitive)
- Removedrecast@0.10.330.11.23(transitive)
- Removedregenerate@1.4.2(transitive)
- Removedregenerator@0.8.40(transitive)
- Removedregexpu@1.3.0(transitive)
- Removedregjsgen@0.2.0(transitive)
- Removedregjsparser@0.1.5(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedrepeating@1.1.3(transitive)
- Removedresolve@1.22.10(transitive)
- Removedright-align@0.1.3(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedsimple-fmt@0.1.0(transitive)
- Removedsimple-is@0.2.0(transitive)
- Removedslash@1.0.0(transitive)
- Removedsource-map@0.1.320.5.7(transitive)
- Removedsource-map-support@0.2.10(transitive)
- Removedstable@0.1.8(transitive)
- Removedstringmap@0.2.2(transitive)
- Removedstringset@0.2.1(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
- Removedsupports-preserve-symlinks-flag@1.0.0(transitive)
- Removedthrough@2.3.8(transitive)
- Removedto-fast-properties@1.0.3(transitive)
- Removedtrim-right@1.0.1(transitive)
- Removedtry-resolve@1.0.1(transitive)
- Removedtryor@0.1.2(transitive)
- Removeduser-home@1.1.1(transitive)
- Removedwindow-size@0.1.4(transitive)
- Removedwordwrap@0.0.2(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedy18n@3.2.2(transitive)
- Removedyargs@3.27.0(transitive)