web-node 1.0.617 → 1.0.619

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.d.ts +3 -1
  2. package/index.js +36 -36
  3. package/main.js +21 -454
  4. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4,6 +4,8 @@ import type { PluginPreloader } from './type';
4
4
  import { Logger } from 'clientnode';
5
5
  export declare const log: Logger;
6
6
  export declare const main: (pluginLoaderMapping?: PluginPreloader) => Promise<void>;
7
- export declare let isMainModulePositiveCalls: number;
7
+ export declare const isMainModulePositiveCalls: {
8
+ value: number;
9
+ };
8
10
  export declare const isMainModule: (filename?: string, onlyOnce?: boolean) => Promise<boolean>;
9
11
  export default main;
package/index.js CHANGED
@@ -37,13 +37,13 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
37
37
  /* harmony export */ zW: () => (/* binding */ PLUGIN_PRELOADER)
38
38
  /* harmony export */ });
39
39
  /* unused harmony export log */
40
- /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
41
- /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
40
+ /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
41
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
42
42
  /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
43
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
44
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4);
45
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5);
46
- /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
43
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
44
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(5);
45
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(6);
46
+ /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3);
47
47
  /* module decorator */ module = __webpack_require__.hmd(module);
48
48
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_6__]);
49
49
  var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
@@ -249,6 +249,16 @@ module.exports = x({ ["CLOSE_EVENT_NAMES"]: () => (__WEBPACK_EXTERNAL_MODULE_cli
249
249
 
250
250
  /***/ }),
251
251
  /* 2 */
252
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
253
+
254
+ const x = (y) => {
255
+ const x = {}; __webpack_require__.d(x, y); return x
256
+ }
257
+ const y = (x) => (() => (x))
258
+ module.exports = x({ ["fileURLToPath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_url_50af3bb5__.fileURLToPath) });
259
+
260
+ /***/ }),
261
+ /* 3 */
252
262
  /***/ ((module, __webpack_exports__, __webpack_require__) => {
253
263
 
254
264
  __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
@@ -257,10 +267,10 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
257
267
  /* harmony export */ H: () => (/* binding */ configuration)
258
268
  /* harmony export */ });
259
269
  /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
260
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
261
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
262
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
263
- /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
270
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
271
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5);
272
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6);
273
+ /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
264
274
  /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
265
275
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__]);
266
276
  var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
@@ -302,7 +312,7 @@ __webpack_async_result__();
302
312
  } catch(e) { __webpack_async_result__(e); } }, 1);
303
313
 
304
314
  /***/ }),
305
- /* 3 */
315
+ /* 4 */
306
316
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
307
317
 
308
318
  const x = (y) => {
@@ -312,7 +322,7 @@ const y = (x) => (() => (x))
312
322
  module.exports = x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_fs__["default"]) });
313
323
 
314
324
  /***/ }),
315
- /* 4 */
325
+ /* 5 */
316
326
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
317
327
 
318
328
  const x = (y) => {
@@ -322,7 +332,7 @@ const y = (x) => (() => (x))
322
332
  module.exports = x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__["default"]), ["lstat"]: () => (__WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__.lstat), ["readdir"]: () => (__WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__.readdir), ["stat"]: () => (__WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__.stat) });
323
333
 
324
334
  /***/ }),
325
- /* 5 */
335
+ /* 6 */
326
336
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
327
337
 
328
338
  const x = (y) => {
@@ -332,7 +342,7 @@ const y = (x) => (() => (x))
332
342
  module.exports = x({ ["basename"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.basename), ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_path__["default"]), ["dirname"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.dirname), ["extname"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.extname), ["join"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.join), ["resolve"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.resolve) });
333
343
 
334
344
  /***/ }),
335
- /* 6 */
345
+ /* 7 */
336
346
  /***/ ((module, __webpack_exports__, __webpack_require__) => {
337
347
 
338
348
  __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
@@ -363,11 +373,11 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
363
373
  /* harmony export */ vF: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.vF),
364
374
  /* harmony export */ zW: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.zW)
365
375
  /* harmony export */ });
366
- /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
376
+ /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3);
367
377
  /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
368
378
  /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
369
- /* harmony import */ var node_fs_promises__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
370
- /* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11);
379
+ /* harmony import */ var node_fs_promises__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(11);
380
+ /* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2);
371
381
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__]);
372
382
  ([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
373
383
  // #!/usr/bin/env babel-node
@@ -399,14 +409,14 @@ finished=false;closeHandler=function closeHandler(){if(!finished)(0,_pluginAPI_j
399
409
  "@typescript-eslint/unbound-method".
400
410
  */// eslint-disable-next-line @typescript-eslint/unbound-method
401
411
  if((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFunction)(process.stdin["setRawMode"]))process.stdin.setRawMode(true);process.stdin.resume();process.stdin.setEncoding(configuration.core.encoding);process.stdin.on("data",function(key){void _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(){return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(!(key==="\x03")){_context2.n=3;break}if(!cancelTriggered){_context2.n=1;break}log.warn("Stopping ungracefully.");_context2.n=2;break;case 1:cancelTriggered=true;log.info("You have requested to shut down all services. A","second request will force to stop ungracefully.");_context2.n=2;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 2:process.exit();case 3:process.stdout.write(key);case 4:return _context2.a(2)}},_callee2)}))()});// endregion
402
- _context3.p=25;_context3.n=26;return Promise.all(Object.keys(servicePromises).map(function(name){return servicePromises[name]}));case 26:_context3.n=28;break;case 27:_context3.p=27;_t5=_context3.v;case 28:exitTriggered=true;_context3.n=29;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 29:process.exit();_context3.n=38;break;case 30:_context3.p=30;_t6=_context3.v;_context3.n=31;return handleError({configuration:configuration,data:_t6,plugins:plugins,servicePromises:servicePromises,services:services});case 31:if(exitTriggered){_context3.n=35;break}_context3.p=32;_context3.n=33;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 33:_context3.n=35;break;case 34:_context3.p=34;_t7=_context3.v;_context3.n=35;return handleError({configuration:configuration,data:_t7,plugins:plugins,servicePromises:servicePromises,services:services});case 35:if(!configuration.core.debug){_context3.n=36;break}throw _t6;case 36:log.error(_t6);case 37:process.exit(1);case 38:return _context3.a(2)}},_callee3,null,[[32,34],[25,27],[15,17],[12,21,22,23],[10,30],[3,7,8,9]])}));function main(_x2){return _main.apply(this,arguments)}return main}();var isMainModulePositiveCalls=0;/*
412
+ _context3.p=25;_context3.n=26;return Promise.all(Object.keys(servicePromises).map(function(name){return servicePromises[name]}));case 26:_context3.n=28;break;case 27:_context3.p=27;_t5=_context3.v;case 28:exitTriggered=true;_context3.n=29;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 29:process.exit();_context3.n=38;break;case 30:_context3.p=30;_t6=_context3.v;_context3.n=31;return handleError({configuration:configuration,data:_t6,plugins:plugins,servicePromises:servicePromises,services:services});case 31:if(exitTriggered){_context3.n=35;break}_context3.p=32;_context3.n=33;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 33:_context3.n=35;break;case 34:_context3.p=34;_t7=_context3.v;_context3.n=35;return handleError({configuration:configuration,data:_t7,plugins:plugins,servicePromises:servicePromises,services:services});case 35:if(!configuration.core.debug){_context3.n=36;break}throw _t6;case 36:log.error(_t6);case 37:process.exit(1);case 38:return _context3.a(2)}},_callee3,null,[[32,34],[25,27],[15,17],[12,21,22,23],[10,30],[3,7,8,9]])}));function main(_x2){return _main.apply(this,arguments)}return main}();var isMainModulePositiveCalls={value:0};/*
403
413
  NOTE: Neither "import.meta.main" nor "import.meta.url" cannot be used
404
414
  directly since bundlers replace them with a compile time constant
405
415
  referencing the build environments file location.
406
- */var isMainModule=/*#__PURE__*/function(){var _isMainModule=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(filename,onlyOnce){var _t8,_t9,_t0;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(onlyOnce===void 0){onlyOnce=true}if(!(onlyOnce&&isMainModulePositiveCalls>0||process.argv.length<2)){_context4.n=1;break}return _context4.a(2,false);case 1:if(!filename)filename=(0,node_url__WEBPACK_IMPORTED_MODULE_4__.fileURLToPath)(import.meta.url);/*
416
+ */var isMainModule=/*#__PURE__*/function(){var _isMainModule=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(filename,onlyOnce){var _t8,_t9,_t0;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(onlyOnce===void 0){onlyOnce=true}if(!(onlyOnce&&isMainModulePositiveCalls.value>0||process.argv.length<2)){_context4.n=1;break}return _context4.a(2,false);case 1:if(!filename)filename=(0,node_url__WEBPACK_IMPORTED_MODULE_4__.fileURLToPath)(import.meta.url);/*
407
417
  NOTE: Both locations have to be resolved since the executable is
408
418
  usually linked into a package managers binary folder.
409
- */_context4.p=2;_context4.n=3;return (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(process.argv[1]);case 3:_t8=_context4.v;_context4.n=4;return (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(filename);case 4:_t9=_context4.v;if(!(_t8===_t9)){_context4.n=5;break}isMainModulePositiveCalls+=1;return _context4.a(2,true);case 5:_context4.n=7;break;case 6:_context4.p=6;_t0=_context4.v;case 7:return _context4.a(2,false)}},_callee4,null,[[2,6]])}));function isMainModule(_x3,_x4){return _isMainModule.apply(this,arguments)}return isMainModule}();/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main);
419
+ */_context4.p=2;_context4.n=3;return (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(process.argv[1]);case 3:_t8=_context4.v;_context4.n=4;return (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(filename);case 4:_t9=_context4.v;if(!(_t8===_t9)){_context4.n=5;break}isMainModulePositiveCalls.value+=1;return _context4.a(2,true);case 5:_context4.n=7;break;case 6:_context4.p=6;_t0=_context4.v;case 7:return _context4.a(2,false)}},_callee4,null,[[2,6]])}));function isMainModule(_x3,_x4){return _isMainModule.apply(this,arguments)}return isMainModule}();/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main);
410
420
  /* harmony export */ __webpack_require__.d(__webpack_exports__, [
411
421
  /* harmony export */ "Ay", 0, /* export default binding */ __WEBPACK_DEFAULT_EXPORT__
412
422
  /* harmony export */ ]);
@@ -414,21 +424,11 @@ _context3.p=25;_context3.n=26;return Promise.all(Object.keys(servicePromises).ma
414
424
  __webpack_async_result__();
415
425
  } catch(e) { __webpack_async_result__(e); } });
416
426
 
417
- /***/ }),
418
- /* 7 */
419
- /***/ ((module) => {
420
-
421
- module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.617","description":"High level javaScript backend plugin system and configuration merger.","keywords":["api","backend","management","plugin","web"],"homepage":"https://torben.website/web-node","bugs":{"email":"info@torben.website","url":"https://github.com/thaibault/web-node/issues"},"license":"CC-BY-3.0","author":{"email":"info@torben.website","name":"Torben Sickert","url":"https://torben.website"},"repository":{"type":"git","url":"https://github.com/thaibault/web-node.git"},"type":"module","bin":"main.js","exports":{".":"./index.js","./main":"./main.js","./main.js":"./main.js","./package.json":"./package.json","./unixCrypt":"./unixCrypt.js","./unixCrypt.js":"./unixCrypt.js","./type":"./type.d.ts"},"files":["configurator.d.ts","index.d.ts","index.js","main.js","pluginAPI.d.ts","type.d.ts","unixCrypt.d.ts","unixCrypt.js"],"sideEffects":true,"scripts":{"build":"yarn build:types; yarn build:plain","build:plain":"weboptimizer build","build:types":"weboptimizer build:types","check":"yarn check:types; yarn lint","check:types":"weboptimizer check:types","clear":"weboptimizer clear","document":"weboptimizer document","lint":"weboptimizer lint","prepare":"yarn build","prepare:test":"yarn clear && cd dummyPlugin && shx touch yarn.lock && yarn build && cd ..","serve":"yarn build:plain && yarn start","start":"./main.js \'{plugin: {hotReloading: true}}\'","test":"yarn prepare:test && weboptimizer test","test:coverage":"yarn prepare:test && weboptimizer test:coverage","test:coverage:report":"yarn prepare:test && weboptimizer test:coverage:report","update:documentation":"web-documentation","watch":"weboptimizer build --watch"},"devDependencies":{"@babel/cli":"^8.0.4","@babel/eslint-parser":"^8.0.1","@eslint/js":"^10.0.1","@stylistic/eslint-plugin":"^5.10.0","@types/node":"^26.4.1","@types/webpack-env":"^1.18.8","@typescript-eslint/eslint-plugin":"^8.69.0","@typescript-eslint/parser":"^8.69.0","clientnode":"^4.0.1512","eslint":"^10.10.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^64.3.6","jest":"^30.5.1","jsdoc":"^4.0.5","shx":"^0.4.0","typescript-eslint":"^8.69.0","web-documentation":"^1.0.52","weboptimizer":"^4.0.78"},"peerDependencies":{"clientnode":"*"},"resolutions":{"colors":"1.4.0","globals@npm:^11.1.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^14.0.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^9.18.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"},"engines":{"node":">=26","npm":">=12","yarn":">=4"},"webDocumentation":{"trackingCode":"UA-40192634-9"},"webNode":{"core":{"context":{"path":"./","type":"relative"},"debug":false,"encoding":"utf8","interDependencies":{},"name":"web-node","plugin":{"configuration":{"fileNames":["package.json","private-package.json"],"propertyNames":["webNode","webnode","web-node"]},"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","directories":{"external":{"path":{"__evaluate__":"`${currentPath}/node_modules/`"}},"internal":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-_].*)$","path":{"__evaluate__":"`${currentPath}/plugins/`"}}},"hotReloading":false}}},"webOptimizer":{"assetPattern":{"javaScript":{"includeFilePathRegularExpression":"^(.+/)?main\\\\.js$","pattern":{"#":"This is how we can make our main exported artefact executable.","__evaluate__":"`#!/usr/bin/env node\\n// -*- coding: utf-8 -*-\\n${self.generic.assetPattern?.javaScript?.pattern ?? \'\'}\\n{1}`"}}},"injection":{"entry":{"__evaluate__":"2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith(\'test\') ? {testBundle: \'test\'} : {index: \'./index.ts\', main: \'./main.ts\', unixCrypt: \'./unixCrypt.ts\'}"}},"module":{"optimizer":{"terser":{"terserOptions":{"compress":{"#":"To provide a logging output we need to exclude this feature.","drop_console":{"__evaluate__":"false"},"drop_debugger":{"__evaluate__":"false"}}}}}},"targetTechnology":{"boilerplate":"node","payload":"node"}},"packageManager":"yarn@4.18.0"}');
422
-
423
427
  /***/ }),
424
428
  /* 8 */
425
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
429
+ /***/ ((module) => {
426
430
 
427
- const x = (y) => {
428
- const x = {}; __webpack_require__.d(x, y); return x
429
- }
430
- const y = (x) => (() => (x))
431
- module.exports = x({ });
431
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.619","description":"High level javaScript backend plugin system and configuration merger.","keywords":["api","backend","management","plugin","web"],"homepage":"https://torben.website/web-node","bugs":{"email":"info@torben.website","url":"https://github.com/thaibault/web-node/issues"},"license":"CC-BY-3.0","author":{"email":"info@torben.website","name":"Torben Sickert","url":"https://torben.website"},"repository":{"type":"git","url":"https://github.com/thaibault/web-node.git"},"type":"module","bin":"main.js","exports":{".":"./index.js","./main":"./main.js","./main.js":"./main.js","./package.json":"./package.json","./unixCrypt":"./unixCrypt.js","./unixCrypt.js":"./unixCrypt.js","./type":"./type.d.ts"},"files":["configurator.d.ts","index.d.ts","index.js","main.js","pluginAPI.d.ts","type.d.ts","unixCrypt.d.ts","unixCrypt.js"],"sideEffects":true,"scripts":{"build":"yarn build:types; yarn build:plain","build:plain":"weboptimizer build","build:types":"weboptimizer build:types","check":"yarn check:types; yarn lint","check:types":"weboptimizer check:types","clear":"weboptimizer clear","document":"weboptimizer document","lint":"weboptimizer lint","prepare":"yarn build","prepare:test":"yarn clear && cd dummyPlugin && shx touch yarn.lock && yarn build && cd ..","serve":"yarn build:plain && yarn start","start":"./main.js \'{plugin: {hotReloading: true}}\'","test":"yarn prepare:test && weboptimizer test","test:coverage":"yarn prepare:test && weboptimizer test:coverage","test:coverage:report":"yarn prepare:test && weboptimizer test:coverage:report","update:documentation":"web-documentation","watch":"weboptimizer build --watch"},"devDependencies":{"@babel/cli":"^8.0.4","@babel/eslint-parser":"^8.0.1","@eslint/js":"^10.0.1","@stylistic/eslint-plugin":"^5.10.0","@types/node":"^26.4.1","@types/webpack-env":"^1.18.8","@typescript-eslint/eslint-plugin":"^8.69.0","@typescript-eslint/parser":"^8.69.0","clientnode":"^4.0.1512","eslint":"^10.10.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^64.3.6","jest":"^30.5.1","jsdoc":"^4.0.5","shx":"^0.4.0","typescript-eslint":"^8.69.0","web-documentation":"^1.0.52","weboptimizer":"^4.0.78"},"peerDependencies":{"clientnode":"*"},"resolutions":{"colors":"1.4.0","globals@npm:^11.1.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^14.0.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^9.18.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"},"engines":{"node":">=26","npm":">=12","yarn":">=4"},"webDocumentation":{"trackingCode":"UA-40192634-9"},"webNode":{"core":{"context":{"path":"./","type":"relative"},"debug":false,"encoding":"utf8","interDependencies":{},"name":"web-node","plugin":{"configuration":{"fileNames":["package.json","private-package.json"],"propertyNames":["webNode","webnode","web-node"]},"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","directories":{"external":{"path":{"__evaluate__":"`${currentPath}/node_modules/`"}},"internal":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-_].*)$","path":{"__evaluate__":"`${currentPath}/plugins/`"}}},"hotReloading":false}}},"webOptimizer":{"assetPattern":{"javaScript":{"includeFilePathRegularExpression":"^(.+/)?main\\\\.js$","pattern":{"#":"This is how we can make our main exported artefact executable.","__evaluate__":"`#!/usr/bin/env node\\n// -*- coding: utf-8 -*-\\n${self.generic.assetPattern?.javaScript?.pattern ?? \'\'}\\n{1}`"}}},"injection":{"entry":{"__evaluate__":"2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith(\'test\') ? {testBundle: \'test\'} : {index: \'./index.ts\', main: \'./main.ts\', unixCrypt: \'./unixCrypt.ts\'}"}},"module":{"optimizer":{"terser":{"terserOptions":{"compress":{"#":"To provide a logging output we need to exclude this feature.","drop_console":{"__evaluate__":"false"},"drop_debugger":{"__evaluate__":"false"}}}}}},"targetTechnology":{"boilerplate":"node","payload":"node"}},"packageManager":"yarn@4.18.0"}');
432
432
 
433
433
  /***/ }),
434
434
  /* 9 */
@@ -438,7 +438,7 @@ const x = (y) => {
438
438
  const x = {}; __webpack_require__.d(x, y); return x
439
439
  }
440
440
  const y = (x) => (() => (x))
441
- module.exports = x({ ["spawnSync"]: () => (__WEBPACK_EXTERNAL_MODULE_child_process__.spawnSync) });
441
+ module.exports = x({ });
442
442
 
443
443
  /***/ }),
444
444
  /* 10 */
@@ -448,7 +448,7 @@ const x = (y) => {
448
448
  const x = {}; __webpack_require__.d(x, y); return x
449
449
  }
450
450
  const y = (x) => (() => (x))
451
- module.exports = x({ ["realpath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_fs_promises_06ebfe74__.realpath) });
451
+ module.exports = x({ ["spawnSync"]: () => (__WEBPACK_EXTERNAL_MODULE_child_process__.spawnSync) });
452
452
 
453
453
  /***/ }),
454
454
  /* 11 */
@@ -458,7 +458,7 @@ const x = (y) => {
458
458
  const x = {}; __webpack_require__.d(x, y); return x
459
459
  }
460
460
  const y = (x) => (() => (x))
461
- module.exports = x({ ["fileURLToPath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_url_50af3bb5__.fileURLToPath) });
461
+ module.exports = x({ ["realpath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_fs_promises_06ebfe74__.realpath) });
462
462
 
463
463
  /***/ })
464
464
  /******/ ]);
@@ -608,7 +608,7 @@ module.exports = x({ ["fileURLToPath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_ur
608
608
  /******/ // startup
609
609
  /******/ // Load entry module and return exports
610
610
  /******/ // This entry module used 'module' so it can't be inlined
611
- /******/ let __webpack_exports__ = __webpack_require__(6);
611
+ /******/ let __webpack_exports__ = __webpack_require__(7);
612
612
  /******/ __webpack_exports__ = await __webpack_exports__;
613
613
  /******/ const __webpack_exports__PLUGIN_PRELOADER = __webpack_exports__.zW;
614
614
  /******/ const __webpack_exports__callStack = __webpack_exports__.lT;
package/main.js CHANGED
@@ -1,339 +1,14 @@
1
1
  #!/usr/bin/env node
2
2
  // -*- coding: utf-8 -*-
3
3
 
4
- import {fileURLToPath as __webpack_fileURLToPath__} from "node:url";
5
- var __webpack_dirname__ = __webpack_fileURLToPath__(import.meta.url.replace(/\/(?:[^\/]*)$/, ""));
6
- import * as __WEBPACK_EXTERNAL_MODULE_child_process__ from "child_process";
7
- import * as __WEBPACK_EXTERNAL_MODULE_clientnode__ from "clientnode";
8
- import * as __WEBPACK_EXTERNAL_MODULE_core_js_modules_es_array_includes_js_66c3fd7d__ from "core-js/modules/es.array.includes.js";
9
- import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
10
- import * as __WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__ from "fs/promises";
11
- import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_06ebfe74__ from "node:fs/promises";
12
4
  import * as __WEBPACK_EXTERNAL_MODULE_node_url_50af3bb5__ from "node:url";
13
- import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
14
- /******/ var __webpack_modules__ = ([
15
- /* 0 */
16
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
5
+ /******/ var __webpack_modules__ = ({
17
6
 
18
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
19
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20
- /* harmony export */ Ay: () => (__WEBPACK_DEFAULT_EXPORT__),
21
- /* harmony export */ gh: () => (/* binding */ loadAll),
22
- /* harmony export */ gl: () => (/* binding */ callStackSynchronous),
23
- /* harmony export */ lT: () => (/* binding */ _callStack),
24
- /* harmony export */ zW: () => (/* binding */ PLUGIN_PRELOADER)
25
- /* harmony export */ });
26
- /* unused harmony exports log, determineInternalName, evaluateConfiguration, hotReloadAPIFile, hotReloadConfigurationFile, hotReloadFiles, combinePluginConfigurations, load, createNativeAPIFactory, loadAPI, loadConfiguration, loadConfigurations, gatherConfigurationFilePaths, loadFile, determineLocations, isInLocations, pluginAPI */
27
- /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
28
- /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
29
- /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
30
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
31
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4);
32
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5);
33
- /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
34
- /* module decorator */ module = __webpack_require__.hmd(module);
35
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_6__]);
36
- var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
37
- _configurator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_async_dependencies_result__[0];
38
- // #!/usr/bin/env babel-node
39
- // -*- coding: utf-8 -*-
40
- /** @module pluginAPI *//* !
41
- region header
42
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
43
-
44
- License
45
- -------
46
-
47
- This library written by Torben Sickert stands under a creative commons
48
- naming 3.0 unported license.
49
- See https://creativecommons.org/licenses/by/3.0/deed.de
50
- endregion
51
- */// region imports
52
- function _toConsumableArray(r){return _arrayWithoutHoles(r)||_iterableToArray(r)||_unsupportedIterableToArray(r)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArray(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}function _arrayWithoutHoles(r){if(Array.isArray(r))return _arrayLikeToArray(r)};function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}};// endregion
53
- var log=new clientnode__WEBPACK_IMPORTED_MODULE_2__.Logger({name:"web-node.plugin-api"});var PLUGIN_PRELOADER={};await (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.importFilesystemAPI)();/**
54
- * Calls all plugin methods for given trigger description asynchronous and
55
- * waits for their resolved promises.
56
- * @param givenState - Contains runtime information about current hook.
57
- * @param parameters - Additional parameters to forward into plugin api.
58
- * @returns A promise which resolves when all callbacks have resolved their
59
- * promise holding given potentially modified data.
60
- */var _callStack=/*#__PURE__*/function(){var _callStack2=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(givenState){var state,configuration,hook,plugins,isConfigurationHook,pluginsWithChangedConfiguration,localState,pluginsWithChangedAPIFiles,data,_len,parameters,_key,_iterator,_step,plugin,result,_message,_args=arguments,_t,_t2;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:state=_objectSpread(_objectSpread({},givenState),{},{pluginAPI:pluginAPI});configuration=state.configuration,hook=state.hook,plugins=state.plugins;isConfigurationHook=hook.endsWith("ConfigurationLoaded")||hook.endsWith("ConfigurationHotLoaded");if(!configuration.core.plugin.hotReloading){_context.n=6;break}if(isConfigurationHook){_context.n=4;break}_context.n=1;return hotReloadConfigurationFile(plugins,configuration.core.plugin.configuration.propertyNames);case 1:pluginsWithChangedConfiguration=_context.v;if(!pluginsWithChangedConfiguration.length){_context.n=4;break}log.info("Configuration for \""+pluginsWithChangedConfiguration.map(function(plugin){return plugin.name}).join("\", \"")+"\" has been changed: reloading initialized.");localState=_objectSpread(_objectSpread({},state),{},{triggerHook:state.hook,pluginsWithChangedConfiguration:pluginsWithChangedConfiguration});_context.n=2;return _callStack(_objectSpread(_objectSpread({},localState),{},{hook:"preConfigurationHotLoaded"}));case 2:_context.n=3;return loadConfigurations(plugins,configuration);case 3:_context.n=4;return _callStack(_objectSpread(_objectSpread({},localState),{},{hook:"postConfigurationHotLoaded"}));case 4:if(!(hook!=="apiFileReloaded")){_context.n=6;break}_context.n=5;return hotReloadAPIFile(plugins);case 5:pluginsWithChangedAPIFiles=_context.v;if(!pluginsWithChangedAPIFiles.length){_context.n=6;break}log.info("API-file for \""+"".concat(pluginsWithChangedAPIFiles.map(function(plugin){return plugin.name}).join("\", \""),"\""),"has been changed: reloading initialized.");_context.n=6;return _callStack(_objectSpread(_objectSpread({},state),{},{hook:"apiFileReloaded",pluginsWithChangedAPIFiles:pluginsWithChangedAPIFiles,triggerHook:state.hook}));case 6:data=givenState.data;for(_len=_args.length,parameters=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++){parameters[_key-1]=_args[_key]}_iterator=_createForOfIteratorHelper(plugins);_context.p=7;_iterator.s();case 8:if((_step=_iterator.n()).done){_context.n=15;break}plugin=_step.value;if(!plugin.api){_context.n=14;break}result=void 0;_context.p=9;_context.n=10;return plugin.api.apply(plugin,[state].concat(parameters));case 10:result=_context.v;_context.n=13;break;case 11:_context.p=11;_t=_context.v;if(!((_message=_t.message)!==null&&_message!==void 0&&_message.startsWith("NotImplemented:"))){_context.n=12;break}return _context.a(3,14);case 12:throw new Error("Plugin \"".concat(plugin.internalName,"\" ")+(plugin.internalName===plugin.name?"":"(".concat(plugin.name,") "))+"throws: ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(_t)," during asynchronous ")+"hook \"".concat(hook,"\"."),{cause:_t});case 13:data=result;log.info("Ran asynchronous hook \"".concat(hook,"\" for plugin \"").concat(plugin.name,"\"."));case 14:_context.n=8;break;case 15:_context.n=17;break;case 16:_context.p=16;_t2=_context.v;_iterator.e(_t2);case 17:_context.p=17;_iterator.f();return _context.f(17);case 18:if(!(data!==null&&_typeof(data)==="object"&&"then"in data)){_context.n=19;break}return _context.a(2,{promise:data});case 19:return _context.a(2,data)}},_callee,null,[[9,11],[7,16,17,18]])}));function callStack(_x){return _callStack2.apply(this,arguments)}return callStack}();/**
61
- * Calls all plugin methods for given trigger description synchronous.
62
- * @param givenState - Contains runtime information about current hook.
63
- * @param parameters - Additional parameters to forward into plugin api.
64
- * @returns Given potentially modified data.
65
- */var callStackSynchronous=function callStackSynchronous(givenState){var state=_objectSpread(_objectSpread({},givenState),{},{pluginAPI:pluginAPI});var configuration=state.configuration,hook=state.hook,plugins=state.plugins;var data=givenState.data;for(var _len2=arguments.length,parameters=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++){parameters[_key2-1]=arguments[_key2]}var _iterator2=_createForOfIteratorHelper(plugins),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var plugin=_step2.value;if(plugin.api){var result=void 0;try{result=plugin.api.apply(plugin,[state].concat(parameters))}catch(error){var _message2;if((_message2=error.message)!==null&&_message2!==void 0&&_message2.startsWith("NotImplemented:"))continue;throw new Error("Plugin \"".concat(plugin.internalName,"\" ")+(plugin.internalName===plugin.name?"":"(".concat(plugin.name,") "))+"throws: ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(error)," during synchronous hook")+"\"".concat(hook,"\"."),{cause:error})}data=result;if(configuration.core.debug)log.info("Ran synchronous hook \"".concat(hook,"\" for plugin"),"\"".concat(plugin.name,"\"."))}}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}return data};/**
66
- * Converts given plugin name into the corresponding internal representation.
67
- * @param name - Name to convert.
68
- * @param regularExpression - Regular expression pattern which extracts
69
- * relevant name path as first match group.
70
- * @returns Transformed name.
71
- */var determineInternalName=function determineInternalName(name,regularExpression){return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.delimitedToCamelCase)(name.replace(regularExpression,function(fullMatch,firstMatch){return typeof firstMatch==="string"?firstMatch:fullMatch}))};/**
72
- * Evaluates given configuration object by letting plugins package sub
73
- * structure untouched.
74
- * @param configuration - Evaluable configuration structure.
75
- * @returns Resolved configuration.
76
- */var evaluateConfiguration=/*#__PURE__*/function(){var _evaluateConfiguration=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(configuration){var pluginPackageConfigurationBackup,_i,_Object$entries,_Object$entries$_i,name,subConfiguration,now,evaluationOptions,_i2,_Object$entries2,_Object$entries2$_i,_name,pluginPackageConfiguration;return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:/*
77
- NOTE: We have to back up, remove and restore all plugin specific
78
- package configuration to avoid evaluation non web node#
79
- configuration structures.
80
- */pluginPackageConfigurationBackup={};for(_i=0,_Object$entries=Object.entries(configuration);_i<_Object$entries.length;_i++){_Object$entries$_i=_slicedToArray(_Object$entries[_i],2),name=_Object$entries$_i[0],subConfiguration=_Object$entries$_i[1];if(subConfiguration.package){pluginPackageConfigurationBackup[name]=subConfiguration.package;delete subConfiguration.package}}now=new Date;evaluationOptions={scope:_objectSpread(_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_2__.UTILITY_SCOPE),{},{currentPath:process.cwd(),fs:fs_promises__WEBPACK_IMPORTED_MODULE_4__["default"],path:path__WEBPACK_IMPORTED_MODULE_5__["default"],module:module,webNodePath:__webpack_dirname__,now:now,nowUTCTimestamp:(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.getUTCTimestamp)(now)})};_context2.n=1;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.evaluateAsyncDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.evaluateDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.removeKeysInEvaluation)(configuration),_objectSpread(_objectSpread({},evaluationOptions),{},{scope:_objectSpread(_objectSpread({},evaluationOptions.scope),{},{fs:fs__WEBPACK_IMPORTED_MODULE_3__["default"]})})),evaluationOptions);case 1:configuration=_context2.v;for(_i2=0,_Object$entries2=Object.entries(pluginPackageConfigurationBackup);_i2<_Object$entries2.length;_i2++){_Object$entries2$_i=_slicedToArray(_Object$entries2[_i2],2),_name=_Object$entries2$_i[0],pluginPackageConfiguration=_Object$entries2$_i[1];configuration[_name].package=pluginPackageConfiguration}return _context2.a(2,configuration)}},_callee2)}));function evaluateConfiguration(_x2){return _evaluateConfiguration.apply(this,arguments)}return evaluateConfiguration}();/**
81
- * Checks for changed plugin api file in given plugins and reloads them if
82
- * necessary (new timestamp).
83
- * @param plugins - List of plugins to search for updates in.
84
- * @returns A list with plugins which have a changed api scope.
85
- */var hotReloadAPIFile=/*#__PURE__*/function(){var _hotReloadAPIFile=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(plugins){var pluginsWithChangedFiles,pluginChanges,_iterator3,_step3,pluginChange,_i3,_Object$entries3,_Object$entries3$_i,name,value,propertyDescriptor,isWritable;return _regenerator().w(function(_context3){while(1)switch(_context3.n){case 0:pluginsWithChangedFiles=[];_context3.n=1;return hotReloadFiles("api","scope",plugins);case 1:pluginChanges=_context3.v;_iterator3=_createForOfIteratorHelper(pluginChanges);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){pluginChange=_step3.value;if(pluginChange.oldScope){// NOTE: We have to migrate old plugin api's scope state.
86
- for(_i3=0,_Object$entries3=Object.entries(pluginChange.oldScope);_i3<_Object$entries3.length;_i3++){_Object$entries3$_i=_slicedToArray(_Object$entries3[_i3],2),name=_Object$entries3$_i[0],value=_Object$entries3$_i[1];if(Object.prototype.hasOwnProperty.call(pluginChange.newScope,name)&&!(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFunction)(pluginChange.newScope[name])){propertyDescriptor=Object.getOwnPropertyDescriptor(pluginChange.newScope,name);isWritable=true;if(propertyDescriptor){isWritable=propertyDescriptor.writable!==false;if(propertyDescriptor.configurable&&!isWritable)Object.defineProperties(pluginChange.newScope,_defineProperty({},name,{writable:true}))}try{pluginChange.newScope[name]=value}catch(_unused){log.warn("Could not update new constant value for","variable \"".concat(name,"\"."))}if(!isWritable&&propertyDescriptor!==null&&propertyDescriptor!==void 0&&propertyDescriptor.configurable)Object.defineProperties(pluginChange.newScope,_defineProperty({},name,{writable:false}))}}pluginsWithChangedFiles.push(pluginChange.plugin)}}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}return _context3.a(2,pluginsWithChangedFiles)}},_callee3)}));function hotReloadAPIFile(_x3){return _hotReloadAPIFile.apply(this,arguments)}return hotReloadAPIFile}();/**
87
- * Checks for changed plugin configurations in given plugins and reloads them
88
- * if necessary (new timestamp).
89
- * @param plugins - List of plugins to search for updates in.
90
- * @param configurationPropertyNames - Property names to search for to use as
91
- * entry in plugin configuration file.
92
- * @returns A list with plugins which have a changed configurations.
93
- */var hotReloadConfigurationFile=/*#__PURE__*/function(){var _hotReloadConfigurationFile=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(plugins,configurationPropertyNames){var pluginsWithChangedFiles,pluginChanges,_iterator4,_step4,change;return _regenerator().w(function(_context4){while(1)switch(_context4.n){case 0:pluginsWithChangedFiles=[];_context4.n=1;return hotReloadFiles("configuration","packageConfiguration",plugins);case 1:pluginChanges=_context4.v;_iterator4=_createForOfIteratorHelper(pluginChanges);try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){change=_step4.value;change.plugin.configuration=loadConfiguration(change.plugin.internalName,change.plugin.packageConfiguration,configurationPropertyNames);pluginsWithChangedFiles.push(change.plugin)}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}return _context4.a(2,pluginsWithChangedFiles)}},_callee4)}));function hotReloadConfigurationFile(_x4,_x5){return _hotReloadConfigurationFile.apply(this,arguments)}return hotReloadConfigurationFile}();/**
94
- * Checks for changed plugin file type in given plugins and reloads them if
95
- * necessary (timestamp has changed).
96
- * @param type - Plugin file type to search for updates.
97
- * @param target - Property name existing in plugin meta information objects
98
- * which should be updated.
99
- * @param plugins - List of plugins to search for updates in.
100
- * @returns A list with plugin changes.
101
- */var hotReloadFiles=/*#__PURE__*/function(){var _hotReloadFiles=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(type,target,plugins){var pluginChanges,_iterator5,_step5,plugin,index,_iterator6,_step6,filePath,timestamp,oldScope,_t3,_t4;return _regenerator().w(function(_context5){while(1)switch(_context5.p=_context5.n){case 0:pluginChanges=[];_iterator5=_createForOfIteratorHelper(plugins);_context5.p=1;_iterator5.s();case 2:if((_step5=_iterator5.n()).done){_context5.n=13;break}plugin=_step5.value;if(!plugin[target]){_context5.n=12;break}index=0;_iterator6=_createForOfIteratorHelper(plugin["".concat(type,"FilePaths")]);_context5.p=3;_iterator6.s();case 4:if((_step6=_iterator6.n()).done){_context5.n=9;break}filePath=_step6.value;_context5.n=5;return (0,fs_promises__WEBPACK_IMPORTED_MODULE_4__.stat)(filePath);case 5:timestamp=_context5.v.mtime.getTime();if(!(plugin["".concat(type,"FileLoadTimestamps")][index]<timestamp)){_context5.n=7;break}log.info("Determined updated file \"".concat(filePath,"\"."),"Doing a reload.");oldScope=plugin[target];_context5.n=6;return loadFile(filePath,plugin.name,plugin[target]);case 6:plugin[target]=_context5.v;log.info("File \"".concat(filePath,"\" reloaded."));pluginChanges.push({newScope:plugin[target],oldScope:oldScope,plugin:plugin,target:target});case 7:plugin["".concat(type,"FileLoadTimestamps")][index]=timestamp;index+=1;case 8:_context5.n=4;break;case 9:_context5.n=11;break;case 10:_context5.p=10;_t3=_context5.v;_iterator6.e(_t3);case 11:_context5.p=11;_iterator6.f();return _context5.f(11);case 12:_context5.n=2;break;case 13:_context5.n=15;break;case 14:_context5.p=14;_t4=_context5.v;_iterator5.e(_t4);case 15:_context5.p=15;_iterator5.f();return _context5.f(15);case 16:return _context5.a(2,pluginChanges)}},_callee5,null,[[3,10,11,12],[1,14,15,16]])}));function hotReloadFiles(_x6,_x7,_x8){return _hotReloadFiles.apply(this,arguments)}return hotReloadFiles}();/**
102
- * Combines given plugin configurations into one and returns a plugin specific
103
- * meta information object.
104
- * @param name - Name of the plugin.
105
- * @param configurations - Array of plugin configurations to combine.
106
- * @param propertyNames - Array of property names to consider in the
107
- * configuration.
108
- * @returns An object of plugin specific meta information.
109
- */var combinePluginConfigurations=function combinePluginConfigurations(name,configurations,propertyNames){if(propertyNames===void 0){propertyNames=["webNode"]}var packageConfiguration={};var _iterator7=_createForOfIteratorHelper(configurations),_step7;try{for(_iterator7.s();!(_step7=_iterator7.n()).done;){var configuration=_step7.value;(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,/*
110
- NOTE: Source and target configuration got modified. While the
111
- target configuration receives the modifications the source
112
- configuration will lose their modification expressions
113
- therefore we can use the source configuration afterward to
114
- extend the target configuration.
115
- */(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.modifyObject)(packageConfiguration,configuration),configuration)}}catch(err){_iterator7.e(err)}finally{_iterator7.f()}name=packageConfiguration.webNodeInternalName||name;return{name:name,configuration:loadConfiguration(name,packageConfiguration,propertyNames)}};/**
116
- * Extends given configuration object with given plugin specific ones and
117
- * returns a plugin specific meta information object.
118
- * @param name - Name of plugin to extend.
119
- * @param internalName - Internal name of plugin to extend.
120
- * @param plugins - List of all yet determined plugin information.
121
- * @param metaConfiguration - Configuration file configuration.
122
- * @param pluginPath - Path to given plugin.
123
- * @param encoding - Encoding to use to read and write from child process's.
124
- * @returns An object of plugin specific meta information.
125
- */var load=/*#__PURE__*/function(){var _load=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(name,internalName,plugins,metaConfiguration,pluginPath,encoding){var configurationFilePaths,sourceConfigurations,_iterator8,_step8,filePath,_combinePluginConfigu,resolvedInternalName,configuration,apiFilePaths,_t5,_t6;return _regenerator().w(function(_context6){while(1)switch(_context6.p=_context6.n){case 0:if(encoding===void 0){encoding="utf8"}_context6.n=1;return gatherConfigurationFilePaths(pluginPath,metaConfiguration.fileNames);case 1:configurationFilePaths=_context6.v;sourceConfigurations=[];_iterator8=_createForOfIteratorHelper(configurationFilePaths);_context6.p=2;_iterator8.s();case 3:if((_step8=_iterator8.n()).done){_context6.n=6;break}filePath=_step8.value;_t5=sourceConfigurations;_context6.n=4;return loadFile(filePath,name);case 4:_t5.push.call(_t5,_context6.v);case 5:_context6.n=3;break;case 6:_context6.n=8;break;case 7:_context6.p=7;_t6=_context6.v;_iterator8.e(_t6);case 8:_context6.p=8;_iterator8.f();return _context6.f(8);case 9:_combinePluginConfigu=combinePluginConfigurations(internalName,sourceConfigurations,metaConfiguration.propertyNames),resolvedInternalName=_combinePluginConfigu.name,configuration=_combinePluginConfigu.configuration;apiFilePaths=["index.js"];if(!Object.keys(configuration[resolvedInternalName].package).length){_context6.n=11;break}if(configuration[resolvedInternalName].package.main)apiFilePaths[0]=configuration[resolvedInternalName].package.main;_context6.n=10;return loadAPI(apiFilePaths,pluginPath,name,resolvedInternalName,plugins,encoding,configuration,configurationFilePaths);case 10:return _context6.a(2,_context6.v);case 11:_context6.n=12;return loadAPI(apiFilePaths,pluginPath,name,resolvedInternalName,plugins,encoding);case 12:return _context6.a(2,_context6.v)}},_callee6,null,[[2,7,8,9]])}));function load(_x9,_x0,_x1,_x10,_x11,_x12){return _load.apply(this,arguments)}return load}();/**
126
- * Creates a function callable by plugin api which calls the corresponding
127
- * plugin scope method.
128
- * @param plugins - To search for plugin scope in.
129
- * @param name - Name of plugin to search for.
130
- * @returns A function which calls the corresponding plugin scope method.
131
- */var createNativeAPIFactory=function createNativeAPIFactory(plugins,name){return function(state){var _ref;for(var _len3=arguments.length,parameters=new Array(_len3>1?_len3-1:0),_key3=1;_key3<_len3;_key3++){parameters[_key3-1]=arguments[_key3]}if(plugins[name].scope&&state.hook in plugins[name].scope)return(_ref=plugins[name].scope)[state.hook].apply(_ref,[state].concat(parameters,[module]));throw new Error("NotImplemented: API method \"".concat(state.hook,"\" is not ")+"implemented in plugin \"".concat(name,"\"."))}};/**
132
- * Load given plugin api file in given path and generates a plugin specific
133
- * data structure with useful meta information.
134
- * @param relativeFilePaths - Paths to file to load relatively from given
135
- * plugin path.
136
- * @param pluginPath - Path to plugin directory.
137
- * @param name - Plugin name to use for proper error messages.
138
- * @param internalName - Internal plugin name to use for proper error messages.
139
- * @param plugins - List of plugins to search for trigger callbacks in.
140
- * @param encoding - Encoding to use to read and write from child process.
141
- * @param configuration - Plugin specific configurations.
142
- * @param configurationFilePaths - Plugin specific configuration file paths.
143
- * @returns Plugin meta information object.
144
- */var loadAPI=/*#__PURE__*/function(){var _loadAPI=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(relativeFilePaths,pluginPath,name,internalName,plugins,encoding,configuration,configurationFilePaths){var filePath,_iterator9,_step9,fileName,api,nativeAPI,pluginConfiguration,hasPluginConfiguration,scope,_t7,_t8,_t9,_t0,_t1,_t10,_t11,_t12,_t13,_t14,_t15,_t16,_t17,_t18,_t19,_t20,_t21,_t22,_t23,_t24;return _regenerator().w(function(_context8){while(1)switch(_context8.p=_context8.n){case 0:if(encoding===void 0){encoding="utf8"}if(configuration===void 0){configuration=null}if(configurationFilePaths===void 0){configurationFilePaths=[]}filePath=(0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(pluginPath,relativeFilePaths[0]);_context8.n=1;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 1:if(_context8.v){_context8.n=11;break}_t7=_createForOfIteratorHelper;_context8.n=2;return (0,fs_promises__WEBPACK_IMPORTED_MODULE_4__.readdir)(pluginPath);case 2:_iterator9=_t7(_context8.v);_context8.p=3;_iterator9.s();case 4:if((_step9=_iterator9.n()).done){_context8.n=8;break}fileName=_step9.value;_t8=!configurationFilePaths.map(function(filePath){return (0,path__WEBPACK_IMPORTED_MODULE_5__.basename)(filePath)}).includes(fileName);if(!_t8){_context8.n=6;break}_context8.n=5;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)((0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(pluginPath,fileName));case 5:_t8=_context8.v;case 6:if(!_t8){_context8.n=7;break}filePath=(0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(pluginPath,filePath);if(!["index","main"].includes((0,path__WEBPACK_IMPORTED_MODULE_5__.basename)(filePath,(0,path__WEBPACK_IMPORTED_MODULE_5__.extname)(fileName)))){_context8.n=7;break}return _context8.a(3,8);case 7:_context8.n=4;break;case 8:_context8.n=10;break;case 9:_context8.p=9;_t9=_context8.v;_iterator9.e(_t9);case 10:_context8.p=10;_iterator9.f();return _context8.f(10);case 11:api=null;nativeAPI=false;_t0=configuration&&(/*
145
- NOTE: Check if a webNode plugin configuration is available
146
- indicating a backend responsibility for api file.
147
-
148
- NOTE: One key is always there representing the whole package
149
- configuration.
150
- */Object.keys(configuration).length>1||Object.prototype.hasOwnProperty.call(configuration,internalName)&&Object.keys(configuration[internalName]).length>1);if(!_t0){_context8.n=13;break}_context8.n=12;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 12:_t0=_context8.v;case 13:if(!_t0){_context8.n=14;break}if(filePath.endsWith(".js")){nativeAPI=true;api=createNativeAPIFactory(plugins,name)}else// NOTE: Any executable file can represent an api.
151
- api=function api(_ref2){var hook=_ref2.hook,data=_ref2.data;for(var _len4=arguments.length,parameters=new Array(_len4>1?_len4-1:0),_key4=1;_key4<_len4;_key4++){parameters[_key4-1]=arguments[_key4]}var childProcessResult=(0,child_process__WEBPACK_IMPORTED_MODULE_1__.spawnSync)(filePath,[hook].concat(_toConsumableArray(parameters.map(function(item){return JSON.stringify(item)}))),{cwd:process.cwd(),encoding:encoding,env:process.env,input:JSON.stringify(data),shell:true,stdio:"inherit"});if(childProcessResult.status===404)return data;var jsonIndicatorPrefix="##!JSON!##";if(childProcessResult.stdout.startsWith(jsonIndicatorPrefix))return JSON.parse(childProcessResult.stdout.substring(jsonIndicatorPrefix.length));return data};case 14:pluginConfiguration=configuration!==null&&configuration!==void 0?configuration:_defineProperty({},internalName,{package:{}});hasPluginConfiguration=Object.prototype.hasOwnProperty.call(pluginConfiguration,internalName);if(!plugins[name]){_context8.n=15;break}_t1=plugins[name].scope;_context8.n=19;break;case 15:if(!nativeAPI){_context8.n=17;break}_context8.n=16;return loadFile(filePath,name);case 16:_t10=_context8.v;_context8.n=18;break;case 17:_t10=null;case 18:_t1=_t10;case 19:scope=_t1;_t11=api;if(!api){_context8.n=21;break}_context8.n=20;return (0,fs_promises__WEBPACK_IMPORTED_MODULE_4__.stat)(filePath);case 20:_t13=_context8.v.mtime.getTime();_t12=[_t13];_context8.n=22;break;case 21:_t12=[];case 22:_t14=_t12;_t15=api?[filePath]:[];_t16=pluginConfiguration;_t17=configurationFilePaths;_context8.n=23;return Promise.all(configurationFilePaths.map(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(filePath){return _regenerator().w(function(_context7){while(1)switch(_context7.n){case 0:_context7.n=1;return (0,fs_promises__WEBPACK_IMPORTED_MODULE_4__.stat)(filePath);case 1:return _context7.a(2,_context7.v.mtime.getTime())}},_callee7)}))));case 23:_t18=_context8.v;_t19=hasPluginConfiguration&&pluginConfiguration[internalName].dependencies?pluginConfiguration[internalName].dependencies:[];_t20=internalName;_t21=name;_t22=hasPluginConfiguration?pluginConfiguration[internalName].package:{};_t23=pluginPath;_t24=scope;return _context8.a(2,{api:_t11,apiFileLoadTimestamps:_t14,apiFilePaths:_t15,configuration:_t16,configurationFilePaths:_t17,configurationFileLoadTimestamps:_t18,dependencies:_t19,internalName:_t20,name:_t21,packageConfiguration:_t22,path:_t23,scope:_t24})}},_callee8,null,[[3,9,10,11]])}));function loadAPI(_x13,_x14,_x15,_x16,_x17,_x18,_x19,_x20){return _loadAPI.apply(this,arguments)}return loadAPI}();/**
152
- * Loads plugin specific configuration object.
153
- * @param name - Property name where to inject resolved configuration into
154
- * global one.
155
- * @param packageConfiguration - Plugin specific package configuration object.
156
- * @param configurationPropertyNames - Property names to search for to use as
157
- * entry in plugin configuration file.
158
- * @returns Determined configuration object.
159
- */var loadConfiguration=function loadConfiguration(name,packageConfiguration,configurationPropertyNames){/*
160
- No plugin specific configuration found. Only provide package
161
- configuration.
162
- Removing comments (default key prefix to delete is "#").
163
- */var packageConfigurationCopy=(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.removeKeyPrefixes)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(packageConfiguration));var result=_defineProperty({},name,{package:packageConfigurationCopy});var _iterator0=_createForOfIteratorHelper(configurationPropertyNames),_step0;try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){var propertyName=_step0.value;if(packageConfiguration[propertyName]){(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,result,packageConfiguration[propertyName]);/*
164
- NOTE: We should break the cycle here to avoid endless loops
165
- when traversing this data structure.
166
- */delete result[name].package[propertyName];break}}}catch(err){_iterator0.e(err)}finally{_iterator0.f()}return result};/**
167
- * Loads given plugin configurations into global configuration.
168
- * @param plugins - Topological sorted list of plugins to check for
169
- * configurations.
170
- * @param configuration - Global configuration to extend with.
171
- * @returns Updated given configuration object.
172
- */var loadConfigurations=function loadConfigurations(plugins,configuration){/*
173
- First clear current configuration content key by key to let old top
174
- level configuration object instance untouched.
175
- */for(var _i4=0,_Object$keys=Object.keys(configuration);_i4<_Object$keys.length;_i4++){var key=_Object$keys[_i4];delete configuration[key]};(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(configuration,(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(_configurator_js__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .A));var _iterator1=_createForOfIteratorHelper(plugins),_step1;try{for(_iterator1.s();!(_step1=_iterator1.n()).done;){var plugin=_step1.value;if(Object.prototype.hasOwnProperty.call(plugin,"configuration")){var pluginConfiguration=(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(plugin.configuration);(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.modifyObject)(configuration,pluginConfiguration),/*
176
- NOTE: Should be resolved via preceding
177
- "object.modifyObject" call.
178
- */pluginConfiguration);/*
179
- NOTE: We apply provided runtime configuration after each plugin
180
- specific configuration set to give runtime configuration always
181
- the highest priority when resolving intermediate configuration
182
- states.
183
- */if(configuration.core.runtimeConfiguration)(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,configuration,configuration.core.runtimeConfiguration)}}}catch(err){_iterator1.e(err)}finally{_iterator1.f()}return evaluateConfiguration(configuration)};/**
184
- * Gathers all existing configuration file paths for given plugin path and
185
- * file names.
186
- * @param pluginPath - Path to the plugin directory.
187
- * @param fileNames - List of configuration file names to check.
188
- * @returns A list of existing configuration file paths.
189
- */var gatherConfigurationFilePaths=/*#__PURE__*/function(){var _gatherConfigurationFilePaths=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(pluginPath,fileNames){var result,_iterator10,_step10,fileName,filePath,_t25;return _regenerator().w(function(_context9){while(1)switch(_context9.p=_context9.n){case 0:result=[];_iterator10=_createForOfIteratorHelper(fileNames);_context9.p=1;_iterator10.s();case 2:if((_step10=_iterator10.n()).done){_context9.n=5;break}fileName=_step10.value;filePath=(0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(pluginPath,fileName);_context9.n=3;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 3:if(!_context9.v){_context9.n=4;break}result.push(filePath);case 4:_context9.n=2;break;case 5:_context9.n=7;break;case 6:_context9.p=6;_t25=_context9.v;_iterator10.e(_t25);case 7:_context9.p=7;_iterator10.f();return _context9.f(7);case 8:return _context9.a(2,result.sort())}},_callee9,null,[[1,6,7,8]])}));function gatherConfigurationFilePaths(_x22,_x23){return _gatherConfigurationFilePaths.apply(this,arguments)}return gatherConfigurationFilePaths}();/**
190
- * Load given api file path and returns exported scope.
191
- * @param filePath - Path to file to load.
192
- * @param name - Plugin name to use for proper error messages.
193
- * @param fallbackScope - Scope to return if an error occurs during loading.
194
- * If a "null" is given an error will be thrown.
195
- * @param doLogging - Enables logging.
196
- * @returns Exported api file scope.
197
- */var loadFile=/*#__PURE__*/function(){var _loadFile=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(filePath,name,fallbackScope,doLogging){var options,scope,_t26;return _regenerator().w(function(_context0){while(1)switch(_context0.p=_context0.n){case 0:if(fallbackScope===void 0){fallbackScope=null}if(doLogging===void 0){doLogging=true}options={};if((0,path__WEBPACK_IMPORTED_MODULE_5__.extname)(filePath)===".json")options.with={type:"json"};_context0.p=1;_context0.n=2;return import(/* webpackIgnore: true */"".concat(filePath,"?timestamp=").concat(String(Date.now())),options);case 2:scope=_context0.v;_context0.n=5;break;case 3:_context0.p=3;_t26=_context0.v;if(!fallbackScope){_context0.n=4;break}scope=fallbackScope;if(doLogging)log.warn("Couldn't load new api plugin file \"".concat(filePath,"\" for"),"plugin \"".concat(name,"\": ").concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(_t26),". Using"),"fallback one.");_context0.n=5;break;case 4:throw new Error("Couldn't load plugin file \"".concat(filePath,"\" for plugin ")+"\"".concat(name,"\": ").concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(_t26)),{cause:_t26});case 5:if(!(Object.prototype.hasOwnProperty.call(scope,"default")&&scope.default)){_context0.n=6;break}return _context0.a(2,scope.default);case 6:return _context0.a(2,scope)}},_callee0,null,[[1,3]])}));function loadFile(_x24,_x25,_x26,_x27){return _loadFile.apply(this,arguments)}return loadFile}();/**
198
- * Extends given configuration object with all plugin specific ones and returns
199
- * a topological sorted list of plugins with plugins specific meta information
200
- * stored.
201
- * @param configuration - Configuration object to extend and use.
202
- * @returns A topological sorted list of plugins objects.
203
- */var loadAll=/*#__PURE__*/function(){var _loadAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee1(configuration){var plugins,_i5,_Object$entries4,_Object$entries4$_i,name,plugin,pluginConfigurations,_combinePluginConfigu2,internalName,pluginConfiguration,hasPluginConfiguration,_configuration$core$p,_name2,_internalName,_i6,_Object$values,directory,_directory$nameRegula,compiledRegularExpression,_iterator11,_step11,pluginName,currentPluginPath,_internalName2,temporaryPlugins,_i7,_Object$values2,_plugin,_iterator12,_step12,_name3,sortedPlugins,_iterator13,_step13,_pluginName,_i8,_Object$entries5,_Object$entries5$_i,_name4,_plugin2,_t27,_t28,_t29,_t30,_t31;return _regenerator().w(function(_context1){while(1)switch(_context1.p=_context1.n){case 0:plugins={};for(_i5=0,_Object$entries4=Object.entries(PLUGIN_PRELOADER);_i5<_Object$entries4.length;_i5++){_Object$entries4$_i=_slicedToArray(_Object$entries4[_i5],2),name=_Object$entries4$_i[0],plugin=_Object$entries4$_i[1];pluginConfigurations=[].concat(plugin.configurations||[]);_combinePluginConfigu2=combinePluginConfigurations(plugin.name||name,pluginConfigurations),internalName=_combinePluginConfigu2.name,pluginConfiguration=_combinePluginConfigu2.configuration;hasPluginConfiguration=Object.prototype.hasOwnProperty.call(pluginConfiguration,internalName);plugins[name]={api:createNativeAPIFactory(plugins,name),apiFileLoadTimestamps:plugin.scope?[0]:[],apiFilePaths:plugin.scope?[""]:[],configuration:pluginConfiguration,configurationFilePaths:pluginConfigurations.map(function(){return""}),configurationFileLoadTimestamps:pluginConfigurations.map(function(){return 0}),dependencies:hasPluginConfiguration&&pluginConfiguration[internalName].dependencies?pluginConfiguration[internalName].dependencies:[],internalName:internalName,name:name,packageConfiguration:hasPluginConfiguration?pluginConfiguration[internalName].package:{},path:"",scope:plugin.scope||{}}}/*
204
- Load main plugin configuration at first.
205
-
206
- NOTE: If application's main is this itself avoid loading it twice.
207
- */if(!(configuration.name!=="web-node")){_context1.n=2;break}_name2=configuration.name;_internalName=determineInternalName(_name2,new RegExp((_configuration$core$p=configuration.core.plugin.directories.external.nameRegularExpressionPattern)!==null&&_configuration$core$p!==void 0?_configuration$core$p:configuration.core.plugin.nameRegularExpressionPattern));_context1.n=1;return load(_name2,_internalName,plugins,configuration.core.plugin.configuration,configuration.core.context.path,configuration.core.encoding);case 1:plugins[_name2]=_context1.v;case 2:_i6=0,_Object$values=Object.values(configuration.core.plugin.directories);case 3:if(!(_i6<_Object$values.length)){_context1.n=17;break}directory=_Object$values[_i6];_context1.n=4;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isDirectory)(directory.path);case 4:if(!_context1.v){_context1.n=16;break}compiledRegularExpression=new RegExp((_directory$nameRegula=directory.nameRegularExpressionPattern)!==null&&_directory$nameRegula!==void 0?_directory$nameRegula:configuration.core.plugin.nameRegularExpressionPattern);_t27=_createForOfIteratorHelper;_context1.n=5;return (0,fs_promises__WEBPACK_IMPORTED_MODULE_4__.readdir)(directory.path);case 5:_iterator11=_t27(_context1.v);_context1.p=6;_iterator11.s();case 7:if((_step11=_iterator11.n()).done){_context1.n=13;break}pluginName=_step11.value;if(compiledRegularExpression.test(pluginName)){_context1.n=8;break}return _context1.a(3,12);case 8:currentPluginPath=(0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(directory.path,pluginName);if(!Object.prototype.hasOwnProperty.call(plugins,pluginName)){_context1.n=10;break}plugins[pluginName].path=currentPluginPath;_context1.n=9;return gatherConfigurationFilePaths(currentPluginPath,configuration.core.plugin.configuration.fileNames);case 9:plugins[pluginName].configurationFilePaths=_context1.v;return _context1.a(3,12);case 10:_internalName2=determineInternalName(pluginName,compiledRegularExpression);_context1.n=11;return load(pluginName,_internalName2,plugins,configuration.core.plugin.configuration,currentPluginPath,configuration.core.encoding);case 11:plugins[pluginName]=_context1.v;case 12:_context1.n=7;break;case 13:_context1.n=15;break;case 14:_context1.p=14;_t28=_context1.v;_iterator11.e(_t28);case 15:_context1.p=15;_iterator11.f();return _context1.f(15);case 16:_i6++;_context1.n=3;break;case 17:temporaryPlugins={};for(_i7=0,_Object$values2=Object.values(plugins);_i7<_Object$values2.length;_i7++){_plugin=_Object$values2[_i7];temporaryPlugins[_plugin.internalName]=_plugin.dependencies;if(Object.prototype.hasOwnProperty.call(configuration.core.interDependencies,_plugin.internalName)){_iterator12=_createForOfIteratorHelper([].concat(configuration.core.interDependencies[_plugin.internalName]));try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){_name3=_step12.value;if(!temporaryPlugins[_plugin.internalName].includes(_name3))temporaryPlugins[_plugin.internalName].push(_name3)}}catch(err){_iterator12.e(err)}finally{_iterator12.f()}}}sortedPlugins=[];_iterator13=_createForOfIteratorHelper((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.sortTopological)(temporaryPlugins));_context1.p=18;_iterator13.s();case 19:if((_step13=_iterator13.n()).done){_context1.n=23;break}_pluginName=_step13.value;_i8=0,_Object$entries5=Object.entries(plugins);case 20:if(!(_i8<_Object$entries5.length)){_context1.n=22;break}_Object$entries5$_i=_slicedToArray(_Object$entries5[_i8],2),_name4=_Object$entries5$_i[0],_plugin2=_Object$entries5$_i[1];if(![_plugin2.internalName,_name4].includes(_pluginName)){_context1.n=21;break}sortedPlugins.push(_plugin2);return _context1.a(3,22);case 21:_i8++;_context1.n=20;break;case 22:_context1.n=19;break;case 23:_context1.n=25;break;case 24:_context1.p=24;_t29=_context1.v;_iterator13.e(_t29);case 25:_context1.p=25;_iterator13.f();return _context1.f(25);case 26:_context1.n=27;return loadConfigurations(sortedPlugins,configuration);case 27:_t30=_context1.v;_t31=sortedPlugins;return _context1.a(2,{configuration:_t30,plugins:_t31})}},_callee1,null,[[18,24,25,26],[6,14,15,16]])}));function loadAll(_x28){return _loadAll.apply(this,arguments)}return loadAll}();/**
208
- * Transform a list of absolute paths respecting the application context.
209
- * @param configuration - Configuration object.
210
- * @param configuration.core - Sub configuration web-node.
211
- * @param configuration.core.context - Sub web-node context configurations.
212
- * @param configuration.core.context.path - Current web-nodes path.
213
- * @param locations - Locations to process.
214
- * @returns Given and processed locations.
215
- */var determineLocations=function determineLocations(_ref5,locations){var contextPath=_ref5.core.context.path;if(locations===void 0){locations=[]}locations=[].concat(locations);return locations.length?locations.map(function(location){return (0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(contextPath,location)}):[contextPath]};/**
216
- * Checks whether given file path is in provided locations.
217
- * @param configuration - Configuration object.
218
- * @param plugins - List of active plugins.
219
- * @param filePath - Path to search for.
220
- * @param locations - Locations to search in.
221
- * @returns A boolean indicating whether given file path is in provided
222
- * locations.
223
- */var isInLocations=function isInLocations(configuration,plugins,filePath,locations){var pluginPaths=plugins.map(function(plugin){return plugin.path});var _iterator14=_createForOfIteratorHelper([].concat(locations)),_step14;try{for(_iterator14.s();!(_step14=_iterator14.n()).done;){var location=_step14.value;if(location.startsWith("/")){if(filePath.startsWith((0,path__WEBPACK_IMPORTED_MODULE_5__.join)(configuration.core.context.path,location)))return true}else{var _iterator15=_createForOfIteratorHelper(pluginPaths),_step15;try{for(_iterator15.s();!(_step15=_iterator15.n()).done;){var pluginPath=_step15.value;if(filePath.startsWith((0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(pluginPath,location)))return true}}catch(err){_iterator15.e(err)}finally{_iterator15.f()}}}}catch(err){_iterator14.e(err)}finally{_iterator14.f()}return false};var pluginAPI={callStack:_callStack,callStackSynchronous:callStackSynchronous,determineInternalName:determineInternalName,determineLocations:determineLocations,evaluateConfiguration:evaluateConfiguration,hotReloadAPIFile:hotReloadAPIFile,hotReloadConfigurationFile:hotReloadConfigurationFile,hotReloadFiles:hotReloadFiles,isInLocations:isInLocations,load:load,loadAll:loadAll,loadAPI:loadAPI,loadConfiguration:loadConfiguration,loadConfigurations:loadConfigurations,loadFile:loadFile};/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (pluginAPI);
224
- __webpack_async_result__();
225
- } catch(e) { __webpack_async_result__(e); } }, 1);
226
-
227
- /***/ }),
228
- /* 1 */
229
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
230
-
231
- const x = (y) => {
232
- const x = {}; __webpack_require__.d(x, y); return x
233
- }
234
- const y = (x) => (() => (x))
235
- module.exports = x({ ["CLOSE_EVENT_NAMES"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.CLOSE_EVENT_NAMES), ["Logger"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.Logger), ["MAXIMAL_NUMBER_OF_ITERATIONS"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.MAXIMAL_NUMBER_OF_ITERATIONS), ["UTILITY_SCOPE"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.UTILITY_SCOPE), ["capitalize"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.capitalize), ["copy"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.copy), ["delimitedToCamelCase"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.delimitedToCamelCase), ["evaluateAsyncDynamicData"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.evaluateAsyncDynamicData), ["evaluateDynamicData"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.evaluateDynamicData), ["extend"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.extend), ["getUTCTimestamp"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.getUTCTimestamp), ["importFilesystemAPI"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.importFilesystemAPI), ["isDirectory"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isDirectory), ["isFile"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isFile), ["isFunction"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isFunction), ["isObject"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isObject), ["isPlainObject"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.isPlainObject), ["modifyObject"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.modifyObject), ["parseEncodedObject"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.parseEncodedObject), ["removeKeyPrefixes"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.removeKeyPrefixes), ["removeKeysInEvaluation"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.removeKeysInEvaluation), ["represent"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.represent), ["sortTopological"]: () => (__WEBPACK_EXTERNAL_MODULE_clientnode__.sortTopological) });
236
-
237
- /***/ }),
238
- /* 2 */
239
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
7
+ /***/ 12
8
+ (module, __unused_webpack___webpack_exports__, __webpack_require__) {
240
9
 
241
10
  __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
242
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
243
- /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
244
- /* harmony export */ });
245
- /* unused harmony export configuration */
246
- /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
247
- /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
248
- /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
249
- /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
250
- /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
251
- /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
252
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__]);
253
- var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
254
- _pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_async_dependencies_result__[0];
255
- // #!/usr/bin/env node
256
- // -*- coding: utf-8 -*-
257
- /* !
258
- region header
259
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
260
-
261
- License
262
- -------
263
-
264
- This library written by Torben Sickert stands under a creative commons
265
- naming 3.0 unported license.
266
- See https://creativecommons.org/licenses/by/3.0/deed.de
267
- endregion
268
- */// region imports
269
- function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}var _mainPackageConfigura,_mainPackageConfigura2;function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)};// endregion
270
- /*
271
- To assume to go two folder up from this file until there is no
272
- "node_modules" parent folder is usually resilient again dealing with
273
- projects where current working directory isn't the projects directory and
274
- this library is located as a nested dependency.
275
- */_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context={path:__webpack_dirname__,type:"relative"};for(var iteration=0;iteration<clientnode__WEBPACK_IMPORTED_MODULE_0__.MAXIMAL_NUMBER_OF_ITERATIONS.value;iteration++){_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path=(0,path__WEBPACK_IMPORTED_MODULE_3__.resolve)(_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path,"../../");if((0,path__WEBPACK_IMPORTED_MODULE_3__.basename)((0,path__WEBPACK_IMPORTED_MODULE_3__.dirname)(_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path))!=="node_modules")break}if(_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path==="/"||(0,path__WEBPACK_IMPORTED_MODULE_3__.basename)((0,path__WEBPACK_IMPORTED_MODULE_3__.dirname)(process.cwd()))==="node_modules"||(0,path__WEBPACK_IMPORTED_MODULE_3__.basename)((0,path__WEBPACK_IMPORTED_MODULE_3__.dirname)(process.cwd()))===".staging"&&(0,path__WEBPACK_IMPORTED_MODULE_3__.basename)((0,path__WEBPACK_IMPORTED_MODULE_3__.dirname)((0,path__WEBPACK_IMPORTED_MODULE_3__.dirname)(process.cwd())))==="node_modules")/*
276
- NOTE: If we are dealing was a dependent project use current directory
277
- as context.
278
- */_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path=process.cwd();else/*
279
- NOTE: If the current working directory references this file via a
280
- linked "node_modules" folder using current working directory as context
281
- is a better assumption than two folders up the hierarchy.
282
- */try{if((await (0,fs_promises__WEBPACK_IMPORTED_MODULE_2__.lstat)((0,path__WEBPACK_IMPORTED_MODULE_3__.join)(process.cwd(),"node_modules"))).isSymbolicLink())_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path=process.cwd()}catch(_unused){// Ignore error.
283
- }var mainPackageConfiguration={name:"main"};try{mainPackageConfiguration=(await import(/* webpackIgnore: true */(0,path__WEBPACK_IMPORTED_MODULE_3__.join)(_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path,"package.json"),{with:{type:"json"}})).default}catch(_unused2){_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path=process.cwd()}var configName=mainPackageConfiguration.webNodeInternalName;var name=configName&&((_mainPackageConfigura=mainPackageConfiguration.webNode)===null||_mainPackageConfigura===void 0||(_mainPackageConfigura=_mainPackageConfigura[configName])===null||_mainPackageConfigura===void 0?void 0:_mainPackageConfigura.name)||configName||((_mainPackageConfigura2=mainPackageConfiguration.webDocumentation)===null||_mainPackageConfigura2===void 0?void 0:_mainPackageConfigura2.name)||mainPackageConfiguration.name||"main";var applicationConfiguration=mainPackageConfiguration.webNode||_defineProperty({},name,{name:name,package:mainPackageConfiguration});// endregion
284
- _package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.name=_package_json__WEBPACK_IMPORTED_MODULE_4__.webDocumentation.name||_package_json__WEBPACK_IMPORTED_MODULE_4__.name;var now=new Date;var scope=_objectSpread(_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE),{},{currentPath:process.cwd(),fs:fs_promises__WEBPACK_IMPORTED_MODULE_2__["default"],path:path__WEBPACK_IMPORTED_MODULE_3__["default"],pluginAPI:_pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Ay,webNodePath:__webpack_dirname__,now:now,nowUTCTimestamp:(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.getUTCTimestamp)(now)});var configuration=await (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluateAsyncDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluateDynamicData)(_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode,{scope:_objectSpread(_objectSpread({},scope),{},{fs:fs__WEBPACK_IMPORTED_MODULE_1__["default"]})}),{scope:scope});delete _package_json__WEBPACK_IMPORTED_MODULE_4__.webNode;(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.extend)(true,(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.modifyObject)(configuration,applicationConfiguration),applicationConfiguration);var result={};var _iterator=_createForOfIteratorHelper(process.argv.slice(1)),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var argument=_step.value;var subResult=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.parseEncodedObject)(argument,configuration,"configuration");if((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(subResult))(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.extend)(true,result,subResult)}}catch(err){_iterator.e(err)}finally{_iterator.f()}if(Object.keys(result).length>0){(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.extend)(true,/*
285
- NOTE: "object.modifyObject" removes modifications in "result"
286
- in-place before it is used as extending source.
287
- */(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.modifyObject)(configuration,result),result);configuration.core.runtimeConfiguration=result}configuration=await (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluateAsyncDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluateDynamicData)((0,clientnode__WEBPACK_IMPORTED_MODULE_0__.removeKeysInEvaluation)(configuration),{scope:_objectSpread(_objectSpread({},scope),{},{fs:fs__WEBPACK_IMPORTED_MODULE_1__["default"]})}),{scope:scope});configuration.name=name;configuration.core.package=_package_json__WEBPACK_IMPORTED_MODULE_4__;/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (configuration);
288
- __webpack_async_result__();
289
- } catch(e) { __webpack_async_result__(e); } }, 1);
290
-
291
- /***/ }),
292
- /* 3 */
293
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
294
-
295
- const x = (y) => {
296
- const x = {}; __webpack_require__.d(x, y); return x
297
- }
298
- const y = (x) => (() => (x))
299
- module.exports = x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_fs__["default"]) });
300
-
301
- /***/ }),
302
- /* 4 */
303
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
304
-
305
- const x = (y) => {
306
- const x = {}; __webpack_require__.d(x, y); return x
307
- }
308
- const y = (x) => (() => (x))
309
- module.exports = x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__["default"]), ["lstat"]: () => (__WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__.lstat), ["readdir"]: () => (__WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__.readdir), ["stat"]: () => (__WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__.stat) });
310
-
311
- /***/ }),
312
- /* 5 */
313
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
314
-
315
- const x = (y) => {
316
- const x = {}; __webpack_require__.d(x, y); return x
317
- }
318
- const y = (x) => (() => (x))
319
- module.exports = x({ ["basename"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.basename), ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_path__["default"]), ["dirname"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.dirname), ["extname"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.extname), ["join"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.join), ["resolve"]: () => (__WEBPACK_EXTERNAL_MODULE_path__.resolve) });
320
-
321
- /***/ }),
322
- /* 6 */
323
- /***/ ((module, __webpack_exports__, __webpack_require__) => {
324
-
325
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
326
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
327
- /* harmony export */ eQ: () => (/* binding */ isMainModule)
328
- /* harmony export */ });
329
- /* unused harmony exports log, main, isMainModulePositiveCalls */
330
- /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
331
- /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
332
- /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
333
- /* harmony import */ var node_fs_promises__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
334
- /* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11);
335
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__]);
336
- ([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
11
+ /* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
337
12
  // #!/usr/bin/env babel-node
338
13
  // -*- coding: utf-8 -*-
339
14
  /** @module web-node *//* !
@@ -349,74 +24,19 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_con
349
24
  naming 3.0 unported license.
350
25
  See https://creativecommons.org/licenses/by/3.0/deed.de
351
26
  endregion
352
- */function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _slicedToArray(r,e){return _arrayWithHoles(r)||_iterableToArrayLimit(r,e)||_unsupportedIterableToArray(r,e)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(r,l){var t=null==r?null:"undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(null!=t){var e,n,i,u,a=[],f=!0,o=!1;try{if(i=(t=t.call(r)).next,0===l){if(Object(t)!==t)return;f=!1}else for(;!(f=(e=i.call(t)).done)&&(a.push(e.value),a.length!==l);f=!0);}catch(r){o=!0,n=r}finally{try{if(!f&&null!=t.return&&(u=t.return(),Object(u)!==u))return}finally{if(o)throw n}}return a}}function _arrayWithHoles(r){if(Array.isArray(r))return r}function _createForOfIteratorHelper(r,e){var t="undefined"!=typeof Symbol&&r[Symbol.iterator]||r["@@iterator"];if(!t){if(Array.isArray(r)||(t=_unsupportedIterableToArray(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var _n=0,F=function F(){};return{s:F,n:function n(){return _n>=r.length?{done:!0}:{done:!1,value:r[_n++]}},e:function e(r){throw r},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,u=!1;return{s:function s(){t=t.call(r)},n:function n(){var r=t.next();return a=r.done,r},e:function e(r){u=!0,o=r},f:function f(){try{a||null==t.return||t.return()}finally{if(u)throw o}}}}function _unsupportedIterableToArray(r,a){if(r){if("string"==typeof r)return _arrayLikeToArray(r,a);var t={}.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_arrayLikeToArray(r,a):void 0}}function _arrayLikeToArray(r,a){(null==a||a>r.length)&&(a=r.length);for(var e=0,n=Array(a);e<a;e++)n[e]=r[e];return n}function _regenerator(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof Generator?n:Generator,u=Object.create(c.prototype);return _regeneratorDefine2(u,"_invoke",function(r,n,o){var i,c,u,f=0,p=o||[],y=!1,G={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function d(t,r){return i=t,c=0,u=e,G.n=r,a}};function d(r,n){for(c=r,u=n,t=0;!y&&f&&!o&&t<p.length;t++){var o,i=p[t],d=G.p,l=i[2];r>3?(o=l===n)&&(u=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,G.v=n,G.n=i[1]):d<l&&(o=r<3||i[0]>n||n>l)&&(i[4]=r,i[5]=n,G.n=l,c=0))}if(o||r>1)return a;throw y=!0,n}return function(o,p,l){if(f>1)throw TypeError("Generator is already running");for(y&&1===p&&d(p,l),c=p,u=l;(t=c<2?e:u)||!y;){i||(c?c<3?(c>1&&(G.n=-1),d(c,u)):G.n=u:G.v=u);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(y=G.n<0)?u:r.call(n,G))!==a)break}catch(t){i=e,c=1,u=t}finally{f=1}}return{value:t,done:y}}}(r,o,i),!0),u}var a={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine2(t={},n,function(){return this}),t),u=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(c);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,GeneratorFunctionPrototype):(e.__proto__=GeneratorFunctionPrototype,_regeneratorDefine2(e,o,"GeneratorFunction")),e.prototype=Object.create(u),e}return GeneratorFunction.prototype=GeneratorFunctionPrototype,_regeneratorDefine2(u,"constructor",GeneratorFunctionPrototype),_regeneratorDefine2(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName="GeneratorFunction",_regeneratorDefine2(GeneratorFunctionPrototype,o,"GeneratorFunction"),_regeneratorDefine2(u),_regeneratorDefine2(u,o,"Generator"),_regeneratorDefine2(u,n,function(){return this}),_regeneratorDefine2(u,"toString",function(){return"[object Generator]"}),(_regenerator=function _regenerator(){return{w:i,m:f}})()}function _regeneratorDefine2(e,r,n,t){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine2=function _regeneratorDefine(e,r,n,t){function o(r,n){_regeneratorDefine2(e,r,function(e){return this._invoke(r,n,e)})}r?i?i(e,r,{value:n,enumerable:!t,configurable:!t,writable:!t}):e[r]=n:(o("next",0),o("throw",1),o("return",2))},_regeneratorDefine2(e,r,n,t)}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)}function asyncGeneratorStep(n,t,e,r,o,a,c){try{var i=n[a](c),u=i.value}catch(n){return void e(n)}i.done?t(u):Promise.resolve(u).then(r,o)}function _asyncToGenerator(n){return function(){var t=this,e=arguments;return new Promise(function(r,o){var a=n.apply(t,e);function _next(n){asyncGeneratorStep(a,r,o,_next,_throw,"next",n)}function _throw(n){asyncGeneratorStep(a,r,o,_next,_throw,"throw",n)}_next(void 0)})}}// region imports
353
- ;// endregion
354
- var log=new clientnode__WEBPACK_IMPORTED_MODULE_2__.Logger({name:"web-node"});clientnode__WEBPACK_IMPORTED_MODULE_2__.Logger.configureAllInstances();var handleError=/*#__PURE__*/function(){var _handleError=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(state){var _t;return _regenerator().w(function(_context){while(1)switch(_context.p=_context.n){case 0:_context.p=0;_context.n=1;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)(_objectSpread(_objectSpread({},state),{},{hook:"error"}));case 1:_context.n=4;break;case 2:_context.p=2;_t=_context.v;if(!state.configuration.core.debug){_context.n=3;break}throw _t;case 3:log.error(_t);case 4:return _context.a(2)}},_callee,null,[[0,2]])}));function handleError(_x){return _handleError.apply(this,arguments)}return handleError}();var main=/*#__PURE__*/function(){var _main=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(pluginLoaderMapping){var _yield$loadAll,configuration,plugins,pluginsWithChangedConfiguration,_iterator,_step,type,services,servicePromises,exitTriggered,_i,_Object$keys,name,_iterator2,_step2,plugin,result,_message,_i2,_Object$entries,_Object$entries$_i,_name,promise,finished,closeHandler,_iterator3,_step3,closeEventName,cancelTriggered,_t2,_t3,_t4,_t5,_t6,_t7;return _regenerator().w(function(_context3){while(1)switch(_context3.p=_context3.n){case 0:if(pluginLoaderMapping===void 0){pluginLoaderMapping={}};(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .PLUGIN_PRELOADER */ .zW,pluginLoaderMapping);// region load plugins
355
- _context3.n=1;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .loadAll */ .gh)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(_configurator_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .A));case 1:_yield$loadAll=_context3.v;configuration=_yield$loadAll.configuration;plugins=_yield$loadAll.plugins;_context3.n=2;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"initialize",plugins:plugins});case 2:if(plugins.length)log.info("Loaded plugins: \""+plugins.map(function(plugin){return plugin.internalName}).join("\", \"")+"\".");pluginsWithChangedConfiguration=plugins.filter(function(plugin){return Boolean(plugin.configurationFilePaths.length)});_iterator=_createForOfIteratorHelper(["pre","post"]);_context3.p=3;_iterator.s();case 4:if((_step=_iterator.n()).done){_context3.n=6;break}type=_step.value;_context3.n=5;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"".concat(type,"ConfigurationLoaded"),plugins:plugins,pluginsWithChangedConfiguration:pluginsWithChangedConfiguration});case 5:_context3.n=4;break;case 6:_context3.n=8;break;case 7:_context3.p=7;_t2=_context3.v;_iterator.e(_t2);case 8:_context3.p=8;_iterator.f();return _context3.f(8);case 9:// endregion
356
- services={};servicePromises={};exitTriggered=false;_context3.p=10;_context3.n=11;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"preLoadService",plugins:plugins,services:services});case 11:for(_i=0,_Object$keys=Object.keys(services);_i<_Object$keys.length;_i++){name=_Object$keys[_i];log.info("Service \"".concat(name,"\" initialized."))}_iterator2=_createForOfIteratorHelper(plugins);_context3.p=12;_iterator2.s();case 13:if((_step2=_iterator2.n()).done){_context3.n=20;break}plugin=_step2.value;if(!plugin.api){_context3.n=19;break}_context3.n=14;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"preLoad".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.capitalize)(plugin.internalName),"Service"),plugins:plugins,services:services});case 14:result=null;_context3.p=15;_context3.n=16;return plugin.api({configuration:configuration,hook:"loadService",pluginAPI:_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .Ay,plugins:plugins,servicePromises:servicePromises,services:services});case 16:result=_context3.v;_context3.n=18;break;case 17:_context3.p=17;_t3=_context3.v;if(_t3!==null&&_t3!==void 0&&(_message=_t3.message)!==null&&_message!==void 0&&_message.startsWith("NotImplemented:")){_context3.n=18;break}throw new Error("Plugin \"".concat(plugin.internalName,"\" ")+(plugin.internalName===plugin.name?"":"(".concat(plugin.name,") "))+"throws: ".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.represent)(_t3)," 'during asynchrone ")+"hook \"loadService\".",{cause:_t3});case 18:if(result)for(_i2=0,_Object$entries=Object.entries(result);_i2<_Object$entries.length;_i2++){_Object$entries$_i=_slicedToArray(_Object$entries[_i2],2),_name=_Object$entries$_i[0],promise=_Object$entries$_i[1];if((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isObject)(promise)&&"then"in promise){log.info("Service \"".concat(_name,"\" started."));servicePromises[_name]=promise}else log.info("Service \"".concat(_name,"\" loaded."))}_context3.n=19;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"postLoad".concat((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.capitalize)(plugin.internalName),"Service"),plugins:plugins,servicePromises:servicePromises,services:services});case 19:_context3.n=13;break;case 20:_context3.n=22;break;case 21:_context3.p=21;_t4=_context3.v;_iterator2.e(_t4);case 22:_context3.p=22;_iterator2.f();return _context3.f(22);case 23:_context3.n=24;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"postLoadService",plugins:plugins,servicePromises:servicePromises,services:services});case 24:// endregion
357
- // region register close handler
358
- finished=false;closeHandler=function closeHandler(){if(!finished)(0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStackSynchronous */ .gl)({configuration:configuration,data:undefined,hook:"exit",plugins:plugins.slice().reverse(),servicePromises:servicePromises,services:services});finished=true};_iterator3=_createForOfIteratorHelper(clientnode__WEBPACK_IMPORTED_MODULE_2__.CLOSE_EVENT_NAMES);try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){closeEventName=_step3.value;process.on(closeEventName,closeHandler)}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}cancelTriggered=false;/*
359
- NOTE: "setRawMode" is only available when the input is provided by
360
- a TTY and not as direct stream from stdin.
361
-
362
- NOTE: Access property via string to avoid lint error
363
- "@typescript-eslint/unbound-method".
364
- */// eslint-disable-next-line @typescript-eslint/unbound-method
365
- if((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFunction)(process.stdin["setRawMode"]))process.stdin.setRawMode(true);process.stdin.resume();process.stdin.setEncoding(configuration.core.encoding);process.stdin.on("data",function(key){void _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2(){return _regenerator().w(function(_context2){while(1)switch(_context2.n){case 0:if(!(key==="\x03")){_context2.n=3;break}if(!cancelTriggered){_context2.n=1;break}log.warn("Stopping ungracefully.");_context2.n=2;break;case 1:cancelTriggered=true;log.info("You have requested to shut down all services. A","second request will force to stop ungracefully.");_context2.n=2;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 2:process.exit();case 3:process.stdout.write(key);case 4:return _context2.a(2)}},_callee2)}))()});// endregion
366
- _context3.p=25;_context3.n=26;return Promise.all(Object.keys(servicePromises).map(function(name){return servicePromises[name]}));case 26:_context3.n=28;break;case 27:_context3.p=27;_t5=_context3.v;case 28:exitTriggered=true;_context3.n=29;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 29:process.exit();_context3.n=38;break;case 30:_context3.p=30;_t6=_context3.v;_context3.n=31;return handleError({configuration:configuration,data:_t6,plugins:plugins,servicePromises:servicePromises,services:services});case 31:if(exitTriggered){_context3.n=35;break}_context3.p=32;_context3.n=33;return (0,_pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__/* .callStack */ .lT)({configuration:configuration,data:undefined,hook:"shouldExit",plugins:plugins,servicePromises:servicePromises,services:services});case 33:_context3.n=35;break;case 34:_context3.p=34;_t7=_context3.v;_context3.n=35;return handleError({configuration:configuration,data:_t7,plugins:plugins,servicePromises:servicePromises,services:services});case 35:if(!configuration.core.debug){_context3.n=36;break}throw _t6;case 36:log.error(_t6);case 37:process.exit(1);case 38:return _context3.a(2)}},_callee3,null,[[32,34],[25,27],[15,17],[12,21,22,23],[10,30],[3,7,8,9]])}));function main(_x2){return _main.apply(this,arguments)}return main}();var isMainModulePositiveCalls=0;/*
367
- NOTE: Neither "import.meta.main" nor "import.meta.url" cannot be used
368
- directly since bundlers replace them with a compile time constant
369
- referencing the build environments file location.
370
- */var isMainModule=/*#__PURE__*/function(){var _isMainModule=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(filename,onlyOnce){var _t8,_t9,_t0;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(onlyOnce===void 0){onlyOnce=true}if(!(onlyOnce&&isMainModulePositiveCalls>0||process.argv.length<2)){_context4.n=1;break}return _context4.a(2,false);case 1:if(!filename)filename=(0,node_url__WEBPACK_IMPORTED_MODULE_4__.fileURLToPath)(import.meta.url);/*
371
- NOTE: Both locations have to be resolved since the executable is
372
- usually linked into a package managers binary folder.
373
- */_context4.p=2;_context4.n=3;return (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(process.argv[1]);case 3:_t8=_context4.v;_context4.n=4;return (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(filename);case 4:_t9=_context4.v;if(!(_t8===_t9)){_context4.n=5;break}isMainModulePositiveCalls+=1;return _context4.a(2,true);case 5:_context4.n=7;break;case 6:_context4.p=6;_t0=_context4.v;case 7:return _context4.a(2,false)}},_callee4,null,[[2,6]])}));function isMainModule(_x3,_x4){return _isMainModule.apply(this,arguments)}return isMainModule}();/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main);
374
- /* harmony export */ __webpack_require__.d(__webpack_exports__, [
375
- /* harmony export */ "Ay", 0, /* export default binding */ __WEBPACK_DEFAULT_EXPORT__
376
- /* harmony export */ ]);
377
-
27
+ *//*
28
+ NOTE: We use dynamic import here, so that we can load the module at
29
+ runtime.
30
+ That way we make sure that other imports of this main module share the same
31
+ module instance.
32
+ */var _await$import=await import(/* webpackIgnore: true */"./index.js"),main=_await$import.default,isMainModule=_await$import.isMainModule;if(await isMainModule((0,node_url__WEBPACK_IMPORTED_MODULE_0__.fileURLToPath)(import.meta.url)))void main();
378
33
  __webpack_async_result__();
379
- } catch(e) { __webpack_async_result__(e); } });
380
-
381
- /***/ }),
382
- /* 7 */
383
- /***/ ((module) => {
384
-
385
- module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.617","description":"High level javaScript backend plugin system and configuration merger.","keywords":["api","backend","management","plugin","web"],"homepage":"https://torben.website/web-node","bugs":{"email":"info@torben.website","url":"https://github.com/thaibault/web-node/issues"},"license":"CC-BY-3.0","author":{"email":"info@torben.website","name":"Torben Sickert","url":"https://torben.website"},"repository":{"type":"git","url":"https://github.com/thaibault/web-node.git"},"type":"module","bin":"main.js","exports":{".":"./index.js","./main":"./main.js","./main.js":"./main.js","./package.json":"./package.json","./unixCrypt":"./unixCrypt.js","./unixCrypt.js":"./unixCrypt.js","./type":"./type.d.ts"},"files":["configurator.d.ts","index.d.ts","index.js","main.js","pluginAPI.d.ts","type.d.ts","unixCrypt.d.ts","unixCrypt.js"],"sideEffects":true,"scripts":{"build":"yarn build:types; yarn build:plain","build:plain":"weboptimizer build","build:types":"weboptimizer build:types","check":"yarn check:types; yarn lint","check:types":"weboptimizer check:types","clear":"weboptimizer clear","document":"weboptimizer document","lint":"weboptimizer lint","prepare":"yarn build","prepare:test":"yarn clear && cd dummyPlugin && shx touch yarn.lock && yarn build && cd ..","serve":"yarn build:plain && yarn start","start":"./main.js \'{plugin: {hotReloading: true}}\'","test":"yarn prepare:test && weboptimizer test","test:coverage":"yarn prepare:test && weboptimizer test:coverage","test:coverage:report":"yarn prepare:test && weboptimizer test:coverage:report","update:documentation":"web-documentation","watch":"weboptimizer build --watch"},"devDependencies":{"@babel/cli":"^8.0.4","@babel/eslint-parser":"^8.0.1","@eslint/js":"^10.0.1","@stylistic/eslint-plugin":"^5.10.0","@types/node":"^26.4.1","@types/webpack-env":"^1.18.8","@typescript-eslint/eslint-plugin":"^8.69.0","@typescript-eslint/parser":"^8.69.0","clientnode":"^4.0.1512","eslint":"^10.10.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^64.3.6","jest":"^30.5.1","jsdoc":"^4.0.5","shx":"^0.4.0","typescript-eslint":"^8.69.0","web-documentation":"^1.0.52","weboptimizer":"^4.0.78"},"peerDependencies":{"clientnode":"*"},"resolutions":{"colors":"1.4.0","globals@npm:^11.1.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^14.0.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch","globals@npm:^9.18.0":"patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"},"engines":{"node":">=26","npm":">=12","yarn":">=4"},"webDocumentation":{"trackingCode":"UA-40192634-9"},"webNode":{"core":{"context":{"path":"./","type":"relative"},"debug":false,"encoding":"utf8","interDependencies":{},"name":"web-node","plugin":{"configuration":{"fileNames":["package.json","private-package.json"],"propertyNames":["webNode","webnode","web-node"]},"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","directories":{"external":{"path":{"__evaluate__":"`${currentPath}/node_modules/`"}},"internal":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-_].*)$","path":{"__evaluate__":"`${currentPath}/plugins/`"}}},"hotReloading":false}}},"webOptimizer":{"assetPattern":{"javaScript":{"includeFilePathRegularExpression":"^(.+/)?main\\\\.js$","pattern":{"#":"This is how we can make our main exported artefact executable.","__evaluate__":"`#!/usr/bin/env node\\n// -*- coding: utf-8 -*-\\n${self.generic.assetPattern?.javaScript?.pattern ?? \'\'}\\n{1}`"}}},"injection":{"entry":{"__evaluate__":"2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith(\'test\') ? {testBundle: \'test\'} : {index: \'./index.ts\', main: \'./main.ts\', unixCrypt: \'./unixCrypt.ts\'}"}},"module":{"optimizer":{"terser":{"terserOptions":{"compress":{"#":"To provide a logging output we need to exclude this feature.","drop_console":{"__evaluate__":"false"},"drop_debugger":{"__evaluate__":"false"}}}}}},"targetTechnology":{"boilerplate":"node","payload":"node"}},"packageManager":"yarn@4.18.0"}');
386
-
387
- /***/ }),
388
- /* 8 */
389
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
390
-
391
- const x = (y) => {
392
- const x = {}; __webpack_require__.d(x, y); return x
393
- }
394
- const y = (x) => (() => (x))
395
- module.exports = x({ });
396
-
397
- /***/ }),
398
- /* 9 */
399
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
400
-
401
- const x = (y) => {
402
- const x = {}; __webpack_require__.d(x, y); return x
403
- }
404
- const y = (x) => (() => (x))
405
- module.exports = x({ ["spawnSync"]: () => (__WEBPACK_EXTERNAL_MODULE_child_process__.spawnSync) });
406
-
407
- /***/ }),
408
- /* 10 */
409
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
34
+ } catch(e) { __webpack_async_result__(e); } }, 1);
410
35
 
411
- const x = (y) => {
412
- const x = {}; __webpack_require__.d(x, y); return x
413
- }
414
- const y = (x) => (() => (x))
415
- module.exports = x({ ["realpath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_fs_promises_06ebfe74__.realpath) });
36
+ /***/ },
416
37
 
417
- /***/ }),
418
- /* 11 */
419
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
38
+ /***/ 2
39
+ (module, __unused_webpack_exports, __webpack_require__) {
420
40
 
421
41
  const x = (y) => {
422
42
  const x = {}; __webpack_require__.d(x, y); return x
@@ -424,36 +44,9 @@ const x = (y) => {
424
44
  const y = (x) => (() => (x))
425
45
  module.exports = x({ ["fileURLToPath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_url_50af3bb5__.fileURLToPath) });
426
46
 
427
- /***/ }),
428
- /* 12 */
429
- /***/ ((module, __unused_webpack___webpack_exports__, __webpack_require__) => {
430
-
431
- __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
432
- /* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
433
- var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_index_js__WEBPACK_IMPORTED_MODULE_0__]);
434
- var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
435
- _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
436
- // #!/usr/bin/env babel-node
437
- // -*- coding: utf-8 -*-
438
- /** @module web-node *//* !
439
- region header
440
- [Project page](https://torben.website/webNode)
441
-
442
- Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
443
-
444
- License
445
- -------
446
-
447
- This library written by Torben Sickert stands under a creative commons
448
- naming 3.0 unported license.
449
- See https://creativecommons.org/licenses/by/3.0/deed.de
450
- endregion
451
- */if(await (0,_index_js__WEBPACK_IMPORTED_MODULE_0__/* .isMainModule */ .eQ)())void (0,_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)();
452
- __webpack_async_result__();
453
- } catch(e) { __webpack_async_result__(e); } }, 1);
47
+ /***/ }
454
48
 
455
- /***/ })
456
- /******/ ]);
49
+ /******/ });
457
50
  /************************************************************************/
458
51
  /******/ // The module cache
459
52
  /******/ const __webpack_module_cache__ = {};
@@ -467,17 +60,14 @@ __webpack_async_result__();
467
60
  /******/ }
468
61
  /******/ // Create a new module (and put it into the cache)
469
62
  /******/ const module = __webpack_module_cache__[moduleId] = {
470
- /******/ id: moduleId,
471
- /******/ loaded: false,
63
+ /******/ // no module.id needed
64
+ /******/ // no module.loaded needed
472
65
  /******/ exports: {}
473
66
  /******/ };
474
67
  /******/
475
68
  /******/ // Execute the module function
476
69
  /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
477
70
  /******/
478
- /******/ // Flag the module as loaded
479
- /******/ module.loaded = true;
480
- /******/
481
71
  /******/ // Return the exports of the module
482
72
  /******/ return module.exports;
483
73
  /******/ }
@@ -562,36 +152,13 @@ __webpack_async_result__();
562
152
  /******/ /* webpack/runtime/define property getters */
563
153
  /******/ // define getter/value functions for harmony exports
564
154
  /******/ __webpack_require__.d = (exports, definition) => {
565
- /******/ if(Array.isArray(definition)) {
566
- /******/ var i = 0;
567
- /******/ while(i < definition.length) {
568
- /******/ var key = definition[i++];
569
- /******/ var binding = definition[i++];
570
- /******/ var descriptor = binding === 0 ? { enumerable: true, value: definition[i++] } : { enumerable: true, get: binding };
571
- /******/ if(!__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, descriptor);
572
- /******/ }
573
- /******/ } else {
574
- /******/ for(var key in definition) {
575
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
576
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
577
- /******/ }
155
+ /******/ for(var key in definition) {
156
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
157
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
578
158
  /******/ }
579
159
  /******/ }
580
160
  /******/ };
581
161
  /******/
582
- /******/ /* webpack/runtime/harmony module decorator */
583
- /******/ __webpack_require__.hmd = (module) => {
584
- /******/ module = Object.create(module);
585
- /******/ if (!module.children) module.children = [];
586
- /******/ Object.defineProperty(module, 'exports', {
587
- /******/ enumerable: true,
588
- /******/ set() {
589
- /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
590
- /******/ }
591
- /******/ });
592
- /******/ return module;
593
- /******/ };
594
- /******/
595
162
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
596
163
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
597
164
  /******/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-node",
3
- "version": "1.0.617",
3
+ "version": "1.0.619",
4
4
  "description": "High level javaScript backend plugin system and configuration merger.",
5
5
  "keywords": [
6
6
  "api",