meocord 1.0.0-alpha.21 → 1.0.0-alpha.22

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.
@@ -15,13 +15,11 @@
15
15
  *
16
16
  * You should have received a copy of the GNU General Public License
17
17
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18
- */"use strict";var _generator=require("./generator"),path=_interopRequireWildcard(require("node:path")),_webpack=_interopRequireDefault(require("webpack")),_common=require("../common"),_nodeChild_process=require("node:child_process"),_lodash=require("lodash"),_wait=_interopRequireDefault(require("../util/wait.util")),fs=_interopRequireWildcard(require("node:fs")),_common2=require("../util/common.util"),_commander=require("commander"),_cliTable=_interopRequireDefault(require("cli-table3")),_meocordConfigLoader=require("../util/meocord-config-loader.util");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(a){return a?c:b})(a)}function _interopRequireWildcard(b,c){if(!c&&b&&b.__esModule)return b;if(null===b||"object"!=_typeof(b)&&"function"!=typeof b)return{default:b};var d=_getRequireWildcardCache(c);if(d&&d.has(b))return d.get(b);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in b)if("default"!=a&&{}.hasOwnProperty.call(b,a)){var g=f?Object.getOwnPropertyDescriptor(b,a):null;g&&(g.get||g.set)?Object.defineProperty(e,a,g):e[a]=b[a]}return e["default"]=b,d&&d.set(b,e),e}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function define(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function wrap(b,d,e,f){var g=d&&d.prototype instanceof Generator?d:Generator,i=Object.create(g.prototype),a=new Context(f||[]);return h(i,"_invoke",{value:makeInvokeMethod(b,e,a)}),i}function tryCatch(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(a){["next","throw","return"].forEach(function(b){define(a,b,function(a){return this._invoke(b,a)})})}function AsyncIterator(b,d){function invoke(e,f,g,i){var a=tryCatch(b[e],b,f);if("throw"!==a.type){var c=a.arg,k=c.value;return k&&"object"==_typeof(k)&&j.call(k,"__await")?d.resolve(k.__await).then(function(a){invoke("next",a,g,i)},function(a){invoke("throw",a,g,i)}):d.resolve(k).then(function(a){c.value=a,g(c)},function(a){return invoke("throw",a,g,i)})}i(a.arg)}var a;h(this,"_invoke",{value:function value(b,c){function callInvokeWithMethodAndArg(){return new d(function(a,d){invoke(b,c,a,d)})}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(a,d,e){var f="suspendedStart";return function(g,h){if(f==="executing")throw Error("Generator is already running");if("completed"===f){if("throw"===g)throw h;return{value:b,done:!0}}for(e.method=g,e.arg=h;;){var i=e.delegate;if(i){var j=maybeInvokeDelegate(i,e);if(j){if(j===m)continue;return j}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===f)throw f="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);f="executing";var k=tryCatch(a,d,e);if("normal"===k.type){if(f=e.done?"completed":"suspendedYield",k.arg===m)continue;return{value:k.arg,done:e.done}}"throw"===k.type&&(f="completed",e.method="throw",e.arg=k.arg)}}}function maybeInvokeDelegate(c,d){var e=d.method,f=c.iterator[e];if(f===b)return d.delegate=null,"throw"===e&&c.iterator["return"]&&(d.method="return",d.arg=b,maybeInvokeDelegate(c,d),"throw"===d.method)||"return"!==e&&(d.method="throw",d.arg=new TypeError("The iterator does not provide a '"+e+"' method")),m;var g=tryCatch(f,c.iterator,d.arg);if("throw"===g.type)return d.method="throw",d.arg=g.arg,d.delegate=null,m;var h=g.arg;return h?h.done?(d[c.resultName]=h.value,d.next=c.nextLoc,"return"!==d.method&&(d.method="next",d.arg=b),d.delegate=null,m):h:(d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,m)}function pushTryEntry(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function resetTryEntry(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function Context(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(pushTryEntry,this),this.reset(!0)}function values(a){if(a||""===a){var c=a[l];if(c)return c.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var d=-1,e=function next(){for(;++d<a.length;)if(j.call(a,d))return next.value=a[d],next.done=!1,next;return next.value=b,next.done=!0,next};return e.next=e}}throw new TypeError(_typeof(a)+" is not iterable")}_regeneratorRuntime=function _regeneratorRuntime(){return f};var b,f={},e=Object.prototype,j=e.hasOwnProperty,h=Object.defineProperty||function(a,b,c){a[b]=c.value},k="function"==typeof Symbol?Symbol:{},l=k.iterator||"@@iterator",a=k.asyncIterator||"@@asyncIterator",c=k.toStringTag||"@@toStringTag";try{define({},"")}catch(a){define=function define(a,b,c){return a[b]=c}}f.wrap=wrap;var m={},i={};define(i,l,function(){return this});var n=Object.getPrototypeOf,d=n&&n(n(values([])));d&&d!==e&&j.call(d,l)&&(i=d);var o=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(i);return GeneratorFunction.prototype=GeneratorFunctionPrototype,h(o,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),h(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,c,"GeneratorFunction"),f.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===GeneratorFunction||"GeneratorFunction"===(b.displayName||b.name))},f.mark=function(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,GeneratorFunctionPrototype):(a.__proto__=GeneratorFunctionPrototype,define(a,c,"GeneratorFunction")),a.prototype=Object.create(o),a},f.awrap=function(a){return{__await:a}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,function(){return this}),f.AsyncIterator=AsyncIterator,f.async=function(b,c,d,e,g){void 0===g&&(g=Promise);var h=new AsyncIterator(wrap(b,c,d,e),g);return f.isGeneratorFunction(c)?h:h.next().then(function(a){return a.done?a.value:h.next()})},defineIteratorMethods(o),define(o,c,"Generator"),define(o,l,function(){return this}),define(o,"toString",function(){return"[object Generator]"}),f.keys=function(a){var b=Object(a),c=[];for(var d in b)c.push(d);return c.reverse(),function next(){for(;c.length;){var a=c.pop();if(a in b)return next.value=a,next.done=!1,next}return next.done=!0,next}},f.values=values,Context.prototype={constructor:Context,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=b,this.done=!1,this.delegate=null,this.method="next",this.arg=b,this.tryEntries.forEach(resetTryEntry),!a)for(var c in this)"t"===c.charAt(0)&&j.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=b)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(d){function handle(a,c){return h.type="throw",h.arg=d,e.next=a,c&&(e.method="next",e.arg=b),!!c}if(this.done)throw d;for(var e=this,f=this.tryEntries.length-1;0<=f;--f){var g=this.tryEntries[f],h=g.completion;if("root"===g.tryLoc)return handle("end");if(g.tryLoc<=this.prev){var k=j.call(g,"catchLoc"),l=j.call(g,"finallyLoc");if(k&&l){if(this.prev<g.catchLoc)return handle(g.catchLoc,!0);if(this.prev<g.finallyLoc)return handle(g.finallyLoc)}else if(!k){if(!l)throw Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return handle(g.finallyLoc)}else if(this.prev<g.catchLoc)return handle(g.catchLoc,!0)}}},abrupt:function abrupt(b,c){for(var d,e=this.tryEntries.length-1;0<=e;--e)if(d=this.tryEntries[e],d.tryLoc<=this.prev&&j.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var f=d;break}f&&("break"===b||"continue"===b)&&f.tryLoc<=c&&c<=f.finallyLoc&&(f=null);var g=f?f.completion:{};return g.type=b,g.arg=c,f?(this.method="next",this.next=f.finallyLoc,m):this.complete(g)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),m},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),resetTryEntry(b),m},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var f=d.arg;resetTryEntry(b)}return f}throw Error("illegal catch attempt")},delegateYield:function delegateYield(a,c,d){return this.delegate={iterator:values(a),resultName:c,nextLoc:d},"next"===this.method&&(this.arg=b),m}},f}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function _next(a){asyncGeneratorStep(g,e,f,_next,_throw,"next",a)}function _throw(a){asyncGeneratorStep(g,e,f,_next,_throw,"throw",a)}var g=b.apply(c,d);_next(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
18
+ */"use strict";var _generator=require("./generator"),path=_interopRequireWildcard(require("node:path")),_webpack=_interopRequireDefault(require("webpack")),_common=require("../common"),_nodeChild_process=require("node:child_process"),_lodash=require("lodash"),_wait=_interopRequireDefault(require("../util/wait.util")),fs=_interopRequireWildcard(require("node:fs")),_common2=require("../util/common.util"),_commander=require("commander"),_cliTable=_interopRequireDefault(require("cli-table3")),_meocordConfigLoader=require("../util/meocord-config-loader.util");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _getRequireWildcardCache(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(a){return a?c:b})(a)}function _interopRequireWildcard(b,c){if(!c&&b&&b.__esModule)return b;if(null===b||"object"!=_typeof(b)&&"function"!=typeof b)return{default:b};var d=_getRequireWildcardCache(c);if(d&&d.has(b))return d.get(b);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in b)if("default"!=a&&{}.hasOwnProperty.call(b,a)){var g=f?Object.getOwnPropertyDescriptor(b,a):null;g&&(g.get||g.set)?Object.defineProperty(e,a,g):e[a]=b[a]}return e["default"]=b,d&&d.set(b,e),e}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function define(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function wrap(b,d,e,f){var g=d&&d.prototype instanceof Generator?d:Generator,i=Object.create(g.prototype),a=new Context(f||[]);return h(i,"_invoke",{value:makeInvokeMethod(b,e,a)}),i}function tryCatch(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(a){["next","throw","return"].forEach(function(b){define(a,b,function(a){return this._invoke(b,a)})})}function AsyncIterator(b,d){function invoke(e,f,g,i){var a=tryCatch(b[e],b,f);if("throw"!==a.type){var c=a.arg,k=c.value;return k&&"object"==_typeof(k)&&j.call(k,"__await")?d.resolve(k.__await).then(function(a){invoke("next",a,g,i)},function(a){invoke("throw",a,g,i)}):d.resolve(k).then(function(a){c.value=a,g(c)},function(a){return invoke("throw",a,g,i)})}i(a.arg)}var a;h(this,"_invoke",{value:function value(b,c){function callInvokeWithMethodAndArg(){return new d(function(a,d){invoke(b,c,a,d)})}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(a,d,e){var f="suspendedStart";return function(g,h){if(f==="executing")throw Error("Generator is already running");if("completed"===f){if("throw"===g)throw h;return{value:b,done:!0}}for(e.method=g,e.arg=h;;){var i=e.delegate;if(i){var j=maybeInvokeDelegate(i,e);if(j){if(j===m)continue;return j}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===f)throw f="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);f="executing";var k=tryCatch(a,d,e);if("normal"===k.type){if(f=e.done?"completed":"suspendedYield",k.arg===m)continue;return{value:k.arg,done:e.done}}"throw"===k.type&&(f="completed",e.method="throw",e.arg=k.arg)}}}function maybeInvokeDelegate(c,d){var e=d.method,f=c.iterator[e];if(f===b)return d.delegate=null,"throw"===e&&c.iterator["return"]&&(d.method="return",d.arg=b,maybeInvokeDelegate(c,d),"throw"===d.method)||"return"!==e&&(d.method="throw",d.arg=new TypeError("The iterator does not provide a '"+e+"' method")),m;var g=tryCatch(f,c.iterator,d.arg);if("throw"===g.type)return d.method="throw",d.arg=g.arg,d.delegate=null,m;var h=g.arg;return h?h.done?(d[c.resultName]=h.value,d.next=c.nextLoc,"return"!==d.method&&(d.method="next",d.arg=b),d.delegate=null,m):h:(d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,m)}function pushTryEntry(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function resetTryEntry(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function Context(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(pushTryEntry,this),this.reset(!0)}function values(a){if(a||""===a){var c=a[l];if(c)return c.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var d=-1,e=function next(){for(;++d<a.length;)if(j.call(a,d))return next.value=a[d],next.done=!1,next;return next.value=b,next.done=!0,next};return e.next=e}}throw new TypeError(_typeof(a)+" is not iterable")}_regeneratorRuntime=function _regeneratorRuntime(){return f};var b,f={},e=Object.prototype,j=e.hasOwnProperty,h=Object.defineProperty||function(a,b,c){a[b]=c.value},k="function"==typeof Symbol?Symbol:{},l=k.iterator||"@@iterator",a=k.asyncIterator||"@@asyncIterator",c=k.toStringTag||"@@toStringTag";try{define({},"")}catch(a){define=function define(a,b,c){return a[b]=c}}f.wrap=wrap;var m={},i={};define(i,l,function(){return this});var n=Object.getPrototypeOf,d=n&&n(n(values([])));d&&d!==e&&j.call(d,l)&&(i=d);var o=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(i);return GeneratorFunction.prototype=GeneratorFunctionPrototype,h(o,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),h(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,c,"GeneratorFunction"),f.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===GeneratorFunction||"GeneratorFunction"===(b.displayName||b.name))},f.mark=function(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,GeneratorFunctionPrototype):(a.__proto__=GeneratorFunctionPrototype,define(a,c,"GeneratorFunction")),a.prototype=Object.create(o),a},f.awrap=function(a){return{__await:a}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,function(){return this}),f.AsyncIterator=AsyncIterator,f.async=function(b,c,d,e,g){void 0===g&&(g=Promise);var h=new AsyncIterator(wrap(b,c,d,e),g);return f.isGeneratorFunction(c)?h:h.next().then(function(a){return a.done?a.value:h.next()})},defineIteratorMethods(o),define(o,c,"Generator"),define(o,l,function(){return this}),define(o,"toString",function(){return"[object Generator]"}),f.keys=function(a){var b=Object(a),c=[];for(var d in b)c.push(d);return c.reverse(),function next(){for(;c.length;){var a=c.pop();if(a in b)return next.value=a,next.done=!1,next}return next.done=!0,next}},f.values=values,Context.prototype={constructor:Context,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=b,this.done=!1,this.delegate=null,this.method="next",this.arg=b,this.tryEntries.forEach(resetTryEntry),!a)for(var c in this)"t"===c.charAt(0)&&j.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=b)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(d){function handle(a,c){return h.type="throw",h.arg=d,e.next=a,c&&(e.method="next",e.arg=b),!!c}if(this.done)throw d;for(var e=this,f=this.tryEntries.length-1;0<=f;--f){var g=this.tryEntries[f],h=g.completion;if("root"===g.tryLoc)return handle("end");if(g.tryLoc<=this.prev){var k=j.call(g,"catchLoc"),l=j.call(g,"finallyLoc");if(k&&l){if(this.prev<g.catchLoc)return handle(g.catchLoc,!0);if(this.prev<g.finallyLoc)return handle(g.finallyLoc)}else if(!k){if(!l)throw Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return handle(g.finallyLoc)}else if(this.prev<g.catchLoc)return handle(g.catchLoc,!0)}}},abrupt:function abrupt(b,c){for(var d,e=this.tryEntries.length-1;0<=e;--e)if(d=this.tryEntries[e],d.tryLoc<=this.prev&&j.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var f=d;break}f&&("break"===b||"continue"===b)&&f.tryLoc<=c&&c<=f.finallyLoc&&(f=null);var g=f?f.completion:{};return g.type=b,g.arg=c,f?(this.method="next",this.next=f.finallyLoc,m):this.complete(g)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),m},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),resetTryEntry(b),m},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var f=d.arg;resetTryEntry(b)}return f}throw Error("illegal catch attempt")},delegateYield:function delegateYield(a,c,d){return this.delegate={iterator:values(a),resultName:c,nextLoc:d},"next"===this.method&&(this.arg=b),m}},f}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function _next(a){asyncGeneratorStep(g,e,f,_next,_throw,"next",a)}function _throw(a){asyncGeneratorStep(g,e,f,_next,_throw,"throw",a)}var g=b.apply(c,d);_next(void 0)})}}function _classCallCheck(b,a){if(!(b instanceof a))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,_toPropertyKey(c.key),c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),Object.defineProperty(a,"prototype",{writable:!1}),a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}/**
19
19
  * A Command Line Interface (CLI) for managing the MeoCord application.
20
- */var MeoCordCLI=/*#__PURE__*/function(){/**
21
- * Initializes the MeoCordCLI instance.
22
- */function MeoCordCLI(){_classCallCheck(this,MeoCordCLI),this.appName="MeoCord",this.projectRoot=process.cwd(),this.mainJSPath=path.join(this.projectRoot,"dist","main.js"),this.webpackConfigPath=path.resolve(__dirname,"..","..","webpack.config.js"),this.logger=new _common.Logger(this.appName),this.generatorCLI=new _generator.GeneratorCLI(this.appName)}/**
20
+ */var MeoCordCLI=/*#__PURE__*/function(){function MeoCordCLI(){_classCallCheck(this,MeoCordCLI),_defineProperty(this,"appName","MeoCord"),_defineProperty(this,"logger",new _common.Logger(this.appName)),_defineProperty(this,"projectRoot",process.cwd()),_defineProperty(this,"mainJSPath",path.join(this.projectRoot,"dist","main.js")),_defineProperty(this,"webpackConfigPath",path.resolve(__dirname,"..","..","webpack.config.js")),_defineProperty(this,"generatorCLI",new _generator.GeneratorCLI(this.appName))}return _createClass(MeoCordCLI,[{key:"run",value:(/**
23
21
  * Configures and runs the MeoCord CLI.
24
- */return _createClass(MeoCordCLI,[{key:"run",value:(function(){function run(){return a.apply(this,arguments)}var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var a,b=this;return _regeneratorRuntime().wrap(function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.ensureReady();case 2:a=new _commander.Command,a.name(this.appName.toLowerCase()).description("CLI for managing the ".concat(this.appName," application")).version("1.0.0"),a.command("show").description("Display information").option("-w, --warranty","Display warranty disclaimer").option("-c, --license","Display licensing conditions and usage rights").action(function(b){if(!b.warranty&&!b.license){var c;null===(c=a.commands.find(function(a){return"show"===a.name()}))||void 0===c||c.outputHelp(),process.exit(1)}b.warranty&&console.log("\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\nThe authors of this software are not responsible for damages caused\nby the usage, misuse, or inability to use the software.\n\nSee the GNU General Public License for full details:\n<https://www.gnu.org/licenses/>.\n "),b.license&&console.log("\nThis program is free software: you can redistribute it and/or\nmodify it under the terms of the GNU General Public License as\npublished by the Free Software Foundation, either version 3 of\nthe License, or (at your option) any later version.\n\nKey conditions of the GNU GPL v3:\n- You can use this software for personal, academic, or commercial purposes.\n- If you distribute modified versions, you must share the source code under the same GPL v3 license.\n- The original copyright must be retained.\n\nFor full license details, refer to:\n<https://www.gnu.org/licenses/gpl-3.0.txt>\n ")}),a.command("build").description("Build the application").option("-d, --dev","Build in development mode").option("-p, --prod","Build in production mode").action(/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(a){var c,d,e;return _regeneratorRuntime().wrap(function _callee$(f){for(;1;)switch(f.prev=f.next){case 0:if(c=a.prod?"production":"development",process.env.NODE_ENV||(process.env.NODE_ENV=c),d=path.resolve(process.cwd(),"meocord.config.ts"),fs.existsSync(d)){f.next=8;break}return b.logger.error("Configuration file \"meocord.config.ts\" is missing!"),f.next=7,(0,_wait["default"])(100);case 7:process.exit(1);case 8:if((0,_meocordConfigLoader.compileMeoCordConfig)(),e=(0,_meocordConfigLoader.loadMeoCordConfig)(),null!==e&&void 0!==e&&e.discordToken){f.next=15;break}return b.logger.error("Discord token is missing!"),f.next=14,(0,_wait["default"])(100);case 14:process.exit(1);case 15:return f.next=17,b.build(c);case 17:case"end":return f.stop()}},_callee)}));return function(b){return a.apply(this,arguments)}}()),a.command("start").description("Start the application").option("-b, --build","Pre-build before starting").option("-d, --dev","Start in development mode").option("-p, --prod","Start in production mode").action(/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(a){var c,d,e;return _regeneratorRuntime().wrap(function _callee2$(f){for(;1;)switch(f.prev=f.next){case 0:if(c=a.prod?"production":"development",process.env.NODE_ENV||(process.env.NODE_ENV=c),!(a.build||a.dev)){f.next=16;break}if(d=path.resolve(process.cwd(),"meocord.config.ts"),fs.existsSync(d)){f.next=9;break}return b.logger.error("Configuration file \"meocord.config.ts\" is missing!"),f.next=8,(0,_wait["default"])(100);case 8:process.exit(1);case 9:if((0,_meocordConfigLoader.compileMeoCordConfig)(),e=(0,_meocordConfigLoader.loadMeoCordConfig)(),null!==e&&void 0!==e&&e.discordToken){f.next=16;break}return b.logger.error("Discord token is missing!"),f.next=15,(0,_wait["default"])(100);case 15:process.exit(1);case 16:if(!a.build){f.next=19;break}return f.next=19,b.build(c);case 19:if(!a.prod){f.next=24;break}return f.next=22,b.startProd();case 22:f.next=26;break;case 24:return f.next=26,b.startDev();case 26:case"end":return f.stop()}},_callee2)}));return function(b){return a.apply(this,arguments)}}()),a=this.generatorCLI.register(a),this.configureCommandHelp(a),a.showHelpAfterError().parse(process.argv);case 10:case"end":return c.stop()}},_callee3,this)}));return run}()/**
22
+ */function(){function run(){return a.apply(this,arguments)}var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var a,b=this;return _regeneratorRuntime().wrap(function _callee3$(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.ensureReady();case 2:a=new _commander.Command,a.name(this.appName.toLowerCase()).description("CLI for managing the ".concat(this.appName," application")).version("1.0.0"),a.command("show").description("Display information").option("-w, --warranty","Display warranty disclaimer").option("-c, --license","Display licensing conditions and usage rights").action(function(b){if(!b.warranty&&!b.license){var c;null===(c=a.commands.find(function(a){return"show"===a.name()}))||void 0===c||c.outputHelp(),process.exit(1)}b.warranty&&console.log("\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\nThe authors of this software are not responsible for damages caused\nby the usage, misuse, or inability to use the software.\n\nSee the GNU General Public License for full details:\n<https://www.gnu.org/licenses/>.\n "),b.license&&console.log("\nThis program is free software: you can redistribute it and/or\nmodify it under the terms of the GNU General Public License as\npublished by the Free Software Foundation, either version 3 of\nthe License, or (at your option) any later version.\n\nKey conditions of the GNU GPL v3:\n- You can use this software for personal, academic, or commercial purposes.\n- If you distribute modified versions, you must share the source code under the same GPL v3 license.\n- The original copyright must be retained.\n\nFor full license details, refer to:\n<https://www.gnu.org/licenses/gpl-3.0.txt>\n ")}),a.command("build").description("Build the application").option("-d, --dev","Build in development mode").option("-p, --prod","Build in production mode").action(/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(a){var c;return _regeneratorRuntime().wrap(function _callee$(d){for(;1;)switch(d.prev=d.next){case 0:return c=a.prod?"production":"development",(0,_common2.setEnvironment)(c),d.next=4,(0,_common2.compileAndValidateConfig)();case 4:return d.next=6,b.build(c);case 6:case"end":return d.stop()}},_callee)}));return function(b){return a.apply(this,arguments)}}()),a.command("start").description("Start the application").option("-b, --build","Pre-build before starting").option("-d, --dev","Start in development mode").option("-p, --prod","Start in production mode").action(/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(a){var c;return _regeneratorRuntime().wrap(function _callee2$(d){for(;1;)switch(d.prev=d.next){case 0:if(c=a.prod?"production":"development",(0,_common2.setEnvironment)(c),!(a.build||a.dev)){d.next=5;break}return d.next=5,(0,_common2.compileAndValidateConfig)();case 5:if(!a.build){d.next=8;break}return d.next=8,b.build(c);case 8:if(!a.prod){d.next=13;break}return d.next=11,b.startProd();case 11:d.next=15;break;case 13:return d.next=15,b.startDev();case 15:case"end":return d.stop()}},_callee2)}));return function(b){return a.apply(this,arguments)}}()),a=this.generatorCLI.register(a),this.configureCommandHelp(a),a.showHelpAfterError().parse(process.argv);case 10:case"end":return c.stop()}},_callee3,this)}));return run}()/**
25
23
  * Builds the MeoCord application in the specified mode.
26
24
  *
27
25
  * @param mode - The build mode ('production' or 'development').
@@ -46,7 +44,7 @@
46
44
  * @param helper - The helper object for formatting.
47
45
  * @param options - The options available for the command.
48
46
  * @returns The formatted help text.
49
- */},{key:"formatHelp",value:function formatHelp(a,b,c){var d="MeoCord Copyright (C) 2025 Ukasyah Rahmatullah Zada\n This program comes with ABSOLUTELY NO WARRANTY; for details type `meocord show -w'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `meocord show -c' for details.\n\n";return d+="".concat(b.commandUsage(a),"\n\n"),d+="".concat(b.commandDescription(a),"\n\n"),0<a.registeredArguments.length&&(d+="Available Arguments:\n",d+=this.generateArgumentsTable(a.registeredArguments),d+="\n\n"),0<c.length&&(d+="Available Options:\n",d+=this.generateOptionsTable(c,b),d+="\n\n"),0<a.commands.length&&(d+="Available Commands:\n",d+=this.generateCommandsTable(a),d+="\n"),d}/**
47
+ */},{key:"formatHelp",value:function formatHelp(a,b,c){var d="MeoCord Copyright (C) 2025 Ukasyah Rahmatullah Zada\n This program comes with ABSOLUTELY NO WARRANTY; for details type `meocord show -w'.\n This is free software, and you are welcome to redistribute it\n under certain conditions; type `meocord show -c' for details.\n\n";return d+="".concat(b.commandUsage(a),"\n\n"),d+="".concat(b.commandDescription(a),"\n\n"),0<a.registeredArguments.length&&(d+=this.generateArgumentsTable(a.registeredArguments),d+="\n\n"),0<c.length&&(d+="Available Options:\n",d+=this.generateOptionsTable(c,b),d+="\n\n"),0<a.commands.length&&(d+="Available Commands:\n",d+=this.generateCommandsTable(a),d+="\n"),d}/**
50
48
  * Generates a table of commands with their aliases and descriptions.
51
49
  *
52
50
  * @param cmd - The command for which to generate the table.
@@ -58,9 +56,13 @@
58
56
  * @param helper
59
57
  * @returns The formatted table of commands.
60
58
  */},{key:"generateOptionsTable",value:function generateOptionsTable(a,b){var c=new _cliTable["default"]({head:["Option","Description"]});return a.forEach(function(a){return c.push([b.optionTerm(a),b.optionDescription(a)])}),c.toString()}/**
61
- * Generates a table of arguments for a command.
59
+ * Generates a formatted table of arguments for the specified command.
62
60
  *
63
- * @param args - The arguments for the command.
64
- * @returns The formatted table of arguments.
65
- */},{key:"generateArgumentsTable",value:function generateArgumentsTable(a){var b=new _cliTable["default"]({head:["Argument","Description"]});return a.forEach(function(a){return b.push([a.name(),a.description||"No description provided"])}),b.toString()}}])}(),cli=new MeoCordCLI;// Create an instance of the CLI and run it
66
- cli.run();
61
+ * This method creates two tables:
62
+ * 1. A table displaying argument names and their descriptions.
63
+ * 2. (If applicable) A table showing available choices for arguments with predefined choices.
64
+ *
65
+ * @param args - The list of arguments for the command.
66
+ * @returns A string representation of the formatted tables, including available arguments and their choices.
67
+ */},{key:"generateArgumentsTable",value:function generateArgumentsTable(a){var b=new _cliTable["default"]({head:["Argument","Description"]}),c=new _cliTable["default"]({head:["Choice"]}),d=!1;a.forEach(function(a){a.argChoices&&(d=!0,a.argChoices.map(function(a){c.push([a])})),b.push([a.name(),a.description||"No description provided"])});var e="";return d?(e+="Available Choices:\n",e+=c.toString(),e+="\n\n"):e+="No available choices.\n\n",e+="Available Arguments:\n",e+=b.toString(),e}}])}(),cli=new MeoCordCLI;// Create an instance of the CLI and run it
68
+ cli.run()["catch"](/*#__PURE__*/function(){var a=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee11(a){return _regeneratorRuntime().wrap(function _callee11$(b){for(;1;)switch(b.prev=b.next){case 0:return cli.logger.error("Failed to initialize CLI:",(null===a||void 0===a?void 0:a.message)||a),b.next=3,(0,_wait["default"])(100);case 3:process.exit(1);case 4:case"end":return b.stop()}},_callee11)}));return function(b){return a.apply(this,arguments)}}());
@@ -5,3 +5,19 @@
5
5
  * @returns {string} - The directory path where the module's package.json is located
6
6
  */
7
7
  export declare const findModulePackageDir: (moduleName: string, baseDir?: string) => string | null;
8
+ /**
9
+ * Compiles and validates the MeoCord configuration file.
10
+ * Ensures that `meocord.config.ts` exists, compiles it, and checks
11
+ * the presence of essential configuration properties like `discordToken`.
12
+ *
13
+ * @throws Will exit the process if the `meocord.config.ts` file is missing or
14
+ * if the `discordToken` property is not found in the configuration.
15
+ */
16
+ export declare function compileAndValidateConfig(): Promise<void>;
17
+ /**
18
+ * Sets the environment mode for the application.
19
+ * Assigns the provided mode to `process.env.NODE_ENV` if it hasn't been set already.
20
+ *
21
+ * @param {'production' | 'development'} mode - The desired environment mode.
22
+ */
23
+ export declare function setEnvironment(mode: 'production' | 'development'): void;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findModulePackageDir=void 0;var _fs=_interopRequireDefault(require("fs")),_path=_interopRequireDefault(require("path")),_common=require("../common");function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}/*
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.compileAndValidateConfig=compileAndValidateConfig,exports.findModulePackageDir=void 0,exports.setEnvironment=setEnvironment;var _fs=_interopRequireDefault(require("fs")),_path=_interopRequireDefault(require("path")),_common=require("../common"),_meocordConfigLoader=require("./meocord-config-loader.util"),_wait=_interopRequireDefault(require("./wait.util"));function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _regeneratorRuntime(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */function define(a,b,c){return Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}),a[b]}function wrap(b,d,e,f){var g=d&&d.prototype instanceof Generator?d:Generator,i=Object.create(g.prototype),a=new Context(f||[]);return h(i,"_invoke",{value:makeInvokeMethod(b,e,a)}),i}function tryCatch(a,b,c){try{return{type:"normal",arg:a.call(b,c)}}catch(a){return{type:"throw",arg:a}}}function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}function defineIteratorMethods(a){["next","throw","return"].forEach(function(b){define(a,b,function(a){return this._invoke(b,a)})})}function AsyncIterator(b,d){function invoke(e,f,g,i){var a=tryCatch(b[e],b,f);if("throw"!==a.type){var c=a.arg,k=c.value;return k&&"object"==_typeof(k)&&j.call(k,"__await")?d.resolve(k.__await).then(function(a){invoke("next",a,g,i)},function(a){invoke("throw",a,g,i)}):d.resolve(k).then(function(a){c.value=a,g(c)},function(a){return invoke("throw",a,g,i)})}i(a.arg)}var a;h(this,"_invoke",{value:function value(b,c){function callInvokeWithMethodAndArg(){return new d(function(a,d){invoke(b,c,a,d)})}return a=a?a.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}})}function makeInvokeMethod(a,d,e){var f="suspendedStart";return function(g,h){if(f==="executing")throw Error("Generator is already running");if("completed"===f){if("throw"===g)throw h;return{value:b,done:!0}}for(e.method=g,e.arg=h;;){var i=e.delegate;if(i){var j=maybeInvokeDelegate(i,e);if(j){if(j===m)continue;return j}}if("next"===e.method)e.sent=e._sent=e.arg;else if("throw"===e.method){if("suspendedStart"===f)throw f="completed",e.arg;e.dispatchException(e.arg)}else"return"===e.method&&e.abrupt("return",e.arg);f="executing";var k=tryCatch(a,d,e);if("normal"===k.type){if(f=e.done?"completed":"suspendedYield",k.arg===m)continue;return{value:k.arg,done:e.done}}"throw"===k.type&&(f="completed",e.method="throw",e.arg=k.arg)}}}function maybeInvokeDelegate(c,d){var e=d.method,f=c.iterator[e];if(f===b)return d.delegate=null,"throw"===e&&c.iterator["return"]&&(d.method="return",d.arg=b,maybeInvokeDelegate(c,d),"throw"===d.method)||"return"!==e&&(d.method="throw",d.arg=new TypeError("The iterator does not provide a '"+e+"' method")),m;var g=tryCatch(f,c.iterator,d.arg);if("throw"===g.type)return d.method="throw",d.arg=g.arg,d.delegate=null,m;var h=g.arg;return h?h.done?(d[c.resultName]=h.value,d.next=c.nextLoc,"return"!==d.method&&(d.method="next",d.arg=b),d.delegate=null,m):h:(d.method="throw",d.arg=new TypeError("iterator result is not an object"),d.delegate=null,m)}function pushTryEntry(a){var b={tryLoc:a[0]};1 in a&&(b.catchLoc=a[1]),2 in a&&(b.finallyLoc=a[2],b.afterLoc=a[3]),this.tryEntries.push(b)}function resetTryEntry(a){var b=a.completion||{};b.type="normal",delete b.arg,a.completion=b}function Context(a){this.tryEntries=[{tryLoc:"root"}],a.forEach(pushTryEntry,this),this.reset(!0)}function values(a){if(a||""===a){var c=a[l];if(c)return c.call(a);if("function"==typeof a.next)return a;if(!isNaN(a.length)){var d=-1,e=function next(){for(;++d<a.length;)if(j.call(a,d))return next.value=a[d],next.done=!1,next;return next.value=b,next.done=!0,next};return e.next=e}}throw new TypeError(_typeof(a)+" is not iterable")}_regeneratorRuntime=function _regeneratorRuntime(){return f};var b,f={},e=Object.prototype,j=e.hasOwnProperty,h=Object.defineProperty||function(a,b,c){a[b]=c.value},k="function"==typeof Symbol?Symbol:{},l=k.iterator||"@@iterator",a=k.asyncIterator||"@@asyncIterator",c=k.toStringTag||"@@toStringTag";try{define({},"")}catch(a){define=function define(a,b,c){return a[b]=c}}f.wrap=wrap;var m={},i={};define(i,l,function(){return this});var n=Object.getPrototypeOf,d=n&&n(n(values([])));d&&d!==e&&j.call(d,l)&&(i=d);var o=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(i);return GeneratorFunction.prototype=GeneratorFunctionPrototype,h(o,"constructor",{value:GeneratorFunctionPrototype,configurable:!0}),h(GeneratorFunctionPrototype,"constructor",{value:GeneratorFunction,configurable:!0}),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,c,"GeneratorFunction"),f.isGeneratorFunction=function(a){var b="function"==typeof a&&a.constructor;return!!b&&(b===GeneratorFunction||"GeneratorFunction"===(b.displayName||b.name))},f.mark=function(a){return Object.setPrototypeOf?Object.setPrototypeOf(a,GeneratorFunctionPrototype):(a.__proto__=GeneratorFunctionPrototype,define(a,c,"GeneratorFunction")),a.prototype=Object.create(o),a},f.awrap=function(a){return{__await:a}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,a,function(){return this}),f.AsyncIterator=AsyncIterator,f.async=function(b,c,d,e,g){void 0===g&&(g=Promise);var h=new AsyncIterator(wrap(b,c,d,e),g);return f.isGeneratorFunction(c)?h:h.next().then(function(a){return a.done?a.value:h.next()})},defineIteratorMethods(o),define(o,c,"Generator"),define(o,l,function(){return this}),define(o,"toString",function(){return"[object Generator]"}),f.keys=function(a){var b=Object(a),c=[];for(var d in b)c.push(d);return c.reverse(),function next(){for(;c.length;){var a=c.pop();if(a in b)return next.value=a,next.done=!1,next}return next.done=!0,next}},f.values=values,Context.prototype={constructor:Context,reset:function reset(a){if(this.prev=0,this.next=0,this.sent=this._sent=b,this.done=!1,this.delegate=null,this.method="next",this.arg=b,this.tryEntries.forEach(resetTryEntry),!a)for(var c in this)"t"===c.charAt(0)&&j.call(this,c)&&!isNaN(+c.slice(1))&&(this[c]=b)},stop:function stop(){this.done=!0;var a=this.tryEntries[0].completion;if("throw"===a.type)throw a.arg;return this.rval},dispatchException:function dispatchException(d){function handle(a,c){return h.type="throw",h.arg=d,e.next=a,c&&(e.method="next",e.arg=b),!!c}if(this.done)throw d;for(var e=this,f=this.tryEntries.length-1;0<=f;--f){var g=this.tryEntries[f],h=g.completion;if("root"===g.tryLoc)return handle("end");if(g.tryLoc<=this.prev){var k=j.call(g,"catchLoc"),l=j.call(g,"finallyLoc");if(k&&l){if(this.prev<g.catchLoc)return handle(g.catchLoc,!0);if(this.prev<g.finallyLoc)return handle(g.finallyLoc)}else if(!k){if(!l)throw Error("try statement without catch or finally");if(this.prev<g.finallyLoc)return handle(g.finallyLoc)}else if(this.prev<g.catchLoc)return handle(g.catchLoc,!0)}}},abrupt:function abrupt(b,c){for(var d,e=this.tryEntries.length-1;0<=e;--e)if(d=this.tryEntries[e],d.tryLoc<=this.prev&&j.call(d,"finallyLoc")&&this.prev<d.finallyLoc){var f=d;break}f&&("break"===b||"continue"===b)&&f.tryLoc<=c&&c<=f.finallyLoc&&(f=null);var g=f?f.completion:{};return g.type=b,g.arg=c,f?(this.method="next",this.next=f.finallyLoc,m):this.complete(g)},complete:function complete(a,b){if("throw"===a.type)throw a.arg;return"break"===a.type||"continue"===a.type?this.next=a.arg:"return"===a.type?(this.rval=this.arg=a.arg,this.method="return",this.next="end"):"normal"===a.type&&b&&(this.next=b),m},finish:function finish(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.finallyLoc===a)return this.complete(b.completion,b.afterLoc),resetTryEntry(b),m},catch:function _catch(a){for(var b,c=this.tryEntries.length-1;0<=c;--c)if(b=this.tryEntries[c],b.tryLoc===a){var d=b.completion;if("throw"===d.type){var f=d.arg;resetTryEntry(b)}return f}throw Error("illegal catch attempt")},delegateYield:function delegateYield(a,c,d){return this.delegate={iterator:values(a),resultName:c,nextLoc:d},"next"===this.method&&(this.arg=b),m}},f}function asyncGeneratorStep(b,d,f,e,g,h,a){try{var c=b[h](a),i=c.value}catch(a){return void f(a)}c.done?d(i):Promise.resolve(i).then(e,g)}function _asyncToGenerator(b){return function(){var c=this,d=arguments;return new Promise(function(e,f){function _next(a){asyncGeneratorStep(g,e,f,_next,_throw,"next",a)}function _throw(a){asyncGeneratorStep(g,e,f,_next,_throw,"throw",a)}var g=b.apply(c,d);_next(void 0)})}}/*
2
2
  * MeoCord Framework
3
3
  * Copyright (C) 2025 Ukasyah Rahmatullah Zada
4
4
  *
@@ -23,4 +23,16 @@
23
23
  // Traverse the node_modules directories upwards until the package is found
24
24
  for(var d=b;d!==_path["default"].parse(d).root;){var e=_path["default"].join(d,"node_modules",a);if(_fs["default"].existsSync(e))return e;// Return the full path to the module directory
25
25
  // Move up one level in the directory structure
26
- d=_path["default"].join(d,"..")}throw new Error("Module ".concat(a," not found in node_modules."))}catch(b){return b instanceof Error?c.error("Error finding package directory for ".concat(a,":"),b.message):c.error("Error finding package directory for ".concat(a,":"),b),null}};
26
+ d=_path["default"].join(d,"..")}throw new Error("Module ".concat(a," not found in node_modules."))}catch(b){return b instanceof Error?c.error("Error finding package directory for ".concat(a,":"),b.message):c.error("Error finding package directory for ".concat(a,":"),b),null}};/**
27
+ * Compiles and validates the MeoCord configuration file.
28
+ * Ensures that `meocord.config.ts` exists, compiles it, and checks
29
+ * the presence of essential configuration properties like `discordToken`.
30
+ *
31
+ * @throws Will exit the process if the `meocord.config.ts` file is missing or
32
+ * if the `discordToken` property is not found in the configuration.
33
+ */function compileAndValidateConfig(){return _compileAndValidateConfig.apply(this,arguments)}/**
34
+ * Sets the environment mode for the application.
35
+ * Assigns the provided mode to `process.env.NODE_ENV` if it hasn't been set already.
36
+ *
37
+ * @param {'production' | 'development'} mode - The desired environment mode.
38
+ */function _compileAndValidateConfig(){return _compileAndValidateConfig=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var a,b,c;return _regeneratorRuntime().wrap(function _callee$(d){for(;1;)switch(d.prev=d.next){case 0:if(a=new _common.Logger("MeoCord"),b=_path["default"].resolve(process.cwd(),"meocord.config.ts"),_fs["default"].existsSync(b)){d.next=7;break}return a.error("Configuration file \"meocord.config.ts\" is missing!"),d.next=6,(0,_wait["default"])(100);case 6:process.exit(1);case 7:if((0,_meocordConfigLoader.compileMeoCordConfig)(),c=(0,_meocordConfigLoader.loadMeoCordConfig)(),null!==c&&void 0!==c&&c.discordToken){d.next=14;break}return a.error("Discord token is missing!"),d.next=13,(0,_wait["default"])(100);case 13:process.exit(1);case 14:case"end":return d.stop()}},_callee)})),_compileAndValidateConfig.apply(this,arguments)}function setEnvironment(a){process.env.NODE_ENV||(process.env.NODE_ENV=a)}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "meocord",
3
3
  "description": "MeoCord is a lightweight and modular framework for building scalable Discord bots using TypeScript and Discord.js. It simplifies bot development with an extensible architecture, TypeScript-first approach, and powerful CLI tools.",
4
- "version": "1.0.0-alpha.21",
4
+ "version": "1.0.0-alpha.22",
5
5
  "packageManager": "yarn@4.6.0",
6
6
  "type": "commonjs",
7
7
  "scripts": {