web-node 1.0.599 → 1.0.601

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 (3) hide show
  1. package/index.js +22 -12
  2. package/main.js +631 -0
  3. package/package.json +9 -6
package/index.js CHANGED
@@ -1,15 +1,12 @@
1
- #!/usr/bin/env node
2
- // -*- coding: utf-8 -*-
3
-
4
1
  import {fileURLToPath as __webpack_fileURLToPath__} from "node:url";
5
2
  var __webpack_dirname__ = __webpack_fileURLToPath__(import.meta.url.replace(/\/(?:[^\/]*)$/, ""));
6
- var __webpack_filename__ = __webpack_fileURLToPath__(import.meta.url);
7
3
  import * as __WEBPACK_EXTERNAL_MODULE_child_process__ from "child_process";
8
4
  import * as __WEBPACK_EXTERNAL_MODULE_clientnode__ from "clientnode";
9
5
  import * as __WEBPACK_EXTERNAL_MODULE_core_js_modules_es_array_includes_js_66c3fd7d__ from "core-js/modules/es.array.includes.js";
10
6
  import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
11
7
  import * as __WEBPACK_EXTERNAL_MODULE_fs_promises_cc1b69f3__ from "fs/promises";
12
8
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs_promises_06ebfe74__ from "node:fs/promises";
9
+ import * as __WEBPACK_EXTERNAL_MODULE_node_url_50af3bb5__ from "node:url";
13
10
  import * as __WEBPACK_EXTERNAL_MODULE_path__ from "path";
14
11
  /******/ var __webpack_modules__ = ([
15
12
  /* 0 */
@@ -389,6 +386,7 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
389
386
  /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
390
387
  /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
391
388
  /* harmony import */ var node_fs_promises__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
389
+ /* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11);
392
390
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__]);
393
391
  ([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
394
392
  // #!/usr/bin/env babel-node
@@ -419,24 +417,26 @@ finished=false;closeHandler=function closeHandler(){if(!finished)(0,_pluginAPI_j
419
417
  "@typescript-eslint/unbound-method".
420
418
  */// eslint-disable-next-line @typescript-eslint/unbound-method
421
419
  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
422
- _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(){return _main.apply(this,arguments)}return main}();var defaultFilename=await (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(__webpack_filename__);/*
423
- NOTE: Neither "import.meta.main" nor "import.meta.url" can be used here
424
- since bundlers replace them with a compile time constant referencing the
425
- build environments file location. "__filename" is substituted with a
426
- runtime evaluated value instead.
427
- */var isMainModule=/*#__PURE__*/function(){var _isMainModule=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(filename){var _t8,_t9,_t0,_t1;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(filename===void 0){filename=defaultFilename}if(!(process.argv.length<2)){_context4.n=1;break}return _context4.a(2,false);case 1:_t8=console;_context4.n=2;return (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(process.argv[1]);case 2:_t8.log.call(_t8,"A",_context4.v,defaultFilename,filename);_context4.p=3;_context4.n=4;return (0,node_fs_promises__WEBPACK_IMPORTED_MODULE_3__.realpath)(process.argv[1]);case 4:_t9=_context4.v;_t0=filename;return _context4.a(2,_t9===_t0);case 5:_context4.p=5;_t1=_context4.v;return _context4.a(2,false)}},_callee4,null,[[3,5]])}));function isMainModule(_x2){return _isMainModule.apply(this,arguments)}return isMainModule}();/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main);if(await isMainModule())void main();
420
+ _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(){return _main.apply(this,arguments)}return main}();/*
421
+ NOTE: Neither "import.meta.main" nor "import.meta.url" cannot be used
422
+ directly since bundlers replace them with a compile time constant
423
+ referencing the build environments file location.
424
+ */var isMainModule=/*#__PURE__*/function(){var _isMainModule=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(filename){var _t8,_t9,_t0;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(!(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);/*
425
+ NOTE: Both locations have to be resolved since the executable is
426
+ usually linked into a package managers binary folder.
427
+ */_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;return _context4.a(2,_t8===_t9);case 5:_context4.p=5;_t0=_context4.v;return _context4.a(2,false)}},_callee4,null,[[2,5]])}));function isMainModule(_x2){return _isMainModule.apply(this,arguments)}return isMainModule}();/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main);
428
428
  /* harmony export */ __webpack_require__.d(__webpack_exports__, [
429
429
  /* harmony export */ "Ay", 0, /* export default binding */ __WEBPACK_DEFAULT_EXPORT__
430
430
  /* harmony export */ ]);
431
431
 
432
432
  __webpack_async_result__();
433
- } catch(e) { __webpack_async_result__(e); } }, 1);
433
+ } catch(e) { __webpack_async_result__(e); } });
434
434
 
435
435
  /***/ }),
436
436
  /* 7 */
437
437
  /***/ ((module) => {
438
438
 
439
- module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.599","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":"index.js","exports":{".":"./index.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","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":"./index.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.1506","eslint":"^10.10.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^64.3.5","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.75"},"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"]},"directories":{"external":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","path":{"__evaluate__":"`${currentPath}/node_modules/`"}},"internal":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-_].*)$","path":{"__evaluate__":"`${currentPath}/plugins/`"}}},"hotReloading":false}}},"webOptimizer":{"assetPattern":{"javaScript":{"includeFilePathRegularExpression":"^(.+/)?index\\\\.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\', 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"}');
439
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.601","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.1506","eslint":"^10.10.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^64.3.5","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.76"},"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"]},"directories":{"external":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","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"}');
440
440
 
441
441
  /***/ }),
442
442
  /* 8 */
@@ -468,6 +468,16 @@ const x = (y) => {
468
468
  const y = (x) => (() => (x))
469
469
  module.exports = x({ ["realpath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_fs_promises_06ebfe74__.realpath) });
470
470
 
471
+ /***/ }),
472
+ /* 11 */
473
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
474
+
475
+ const x = (y) => {
476
+ const x = {}; __webpack_require__.d(x, y); return x
477
+ }
478
+ const y = (x) => (() => (x))
479
+ module.exports = x({ ["fileURLToPath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_url_50af3bb5__.fileURLToPath) });
480
+
471
481
  /***/ })
472
482
  /******/ ]);
473
483
  /************************************************************************/
package/main.js ADDED
@@ -0,0 +1,631 @@
1
+ #!/usr/bin/env node
2
+ // -*- coding: utf-8 -*-
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
+ 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__) => {
17
+
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 */ });
25
+ /* unused harmony exports log, determineInternalName, evaluateConfiguration, hotReloadAPIFile, hotReloadConfigurationFile, hotReloadFiles, load, loadAPI, loadConfiguration, loadConfigurations, loadFile, determineLocations, isInLocations, pluginAPI */
26
+ /* harmony import */ var core_js_modules_es_array_includes_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8);
27
+ /* harmony import */ var child_process__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
28
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
29
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3);
30
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4);
31
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5);
32
+ /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2);
33
+ /* module decorator */ module = __webpack_require__.hmd(module);
34
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_6__]);
35
+ var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
36
+ _configurator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_async_dependencies_result__[0];
37
+ // #!/usr/bin/env babel-node
38
+ // -*- coding: utf-8 -*-
39
+ /** @module pluginAPI *//* !
40
+ region header
41
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
42
+
43
+ License
44
+ -------
45
+
46
+ This library written by Torben Sickert stands under a creative commons
47
+ naming 3.0 unported license.
48
+ See https://creativecommons.org/licenses/by/3.0/deed.de
49
+ endregion
50
+ */// region imports
51
+ 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
52
+ var log=new clientnode__WEBPACK_IMPORTED_MODULE_2__.Logger({name:"web-node.plugin-api"});await (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.importFilesystemAPI)();// region allow plugins to import "web-node" as already loaded main module
53
+ /*
54
+ Esmodule specific logic to deduplicate the main module's scope for plugins
55
+ to avoid loading it twice and therefore having two different scopes of the
56
+ same module in memory:
57
+
58
+ // main-module-hook.ts (must compile/run as a standalone module)
59
+ import type {ResolveHook, InitializeHook} from 'node:module'
60
+
61
+ let mainModuleURL: string | undefined
62
+
63
+ export const initialize: InitializeHook = (
64
+ data: {mainModuleURL?: string}
65
+ ): void => {
66
+ mainModuleURL = data.mainModuleURL
67
+ }
68
+
69
+ export const resolve: ResolveHook = (specifier, context, nextResolve) => {
70
+ if (specifier === 'main-module' && mainModuleURL)
71
+ // Redirect to the entry module's URL; the ESM cache is keyed by
72
+ // resolved URL, so every importer shares that one instance.
73
+ return nextResolve(mainModuleURL, context)
74
+
75
+ return nextResolve(specifier, context)
76
+ }
77
+
78
+ Registering it
79
+
80
+ // setup.ts (imported first, before anything does import 'main-module')
81
+ import {register} from 'node:module'
82
+ import {pathToFileURL} from 'node:url'
83
+
84
+ register('./main-module-hook.js', {
85
+ parentURL: import.meta.url,
86
+ data: {mainModuleURL: pathToFileURL(process.argv[1]).href}
87
+ })
88
+ */// endregion
89
+ /**
90
+ * Calls all plugin methods for given trigger description asynchronous and
91
+ * waits for their resolved promises.
92
+ * @param givenState - Contains runtime information about current hook.
93
+ * @param parameters - Additional parameters to forward into plugin api.
94
+ * @returns A promise which resolves when all callbacks have resolved their
95
+ * promise holding given potentially modified data.
96
+ */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}();/**
97
+ * Calls all plugin methods for given trigger description synchronous.
98
+ * @param givenState - Contains runtime information about current hook.
99
+ * @param parameters - Additional parameters to forward into plugin api.
100
+ * @returns Given potentially modified data.
101
+ */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};/**
102
+ * Converts given plugin name into the corresponding internal representation.
103
+ * @param name - Name to convert.
104
+ * @param regularExpression - Regular expression pattern which extracts
105
+ * relevant name path as first match group.
106
+ * @returns Transformed name.
107
+ */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}))};/**
108
+ * Evaluates given configuration object by letting plugins package sub
109
+ * structure untouched.
110
+ * @param configuration - Evaluable configuration structure.
111
+ * @returns Resolved configuration.
112
+ */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:/*
113
+ NOTE: We have to back up, remove and restore all plugin specific
114
+ package configuration to avoid evaluation non web node#
115
+ configuration structures.
116
+ */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}();/**
117
+ * Checks for changed plugin api file in given plugins and reloads them if
118
+ * necessary (new timestamp).
119
+ * @param plugins - List of plugins to search for updates in.
120
+ * @returns A list with plugins which have a changed api scope.
121
+ */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.
122
+ 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}();/**
123
+ * Checks for changed plugin configurations in given plugins and reloads them
124
+ * if necessary (new timestamp).
125
+ * @param plugins - List of plugins to search for updates in.
126
+ * @param configurationPropertyNames - Property names to search for to use as
127
+ * entry in plugin configuration file.
128
+ * @returns A list with plugins which have a changed configurations.
129
+ */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}();/**
130
+ * Checks for changed plugin file type in given plugins and reloads them if
131
+ * necessary (timestamp has changed).
132
+ * @param type - Plugin file type to search for updates.
133
+ * @param target - Property name existing in plugin meta information objects
134
+ * which should be updated.
135
+ * @param plugins - List of plugins to search for updates in.
136
+ * @returns A list with plugin changes.
137
+ */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}();/**
138
+ * Extends given configuration object with given plugin specific ones and
139
+ * returns a plugin specific meta information object.
140
+ * @param name - Name of plugin to extend.
141
+ * @param internalName - Internal name of plugin to extend.
142
+ * @param plugins - List of all yet determined plugin information.
143
+ * @param metaConfiguration - Configuration file configuration.
144
+ * @param pluginPath - Path to given plugin.
145
+ * @param encoding - Encoding to use to read and write from child process's.
146
+ * @returns An object of plugin specific meta information.
147
+ */var load=/*#__PURE__*/function(){var _load=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee6(name,internalName,plugins,metaConfiguration,pluginPath,encoding){var configurationFilePaths,packageConfiguration,_iterator7,_step7,fileName,filePath,sourceConfiguration,apiFilePaths,configuration,_t5;return _regenerator().w(function(_context6){while(1)switch(_context6.p=_context6.n){case 0:if(encoding===void 0){encoding="utf8"}configurationFilePaths=[];packageConfiguration={};_iterator7=_createForOfIteratorHelper(metaConfiguration.fileNames);_context6.p=1;_iterator7.s();case 2:if((_step7=_iterator7.n()).done){_context6.n=6;break}fileName=_step7.value;filePath=(0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(pluginPath,fileName);_context6.n=3;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 3:if(!_context6.v){_context6.n=5;break}_context6.n=4;return loadFile(filePath,name);case 4:sourceConfiguration=_context6.v;(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,/*
148
+ NOTE: Source and target configuration got modified.
149
+ While the target configuration receives the modifications
150
+ the source configuration will lose their modification
151
+ expressions therefore we can use the source configuration
152
+ afterward to extend the target configuration.
153
+ */(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.modifyObject)(packageConfiguration,sourceConfiguration),sourceConfiguration);configurationFilePaths.push(filePath);case 5:_context6.n=2;break;case 6:_context6.n=8;break;case 7:_context6.p=7;_t5=_context6.v;_iterator7.e(_t5);case 8:_context6.p=8;_iterator7.f();return _context6.f(8);case 9:apiFilePaths=["index.js"];if(!Object.keys(packageConfiguration).length){_context6.n=11;break}internalName=packageConfiguration.webNodeInternalName||internalName;configuration=loadConfiguration(internalName,packageConfiguration,metaConfiguration.propertyNames);if(configuration[internalName].package.main)apiFilePaths[0]=configuration[internalName].package.main;_context6.n=10;return loadAPI(apiFilePaths,pluginPath,name,internalName,plugins,encoding,configuration,configurationFilePaths);case 10:return _context6.a(2,_context6.v);case 11:_context6.n=12;return loadAPI(apiFilePaths,pluginPath,name,internalName,plugins,encoding);case 12:return _context6.a(2,_context6.v)}},_callee6,null,[[1,7,8,9]])}));function load(_x9,_x0,_x1,_x10,_x11,_x12){return _load.apply(this,arguments)}return load}();/**
154
+ * Load given plugin api file in given path and generates a plugin specific
155
+ * data structure with useful meta information.
156
+ * @param relativeFilePaths - Paths to file to load relatively from given
157
+ * plugin path.
158
+ * @param pluginPath - Path to plugin directory.
159
+ * @param name - Plugin name to use for proper error messages.
160
+ * @param internalName - Internal plugin name to use for proper error messages.
161
+ * @param plugins - List of plugins to search for trigger callbacks in.
162
+ * @param encoding - Encoding to use to read and write from child process.
163
+ * @param configuration - Plugin specific configurations.
164
+ * @param configurationFilePaths - Plugin specific configuration file paths.
165
+ * @returns Plugin meta information object.
166
+ */var loadAPI=/*#__PURE__*/function(){var _loadAPI=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(relativeFilePaths,pluginPath,name,internalName,plugins,encoding,configuration,configurationFilePaths){var filePath,_iterator8,_step8,fileName,api,nativeAPI,pluginConfiguration,_t6,_t7,_t8,_t9,_t0,_t1,_t10,_t11,_t12,_t13,_t14,_t15,_t16,_t17,_t18,_t19,_t20,_t21,_t22;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}_t6=_createForOfIteratorHelper;_context8.n=2;return (0,fs_promises__WEBPACK_IMPORTED_MODULE_4__.readdir)(pluginPath);case 2:_iterator8=_t6(_context8.v);_context8.p=3;_iterator8.s();case 4:if((_step8=_iterator8.n()).done){_context8.n=8;break}fileName=_step8.value;_t7=!configurationFilePaths.map(function(filePath){return (0,path__WEBPACK_IMPORTED_MODULE_5__.basename)(filePath)}).includes(fileName);if(!_t7){_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:_t7=_context8.v;case 6:if(!_t7){_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;_t8=_context8.v;_iterator8.e(_t8);case 10:_context8.p=10;_iterator8.f();return _context8.f(10);case 11:api=null;nativeAPI=false;_t9=configuration&&(/*
167
+ NOTE: Check if a webNode plugin configuration is available
168
+ indicating a backend responsibility for api file.
169
+
170
+ NOTE: One key is always there representing the whole package
171
+ configuration.
172
+ */Object.keys(configuration).length>1||Object.prototype.hasOwnProperty.call(configuration,internalName)&&Object.keys(configuration[internalName]).length>1);if(!_t9){_context8.n=13;break}_context8.n=12;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 12:_t9=_context8.v;case 13:if(!_t9){_context8.n=14;break}if(filePath.endsWith(".js")){nativeAPI=true;api=function api(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,"\"."))}}else// NOTE: Any executable file can represent an api.
173
+ 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:{}});_t0=api;if(!api){_context8.n=16;break}_context8.n=15;return (0,fs_promises__WEBPACK_IMPORTED_MODULE_4__.stat)(filePath);case 15:_t10=_context8.v.mtime.getTime();_t1=[_t10];_context8.n=17;break;case 16:_t1=[];case 17:_t11=_t1;_t12=api?[filePath]:[];_t13=pluginConfiguration;_t14=configurationFilePaths;_context8.n=18;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 18:_t15=_context8.v;_t16=Object.prototype.hasOwnProperty.call(pluginConfiguration,internalName)&&pluginConfiguration[internalName].dependencies?pluginConfiguration[internalName].dependencies:[];_t17=internalName;_t18=name;_t19=pluginConfiguration[internalName].package;_t20=pluginPath;if(!nativeAPI){_context8.n=20;break}_context8.n=19;return loadFile(filePath,name);case 19:_t21=_context8.v;_context8.n=21;break;case 20:_t21=null;case 21:_t22=_t21;return _context8.a(2,{api:_t0,apiFileLoadTimestamps:_t11,apiFilePaths:_t12,configuration:_t13,configurationFilePaths:_t14,configurationFileLoadTimestamps:_t15,dependencies:_t16,internalName:_t17,name:_t18,packageConfiguration:_t19,path:_t20,scope:_t22})}},_callee8,null,[[3,9,10,11]])}));function loadAPI(_x13,_x14,_x15,_x16,_x17,_x18,_x19,_x20){return _loadAPI.apply(this,arguments)}return loadAPI}();/**
174
+ * Loads plugin specific configuration object.
175
+ * @param name - Property name where to inject resolved configuration into
176
+ * global one.
177
+ * @param packageConfiguration - Plugin specific package configuration object.
178
+ * @param configurationPropertyNames - Property names to search for to use as
179
+ * entry in plugin configuration file.
180
+ * @returns Determined configuration object.
181
+ */var loadConfiguration=function loadConfiguration(name,packageConfiguration,configurationPropertyNames){/*
182
+ No plugin specific configuration found. Only provide package
183
+ configuration.
184
+ Removing comments (default key prefix to delete is "#").
185
+ */var packageConfigurationCopy=(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.removeKeyPrefixes)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(packageConfiguration));var result=_defineProperty({},name,{package:packageConfigurationCopy});var _iterator9=_createForOfIteratorHelper(configurationPropertyNames),_step9;try{for(_iterator9.s();!(_step9=_iterator9.n()).done;){var propertyName=_step9.value;if(packageConfiguration[propertyName]){(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,result,packageConfiguration[propertyName]);/*
186
+ NOTE: We should break the cycle here to avoid endless loops
187
+ when traversing this data structure.
188
+ */delete result[name].package[propertyName];break}}}catch(err){_iterator9.e(err)}finally{_iterator9.f()}return result};/**
189
+ * Loads given plugin configurations into global configuration.
190
+ * @param plugins - Topological sorted list of plugins to check for
191
+ * configurations.
192
+ * @param configuration - Global configuration to extend with.
193
+ * @returns Updated given configuration object.
194
+ */var loadConfigurations=function loadConfigurations(plugins,configuration){/*
195
+ First clear current configuration content key by key to let old top
196
+ level configuration object instance untouched.
197
+ */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 _iterator0=_createForOfIteratorHelper(plugins),_step0;try{for(_iterator0.s();!(_step0=_iterator0.n()).done;){var plugin=_step0.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),/*
198
+ NOTE: Should be resolved via preceding
199
+ "object.modifyObject" call.
200
+ */pluginConfiguration);/*
201
+ NOTE: We apply provided runtime configuration after each plugin
202
+ specific configuration set to give runtime configuration always
203
+ the highest priority when resolving intermediate configuration
204
+ states.
205
+ */if(configuration.core.runtimeConfiguration)(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,configuration,configuration.core.runtimeConfiguration)}}}catch(err){_iterator0.e(err)}finally{_iterator0.f()}return evaluateConfiguration(configuration)};/**
206
+ * Load given api file path and returns exported scope.
207
+ * @param filePath - Path to file to load.
208
+ * @param name - Plugin name to use for proper error messages.
209
+ * @param fallbackScope - Scope to return if an error occurs during loading.
210
+ * If a "null" is given an error will be thrown.
211
+ * @param doLogging - Enables logging.
212
+ * @returns Exported api file scope.
213
+ */var loadFile=/*#__PURE__*/function(){var _loadFile=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(filePath,name,fallbackScope,doLogging){var options,scope,_t23;return _regenerator().w(function(_context9){while(1)switch(_context9.p=_context9.n){case 0:if(fallbackScope===void 0){fallbackScope=null}if(doLogging===void 0){doLogging=true}// Clear module cache if possible in the future.
214
+ /*
215
+ let reference: string | undefined
216
+ try {
217
+ reference = import.meta.resolve(filePath)
218
+ } catch {
219
+ // Ignore error.
220
+ }
221
+
222
+ if (reference)
223
+ // Clear the module cache.
224
+ */options={};if((0,path__WEBPACK_IMPORTED_MODULE_5__.extname)(filePath)===".json")options.with={type:"json"};_context9.p=1;_context9.n=2;return import(/* webpackIgnore: true */"".concat(filePath,"?timestamp=").concat(String(Date.now())),options);case 2:scope=_context9.v;_context9.n=5;break;case 3:_context9.p=3;_t23=_context9.v;if(!fallbackScope){_context9.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)(_t23),". Using"),"fallback one.");_context9.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)(_t23)),{cause:_t23});case 5:if(!(Object.prototype.hasOwnProperty.call(scope,"default")&&scope.default)){_context9.n=6;break}return _context9.a(2,scope.default);case 6:return _context9.a(2,scope)}},_callee9,null,[[1,3]])}));function loadFile(_x22,_x23,_x24,_x25){return _loadFile.apply(this,arguments)}return loadFile}();/**
225
+ * Extends given configuration object with all plugin specific ones and returns
226
+ * a topological sorted list of plugins with plugins specific meta information
227
+ * stored.
228
+ * @param configuration - Configuration object to extend and use.
229
+ * @returns A topological sorted list of plugins objects.
230
+ */var loadAll=/*#__PURE__*/function(){var _loadAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee0(configuration){var plugins,_i5,_Object$values,directory,compiledRegularExpression,_iterator1,_step1,pluginName,currentPluginPath,internalName,temporaryPlugins,_i6,_Object$values2,plugin,_iterator10,_step10,name,sortedPlugins,_iterator11,_step11,_pluginName,_i7,_Object$entries4,_Object$entries4$_i,_name2,_plugin,_t24,_t25,_t26,_t27,_t28;return _regenerator().w(function(_context0){while(1)switch(_context0.p=_context0.n){case 0:plugins={};/*
231
+ Load main plugin configuration at first.
232
+
233
+ NOTE: If application's main is this itself avoid loading it twice.
234
+ */if(!(configuration.name!=="web-node")){_context0.n=2;break}_context0.n=1;return load(configuration.name,determineInternalName(configuration.name,new RegExp(configuration.core.plugin.directories.external.nameRegularExpressionPattern)),plugins,configuration.core.plugin.configuration,configuration.core.context.path,configuration.core.encoding);case 1:plugins[configuration.name]=_context0.v;case 2:_i5=0,_Object$values=Object.values(configuration.core.plugin.directories);case 3:if(!(_i5<_Object$values.length)){_context0.n=15;break}directory=_Object$values[_i5];_context0.n=4;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isDirectory)(directory.path);case 4:if(!_context0.v){_context0.n=14;break}compiledRegularExpression=new RegExp(directory.nameRegularExpressionPattern);_t24=_createForOfIteratorHelper;_context0.n=5;return (0,fs_promises__WEBPACK_IMPORTED_MODULE_4__.readdir)(directory.path);case 5:_iterator1=_t24(_context0.v);_context0.p=6;_iterator1.s();case 7:if((_step1=_iterator1.n()).done){_context0.n=11;break}pluginName=_step1.value;if(compiledRegularExpression.test(pluginName)){_context0.n=8;break}return _context0.a(3,10);case 8:currentPluginPath=(0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(directory.path,pluginName);internalName=determineInternalName(pluginName,compiledRegularExpression);_context0.n=9;return load(pluginName,internalName,plugins,configuration.core.plugin.configuration,currentPluginPath,configuration.core.encoding);case 9:plugins[pluginName]=_context0.v;case 10:_context0.n=7;break;case 11:_context0.n=13;break;case 12:_context0.p=12;_t25=_context0.v;_iterator1.e(_t25);case 13:_context0.p=13;_iterator1.f();return _context0.f(13);case 14:_i5++;_context0.n=3;break;case 15:temporaryPlugins={};for(_i6=0,_Object$values2=Object.values(plugins);_i6<_Object$values2.length;_i6++){plugin=_Object$values2[_i6];temporaryPlugins[plugin.internalName]=plugin.dependencies;if(Object.prototype.hasOwnProperty.call(configuration.core.interDependencies,plugin.internalName)){_iterator10=_createForOfIteratorHelper([].concat(configuration.core.interDependencies[plugin.internalName]));try{for(_iterator10.s();!(_step10=_iterator10.n()).done;){name=_step10.value;if(!temporaryPlugins[plugin.internalName].includes(name))temporaryPlugins[plugin.internalName].push(name)}}catch(err){_iterator10.e(err)}finally{_iterator10.f()}}}sortedPlugins=[];_iterator11=_createForOfIteratorHelper((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.sortTopological)(temporaryPlugins));_context0.p=16;_iterator11.s();case 17:if((_step11=_iterator11.n()).done){_context0.n=21;break}_pluginName=_step11.value;_i7=0,_Object$entries4=Object.entries(plugins);case 18:if(!(_i7<_Object$entries4.length)){_context0.n=20;break}_Object$entries4$_i=_slicedToArray(_Object$entries4[_i7],2),_name2=_Object$entries4$_i[0],_plugin=_Object$entries4$_i[1];if(![_plugin.internalName,_name2].includes(_pluginName)){_context0.n=19;break}sortedPlugins.push(_plugin);return _context0.a(3,20);case 19:_i7++;_context0.n=18;break;case 20:_context0.n=17;break;case 21:_context0.n=23;break;case 22:_context0.p=22;_t26=_context0.v;_iterator11.e(_t26);case 23:_context0.p=23;_iterator11.f();return _context0.f(23);case 24:_context0.n=25;return loadConfigurations(sortedPlugins,configuration);case 25:_t27=_context0.v;_t28=sortedPlugins;return _context0.a(2,{configuration:_t27,plugins:_t28})}},_callee0,null,[[16,22,23,24],[6,12,13,14]])}));function loadAll(_x26){return _loadAll.apply(this,arguments)}return loadAll}();/**
235
+ * Transform a list of absolute paths respecting the application context.
236
+ * @param configuration - Configuration object.
237
+ * @param configuration.core - Sub configuration web-node.
238
+ * @param configuration.core.context - Sub web-node context configurations.
239
+ * @param configuration.core.context.path - Current web-nodes path.
240
+ * @param locations - Locations to process.
241
+ * @returns Given and processed locations.
242
+ */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]};/**
243
+ * Checks whether given file path is in provided locations.
244
+ * @param configuration - Configuration object.
245
+ * @param plugins - List of active plugins.
246
+ * @param filePath - Path to search for.
247
+ * @param locations - Locations to search in.
248
+ * @returns A boolean indicating whether given file path is in provided
249
+ * locations.
250
+ */var isInLocations=function isInLocations(configuration,plugins,filePath,locations){var pluginPaths=plugins.map(function(plugin){return plugin.path});var _iterator12=_createForOfIteratorHelper([].concat(locations)),_step12;try{for(_iterator12.s();!(_step12=_iterator12.n()).done;){var location=_step12.value;if(location.startsWith("/")){if(filePath.startsWith((0,path__WEBPACK_IMPORTED_MODULE_5__.join)(configuration.core.context.path,location)))return true}else{var _iterator13=_createForOfIteratorHelper(pluginPaths),_step13;try{for(_iterator13.s();!(_step13=_iterator13.n()).done;){var pluginPath=_step13.value;if(filePath.startsWith((0,path__WEBPACK_IMPORTED_MODULE_5__.resolve)(pluginPath,location)))return true}}catch(err){_iterator13.e(err)}finally{_iterator13.f()}}}}catch(err){_iterator12.e(err)}finally{_iterator12.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);
251
+ __webpack_async_result__();
252
+ } catch(e) { __webpack_async_result__(e); } }, 1);
253
+
254
+ /***/ }),
255
+ /* 1 */
256
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
257
+
258
+ const x = (y) => {
259
+ const x = {}; __webpack_require__.d(x, y); return x
260
+ }
261
+ const y = (x) => (() => (x))
262
+ 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) });
263
+
264
+ /***/ }),
265
+ /* 2 */
266
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
267
+
268
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
269
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
270
+ /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
271
+ /* harmony export */ });
272
+ /* unused harmony export configuration */
273
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
274
+ /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
275
+ /* harmony import */ var fs_promises__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4);
276
+ /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5);
277
+ /* harmony import */ var _package_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7);
278
+ /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(0);
279
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__]);
280
+ var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
281
+ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_async_dependencies_result__[0];
282
+ // #!/usr/bin/env node
283
+ // -*- coding: utf-8 -*-
284
+ /* !
285
+ region header
286
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
287
+
288
+ License
289
+ -------
290
+
291
+ This library written by Torben Sickert stands under a creative commons
292
+ naming 3.0 unported license.
293
+ See https://creativecommons.org/licenses/by/3.0/deed.de
294
+ endregion
295
+ */// region imports
296
+ 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;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
297
+ /*
298
+ To assume to go two folder up from this file until there is no
299
+ "node_modules" parent folder is usually resilient again dealing with
300
+ projects where current working directory isn't the projects directory and
301
+ this library is located as a nested dependency.
302
+ */_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")/*
303
+ NOTE: If we are dealing was a dependent project use current directory
304
+ as context.
305
+ */_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path=process.cwd();else/*
306
+ NOTE: If the current working directory references this file via a
307
+ linked "node_modules" folder using current working directory as context
308
+ is a better assumption than two folders up the hierarchy.
309
+ */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.
310
+ }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"),{with:{type:"json"}})).default}catch(_unused2){_package_json__WEBPACK_IMPORTED_MODULE_4__.webNode.core.context.path=process.cwd()}var name=((_mainPackageConfigura=mainPackageConfiguration.webDocumentation)===null||_mainPackageConfigura===void 0?void 0:_mainPackageConfigura.name)||mainPackageConfiguration.name||"main";var applicationConfiguration=mainPackageConfiguration.webNode||_defineProperty({},name,{name:name,package:mainPackageConfiguration});// endregion
311
+ _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,/*
312
+ NOTE: "object.modifyObject" removes modifications in "result"
313
+ in-place before it is used as extending source.
314
+ */(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);
315
+ __webpack_async_result__();
316
+ } catch(e) { __webpack_async_result__(e); } }, 1);
317
+
318
+ /***/ }),
319
+ /* 3 */
320
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
321
+
322
+ const x = (y) => {
323
+ const x = {}; __webpack_require__.d(x, y); return x
324
+ }
325
+ const y = (x) => (() => (x))
326
+ module.exports = x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_fs__["default"]) });
327
+
328
+ /***/ }),
329
+ /* 4 */
330
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
331
+
332
+ const x = (y) => {
333
+ const x = {}; __webpack_require__.d(x, y); return x
334
+ }
335
+ const y = (x) => (() => (x))
336
+ 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) });
337
+
338
+ /***/ }),
339
+ /* 5 */
340
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
341
+
342
+ const x = (y) => {
343
+ const x = {}; __webpack_require__.d(x, y); return x
344
+ }
345
+ const y = (x) => (() => (x))
346
+ 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) });
347
+
348
+ /***/ }),
349
+ /* 6 */
350
+ /***/ ((module, __webpack_exports__, __webpack_require__) => {
351
+
352
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
353
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
354
+ /* harmony export */ eQ: () => (/* binding */ isMainModule)
355
+ /* harmony export */ });
356
+ /* unused harmony exports log, main */
357
+ /* harmony import */ var _configurator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
358
+ /* harmony import */ var _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(0);
359
+ /* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1);
360
+ /* harmony import */ var node_fs_promises__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(10);
361
+ /* harmony import */ var node_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11);
362
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__]);
363
+ ([_configurator_js__WEBPACK_IMPORTED_MODULE_0__, _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
364
+ // #!/usr/bin/env babel-node
365
+ // -*- coding: utf-8 -*-
366
+ /** @module web-node *//* !
367
+ region header
368
+ [Project page](https://torben.website/webNode)
369
+
370
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
371
+
372
+ License
373
+ -------
374
+
375
+ This library written by Torben Sickert stands under a creative commons
376
+ naming 3.0 unported license.
377
+ See https://creativecommons.org/licenses/by/3.0/deed.de
378
+ endregion
379
+ */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
380
+ ;// endregion
381
+ 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(){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:_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
382
+ 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
383
+ // region register close handler
384
+ 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;/*
385
+ NOTE: "setRawMode" is only available when the input is provided by
386
+ a TTY and not as direct stream from stdin.
387
+
388
+ NOTE: Access property via string to avoid lint error
389
+ "@typescript-eslint/unbound-method".
390
+ */// eslint-disable-next-line @typescript-eslint/unbound-method
391
+ 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
392
+ _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(){return _main.apply(this,arguments)}return main}();/*
393
+ NOTE: Neither "import.meta.main" nor "import.meta.url" cannot be used
394
+ directly since bundlers replace them with a compile time constant
395
+ referencing the build environments file location.
396
+ */var isMainModule=/*#__PURE__*/function(){var _isMainModule=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(filename){var _t8,_t9,_t0;return _regenerator().w(function(_context4){while(1)switch(_context4.p=_context4.n){case 0:if(!(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);/*
397
+ NOTE: Both locations have to be resolved since the executable is
398
+ usually linked into a package managers binary folder.
399
+ */_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;return _context4.a(2,_t8===_t9);case 5:_context4.p=5;_t0=_context4.v;return _context4.a(2,false)}},_callee4,null,[[2,5]])}));function isMainModule(_x2){return _isMainModule.apply(this,arguments)}return isMainModule}();/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (main);
400
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, [
401
+ /* harmony export */ "Ay", 0, /* export default binding */ __WEBPACK_DEFAULT_EXPORT__
402
+ /* harmony export */ ]);
403
+
404
+ __webpack_async_result__();
405
+ } catch(e) { __webpack_async_result__(e); } });
406
+
407
+ /***/ }),
408
+ /* 7 */
409
+ /***/ ((module) => {
410
+
411
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.601","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.1506","eslint":"^10.10.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^64.3.5","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.76"},"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"]},"directories":{"external":{"nameRegularExpressionPattern":"^([a-zA-Z0-9-]+?)-?[wW]eb-?[nN]ode-?[pP]lugin$","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"}');
412
+
413
+ /***/ }),
414
+ /* 8 */
415
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
416
+
417
+ const x = (y) => {
418
+ const x = {}; __webpack_require__.d(x, y); return x
419
+ }
420
+ const y = (x) => (() => (x))
421
+ module.exports = x({ });
422
+
423
+ /***/ }),
424
+ /* 9 */
425
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
426
+
427
+ const x = (y) => {
428
+ const x = {}; __webpack_require__.d(x, y); return x
429
+ }
430
+ const y = (x) => (() => (x))
431
+ module.exports = x({ ["spawnSync"]: () => (__WEBPACK_EXTERNAL_MODULE_child_process__.spawnSync) });
432
+
433
+ /***/ }),
434
+ /* 10 */
435
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
436
+
437
+ const x = (y) => {
438
+ const x = {}; __webpack_require__.d(x, y); return x
439
+ }
440
+ const y = (x) => (() => (x))
441
+ module.exports = x({ ["realpath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_fs_promises_06ebfe74__.realpath) });
442
+
443
+ /***/ }),
444
+ /* 11 */
445
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
446
+
447
+ const x = (y) => {
448
+ const x = {}; __webpack_require__.d(x, y); return x
449
+ }
450
+ const y = (x) => (() => (x))
451
+ module.exports = x({ ["fileURLToPath"]: () => (__WEBPACK_EXTERNAL_MODULE_node_url_50af3bb5__.fileURLToPath) });
452
+
453
+ /***/ }),
454
+ /* 12 */
455
+ /***/ ((module, __unused_webpack___webpack_exports__, __webpack_require__) => {
456
+
457
+ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
458
+ /* harmony import */ var _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
459
+ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_index_js__WEBPACK_IMPORTED_MODULE_0__]);
460
+ var __webpack_async_dependencies_result__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
461
+ _index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_async_dependencies_result__[0];
462
+ // #!/usr/bin/env babel-node
463
+ // -*- coding: utf-8 -*-
464
+ /** @module web-node *//* !
465
+ region header
466
+ [Project page](https://torben.website/webNode)
467
+
468
+ Copyright Torben Sickert (info["~at~"]torben.website) 16.12.2012
469
+
470
+ License
471
+ -------
472
+
473
+ This library written by Torben Sickert stands under a creative commons
474
+ naming 3.0 unported license.
475
+ See https://creativecommons.org/licenses/by/3.0/deed.de
476
+ endregion
477
+ */if(await (0,_index_js__WEBPACK_IMPORTED_MODULE_0__/* .isMainModule */ .eQ)())void (0,_index_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Ay)();
478
+ __webpack_async_result__();
479
+ } catch(e) { __webpack_async_result__(e); } }, 1);
480
+
481
+ /***/ })
482
+ /******/ ]);
483
+ /************************************************************************/
484
+ /******/ // The module cache
485
+ /******/ const __webpack_module_cache__ = {};
486
+ /******/
487
+ /******/ // The require function
488
+ /******/ function __webpack_require__(moduleId) {
489
+ /******/ // Check if module is in cache
490
+ /******/ const cachedModule = __webpack_module_cache__[moduleId];
491
+ /******/ if (cachedModule !== undefined) {
492
+ /******/ return cachedModule.exports;
493
+ /******/ }
494
+ /******/ // Create a new module (and put it into the cache)
495
+ /******/ const module = __webpack_module_cache__[moduleId] = {
496
+ /******/ id: moduleId,
497
+ /******/ loaded: false,
498
+ /******/ exports: {}
499
+ /******/ };
500
+ /******/
501
+ /******/ // Execute the module function
502
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
503
+ /******/
504
+ /******/ // Flag the module as loaded
505
+ /******/ module.loaded = true;
506
+ /******/
507
+ /******/ // Return the exports of the module
508
+ /******/ return module.exports;
509
+ /******/ }
510
+ /******/
511
+ /************************************************************************/
512
+ /******/ /* webpack/runtime/async module */
513
+ /******/ (() => {
514
+ /******/ const webpackQueues = Symbol("webpack queues");
515
+ /******/ const webpackExports = Symbol("webpack exports");
516
+ /******/ const webpackError = Symbol("webpack error");
517
+ /******/
518
+ /******/ const resolveQueue = (queue) => {
519
+ /******/ if(queue?.d < 1) {
520
+ /******/ queue.d = 1;
521
+ /******/ queue.forEach((fn) => (fn.r--));
522
+ /******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
523
+ /******/ }
524
+ /******/ }
525
+ /******/ const wrapDeps = (deps) => (deps.map((dep) => {
526
+ /******/ if(dep !== null && typeof dep === "object") {
527
+ /******/
528
+ /******/ if(dep[webpackQueues]) return dep;
529
+ /******/ if(dep.then) {
530
+ /******/ const queue = [];
531
+ /******/ queue.d = 0;
532
+ /******/ dep.then((r) => {
533
+ /******/ obj[webpackExports] = r;
534
+ /******/ resolveQueue(queue);
535
+ /******/ }, (e) => {
536
+ /******/ obj[webpackError] = e;
537
+ /******/ resolveQueue(queue);
538
+ /******/ });
539
+ /******/ const obj = {};
540
+ /******/
541
+ /******/ obj[webpackQueues] = (fn) => (fn(queue));
542
+ /******/ return obj;
543
+ /******/ }
544
+ /******/ }
545
+ /******/ const ret = {};
546
+ /******/ ret[webpackQueues] = x => {};
547
+ /******/ ret[webpackExports] = dep;
548
+ /******/ return ret;
549
+ /******/ }));
550
+ /******/ __webpack_require__.a = (module, body, hasAwait) => {
551
+ /******/ let queue;
552
+ /******/ hasAwait && ((queue = []).d = -1);
553
+ /******/ const depQueues = new Set();
554
+ /******/ const exports = module.exports;
555
+ /******/ let currentDeps;
556
+ /******/ let outerResolve;
557
+ /******/ let reject;
558
+ /******/ const promise = new Promise((resolve, rej) => {
559
+ /******/ reject = rej;
560
+ /******/ outerResolve = resolve;
561
+ /******/ });
562
+ /******/ promise[webpackExports] = exports;
563
+ /******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
564
+ /******/ module.exports = promise;
565
+ /******/ const handle = (deps) => {
566
+ /******/ currentDeps = wrapDeps(deps);
567
+ /******/ let fn;
568
+ /******/ const getResult = () => (currentDeps.map((d) => {
569
+ /******/
570
+ /******/ if(d[webpackError]) throw d[webpackError];
571
+ /******/ return d[webpackExports];
572
+ /******/ }))
573
+ /******/ const promise = new Promise((resolve) => {
574
+ /******/ fn = () => (resolve(getResult));
575
+ /******/ fn.r = 0;
576
+ /******/ const fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
577
+ /******/ currentDeps.forEach((dep) => (dep[webpackQueues](fnQueue)));
578
+ /******/ });
579
+ /******/ return fn.r ? promise : getResult();
580
+ /******/ }
581
+ /******/ const done = (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))
582
+ /******/
583
+ /******/ body(handle, done);
584
+ /******/ queue?.d < 0 && (queue.d = 0);
585
+ /******/ };
586
+ /******/ })();
587
+ /******/
588
+ /******/ /* webpack/runtime/define property getters */
589
+ /******/ // define getter/value functions for harmony exports
590
+ /******/ __webpack_require__.d = (exports, definition) => {
591
+ /******/ if(Array.isArray(definition)) {
592
+ /******/ var i = 0;
593
+ /******/ while(i < definition.length) {
594
+ /******/ var key = definition[i++];
595
+ /******/ var binding = definition[i++];
596
+ /******/ var descriptor = binding === 0 ? { enumerable: true, value: definition[i++] } : { enumerable: true, get: binding };
597
+ /******/ if(!__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, descriptor);
598
+ /******/ }
599
+ /******/ } else {
600
+ /******/ for(var key in definition) {
601
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
602
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
603
+ /******/ }
604
+ /******/ }
605
+ /******/ }
606
+ /******/ };
607
+ /******/
608
+ /******/ /* webpack/runtime/harmony module decorator */
609
+ /******/ __webpack_require__.hmd = (module) => {
610
+ /******/ module = Object.create(module);
611
+ /******/ if (!module.children) module.children = [];
612
+ /******/ Object.defineProperty(module, 'exports', {
613
+ /******/ enumerable: true,
614
+ /******/ set() {
615
+ /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
616
+ /******/ }
617
+ /******/ });
618
+ /******/ return module;
619
+ /******/ };
620
+ /******/
621
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
622
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop));
623
+ /******/
624
+ /************************************************************************/
625
+ /******/
626
+ /******/ // startup
627
+ /******/ // Load entry module and return exports
628
+ /******/ // This entry module used 'module' so it can't be inlined
629
+ /******/ let __webpack_exports__ = __webpack_require__(12);
630
+ /******/ __webpack_exports__ = await __webpack_exports__;
631
+ /******/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-node",
3
- "version": "1.0.599",
3
+ "version": "1.0.601",
4
4
  "description": "High level javaScript backend plugin system and configuration merger.",
5
5
  "keywords": [
6
6
  "api",
@@ -25,9 +25,11 @@
25
25
  "url": "https://github.com/thaibault/web-node.git"
26
26
  },
27
27
  "type": "module",
28
- "bin": "index.js",
28
+ "bin": "main.js",
29
29
  "exports": {
30
30
  ".": "./index.js",
31
+ "./main": "./main.js",
32
+ "./main.js": "./main.js",
31
33
  "./package.json": "./package.json",
32
34
  "./unixCrypt": "./unixCrypt.js",
33
35
  "./unixCrypt.js": "./unixCrypt.js",
@@ -37,6 +39,7 @@
37
39
  "configurator.d.ts",
38
40
  "index.d.ts",
39
41
  "index.js",
42
+ "main.js",
40
43
  "pluginAPI.d.ts",
41
44
  "type.d.ts",
42
45
  "unixCrypt.d.ts",
@@ -55,7 +58,7 @@
55
58
  "prepare": "yarn build",
56
59
  "prepare:test": "yarn clear && cd dummyPlugin && shx touch yarn.lock && yarn build && cd ..",
57
60
  "serve": "yarn build:plain && yarn start",
58
- "start": "./index.js '{plugin: {hotReloading: true}}'",
61
+ "start": "./main.js '{plugin: {hotReloading: true}}'",
59
62
  "test": "yarn prepare:test && weboptimizer test",
60
63
  "test:coverage": "yarn prepare:test && weboptimizer test:coverage",
61
64
  "test:coverage:report": "yarn prepare:test && weboptimizer test:coverage:report",
@@ -80,7 +83,7 @@
80
83
  "shx": "^0.4.0",
81
84
  "typescript-eslint": "^8.69.0",
82
85
  "web-documentation": "^1.0.52",
83
- "weboptimizer": "^4.0.75"
86
+ "weboptimizer": "^4.0.76"
84
87
  },
85
88
  "peerDependencies": {
86
89
  "clientnode": "*"
@@ -142,7 +145,7 @@
142
145
  "webOptimizer": {
143
146
  "assetPattern": {
144
147
  "javaScript": {
145
- "includeFilePathRegularExpression": "^(.+/)?index\\.js$",
148
+ "includeFilePathRegularExpression": "^(.+/)?main\\.js$",
146
149
  "pattern": {
147
150
  "#": "This is how we can make our main exported artefact executable.",
148
151
  "__evaluate__": "`#!/usr/bin/env node\n// -*- coding: utf-8 -*-\n${self.generic.assetPattern?.javaScript?.pattern ?? ''}\n{1}`"
@@ -151,7 +154,7 @@
151
154
  },
152
155
  "injection": {
153
156
  "entry": {
154
- "__evaluate__": "2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith('test') ? {testBundle: 'test'} : {index: './index.ts', unixCrypt: './unixCrypt.ts'}"
157
+ "__evaluate__": "2 < self.givenCommandLineArguments.length && self.givenCommandLineArguments[2].startsWith('test') ? {testBundle: 'test'} : {index: './index.ts', main: './main.ts', unixCrypt: './unixCrypt.ts'}"
155
158
  }
156
159
  },
157
160
  "module": {