web-node 1.0.584 → 1.0.586
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.
- package/configurator.d.ts +0 -1
- package/index.js +40 -56
- package/package.json +25 -32
- package/pluginAPI.d.ts +8 -8
package/configurator.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -58,29 +58,8 @@ _configurator_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_async_dependencies_res
|
|
|
58
58
|
endregion
|
|
59
59
|
*/// region imports
|
|
60
60
|
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
|
|
61
|
-
var log=new clientnode__WEBPACK_IMPORTED_MODULE_2__.Logger({name:"web-node.plugin-api"});await (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.importFilesystemAPI)()
|
|
61
|
+
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
|
|
62
62
|
/*
|
|
63
|
-
Commonjs specific logic to deduplicate the main module's scope for plugins
|
|
64
|
-
to avoid loading it twice and therefore having two different scopes of the
|
|
65
|
-
same module in memory:
|
|
66
|
-
|
|
67
|
-
import {Module} from 'module'
|
|
68
|
-
|
|
69
|
-
type ModuleType =
|
|
70
|
-
typeof Module &
|
|
71
|
-
{_resolveFilename: (
|
|
72
|
-
request: string, module: typeof Module, isMain: boolean
|
|
73
|
-
) => string}
|
|
74
|
-
const oldResolveFilename = (Module as ModuleType)._resolveFilename
|
|
75
|
-
;(Module as ModuleType)._resolveFilename = (
|
|
76
|
-
request: string, parent: typeof Module, isMain: boolean
|
|
77
|
-
): string => {
|
|
78
|
-
if (request === 'main-module' && currentRequire.main?.id)
|
|
79
|
-
return oldResolveFilename(currentRequire.main.id, parent, isMain)
|
|
80
|
-
|
|
81
|
-
return oldResolveFilename(request, parent, isMain)
|
|
82
|
-
}
|
|
83
|
-
*//*
|
|
84
63
|
Esmodule specific logic to deduplicate the main module's scope for plugins
|
|
85
64
|
to avoid loading it twice and therefore having two different scopes of the
|
|
86
65
|
same module in memory:
|
|
@@ -123,7 +102,7 @@ register('./main-module-hook.js', {
|
|
|
123
102
|
* @param parameters - Additional parameters to forward into plugin api.
|
|
124
103
|
* @returns A promise which resolves when all callbacks have resolved their
|
|
125
104
|
* promise holding given potentially modified data.
|
|
126
|
-
*/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=
|
|
105
|
+
*/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}();/**
|
|
127
106
|
* Calls all plugin methods for given trigger description synchronous.
|
|
128
107
|
* @param givenState - Contains runtime information about current hook.
|
|
129
108
|
* @param parameters - Additional parameters to forward into plugin api.
|
|
@@ -148,15 +127,15 @@ register('./main-module-hook.js', {
|
|
|
148
127
|
* necessary (new timestamp).
|
|
149
128
|
* @param plugins - List of plugins to search for updates in.
|
|
150
129
|
* @returns A list with plugins which have a changed api scope.
|
|
151
|
-
*/var hotReloadAPIFile=function
|
|
152
|
-
for(
|
|
130
|
+
*/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.
|
|
131
|
+
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}();/**
|
|
153
132
|
* Checks for changed plugin configurations in given plugins and reloads them
|
|
154
133
|
* if necessary (new timestamp).
|
|
155
134
|
* @param plugins - List of plugins to search for updates in.
|
|
156
135
|
* @param configurationPropertyNames - Property names to search for to use as
|
|
157
136
|
* entry in plugin configuration file.
|
|
158
137
|
* @returns A list with plugins which have a changed configurations.
|
|
159
|
-
*/var hotReloadConfigurationFile=function
|
|
138
|
+
*/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}();/**
|
|
160
139
|
* Checks for changed plugin file type in given plugins and reloads them if
|
|
161
140
|
* necessary (timestamp has changed).
|
|
162
141
|
* @param type - Plugin file type to search for updates.
|
|
@@ -164,8 +143,7 @@ for(var _i4=0,_Object$entries3=Object.entries(pluginChange.oldScope);_i4<_Object
|
|
|
164
143
|
* which should be updated.
|
|
165
144
|
* @param plugins - List of plugins to search for updates in.
|
|
166
145
|
* @returns A list with plugin changes.
|
|
167
|
-
*/var hotReloadFiles=function
|
|
168
|
-
delete currentRequire.cache[currentRequire.resolve(filePath)];var oldScope=plugin[target];plugin[target]=loadFile(filePath,plugin.name,plugin[target]);log.info("File \"".concat(filePath,"\" reloaded."));pluginChanges.push({newScope:plugin[target],oldScope:oldScope,plugin:plugin,target:target})}plugin["".concat(type,"FileLoadTimestamps")][index]=timestamp;index+=1}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}}}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}return pluginChanges};/**
|
|
146
|
+
*/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=12;break}plugin=_step5.value;if(!plugin[target]){_context5.n=11;break}index=0;_iterator6=_createForOfIteratorHelper(plugin["".concat(type,"FilePaths")]);_context5.p=3;_iterator6.s();case 4:if((_step6=_iterator6.n()).done){_context5.n=8;break}filePath=_step6.value;timestamp=(0,fs__WEBPACK_IMPORTED_MODULE_3__.statSync)(filePath).mtime.getTime();if(!(plugin["".concat(type,"FileLoadTimestamps")][index]<timestamp)){_context5.n=6;break}log.info("Determined updated file \"".concat(filePath,"\"."),"Doing a reload.");oldScope=plugin[target];_context5.n=5;return loadFile(filePath,plugin.name,plugin[target]);case 5:plugin[target]=_context5.v;log.info("File \"".concat(filePath,"\" reloaded."));pluginChanges.push({newScope:plugin[target],oldScope:oldScope,plugin:plugin,target:target});case 6:plugin["".concat(type,"FileLoadTimestamps")][index]=timestamp;index+=1;case 7:_context5.n=4;break;case 8:_context5.n=10;break;case 9:_context5.p=9;_t3=_context5.v;_iterator6.e(_t3);case 10:_context5.p=10;_iterator6.f();return _context5.f(10);case 11:_context5.n=2;break;case 12:_context5.n=14;break;case 13:_context5.p=13;_t4=_context5.v;_iterator5.e(_t4);case 14:_context5.p=14;_iterator5.f();return _context5.f(14);case 15:return _context5.a(2,pluginChanges)}},_callee5,null,[[3,9,10,11],[1,13,14,15]])}));function hotReloadFiles(_x6,_x7,_x8){return _hotReloadFiles.apply(this,arguments)}return hotReloadFiles}();/**
|
|
169
147
|
* Extends given configuration object with given plugin specific ones and
|
|
170
148
|
* returns a plugin specific meta information object.
|
|
171
149
|
* @param name - Name of plugin to extend.
|
|
@@ -175,13 +153,13 @@ delete currentRequire.cache[currentRequire.resolve(filePath)];var oldScope=plugi
|
|
|
175
153
|
* @param pluginPath - Path to given plugin.
|
|
176
154
|
* @param encoding - Encoding to use to read and write from child process's.
|
|
177
155
|
* @returns An object of plugin specific meta information.
|
|
178
|
-
*/var load=/*#__PURE__*/function(){var _load=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
156
|
+
*/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_4__.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,/*
|
|
179
157
|
NOTE: Source and target configuration got modified.
|
|
180
158
|
While the target configuration receives the modifications
|
|
181
159
|
the source configuration will lose their modification
|
|
182
160
|
expressions therefore we can use the source configuration
|
|
183
161
|
afterward to extend the target configuration.
|
|
184
|
-
*/(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.modifyObject)(packageConfiguration,sourceConfiguration),sourceConfiguration);configurationFilePaths.push(filePath);case
|
|
162
|
+
*/(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}();/**
|
|
185
163
|
* Load given plugin api file in given path and generates a plugin specific
|
|
186
164
|
* data structure with useful meta information.
|
|
187
165
|
* @param relativeFilePaths - Paths to file to load relatively from given
|
|
@@ -194,15 +172,15 @@ delete currentRequire.cache[currentRequire.resolve(filePath)];var oldScope=plugi
|
|
|
194
172
|
* @param configuration - Plugin specific configurations.
|
|
195
173
|
* @param configurationFilePaths - Plugin specific configuration file paths.
|
|
196
174
|
* @returns Plugin meta information object.
|
|
197
|
-
*/var loadAPI=/*#__PURE__*/function(){var _loadAPI=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
198
|
-
|
|
175
|
+
*/var loadAPI=/*#__PURE__*/function(){var _loadAPI=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee7(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;return _regenerator().w(function(_context7){while(1)switch(_context7.p=_context7.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_4__.resolve)(pluginPath,relativeFilePaths[0]);_context7.n=1;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 1:if(_context7.v){_context7.n=10;break}// Determine entry file if given one does not exist.
|
|
176
|
+
_iterator8=_createForOfIteratorHelper((0,fs__WEBPACK_IMPORTED_MODULE_3__.readdirSync)(pluginPath));_context7.p=2;_iterator8.s();case 3:if((_step8=_iterator8.n()).done){_context7.n=7;break}fileName=_step8.value;_t6=!configurationFilePaths.map(function(filePath){return (0,path__WEBPACK_IMPORTED_MODULE_4__.basename)(filePath)}).includes(fileName);if(!_t6){_context7.n=5;break}_context7.n=4;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)((0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(pluginPath,fileName));case 4:_t6=_context7.v;case 5:if(!_t6){_context7.n=6;break}filePath=(0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(pluginPath,filePath);if(!["index","main"].includes((0,path__WEBPACK_IMPORTED_MODULE_4__.basename)(filePath,(0,path__WEBPACK_IMPORTED_MODULE_4__.extname)(fileName)))){_context7.n=6;break}return _context7.a(3,7);case 6:_context7.n=3;break;case 7:_context7.n=9;break;case 8:_context7.p=8;_t7=_context7.v;_iterator8.e(_t7);case 9:_context7.p=9;_iterator8.f();return _context7.f(9);case 10:api=null;nativeAPI=false;_t8=configuration&&(/*
|
|
199
177
|
NOTE: Check if a webNode plugin configuration is available
|
|
200
178
|
indicating a backend responsibility for api file.
|
|
201
179
|
|
|
202
180
|
NOTE: One key is always there representing the whole package
|
|
203
181
|
configuration.
|
|
204
|
-
*/Object.keys(configuration).length>1||Object.prototype.hasOwnProperty.call(configuration,internalName)&&Object.keys(configuration[internalName]).length>1);if(!
|
|
205
|
-
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 13:pluginConfiguration=configuration!==null&&configuration!==void 0?configuration:_defineProperty({},internalName,{package:{}});
|
|
182
|
+
*/Object.keys(configuration).length>1||Object.prototype.hasOwnProperty.call(configuration,internalName)&&Object.keys(configuration[internalName]).length>1);if(!_t8){_context7.n=12;break}_context7.n=11;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isFile)(filePath);case 11:_t8=_context7.v;case 12:if(!_t8){_context7.n=13;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.
|
|
183
|
+
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 13:pluginConfiguration=configuration!==null&&configuration!==void 0?configuration:_defineProperty({},internalName,{package:{}});_t9=api;_t0=api?[(0,fs__WEBPACK_IMPORTED_MODULE_3__.statSync)(filePath).mtime.getTime()]:[];_t1=api?[filePath]:[];_t10=pluginConfiguration;_t11=configurationFilePaths;_t12=configurationFilePaths.map(function(filePath){return (0,fs__WEBPACK_IMPORTED_MODULE_3__.statSync)(filePath).mtime.getTime()});_t13=Object.prototype.hasOwnProperty.call(pluginConfiguration,internalName)&&pluginConfiguration[internalName].dependencies?pluginConfiguration[internalName].dependencies:[];_t14=internalName;_t15=name;_t16=pluginConfiguration[internalName].package;_t17=pluginPath;if(!nativeAPI){_context7.n=15;break}_context7.n=14;return loadFile(filePath,name);case 14:_t18=_context7.v;_context7.n=16;break;case 15:_t18=null;case 16:_t19=_t18;return _context7.a(2,{api:_t9,apiFileLoadTimestamps:_t0,apiFilePaths:_t1,configuration:_t10,configurationFilePaths:_t11,configurationFileLoadTimestamps:_t12,dependencies:_t13,internalName:_t14,name:_t15,packageConfiguration:_t16,path:_t17,scope:_t19})}},_callee7,null,[[2,8,9,10]])}));function loadAPI(_x13,_x14,_x15,_x16,_x17,_x18,_x19,_x20){return _loadAPI.apply(this,arguments)}return loadAPI}();/**
|
|
206
184
|
* Loads plugin specific configuration object.
|
|
207
185
|
* @param name - Property name where to inject resolved configuration into
|
|
208
186
|
* global one.
|
|
@@ -214,10 +192,10 @@ api=function api(_ref2){var hook=_ref2.hook,data=_ref2.data;for(var _len4=argume
|
|
|
214
192
|
No plugin specific configuration found. Only provide package
|
|
215
193
|
configuration.
|
|
216
194
|
Removing comments (default key prefix to delete is "#").
|
|
217
|
-
*/var packageConfigurationCopy=(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.removeKeyPrefixes)((0,clientnode__WEBPACK_IMPORTED_MODULE_2__.copy)(packageConfiguration));var result=_defineProperty({},name,{package:packageConfigurationCopy});var
|
|
195
|
+
*/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]);/*
|
|
218
196
|
NOTE: We should break the cycle here to avoid endless loops
|
|
219
197
|
when traversing this data structure.
|
|
220
|
-
*/delete result[name].package[propertyName];break}}}catch(err){
|
|
198
|
+
*/delete result[name].package[propertyName];break}}}catch(err){_iterator9.e(err)}finally{_iterator9.f()}return result};/**
|
|
221
199
|
* Loads given plugin configurations into global configuration.
|
|
222
200
|
* @param plugins - Topological sorted list of plugins to check for
|
|
223
201
|
* configurations.
|
|
@@ -226,7 +204,7 @@ api=function api(_ref2){var hook=_ref2.hook,data=_ref2.data;for(var _len4=argume
|
|
|
226
204
|
*/var loadConfigurations=function loadConfigurations(plugins,configuration){/*
|
|
227
205
|
First clear current configuration content key by key to let old top
|
|
228
206
|
level configuration object instance untouched.
|
|
229
|
-
*/for(var
|
|
207
|
+
*/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_5__/* ["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),/*
|
|
230
208
|
NOTE: Should be resolved via preceding
|
|
231
209
|
"object.modifyObject" call.
|
|
232
210
|
*/pluginConfiguration);/*
|
|
@@ -234,7 +212,7 @@ api=function api(_ref2){var hook=_ref2.hook,data=_ref2.data;for(var _len4=argume
|
|
|
234
212
|
specific configuration set to give runtime configuration always
|
|
235
213
|
the highest priority when resolving intermediate configuration
|
|
236
214
|
states.
|
|
237
|
-
*/if(configuration.core.runtimeConfiguration)(0,clientnode__WEBPACK_IMPORTED_MODULE_2__.extend)(true,configuration,configuration.core.runtimeConfiguration)}}}catch(err){
|
|
215
|
+
*/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)};/**
|
|
238
216
|
* Load given api file path and returns exported scope.
|
|
239
217
|
* @param filePath - Path to file to load.
|
|
240
218
|
* @param name - Plugin name to use for proper error messages.
|
|
@@ -242,19 +220,28 @@ api=function api(_ref2){var hook=_ref2.hook,data=_ref2.data;for(var _len4=argume
|
|
|
242
220
|
* If a "null" is given an error will be thrown.
|
|
243
221
|
* @param doLogging - Enables logging.
|
|
244
222
|
* @returns Exported api file scope.
|
|
245
|
-
*/var loadFile=function
|
|
246
|
-
|
|
247
|
-
|
|
223
|
+
*/var loadFile=/*#__PURE__*/function(){var _loadFile=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee8(filePath,name,fallbackScope,doLogging){var options,scope,_t20;return _regenerator().w(function(_context8){while(1)switch(_context8.p=_context8.n){case 0:if(fallbackScope===void 0){fallbackScope=null}if(doLogging===void 0){doLogging=true}// Clear module cache if possible in the future.
|
|
224
|
+
/*
|
|
225
|
+
let reference: string | undefined
|
|
226
|
+
try {
|
|
227
|
+
reference = import.meta.resolve(filePath)
|
|
228
|
+
} catch {
|
|
229
|
+
// Ignore error.
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
if (reference)
|
|
233
|
+
// Clear the module cache.
|
|
234
|
+
*/options={};if((0,path__WEBPACK_IMPORTED_MODULE_4__.extname)(filePath)===".json")options.with={type:"json"};_context8.p=1;_context8.n=2;return import(/* webpackIgnore: true */"".concat(filePath,"?timestamp=").concat(String(Date.now())),options);case 2:scope=_context8.v;_context8.n=5;break;case 3:_context8.p=3;_t20=_context8.v;if(!fallbackScope){_context8.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)(_t20),". Using"),"fallback one.");_context8.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)(_t20)),{cause:_t20});case 5:if(!(Object.prototype.hasOwnProperty.call(scope,"default")&&scope.default)){_context8.n=6;break}return _context8.a(2,scope.default);case 6:return _context8.a(2,scope)}},_callee8,null,[[1,3]])}));function loadFile(_x21,_x22,_x23,_x24){return _loadFile.apply(this,arguments)}return loadFile}();/**
|
|
248
235
|
* Extends given configuration object with all plugin specific ones and returns
|
|
249
236
|
* a topological sorted list of plugins with plugins specific meta information
|
|
250
237
|
* stored.
|
|
251
238
|
* @param configuration - Configuration object to extend and use.
|
|
252
239
|
* @returns A topological sorted list of plugins objects.
|
|
253
|
-
*/var loadAll=/*#__PURE__*/function(){var _loadAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function
|
|
240
|
+
*/var loadAll=/*#__PURE__*/function(){var _loadAll=_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee9(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,_t21,_t22,_t23,_t24;return _regenerator().w(function(_context9){while(1)switch(_context9.p=_context9.n){case 0:plugins={};/*
|
|
254
241
|
Load main plugin configuration at first.
|
|
255
242
|
|
|
256
243
|
NOTE: If application's main is this itself avoid loading it twice.
|
|
257
|
-
*/if(!(configuration.name!=="web-node")){
|
|
244
|
+
*/if(!(configuration.name!=="web-node")){_context9.n=2;break}_context9.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]=_context9.v;case 2:_i5=0,_Object$values=Object.values(configuration.core.plugin.directories);case 3:if(!(_i5<_Object$values.length)){_context9.n=14;break}directory=_Object$values[_i5];_context9.n=4;return (0,clientnode__WEBPACK_IMPORTED_MODULE_2__.isDirectory)(directory.path);case 4:if(!_context9.v){_context9.n=13;break}compiledRegularExpression=new RegExp(directory.nameRegularExpressionPattern);_iterator1=_createForOfIteratorHelper((0,fs__WEBPACK_IMPORTED_MODULE_3__.readdirSync)(directory.path));_context9.p=5;_iterator1.s();case 6:if((_step1=_iterator1.n()).done){_context9.n=10;break}pluginName=_step1.value;if(compiledRegularExpression.test(pluginName)){_context9.n=7;break}return _context9.a(3,9);case 7:currentPluginPath=(0,path__WEBPACK_IMPORTED_MODULE_4__.resolve)(directory.path,pluginName);internalName=determineInternalName(pluginName,compiledRegularExpression);_context9.n=8;return load(pluginName,internalName,plugins,configuration.core.plugin.configuration,currentPluginPath,configuration.core.encoding);case 8:plugins[pluginName]=_context9.v;case 9:_context9.n=6;break;case 10:_context9.n=12;break;case 11:_context9.p=11;_t21=_context9.v;_iterator1.e(_t21);case 12:_context9.p=12;_iterator1.f();return _context9.f(12);case 13:_i5++;_context9.n=3;break;case 14: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));_context9.p=15;_iterator11.s();case 16:if((_step11=_iterator11.n()).done){_context9.n=20;break}_pluginName=_step11.value;_i7=0,_Object$entries4=Object.entries(plugins);case 17:if(!(_i7<_Object$entries4.length)){_context9.n=19;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)){_context9.n=18;break}sortedPlugins.push(_plugin);return _context9.a(3,19);case 18:_i7++;_context9.n=17;break;case 19:_context9.n=16;break;case 20:_context9.n=22;break;case 21:_context9.p=21;_t22=_context9.v;_iterator11.e(_t22);case 22:_context9.p=22;_iterator11.f();return _context9.f(22);case 23:_context9.n=24;return loadConfigurations(sortedPlugins,configuration);case 24:_t23=_context9.v;_t24=sortedPlugins;return _context9.a(2,{configuration:_t23,plugins:_t24})}},_callee9,null,[[15,21,22,23],[5,11,12,13]])}));function loadAll(_x25){return _loadAll.apply(this,arguments)}return loadAll}();/**
|
|
258
245
|
* Transform a list of absolute paths respecting the application context.
|
|
259
246
|
* @param configuration - Configuration object.
|
|
260
247
|
* @param configuration.core - Sub configuration web-node.
|
|
@@ -270,7 +257,7 @@ if(reference&&reference in currentRequire.cache)delete currentRequire.cache[refe
|
|
|
270
257
|
* @param locations - Locations to search in.
|
|
271
258
|
* @returns A boolean indicating whether given file path is in provided
|
|
272
259
|
* locations.
|
|
273
|
-
*/var isInLocations=function isInLocations(configuration,plugins,filePath,locations){var pluginPaths=plugins.map(function(plugin){return plugin.path});var
|
|
260
|
+
*/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_4__.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_4__.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);
|
|
274
261
|
__webpack_async_result__();
|
|
275
262
|
} catch(e) { __webpack_async_result__(e); } }, 1);
|
|
276
263
|
|
|
@@ -282,7 +269,7 @@ const x = (y) => {
|
|
|
282
269
|
const x = {}; __webpack_require__.d(x, y); return x
|
|
283
270
|
}
|
|
284
271
|
const y = (x) => (() => (x))
|
|
285
|
-
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), ["
|
|
272
|
+
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) });
|
|
286
273
|
|
|
287
274
|
/***/ }),
|
|
288
275
|
/* 2 */
|
|
@@ -290,9 +277,8 @@ module.exports = x({ ["CLOSE_EVENT_NAMES"]: () => (__WEBPACK_EXTERNAL_MODULE_cli
|
|
|
290
277
|
|
|
291
278
|
__webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
|
292
279
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
293
|
-
/* harmony export */
|
|
294
|
-
/* harmony export */
|
|
295
|
-
/* harmony export */ lE: () => (/* binding */ currentRequire)
|
|
280
|
+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__),
|
|
281
|
+
/* harmony export */ H: () => (/* binding */ configuration)
|
|
296
282
|
/* harmony export */ });
|
|
297
283
|
/* harmony import */ var clientnode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1);
|
|
298
284
|
/* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
|
|
@@ -317,7 +303,7 @@ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_async_dependencies_result
|
|
|
317
303
|
endregion
|
|
318
304
|
*/// region imports
|
|
319
305
|
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
|
|
320
|
-
|
|
306
|
+
/*
|
|
321
307
|
To assume to go two folder up from this file until there is no
|
|
322
308
|
"node_modules" parent folder is usually resilient again dealing with
|
|
323
309
|
projects where current working directory isn't the projects directory and
|
|
@@ -330,7 +316,7 @@ var currentRequire=await (0,clientnode__WEBPACK_IMPORTED_MODULE_0__.getCurrentRe
|
|
|
330
316
|
linked "node_modules" folder using current working directory as context
|
|
331
317
|
is a better assumption than two folders up the hierarchy.
|
|
332
318
|
*/try{if((0,fs__WEBPACK_IMPORTED_MODULE_1__.lstatSync)((0,path__WEBPACK_IMPORTED_MODULE_2__.join)(process.cwd(),"node_modules")).isSymbolicLink())_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path=process.cwd()}catch(_unused){// Ignore error.
|
|
333
|
-
}var mainPackageConfiguration={name:"main"};try{mainPackageConfiguration=
|
|
319
|
+
}var mainPackageConfiguration={name:"main"};try{mainPackageConfiguration=(await import(/* webpackIgnore: true */(0,path__WEBPACK_IMPORTED_MODULE_2__.join)(_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.context.path,"package"),{with:{type:"json"}})).default}catch(_unused2){_package_json__WEBPACK_IMPORTED_MODULE_3__.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
|
|
334
320
|
_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode.core.name=_package_json__WEBPACK_IMPORTED_MODULE_3__.webDocumentation.name||_package_json__WEBPACK_IMPORTED_MODULE_3__.name;var now=new Date;var scope=_objectSpread(_objectSpread({},clientnode__WEBPACK_IMPORTED_MODULE_0__.UTILITY_SCOPE),{},{currentPath:process.cwd(),fs:fs__WEBPACK_IMPORTED_MODULE_1__["default"],path:path__WEBPACK_IMPORTED_MODULE_2__["default"],pluginAPI:_pluginAPI_js__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Ay,webNodePath:__webpack_dirname__,now:now,nowUTCTimestamp:(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.getUTCTimestamp)(now)});var configuration=(0,clientnode__WEBPACK_IMPORTED_MODULE_0__.evaluateDynamicData)(_package_json__WEBPACK_IMPORTED_MODULE_3__.webNode,{scope:scope});delete _package_json__WEBPACK_IMPORTED_MODULE_3__.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,/*
|
|
335
321
|
NOTE: "object.modifyObject" removes modifications in "result"
|
|
336
322
|
in-place before it is used as extending source.
|
|
@@ -367,7 +353,7 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|
|
367
353
|
/* harmony export */ Ad: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.Ad),
|
|
368
354
|
/* harmony export */ GH: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.GH),
|
|
369
355
|
/* harmony export */ Gy: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.Gy),
|
|
370
|
-
/* harmony export */ HF: () => (/* reexport safe */ _configurator_js__WEBPACK_IMPORTED_MODULE_0__.
|
|
356
|
+
/* harmony export */ HF: () => (/* reexport safe */ _configurator_js__WEBPACK_IMPORTED_MODULE_0__.H),
|
|
371
357
|
/* harmony export */ Hh: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.Hh),
|
|
372
358
|
/* harmony export */ MM: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.MM),
|
|
373
359
|
/* harmony export */ Rm: () => (/* binding */ log),
|
|
@@ -378,7 +364,6 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|
|
378
364
|
/* harmony export */ gl: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.gl),
|
|
379
365
|
/* harmony export */ i9: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.i9),
|
|
380
366
|
/* harmony export */ iW: () => (/* binding */ main),
|
|
381
|
-
/* harmony export */ lE: () => (/* reexport safe */ _configurator_js__WEBPACK_IMPORTED_MODULE_0__.lE),
|
|
382
367
|
/* harmony export */ lT: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.lT),
|
|
383
368
|
/* harmony export */ m7: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.m7),
|
|
384
369
|
/* harmony export */ nQ: () => (/* reexport safe */ _pluginAPI_js__WEBPACK_IMPORTED_MODULE_1__.nQ),
|
|
@@ -408,7 +393,7 @@ var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_con
|
|
|
408
393
|
endregion
|
|
409
394
|
*/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
|
|
410
395
|
;// endregion
|
|
411
|
-
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"] */ .
|
|
396
|
+
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
|
|
412
397
|
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
|
|
413
398
|
// region register close handler
|
|
414
399
|
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;/*
|
|
@@ -434,7 +419,7 @@ __webpack_async_result__();
|
|
|
434
419
|
/* 6 */
|
|
435
420
|
/***/ ((module) => {
|
|
436
421
|
|
|
437
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.
|
|
422
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"web-node","version":"1.0.586","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","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.2.0","@types/webpack-env":"^1.18.8","@typescript-eslint/eslint-plugin":"^8.67.0","@typescript-eslint/parser":"^8.67.0","clientnode":"^4.0.1488","eslint":"^10.9.0","eslint-config-google":"^0.14.0","eslint-plugin-jsdoc":"^64.2.1","jest":"^30.4.2","jsdoc":"^4.0.5","shx":"^0.4.0","typescript-eslint":"^8.67.0","web-documentation":"^1.0.49","weboptimizer":"^4.0.57"},"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 -*-\\nif(import.meta.main)module.paths.unshift(\'/application/node_modules\');{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.14.1+sha512.64df448055b2d37ba269d7db535a469b8da93f8ef1140c25fd7a83c00a8fbaacb214ca0e02553b92a2c54cef78bb67d0b4817fab02001df0e24fac0faccc3b42"}');
|
|
438
423
|
|
|
439
424
|
/***/ }),
|
|
440
425
|
/* 7 */
|
|
@@ -630,7 +615,6 @@ module.exports = x({ ["pathToFileURL"]: () => (__WEBPACK_EXTERNAL_MODULE_node_ur
|
|
|
630
615
|
/******/ const __webpack_exports__callStack = __webpack_exports__.lT;
|
|
631
616
|
/******/ const __webpack_exports__callStackSynchronous = __webpack_exports__.gl;
|
|
632
617
|
/******/ const __webpack_exports__configuration = __webpack_exports__.HF;
|
|
633
|
-
/******/ const __webpack_exports__currentRequire = __webpack_exports__.lE;
|
|
634
618
|
/******/ const __webpack_exports__default = __webpack_exports__.Ay;
|
|
635
619
|
/******/ const __webpack_exports__determineInternalName = __webpack_exports__.Gy;
|
|
636
620
|
/******/ const __webpack_exports__determineLocations = __webpack_exports__.m7;
|
|
@@ -648,5 +632,5 @@ module.exports = x({ ["pathToFileURL"]: () => (__WEBPACK_EXTERNAL_MODULE_node_ur
|
|
|
648
632
|
/******/ const __webpack_exports__log = __webpack_exports__.Rm;
|
|
649
633
|
/******/ const __webpack_exports__main = __webpack_exports__.iW;
|
|
650
634
|
/******/ const __webpack_exports__pluginAPI = __webpack_exports__.MM;
|
|
651
|
-
/******/ export { __webpack_exports__callStack as callStack, __webpack_exports__callStackSynchronous as callStackSynchronous, __webpack_exports__configuration as configuration,
|
|
635
|
+
/******/ export { __webpack_exports__callStack as callStack, __webpack_exports__callStackSynchronous as callStackSynchronous, __webpack_exports__configuration as configuration, __webpack_exports__default as default, __webpack_exports__determineInternalName as determineInternalName, __webpack_exports__determineLocations as determineLocations, __webpack_exports__evaluateConfiguration as evaluateConfiguration, __webpack_exports__hotReloadAPIFile as hotReloadAPIFile, __webpack_exports__hotReloadConfigurationFile as hotReloadConfigurationFile, __webpack_exports__hotReloadFiles as hotReloadFiles, __webpack_exports__isInLocations as isInLocations, __webpack_exports__load as load, __webpack_exports__loadAPI as loadAPI, __webpack_exports__loadAll as loadAll, __webpack_exports__loadConfiguration as loadConfiguration, __webpack_exports__loadConfigurations as loadConfigurations, __webpack_exports__loadFile as loadFile, __webpack_exports__log as log, __webpack_exports__main as main, __webpack_exports__pluginAPI as pluginAPI };
|
|
652
636
|
/******/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "web-node",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.586",
|
|
4
4
|
"description": "High level javaScript backend plugin system and configuration merger.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"api",
|
|
@@ -16,10 +16,16 @@
|
|
|
16
16
|
},
|
|
17
17
|
"license": "CC-BY-3.0",
|
|
18
18
|
"author": {
|
|
19
|
-
"name": "Torben Sickert",
|
|
20
19
|
"email": "info@torben.website",
|
|
20
|
+
"name": "Torben Sickert",
|
|
21
21
|
"url": "https://torben.website"
|
|
22
22
|
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/thaibault/web-node.git"
|
|
26
|
+
},
|
|
27
|
+
"type": "module",
|
|
28
|
+
"bin": "index.js",
|
|
23
29
|
"files": [
|
|
24
30
|
"configurator.d.ts",
|
|
25
31
|
"index.d.ts",
|
|
@@ -29,12 +35,7 @@
|
|
|
29
35
|
"unixCrypt.d.ts",
|
|
30
36
|
"unixCrypt.js"
|
|
31
37
|
],
|
|
32
|
-
"
|
|
33
|
-
"type": "module",
|
|
34
|
-
"repository": {
|
|
35
|
-
"type": "git",
|
|
36
|
-
"url": "https://github.com/thaibault/web-node.git"
|
|
37
|
-
},
|
|
38
|
+
"sideEffects": true,
|
|
38
39
|
"scripts": {
|
|
39
40
|
"build": "yarn build:types; yarn build:plain",
|
|
40
41
|
"build:plain": "weboptimizer build",
|
|
@@ -45,9 +46,9 @@
|
|
|
45
46
|
"document": "weboptimizer document",
|
|
46
47
|
"lint": "weboptimizer lint",
|
|
47
48
|
"prepare": "yarn build",
|
|
49
|
+
"prepare:test": "yarn clear && cd dummyPlugin && shx touch yarn.lock && yarn build && cd ..",
|
|
48
50
|
"serve": "yarn build:plain && yarn start",
|
|
49
51
|
"start": "./index.js '{plugin: {hotReloading: true}}'",
|
|
50
|
-
"prepare:test": "yarn clear && cd dummyPlugin && shx touch yarn.lock && yarn build && cd ..",
|
|
51
52
|
"test": "yarn prepare:test && weboptimizer test",
|
|
52
53
|
"test:coverage": "yarn prepare:test && weboptimizer test:coverage",
|
|
53
54
|
"test:coverage:report": "yarn prepare:test && weboptimizer test:coverage:report",
|
|
@@ -57,45 +58,37 @@
|
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@babel/cli": "^8.0.4",
|
|
59
60
|
"@babel/eslint-parser": "^8.0.1",
|
|
60
|
-
"@babel/runtime": "^8.0.0",
|
|
61
61
|
"@eslint/js": "^10.0.1",
|
|
62
62
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
63
|
-
"@types/node": "^26.
|
|
63
|
+
"@types/node": "^26.2.0",
|
|
64
64
|
"@types/webpack-env": "^1.18.8",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
66
|
-
"@typescript-eslint/parser": "^8.
|
|
67
|
-
"clientnode": "^4.0.
|
|
68
|
-
"eslint": "^10.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^8.67.0",
|
|
66
|
+
"@typescript-eslint/parser": "^8.67.0",
|
|
67
|
+
"clientnode": "^4.0.1488",
|
|
68
|
+
"eslint": "^10.9.0",
|
|
69
69
|
"eslint-config-google": "^0.14.0",
|
|
70
|
-
"eslint-plugin-jsdoc": "^
|
|
70
|
+
"eslint-plugin-jsdoc": "^64.2.1",
|
|
71
71
|
"jest": "^30.4.2",
|
|
72
72
|
"jsdoc": "^4.0.5",
|
|
73
73
|
"shx": "^0.4.0",
|
|
74
|
-
"typescript-eslint": "^8.
|
|
75
|
-
"web-documentation": "^1.0.
|
|
76
|
-
"weboptimizer": "^4.0.
|
|
74
|
+
"typescript-eslint": "^8.67.0",
|
|
75
|
+
"web-documentation": "^1.0.49",
|
|
76
|
+
"weboptimizer": "^4.0.57"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
|
-
"@babel/runtime": "*",
|
|
80
79
|
"clientnode": "*"
|
|
81
80
|
},
|
|
82
|
-
"peerDependenciesMeta": {
|
|
83
|
-
"@babel/runtime": {
|
|
84
|
-
"optional": true
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"engines": {
|
|
88
|
-
"node": ">=24",
|
|
89
|
-
"npm": ">=11",
|
|
90
|
-
"yarn": ">=4"
|
|
91
|
-
},
|
|
92
81
|
"resolutions": {
|
|
93
82
|
"colors": "1.4.0",
|
|
94
|
-
"globals@npm:^14.0.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
|
|
95
83
|
"globals@npm:^11.1.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
|
|
84
|
+
"globals@npm:^14.0.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch",
|
|
96
85
|
"globals@npm:^9.18.0": "patch:globals@npm%3A11.12.0#~/.yarn/patches/globals-npm-11.12.0-1fa7f41a6c.patch"
|
|
97
86
|
},
|
|
98
|
-
"
|
|
87
|
+
"engines": {
|
|
88
|
+
"node": ">=26",
|
|
89
|
+
"npm": ">=12",
|
|
90
|
+
"yarn": ">=4"
|
|
91
|
+
},
|
|
99
92
|
"webDocumentation": {
|
|
100
93
|
"trackingCode": "UA-40192634-9"
|
|
101
94
|
},
|
package/pluginAPI.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const evaluateConfiguration: <Type extends Mapping<unknown> = Con
|
|
|
39
39
|
* @param plugins - List of plugins to search for updates in.
|
|
40
40
|
* @returns A list with plugins which have a changed api scope.
|
|
41
41
|
*/
|
|
42
|
-
export declare const hotReloadAPIFile: (plugins: Array<Plugin>) => Array<Plugin
|
|
42
|
+
export declare const hotReloadAPIFile: (plugins: Array<Plugin>) => Promise<Array<Plugin>>;
|
|
43
43
|
/**
|
|
44
44
|
* Checks for changed plugin configurations in given plugins and reloads them
|
|
45
45
|
* if necessary (new timestamp).
|
|
@@ -48,7 +48,7 @@ export declare const hotReloadAPIFile: (plugins: Array<Plugin>) => Array<Plugin>
|
|
|
48
48
|
* entry in plugin configuration file.
|
|
49
49
|
* @returns A list with plugins which have a changed configurations.
|
|
50
50
|
*/
|
|
51
|
-
export declare const hotReloadConfigurationFile: (plugins: Array<Plugin>, configurationPropertyNames: Array<string>) => Array<Plugin
|
|
51
|
+
export declare const hotReloadConfigurationFile: (plugins: Array<Plugin>, configurationPropertyNames: Array<string>) => Promise<Array<Plugin>>;
|
|
52
52
|
/**
|
|
53
53
|
* Checks for changed plugin file type in given plugins and reloads them if
|
|
54
54
|
* necessary (timestamp has changed).
|
|
@@ -58,7 +58,7 @@ export declare const hotReloadConfigurationFile: (plugins: Array<Plugin>, config
|
|
|
58
58
|
* @param plugins - List of plugins to search for updates in.
|
|
59
59
|
* @returns A list with plugin changes.
|
|
60
60
|
*/
|
|
61
|
-
export declare const hotReloadFiles: (type: "api" | "configuration", target: "packageConfiguration" | "scope", plugins: Array<Plugin>) => Array<PluginChange
|
|
61
|
+
export declare const hotReloadFiles: (type: "api" | "configuration", target: "packageConfiguration" | "scope", plugins: Array<Plugin>) => Promise<Array<PluginChange>>;
|
|
62
62
|
/**
|
|
63
63
|
* Extends given configuration object with given plugin specific ones and
|
|
64
64
|
* returns a plugin specific meta information object.
|
|
@@ -113,7 +113,7 @@ export declare const loadConfigurations: (plugins: Array<Plugin>, configuration:
|
|
|
113
113
|
* @param doLogging - Enables logging.
|
|
114
114
|
* @returns Exported api file scope.
|
|
115
115
|
*/
|
|
116
|
-
export declare const loadFile: (filePath: string, name: string, fallbackScope?: null | object, doLogging?: boolean) => object
|
|
116
|
+
export declare const loadFile: (filePath: string, name: string, fallbackScope?: null | object, doLogging?: boolean) => Promise<object>;
|
|
117
117
|
/**
|
|
118
118
|
* Extends given configuration object with all plugin specific ones and returns
|
|
119
119
|
* a topological sorted list of plugins with plugins specific meta information
|
|
@@ -151,9 +151,9 @@ export declare const pluginAPI: {
|
|
|
151
151
|
readonly determineInternalName: (name: string, regularExpression: RegExp) => string;
|
|
152
152
|
readonly determineLocations: ({ core: { context: { path: contextPath } } }: Configuration, locations?: Array<string> | string) => Array<string>;
|
|
153
153
|
readonly evaluateConfiguration: <Type extends Mapping<unknown> = Configuration>(configuration: RecursiveEvaluateable<Type> | Type) => Promise<Type>;
|
|
154
|
-
readonly hotReloadAPIFile: (plugins: Array<Plugin>) => Array<Plugin
|
|
155
|
-
readonly hotReloadConfigurationFile: (plugins: Array<Plugin>, configurationPropertyNames: Array<string>) => Array<Plugin
|
|
156
|
-
readonly hotReloadFiles: (type: "api" | "configuration", target: "packageConfiguration" | "scope", plugins: Array<Plugin>) => Array<PluginChange
|
|
154
|
+
readonly hotReloadAPIFile: (plugins: Array<Plugin>) => Promise<Array<Plugin>>;
|
|
155
|
+
readonly hotReloadConfigurationFile: (plugins: Array<Plugin>, configurationPropertyNames: Array<string>) => Promise<Array<Plugin>>;
|
|
156
|
+
readonly hotReloadFiles: (type: "api" | "configuration", target: "packageConfiguration" | "scope", plugins: Array<Plugin>) => Promise<Array<PluginChange>>;
|
|
157
157
|
readonly isInLocations: (configuration: Configuration, plugins: Array<Plugin>, filePath: string, locations: Array<string> | string) => boolean;
|
|
158
158
|
readonly load: (name: string, internalName: string, plugins: Mapping<Plugin>, metaConfiguration: MetaPluginConfiguration, pluginPath: string, encoding?: Encoding) => Promise<Plugin>;
|
|
159
159
|
readonly loadAll: (configuration: Configuration) => Promise<{
|
|
@@ -163,6 +163,6 @@ export declare const pluginAPI: {
|
|
|
163
163
|
readonly loadAPI: (relativeFilePaths: Array<string>, pluginPath: string, name: string, internalName: string, plugins: Mapping<Plugin>, encoding?: Encoding, configuration?: EvaluateablePartialConfiguration | null, configurationFilePaths?: Array<string>) => Promise<Plugin>;
|
|
164
164
|
readonly loadConfiguration: (name: string, packageConfiguration: PackageConfiguration, configurationPropertyNames: Array<string>) => EvaluateablePartialConfiguration;
|
|
165
165
|
readonly loadConfigurations: (plugins: Array<Plugin>, configuration: Configuration) => Promise<Configuration>;
|
|
166
|
-
readonly loadFile: (filePath: string, name: string, fallbackScope?: null | object, doLogging?: boolean) => object
|
|
166
|
+
readonly loadFile: (filePath: string, name: string, fallbackScope?: null | object, doLogging?: boolean) => Promise<object>;
|
|
167
167
|
};
|
|
168
168
|
export default pluginAPI;
|