@cyberskill/shared 1.124.0 → 1.126.0
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/dist/_tsup-dts-rollup.d.cts +2 -8
- package/dist/_tsup-dts-rollup.d.ts +2 -8
- package/dist/configs/config.util.cjs +1 -1
- package/dist/configs/config.util.js +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/nodejs/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/nodejs/apollo-server/apollo-server.util.js +1 -1
- package/dist/nodejs/apollo-server/index.cjs +1 -1
- package/dist/nodejs/apollo-server/index.js +1 -1
- package/dist/nodejs/cli/cli.util.cjs +1 -1
- package/dist/nodejs/cli/cli.util.js +1 -1
- package/dist/nodejs/cli/index.cjs +1 -1
- package/dist/nodejs/cli/index.js +1 -1
- package/dist/nodejs/command/command.util.cjs +1 -1
- package/dist/nodejs/command/command.util.js +1 -1
- package/dist/nodejs/command/index.cjs +1 -1
- package/dist/nodejs/command/index.js +1 -1
- package/dist/nodejs/express/express.type.d.cts +0 -1
- package/dist/nodejs/express/express.type.d.ts +0 -1
- package/dist/nodejs/express/express.util.cjs +1 -1
- package/dist/nodejs/express/express.util.js +1 -1
- package/dist/nodejs/express/index.cjs +1 -1
- package/dist/nodejs/express/index.d.cts +0 -1
- package/dist/nodejs/express/index.d.ts +0 -1
- package/dist/nodejs/express/index.js +1 -1
- package/dist/nodejs/fs/fs.util.cjs +1 -1
- package/dist/nodejs/fs/fs.util.js +1 -1
- package/dist/nodejs/fs/index.cjs +1 -1
- package/dist/nodejs/fs/index.js +1 -1
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.d.cts +0 -1
- package/dist/nodejs/index.d.ts +0 -1
- package/dist/nodejs/index.js +1 -1
- package/dist/nodejs/mongo/index.cjs +1 -1
- package/dist/nodejs/mongo/index.js +1 -1
- package/dist/nodejs/mongo/mongo.util.cjs +1 -1
- package/dist/nodejs/mongo/mongo.util.js +1 -1
- package/dist/nodejs/package/index.cjs +1 -1
- package/dist/nodejs/package/index.js +1 -1
- package/dist/nodejs/package/package.util.cjs +1 -1
- package/dist/nodejs/package/package.util.js +1 -1
- package/dist/nodejs/path/index.cjs +1 -1
- package/dist/nodejs/path/index.js +1 -1
- package/dist/nodejs/path/path.constant.cjs +1 -1
- package/dist/nodejs/path/path.constant.js +1 -1
- package/dist/nodejs/path/path.util.cjs +1 -1
- package/dist/nodejs/path/path.util.js +1 -1
- package/dist/nodejs/storage/index.cjs +1 -1
- package/dist/nodejs/storage/index.js +1 -1
- package/dist/nodejs/storage/storage.util.cjs +1 -1
- package/dist/nodejs/storage/storage.util.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/next-intl/index.cjs +1 -1
- package/dist/react/next-intl/index.js +1 -1
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.js +1 -1
- package/dist/react/storage/index.cjs +1 -1
- package/dist/react/storage/index.js +1 -1
- package/dist/react/storage/storage.hook.cjs +1 -1
- package/dist/react/storage/storage.hook.js +1 -1
- package/dist/react/storage/storage.util.cjs +1 -1
- package/dist/react/storage/storage.util.js +1 -1
- package/dist/react/vitest/index.cjs +1 -1
- package/dist/react/vitest/index.js +1 -1
- package/dist/react/vitest/vitest.unit.cjs +1 -1
- package/dist/react/vitest/vitest.unit.js +1 -1
- package/package.json +8 -5
- package/public/tsconfig.base.json +1 -2
- package/dist/typescript/global.d.cjs +0 -1
- package/dist/typescript/global.d.d.cts +0 -1
- package/dist/typescript/global.d.d.ts +0 -1
- package/dist/typescript/global.d.js +0 -0
- /package/dist/{nodejs/express/express.d.cjs → typescript/style.d.cjs} +0 -0
- /package/dist/{nodejs/express/express.d.d.cts → typescript/style.d.d.cts} +0 -0
- /package/dist/{nodejs/express/express.d.d.ts → typescript/style.d.d.ts} +0 -0
- /package/dist/{nodejs/express/express.d.js → typescript/style.d.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r){if(Array.isArray(r))return e(r)}function t(e,r,t,n,o,a,l){try{var u=e[a](l);var i=u.value}catch(e){t(e);return}if(u.done){r(i)}else{Promise.resolve(i).then(n,o)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,a){var l=e.apply(r,n);function u(e){t(l,o,a,u,i,"next",e)}function i(e){t(l,o,a,u,i,"throw",e)}u(undefined)})}}function o(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l(){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 u(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){o(e,r,t[r])})}return e}function i(e){return r(e)||a(e)||f(e)||l()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function s(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},l=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return l.next=u(0),l["throw"]=u(1),l["return"]=u(2),typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(e){return function(r){return i([e,r])}}function i(u){if(t)throw new TypeError("Generator is already executing.");while(l&&(l=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var d=Object.create;var v=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=function(e,r){return v(e,"name",{value:r,configurable:!0})};var S=function(e,r){for(var t in r)v(e,t,{get:r[t],enumerable:!0})},m=function(e,r,t,n){var o=true,a=false,l=undefined;if(r&&(typeof r==="undefined"?"undefined":c(r))=="object"||typeof r=="function")try{var u=function(){var o=f.value;!g.call(e,o)&&o!==t&&v(e,o,{get:function(){return r[o]},enumerable:!(n=p(r,o))||n.enumerable})};for(var i=b(r)[Symbol.iterator](),f;!(o=(f=i.next()).done);o=true)u()}catch(e){a=true;l=e}finally{try{if(!o&&i.return!=null){i.return()}}finally{if(a){throw l}}}return e};var w=function(e,r,t){return t=e!=null?d(y(e)):{},m(r||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)},O=function(e){return m(v({},"__esModule",{value:!0}),e)};var E={};S(E,{createApolloServer:function(){return W},expressMiddleware:function(){return
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(r){if(Array.isArray(r))return e(r)}function t(e,r,t,n,o,a,l){try{var u=e[a](l);var i=u.value}catch(e){t(e);return}if(u.done){r(i)}else{Promise.resolve(i).then(n,o)}}function n(e){return function(){var r=this,n=arguments;return new Promise(function(o,a){var l=e.apply(r,n);function u(e){t(l,o,a,u,i,"next",e)}function i(e){t(l,o,a,u,i,"throw",e)}u(undefined)})}}function o(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function l(){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 u(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}n.forEach(function(r){o(e,r,t[r])})}return e}function i(e){return r(e)||a(e)||f(e)||l()}function c(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function f(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(r,t)}function s(e,r){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},l=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return l.next=u(0),l["throw"]=u(1),l["return"]=u(2),typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(e){return function(r){return i([e,r])}}function i(u){if(t)throw new TypeError("Generator is already executing.");while(l&&(l=0,u[0]&&(a=0)),a)try{if(t=1,n&&(o=u[0]&2?n["return"]:u[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;if(n=0,o)u=[u[0]&2,o.value];switch(u[0]){case 0:case 1:o=u;break;case 4:a.label++;return{value:u[1],done:false};case 5:a.label++;n=u[1];u=[0];continue;case 7:u=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){a=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(u[0]===6&&a.label<o[1]){a.label=o[1];o=u;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(u);break}if(o[2])a.ops.pop();a.trys.pop();continue}u=r.call(e,a)}catch(e){u=[6,e];n=0}finally{t=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}}var d=Object.create;var v=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var h=function(e,r){return v(e,"name",{value:r,configurable:!0})};var S=function(e,r){for(var t in r)v(e,t,{get:r[t],enumerable:!0})},m=function(e,r,t,n){var o=true,a=false,l=undefined;if(r&&(typeof r==="undefined"?"undefined":c(r))=="object"||typeof r=="function")try{var u=function(){var o=f.value;!g.call(e,o)&&o!==t&&v(e,o,{get:function(){return r[o]},enumerable:!(n=p(r,o))||n.enumerable})};for(var i=b(r)[Symbol.iterator](),f;!(o=(f=i.next()).done);o=true)u()}catch(e){a=true;l=e}finally{try{if(!o&&i.return!=null){i.return()}}finally{if(a){throw l}}}return e};var w=function(e,r,t){return t=e!=null?d(y(e)):{},m(r||!e||!e.__esModule?v(t,"default",{value:e,enumerable:!0}):t,e)},O=function(e){return m(v({},"__esModule",{value:!0}),e)};var E={};S(E,{createApolloServer:function(){return W},expressMiddleware:function(){return A.expressMiddleware}});module.exports=O(E);var x=require("@apollo/server"),A=require("@apollo/server/express4"),j=require("@apollo/server/plugin/drainHttpServer"),P=require("@apollo/server/plugin/landingPage/default");var D=w(require("chalk"),1),R=w(require("consola"),1),q=require("graphql");var I=".cyberskill-storage";var k=w(require("@dotenvx/dotenvx"),1),C=require("envalid"),L=w(require("os"),1),_=w(require("path"),1),B=w(require("process"),1);var G=!1;function M(){G||(k.default.config(),G=!0)}h(M,"loadEnvFile");function T(){M();var e=(0,C.cleanEnv)(B.default.env,{CWD:(0,C.str)({default:B.default.cwd()}),DEBUG:(0,C.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,C.str)({default:_.default.join(L.default.homedir(),I)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}h(T,"getEnv");var Y=T();Y.DEBUG||(R.default.level=4);function U(e){var r=D.default[e];return typeof r=="function"?r:D.default.green}h(U,"chalkKeyword");var K={silent:R.default.silent,level:R.default.level,fatal:R.default.fatal,error:R.default.error,warn:R.default.warn,log:R.default.log,info:R.default.info,success:R.default.success,ready:R.default.ready,start:R.default.start,box:R.default.box,debug:R.default.debug,trace:R.default.trace,verbose:R.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){R.default.box(D.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,o=e.rule,a=e.message;R.default.log("".concat(D.default.gray("File:")," ").concat(D.default.blue("".concat(r).concat(n?":".concat(n):"")))),o&&R.default.log(" ".concat(U(t)("Rule:")," ").concat(o)),R.default.log(" ".concat(U(t)("Message:")," ").concat(a))}),R.default.box(U(t)("".concat(e," : ").concat(r.length))),R.default.log(D.default.gray("─".repeat(40)))}};function W(e){return new x.ApolloServer(u({schema:e.schema,plugins:[e.isDev?(0,P.ApolloServerPluginLandingPageLocalDefault)():(0,P.ApolloServerPluginLandingPageProductionDefault)(),(0,j.ApolloServerPluginDrainHttpServer)({httpServer:e.server})].concat(i(e.drainServer?[{serverWillStart:function r(){return n(function(){return s(this,function(r){return[2,{drainServer:function r(){return n(function(){var r;return s(this,function(t){(r=e.drainServer)===null||r===void 0?void 0:r.call(e),K.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}h(W,"createApolloServer");0&&(module.exports={createApolloServer:createApolloServer,expressMiddleware:expressMiddleware});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(e){if(Array.isArray(e))return r(e)}function t(r,e,t,n,o,a,i){try{var l=r[a](i);var c=l.value}catch(r){t(r);return}if(l.done){e(c)}else{Promise.resolve(c).then(n,o)}}function n(r){return function(){var e=this,n=arguments;return new Promise(function(o,a){var i=r.apply(e,n);function l(r){t(i,o,a,l,c,"next",r)}function c(r){t(i,o,a,l,c,"throw",r)}l(undefined)})}}function o(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function a(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function i(){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 l(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}n.forEach(function(e){o(r,e,t[e])})}return r}function c(r){return e(r)||a(r)||u(r)||i()}function u(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}function f(r,e){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=l(0),i["throw"]=l(1),i["return"]=l(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(r){return function(e){return c([r,e])}}function c(l){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,l[0]&&(a=0)),a)try{if(t=1,n&&(o=l[0]&2?n["return"]:l[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;if(n=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;n=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=e.call(r,a)}catch(r){l=[6,r];n=0}finally{t=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}var s=Object.defineProperty;var p=function(r,e){return s(r,"name",{value:e,configurable:!0})};import{ApolloServer as v}from"@apollo/server";import{expressMiddleware as d}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as b}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as g,ApolloServerPluginLandingPageProductionDefault as m}from"@apollo/server/plugin/landingPage/default";import y from"chalk";import h from"consola";import{GraphQLError as S}from"graphql";var
|
|
1
|
+
function r(r,e){if(e==null||e>r.length)e=r.length;for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function e(e){if(Array.isArray(e))return r(e)}function t(r,e,t,n,o,a,i){try{var l=r[a](i);var c=l.value}catch(r){t(r);return}if(l.done){e(c)}else{Promise.resolve(c).then(n,o)}}function n(r){return function(){var e=this,n=arguments;return new Promise(function(o,a){var i=r.apply(e,n);function l(r){t(i,o,a,l,c,"next",r)}function c(r){t(i,o,a,l,c,"throw",r)}l(undefined)})}}function o(r,e,t){if(e in r){Object.defineProperty(r,e,{value:t,enumerable:true,configurable:true,writable:true})}else{r[e]=t}return r}function a(r){if(typeof Symbol!=="undefined"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function i(){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 l(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};var n=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(t).filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable}))}n.forEach(function(e){o(r,e,t[e])})}return r}function c(r){return e(r)||a(r)||u(r)||i()}function u(e,t){if(!e)return;if(typeof e==="string")return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return r(e,t)}function f(r,e){var t,n,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return i.next=l(0),i["throw"]=l(1),i["return"]=l(2),typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(r){return function(e){return c([r,e])}}function c(l){if(t)throw new TypeError("Generator is already executing.");while(i&&(i=0,l[0]&&(a=0)),a)try{if(t=1,n&&(o=l[0]&2?n["return"]:l[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;if(n=0,o)l=[l[0]&2,o.value];switch(l[0]){case 0:case 1:o=l;break;case 4:a.label++;return{value:l[1],done:false};case 5:a.label++;n=l[1];l=[0];continue;case 7:l=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){a=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(l[0]===6&&a.label<o[1]){a.label=o[1];o=l;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(l);break}if(o[2])a.ops.pop();a.trys.pop();continue}l=e.call(r,a)}catch(r){l=[6,r];n=0}finally{t=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}}var s=Object.defineProperty;var p=function(r,e){return s(r,"name",{value:e,configurable:!0})};import{ApolloServer as v}from"@apollo/server";import{expressMiddleware as d}from"@apollo/server/express4";import{ApolloServerPluginDrainHttpServer as b}from"@apollo/server/plugin/drainHttpServer";import{ApolloServerPluginLandingPageLocalDefault as g,ApolloServerPluginLandingPageProductionDefault as m}from"@apollo/server/plugin/landingPage/default";import y from"chalk";import h from"consola";import{GraphQLError as S}from"graphql";var w=".cyberskill-storage";import E from"@dotenvx/dotenvx";import{bool as O,cleanEnv as A,str as D}from"envalid";import x from"node:os";import P from"node:path";import R from"node:process";var j=!1;function I(){j||(E.config(),j=!0)}p(I,"loadEnvFile");function L(){I();var r=A(R.env,{CWD:D({default:R.cwd()}),DEBUG:O({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:D({default:P.join(x.homedir(),w)})});return{CWD:r.CWD,DEBUG:r.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:r.CYBERSKILL_STORAGE_DIRECTORY}}p(L,"getEnv");var k=L();k.DEBUG||(h.level=4);function C(r){var e=y[r];return typeof e=="function"?e:y.green}p(C,"chalkKeyword");var G={silent:h.silent,level:h.level,fatal:h.fatal,error:h.error,warn:h.warn,log:h.log,info:h.info,success:h.success,ready:h.ready,start:h.start,box:h.box,debug:h.debug,trace:h.trace,verbose:h.verbose,printBoxedLog:function r(r,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(e===null||e===void 0?void 0:e.length)){h.box(y.green(r));return}e.forEach(function(r){var e=r.file,n=r.position,o=r.rule,a=r.message;h.log("".concat(y.gray("File:")," ").concat(y.blue("".concat(e).concat(n?":".concat(n):"")))),o&&h.log(" ".concat(C(t)("Rule:")," ").concat(o)),h.log(" ".concat(C(t)("Message:")," ").concat(a))}),h.box(C(t)("".concat(r," : ").concat(e.length))),h.log(y.gray("─".repeat(40)))}};function B(r){return new v(l({schema:r.schema,plugins:[r.isDev?g():m(),b({httpServer:r.server})].concat(c(r.drainServer?[{serverWillStart:function e(){return n(function(){return f(this,function(e){return[2,{drainServer:function e(){return n(function(){var e;return f(this,function(t){(e=r.drainServer)===null||e===void 0?void 0:e.call(r),G.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},r.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}p(B,"createApolloServer");export{B as createApolloServer,d as expressMiddleware};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){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 u(){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 l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function f(e){return n(e)||o(e)||g(e)||u()}function p(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var v=Object.create;var y=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty;var b=function(e,t){return y(e,"name",{value:t,configurable:!0})};var E=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":p(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!j.call(e,s)&&s!==n&&y(e,s,{get:function(){return t[s]},enumerable:!(r=h(t,s))||r.enumerable})};for(var c=_(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var I=function(e,t,n){return n=e!=null?v(x(e)):{},E(t||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e)};var w=I(require("process"),1),S=require("yargs/helpers"),O=I(require("yargs/yargs"),1);var R={name:"@cyberskill/shared",type:"module",version:"1.123.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var C=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var k=require("child_process"),P=I(require("process"),1),T=I(require("util"),1);var G=".cyberskill-storage";var N=I(require("@dotenvx/dotenvx"),1),U=require("envalid"),L=I(require("os"),1),q=I(require("path"),1),D=I(require("process"),1);var M=!1;function A(){M||(N.default.config(),M=!0)}b(A,"loadEnvFile");function F(){A();var e=(0,U.cleanEnv)(D.default.env,{CWD:(0,U.str)({default:D.default.cwd()}),DEBUG:(0,U.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,U.str)({default:q.default.join(L.default.homedir(),G)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}b(F,"getEnv");var B=function(e){return e.Error="error",e.Warning="warning",e}({});var K=I(require("chalk"),1),W=I(require("consola"),1),Y=require("graphql");var H=F();H.DEBUG||(W.default.level=4);function J(e){var t=K.default[e];return typeof t=="function"?t:K.default.green}b(J,"chalkKeyword");var $={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){W.default.box(K.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;W.default.log("".concat(K.default.gray("File:")," ").concat(K.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&W.default.log(" ".concat(J(n)("Rule:")," ").concat(s)),W.default.log(" ".concat(J(n)("Message:")," ").concat(i))}),W.default.box(J(n)("".concat(e," : ").concat(t.length))),W.default.log(K.default.gray("─".repeat(40)))}};var V={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var z=I(require("node-fetch"),1);var Q=I(require("fs-extra"),1),X=require("path");var Z=Q.default,ee=Z.lstatSync,et=Z.readdirSync,en=Z.mkdirSync,er=Z.readFileSync,es=Z.unlinkSync,ei=Z.statSync,eo=Q.default.readJsonSync;function ea(e,t,n){Q.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}b(ea,"writeFileSync");function ec(e,t,n){Q.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}b(ec,"appendFileSync");function eu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return Q.default.pathExistsSync(e)})}b(eu,"pathExistsSync");function el(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eu(e)&&Q.default.removeSync(e)})}b(el,"removeSync");var ed=I(require("path"),1);var ef=F();function ep(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,ed.resolve).apply(this,[ef.CWD].concat(f(t)))}b(ep,"resolveWorkingPath");function eg(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,ed.join).apply(this,f(t))}b(eg,"join");var em=F(),ev=em.CWD,ey="@cyberskill/shared",eh="node_modules",e_="dist",ex="package.json",ej="package-lock.json",eb="tsconfig.json",eE=".gitignore",eI=".simple-git-hooks.json",ew="pnpm-lock.yaml",eS=".git/hooks/",eO=".git/COMMIT_EDITMSG",eR=".migrate-mongo.config.js",eC=eg(ev,eh,ey,e_),ek="cyberskill",eP="src/nodejs/cli/index.ts",eT="eslint",eG="eslint",eN="vitest",eU="playwright",eL="vitest",eq="@commitlint/cli",eD="commitlint",eM="lint-staged",eA="lint-staged",eF="typescript",eB="tsc",eK="tsx",eW="git",eY="pnpm",eH="pnpm exec",eJ="simple-git-hooks",e$="simple-git-hooks",eV="@eslint/config-inspector",ez="eslint-config-inspector",eQ="node-modules-inspector",eX="node-modules-inspector",eZ="migrate-mongo",e0="./node_modules/migrate-mongo/bin/migrate-mongo",e1={CYBERSKILL_DIRECTORY:eC,WORKING_DIRECTORY:ev,TS_CONFIG:ep(eb),GIT_IGNORE:ep(eE),GIT_HOOK:ep(eS),GIT_COMMIT_MSG:ep(eO),SIMPLE_GIT_HOOKS_JSON:ep(eI),PACKAGE_JSON:ep(ex),PACKAGE_LOCK_JSON:ep(ej),PNPM_LOCK_YAML:ep(ew),NODE_MODULES:ep(eh),MIGRATE_MONGO_CONFIG:ep(eR),LINT_STAGED_CONFIG:ep("".concat(eC,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:ep("".concat(eC,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:ep("".concat(eC,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ep("".concat(eC,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ep("".concat(eC,"/react/vitest/vitest.e2e.js"))};function e2(e){var t=e.isCurrentProject;return l({"pre-commit":eA,"commit-msg":eD},t&&{"pre-push":tm("".concat(eW," pull"))})}b(e2,"createGitHooksConfig");function e4(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case C.CLI:return[3,1];case C.STRING:return[3,3]}return[3,4];case 1:return[4,tt(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),ty(tm("".concat(eH," ").concat(n))))];case 3:return[2,ty(tm(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}b(e4,"buildCommand");function e3(e,t,n){return function(){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,e4(e,t,n)]})})()}}b(e3,"commandFactory");var e5={simpleGitHooks:e3(C.CLI,eJ,e$),eslintInspect:e3(C.CLI,eV,ez),nodeModulesInspect:e3(C.CLI,eQ,eX),eslintCheck:e3(C.CLI,eT,"".concat(eG," ").concat(e1.WORKING_DIRECTORY," --no-cache")),eslintFix:e3(C.CLI,eT,"".concat(eG," ").concat(e1.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:e3(C.CLI,eF,"".concat(eB," -p ").concat(e1.TS_CONFIG," --noEmit")),configureGitHook:e3(C.STRING,"".concat(eW," config core.hooksPath ").concat(e1.GIT_HOOK)),testUnit:e3(C.CLI,eN,"".concat(eL," --config ").concat(e1.UNIT_TEST_CONFIG)),testE2e:e3(C.CLI,"".concat(eN," ").concat(eU),"".concat(eL," --config ").concat(e1.E2E_TEST_CONFIG)),mongoMigrateCreate:b(function(e){return e3(C.CLI,eZ,"".concat(eK," ").concat(e0," create ").concat(e," -f ").concat(e1.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e3(C.CLI,eZ,"".concat(eK," ").concat(e0," up -f ").concat(e1.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e3(C.CLI,eZ,"".concat(eK," ").concat(e0," down -f ").concat(e1.MIGRATE_MONGO_CONFIG)),commitLint:e3(C.CLI,eq,"".concat(eD," --edit ").concat(e1.GIT_COMMIT_MSG," --config ").concat(e1.COMMITLINT_CONFIG)),lintStaged:e3(C.CLI,eM,"".concat(eA," --config ").concat(e1.LINT_STAGED_CONFIG)),stageBuildDirectory:e3(C.STRING,"".concat(eW," add ").concat(e_)),build:e3(C.STRING,"".concat(eY," run build")),pnpmInstallStandard:e3(C.STRING,"".concat(eY," install")),pnpmInstallLegacy:e3(C.STRING,"".concat(eY," install --legacy-peer-deps")),pnpmInstallForce:e3(C.STRING,"".concat(eY," install --force"))};var e8=F();function e6(e){var t=eg(e8.CWD,ex);if(!eu(t))return!1;try{var n=eo(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return $.warn("Failed to read package.json: ".concat(e.message)),!1}}b(e6,"getPackage");function e7(e){return /*#__PURE__*/s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,z.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw $.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}b(e7,"getLatestPackageVersion");function e9(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,a,c,u,d,f,p,g,v,y,h,_,x,j,b,E,I;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e6(e);if(!n)return[2,l({},V)];c=n.path,u=n.file,d=n.isCurrentProject,f=n.isDepend,p=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":f?(o=g[e])!==null&&o!==void 0?o:"0.0.0":p?(a=v[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];x=y;return[3,3];case 1:return[4,e7(e)];case 2:x=m.sent();m.label=3;case 3:h=x,_=d||y===h;if(!_&&(t===null||t===void 0?void 0:t.update)){;b=f?"dependencies":p?"devDependencies":null;b&&((j=u[b])===null||j===void 0?void 0:j[e])!==h&&(u[b]=(E=u[b])!==null&&E!==void 0?E:{},u[b][e]=h,ea(c,JSON.stringify(u,null,4)),$.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:_}];case 4:I=m.sent();return[2,($.error('Error checking package "'.concat(e,'": ').concat(I.message)),l({},V))];case 5:return[2]}})})()}b(e9,"checkPackage");function te(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return m(this,function(f){switch(f.label){case 0:e=[{command:b(function(){return e5.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:b(function(){return e5.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:b(function(){return e5.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,t_("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();$.warn("Installation attempt failed: ".concat(c)),$.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}b(te,"installDependencies");function tt(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,a,c,u,d,p,g;return m(this,function(m){switch(m.label){case 0:if(!eu(e1.PACKAGE_JSON)){$.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=f(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e9(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,te()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:p=m.sent();o=true;a=p;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw $.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}b(tt,"setupPackages");var tn=I(require("node-persist"),1);var tr=F();function ts(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=tn.default.defaultInstance;if(e)return[3,2];return[4,tn.default.init({dir:tr.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}b(ts,"initNodePersist");var ti={get:function e(e){return /*#__PURE__*/s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,tn.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,($.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,tn.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,tn.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();$.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,tn.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:($.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,($.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return /*#__PURE__*/s(function(){return m(this,function(t){try{return[2,"".concat(tr.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,($.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var to=F(),ta=T.promisify(k.exec);function tc(e){return"error_list:".concat(e)}b(tc,"getErrorListKey");function tu(e){return /*#__PURE__*/s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tc(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ti.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,ti.getLogLink(n)];case 1:e=t.sent();e&&$.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();$.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}b(tu,"saveErrorListToStorage");function tl(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,ti.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,($.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}b(tl,"getStoredErrorLists");function td(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return ti.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}b(td,"clearAllErrorLists");function tf(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,_,x;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===B.Error?B.Error:B.Warning,message:(m=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(v=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(y=p===null||p===void 0?void 0:p[1])!==null&&y!==void 0?y:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===B.Error?B.Error:B.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:B.Error,message:(_=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&_!==void 0?_:"",rule:(x=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&x!==void 0?x:""}):n.push(e.trim())}}),t.length&&tu(t),to.DEBUG&&n.length&&($.warn("Unmatched lines:"),n.forEach(function(e){return $.info(" ".concat(e))}))}b(tf,"parseTextErrors");function tp(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?B.Error:B.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tu(n)}catch(t){tf(e)}}b(tp,"parseCommandOutput");function tg(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tp;n=new AbortController;P.default.on("SIGINT",function(){$.warn("Process interrupted. Terminating..."),n.abort(),P.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ta(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&$.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}b(tg,"executeCommand");function tm(e){return{raw:!0,cmd:e}}b(tm,"rawCommand");function tv(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eH," ").concat(ey," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eH," ").concat(eK," ").concat(eP," ").concat(e):"".concat(eH," ").concat(ek," ").concat(e)}b(tv,"formatCLI");function ty(e,t){return typeof e=="function"?tv(e(t),t):(typeof e==="undefined"?"undefined":p(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tv(e,t):e}b(ty,"formatCommand");function th(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,a;var c=arguments;return m(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,e9(ey)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,ty(r,i)]}))]}})}).apply(this,arguments)}b(th,"resolveCommands");function t_(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);$.start("".concat(e)),to.DEBUG&&$.info("→ ".concat(t));return[4,tg(t)];case 1:r.sent(),$.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw $.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}b(t_,"runCommand");function tx(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!eu(e1.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e5.typescriptCheck()];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=$.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}b(tx,"checkTypescript");function tj(){return /*#__PURE__*/s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e5.eslintFix()];case 1:return[4,t_.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e5.eslintCheck()];case 4:return[4,t_.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}b(tj,"checkEslint");function tb(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";$.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}b(tb,"printIssues");function tE(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tl()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===B.Error}),n=e.filter(function(e){return e.type===B.Warning});!t.length&&!n.length?$.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tb("Warnings",n),tb("Errors",t),(t.length>0||n.length>0)&&w.default.exit(1));return[2]}})})()}b(tE,"showCheckResult");function tI(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,td()];case 1:o.sent();return[4,e9(ey)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ey)];return[4,e5.build()];case 4:return[4,t_.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e5.stageBuildDirectory()];case 6:return[4,t_.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw $.error("Error building and staging ".concat(ey,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e5.lintStaged()];case 10:return[4,t_.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tE();return[2]}})})()}b(tI,"lintStaged");function tw(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e5.eslintInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tw,"inspectLint");function tS(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tx(),tj()])];case 2:e.sent(),tE();return[2]}})})()}b(tS,"lintCheck");function tO(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tx(),tj(!0)])];case 2:e.sent(),tE();return[2]}})})()}b(tO,"lintFix");function tR(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,td()];case 1:t.sent();e=["Validating commit message"];return[4,e5.commitLint()];case 2:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tE();return[2]}})})()}b(tR,"commitLint");function tC(){return /*#__PURE__*/s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e5.configureGitHook()];case 1:return[4,t_.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),el(e1.GIT_HOOK);return[4,th(e2)];case 3:t=s.sent();ea(e1.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(eI,"\n");eu(e1.GIT_IGNORE)?er(e1.GIT_IGNORE,"utf-8").split("\n").includes(eI)||ec(e1.GIT_IGNORE,n):ea(e1.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e5.simpleGitHooks()];case 4:return[4,t_.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}b(tC,"setupGitHook");function tk(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tt([ey],{update:!0,postInstallActions:[tC]})];case 1:e.sent();return[2]}})})()}b(tk,"setup");function tP(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:el(e1.NODE_MODULES,e1.PNPM_LOCK_YAML);return[4,te()];case 1:e.sent();return[4,tC()];case 2:e.sent();return[2]}})})()}b(tP,"reset");function tT(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e5.nodeModulesInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tT,"inspect");function tG(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e5.testUnit()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tG,"testUnit");function tN(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e5.testE2e()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tN,"testE2E");function tU(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e5.mongoMigrateCreate(e)];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}b(tU,"mongoMigrateCreate");function tL(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e5.mongoMigrateUp()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tL,"mongoMigrateUp");function tq(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e5.mongoMigrateDown()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tq,"mongoMigrateDown");(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,O.default)((0,S.hideBin)(w.default.argv)).scriptName(ek).usage("$0 <command> [options]").command("lint","Check code for linting issues",tS).command("lint:fix","Fix linting issues automatically",tO).command("lint:inspect","View active ESLint configuration",tw).command("lint-staged","Run lint checks on staged files",tI).command("commitlint","Validate commit message format",tR).command("setup","Initialize project setup and dependencies",tk).command("reset","Reset the project and reinstall dependencies",tP).command("inspect","Analyze installed project dependencies",tT).command("test:unit","Run unit test suite",tG).command("test:e2e","Run end-to-end test suite",tN).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return /*#__PURE__*/s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){$.error("Migration name is required.");return[2]}return[4,tU(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tL).command("mongo:migrate:down","Rollback last MongoDB migration",tq).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(R.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();$.error("Fatal: ".concat(e.message)),w.default.exit(1);return[3,3];case 3:return[2]}})})()})();
|
|
2
|
+
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){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 u(){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 l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function f(e){return n(e)||o(e)||g(e)||u()}function p(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=a(0),o["throw"]=a(1),o["return"]=a(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(a){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,a[0]&&(i=0)),i)try{if(n=1,r&&(s=a[0]&2?r["return"]:a[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,a[1])).done)return s;if(r=0,s)a=[a[0]&2,s.value];switch(a[0]){case 0:case 1:s=a;break;case 4:i.label++;return{value:a[1],done:false};case 5:i.label++;r=a[1];a=[0];continue;case 7:a=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(a[0]===6||a[0]===2)){i=0;continue}if(a[0]===3&&(!s||a[1]>s[0]&&a[1]<s[3])){i.label=a[1];break}if(a[0]===6&&i.label<s[1]){i.label=s[1];s=a;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(a);break}if(s[2])i.ops.pop();i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e];r=0}finally{n=s=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var v=Object.create;var y=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var I=function(e,t){return y(e,"name",{value:t,configurable:!0})};var w=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":p(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!b.call(e,s)&&s!==n&&y(e,s,{get:function(){return t[s]},enumerable:!(r=h(t,s))||r.enumerable})};for(var c=x(t)[Symbol.iterator](),u;!(s=(u=c.next()).done);s=true)a()}catch(e){i=true;o=e}finally{try{if(!s&&c.return!=null){c.return()}}finally{if(i){throw o}}}return e};var E=function(e,t,n){return n=e!=null?v(j(e)):{},w(t||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e)};var S=E(require("process"),1),O=require("yargs/helpers"),C=E(require("yargs/yargs"),1);var k={name:"@cyberskill/shared",type:"module",version:"1.125.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var T=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var G=require("child_process"),_=E(require("process"),1),N=E(require("util"),1);var R=".cyberskill-storage";var L=E(require("@dotenvx/dotenvx"),1),q=require("envalid"),D=E(require("os"),1),M=E(require("path"),1),P=E(require("process"),1);var A=!1;function F(){A||(L.default.config(),A=!0)}I(F,"loadEnvFile");function U(){F();var e=(0,q.cleanEnv)(P.default.env,{CWD:(0,q.str)({default:P.default.cwd()}),DEBUG:(0,q.bool)({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:(0,q.str)({default:M.default.join(D.default.homedir(),R)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}I(U,"getEnv");var B=function(e){return e.Error="error",e.Warning="warning",e}({});var K=E(require("chalk"),1),W=E(require("consola"),1),Y=require("graphql");var H=U();H.DEBUG||(W.default.level=4);function J(e){var t=K.default[e];return typeof t=="function"?t:K.default.green}I(J,"chalkKeyword");var $={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){W.default.box(K.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;W.default.log("".concat(K.default.gray("File:")," ").concat(K.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&W.default.log(" ".concat(J(n)("Rule:")," ").concat(s)),W.default.log(" ".concat(J(n)("Message:")," ").concat(i))}),W.default.box(J(n)("".concat(e," : ").concat(t.length))),W.default.log(K.default.gray("─".repeat(40)))}};var V={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var z=E(require("node-fetch"),1);var Q=E(require("fs-extra"),1);var X=E(require("path"),1);var Z=U(),ee=X.default;function et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ee).resolve.apply(r,[Z.CWD].concat(f(t)))}I(et,"resolveWorkingPath");function en(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=ee).join.apply(r,f(t))}I(en,"join");var er=U(),es=er.CWD,ei="@cyberskill/shared",eo="node_modules",ea="dist",ec="package.json",eu="package-lock.json",el="tsconfig.json",ed=".gitignore",ef=".simple-git-hooks.json",ep="pnpm-lock.yaml",eg=".git/hooks/",em=".git/COMMIT_EDITMSG",ev=".migrate-mongo.config.js",ey=en(es,eo,ei,ea),eh="cyberskill",ex="src/nodejs/cli/index.ts",ej="eslint",eb="eslint",eI="vitest",ew="playwright",eE="vitest",eS="@commitlint/cli",eO="commitlint",eC="lint-staged",ek="lint-staged",eT="typescript",eG="tsc",e_="tsx",eN="git",eR="pnpm",eL="pnpm exec",eq="simple-git-hooks",eD="simple-git-hooks",eM="@eslint/config-inspector",eP="eslint-config-inspector",eA="node-modules-inspector",eF="node-modules-inspector",eU="migrate-mongo",eB="./node_modules/migrate-mongo/bin/migrate-mongo",eK={CYBERSKILL_DIRECTORY:ey,WORKING_DIRECTORY:es,TS_CONFIG:et(el),GIT_IGNORE:et(ed),GIT_HOOK:et(eg),GIT_COMMIT_MSG:et(em),SIMPLE_GIT_HOOKS_JSON:et(ef),PACKAGE_JSON:et(ec),PACKAGE_LOCK_JSON:et(eu),PNPM_LOCK_YAML:et(ep),NODE_MODULES:et(eo),MIGRATE_MONGO_CONFIG:et(ev),LINT_STAGED_CONFIG:et("".concat(ey,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:et("".concat(ey,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:et("".concat(ey,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:et("".concat(ey,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:et("".concat(ey,"/react/vitest/vitest.e2e.js"))};function eW(e){var t=e.isCurrentProject;return l({"pre-commit":ek,"commit-msg":eO},t&&{"pre-push":tm("".concat(eN," pull"))})}I(eW,"createGitHooksConfig");function eY(e,t,n){return s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case T.CLI:return[3,1];case T.STRING:return[3,3]}return[3,4];case 1:return[4,tt(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),ty(tm("".concat(eL," ").concat(n))))];case 3:return[2,ty(tm(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}I(eY,"buildCommand");function eH(e,t,n){return function(){return s(function(){return m(this,function(r){return[2,eY(e,t,n)]})})()}}I(eH,"commandFactory");var eJ={simpleGitHooks:eH(T.CLI,eq,eD),eslintInspect:eH(T.CLI,eM,eP),nodeModulesInspect:eH(T.CLI,eA,eF),eslintCheck:eH(T.CLI,ej,"".concat(eb," ").concat(eK.WORKING_DIRECTORY," --no-cache")),eslintFix:eH(T.CLI,ej,"".concat(eb," ").concat(eK.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eH(T.CLI,eT,"".concat(eG," -p ").concat(eK.TS_CONFIG," --noEmit")),configureGitHook:eH(T.STRING,"".concat(eN," config core.hooksPath ").concat(eK.GIT_HOOK)),testUnit:eH(T.CLI,eI,"".concat(eE," --config ").concat(eK.UNIT_TEST_CONFIG)),testE2e:eH(T.CLI,"".concat(eI," ").concat(ew),"".concat(eE," --config ").concat(eK.E2E_TEST_CONFIG)),mongoMigrateCreate:I(function(e){return eH(T.CLI,eU,"".concat(e_," ").concat(eB," create ").concat(e," -f ").concat(eK.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eH(T.CLI,eU,"".concat(e_," ").concat(eB," up -f ").concat(eK.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eH(T.CLI,eU,"".concat(e_," ").concat(eB," down -f ").concat(eK.MIGRATE_MONGO_CONFIG)),commitLint:eH(T.CLI,eS,"".concat(eO," --edit ").concat(eK.GIT_COMMIT_MSG," --config ").concat(eK.COMMITLINT_CONFIG)),lintStaged:eH(T.CLI,eC,"".concat(ek," --config ").concat(eK.LINT_STAGED_CONFIG)),stageBuildDirectory:eH(T.STRING,"".concat(eN," add ").concat(ea)),build:eH(T.STRING,"".concat(eR," run build")),pnpmInstallStandard:eH(T.STRING,"".concat(eR," install")),pnpmInstallLegacy:eH(T.STRING,"".concat(eR," install --legacy-peer-deps")),pnpmInstallForce:eH(T.STRING,"".concat(eR," install --force"))};var e$=Q.default,eV=e$.lstatSync,ez=e$.readdirSync,eQ=e$.mkdirSync,eX=e$.readFileSync,eZ=e$.unlinkSync,e0=e$.statSync,e1=Q.default.readJsonSync;function e2(e,t,n){Q.default.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}I(e2,"writeFileSync");function e4(e,t,n){Q.default.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}I(e4,"appendFileSync");function e3(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return Q.default.pathExistsSync(e)})}I(e3,"pathExistsSync");function e5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){e3(e)&&Q.default.removeSync(e)})}I(e5,"removeSync");var e8=U();function e6(e){var t=en(e8.CWD,ec);if(!e3(t))return!1;try{var n=e1(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in i,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return $.warn("Failed to read package.json: ".concat(e.message)),!1}}I(e6,"getPackage");function e7(e){return s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,z.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw $.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}I(e7,"getLatestPackageVersion");function e9(e,t){return s(function(){var n,r,s,i,o,a,c,u,d,f,p,g,v,y,h,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e6(e);if(!n)return[2,l({},V)];c=n.path,u=n.file,d=n.isCurrentProject,f=n.isDepend,p=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":f?(o=g[e])!==null&&o!==void 0?o:"0.0.0":p?(a=v[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];j=y;return[3,3];case 1:return[4,e7(e)];case 2:j=m.sent();m.label=3;case 3:h=j,x=d||y===h;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=f?"dependencies":p?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==h&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=h,e2(c,JSON.stringify(u,null,4)),$.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,($.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},V))];case 5:return[2]}})})()}I(e9,"checkPackage");function te(){return s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return m(this,function(f){switch(f.label){case 0:e=[{command:I(function(){return eJ.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:I(function(){return eJ.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:I(function(){return eJ.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);s=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,a=o.command,c=o.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,a()];case 4:u=f.sent();return[4,tx("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();$.warn("Installation attempt failed: ".concat(c)),$.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=f.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}I(te,"installDependencies");function tt(e,t){return s(function(){var n,r,s,i,o,a,c,u,d,p,g;return m(this,function(m){switch(m.label){case 0:if(!e3(eK.PACKAGE_JSON)){$.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=f(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e9(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,te()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:p=m.sent();o=true;a=p;return[3,12];case 11:try{if(!i&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw $.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}I(tt,"setupPackages");var tn=E(require("node-persist"),1);var tr=U();function ts(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=tn.default.defaultInstance;if(e)return[3,2];return[4,tn.default.init({dir:tr.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}I(ts,"initNodePersist");var ti={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,tn.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,($.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ts()];case 1:r.sent();return[4,tn.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,tn.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();$.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ts()];case 1:n.sent();return[4,tn.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:($.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,($.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(tr.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,($.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var to=U(),ta=N.promisify(G.exec);function tc(e){return"error_list:".concat(e)}I(tc,"getErrorListKey");function tu(e){return s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tc(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ti.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,ti.getLogLink(n)];case 1:e=t.sent();e&&$.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();$.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}I(tu,"saveErrorListToStorage");function tl(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,ti.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,($.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}I(tl,"getStoredErrorLists");function td(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ti.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return ti.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();$.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}I(td,"clearAllErrorLists");function tf(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a,c,u,l,d;var f=s.exec(e)||[],p=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,x,j;f.length&&r?t.push({file:r,position:"".concat(f[1],":").concat(f[2]),type:f[3]===B.Error?B.Error:B.Warning,message:(m=f===null||f===void 0?void 0:(a=f[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(v=f===null||f===void 0?void 0:(c=f[5])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:""}):p.length?t.push({file:(y=p===null||p===void 0?void 0:p[1])!==null&&y!==void 0?y:"",position:"".concat(p[2],":").concat(p[3]),type:p[4]===B.Error?B.Error:B.Warning,message:(h=p===null||p===void 0?void 0:(u=p[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:B.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tu(t),to.DEBUG&&n.length&&($.warn("Unmatched lines:"),n.forEach(function(e){return $.info(" ".concat(e))}))}I(tf,"parseTextErrors");function tp(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?B.Error:B.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tu(n)}catch(t){tf(e)}}I(tp,"parseCommandOutput");function tg(e){return s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tp;n=new AbortController;_.default.on("SIGINT",function(){$.warn("Process interrupted. Terminating..."),n.abort(),_.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ta(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&$.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}I(tg,"executeCommand");function tm(e){return{raw:!0,cmd:e}}I(tm,"rawCommand");function tv(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eL," ").concat(ei," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eL," ").concat(e_," ").concat(ex," ").concat(e):"".concat(eL," ").concat(eh," ").concat(e)}I(tv,"formatCLI");function ty(e,t){return typeof e=="function"?tv(e(t),t):(typeof e==="undefined"?"undefined":p(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tv(e,t):e}I(ty,"formatCommand");function th(e){return s(function(e){var t,n,r,s,i,o,a;var c=arguments;return m(this,function(u){switch(u.label){case 0:t=c.length>1&&c[1]!==void 0?c[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];a=!1;return[3,3];case 1:return[4,e9(ei)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:s=a,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,ty(r,i)]}))]}})}).apply(this,arguments)}I(th,"resolveCommands");function tx(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);$.start("".concat(e)),to.DEBUG&&$.info("→ ".concat(t));return[4,tg(t)];case 1:r.sent(),$.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw $.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}I(tx,"runCommand");function tj(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!e3(eK.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eJ.typescriptCheck()];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=$.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}I(tj,"checkTypescript");function tb(){return s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eJ.eslintFix()];case 1:return[4,tx.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eJ.eslintCheck()];case 4:return[4,tx.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}I(tb,"checkEslint");function tI(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";$.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}I(tI,"printIssues");function tw(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tl()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===B.Error}),n=e.filter(function(e){return e.type===B.Warning});!t.length&&!n.length?$.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tI("Warnings",n),tI("Errors",t),(t.length>0||n.length>0)&&S.default.exit(1));return[2]}})})()}I(tw,"showCheckResult");function tE(){return s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,td()];case 1:o.sent();return[4,e9(ei)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ei)];return[4,eJ.build()];case 4:return[4,tx.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eJ.stageBuildDirectory()];case 6:return[4,tx.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw $.error("Error building and staging ".concat(ei,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eJ.lintStaged()];case 10:return[4,tx.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tw();return[2]}})})()}I(tE,"lintStaged");function tS(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eJ.eslintInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tS,"inspectLint");function tO(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tj(),tb()])];case 2:e.sent(),tw();return[2]}})})()}I(tO,"lintCheck");function tC(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tj(),tb(!0)])];case 2:e.sent(),tw();return[2]}})})()}I(tC,"lintFix");function tk(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,td()];case 1:t.sent();e=["Validating commit message"];return[4,eJ.commitLint()];case 2:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tw();return[2]}})})()}I(tk,"commitLint");function tT(){return s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eJ.configureGitHook()];case 1:return[4,tx.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),e5(eK.GIT_HOOK);return[4,th(eW)];case 3:t=s.sent();e2(eK.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ef,"\n");e3(eK.GIT_IGNORE)?eX(eK.GIT_IGNORE,"utf-8").split("\n").includes(ef)||e4(eK.GIT_IGNORE,n):e2(eK.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eJ.simpleGitHooks()];case 4:return[4,tx.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}I(tT,"setupGitHook");function tG(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tt([ei],{update:!0,postInstallActions:[tT]})];case 1:e.sent();return[2]}})})()}I(tG,"setup");function t_(){return s(function(){return m(this,function(e){switch(e.label){case 0:e5(eK.NODE_MODULES,eK.PNPM_LOCK_YAML);return[4,te()];case 1:e.sent();return[4,tT()];case 2:e.sent();return[2]}})})()}I(t_,"reset");function tN(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eJ.nodeModulesInspect()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tN,"inspect");function tR(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eJ.testUnit()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tR,"testUnit");function tL(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eJ.testE2e()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tL,"testE2E");function tq(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eJ.mongoMigrateCreate(e)];case 1:return[4,tx.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}I(tq,"mongoMigrateCreate");function tD(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eJ.mongoMigrateUp()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tD,"mongoMigrateUp");function tM(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eJ.mongoMigrateDown()];case 1:return[4,tx.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}I(tM,"mongoMigrateDown");(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,C.default)((0,O.hideBin)(S.default.argv)).scriptName(eh).usage("$0 <command> [options]").command("lint","Check code for linting issues",tO).command("lint:fix","Fix linting issues automatically",tC).command("lint:inspect","View active ESLint configuration",tS).command("lint-staged","Run lint checks on staged files",tE).command("commitlint","Validate commit message format",tk).command("setup","Initialize project setup and dependencies",tG).command("reset","Reset the project and reinstall dependencies",t_).command("inspect","Analyze installed project dependencies",tN).command("test:unit","Run unit test suite",tR).command("test:e2e","Run end-to-end test suite",tL).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){$.error("Migration name is required.");return[2]}return[4,tq(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tD).command("mongo:migrate:down","Rollback last MongoDB migration",tM).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(k.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();$.error("Fatal: ".concat(e.message)),S.default.exit(1);return[3,3];case 3:return[2]}})})()})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){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 u(){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 l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var v=Object.defineProperty;var y=function(e,t){return v(e,"name",{value:t,configurable:!0})};import h from"node:process";import{hideBin as _}from"yargs/helpers";import x from"yargs/yargs";var j={name:"@cyberskill/shared",type:"module",version:"1.123.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.0","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.3",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var b=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as E}from"node:child_process";import I from"node:process";import*as w from"node:util";var S=".cyberskill-storage";import R from"@dotenvx/dotenvx";import{bool as C,cleanEnv as O,str as k}from"envalid";import T from"node:os";import P from"node:path";import G from"node:process";var U=!1;function N(){U||(R.config(),U=!0)}y(N,"loadEnvFile");function L(){N();var e=O(G.env,{CWD:k({default:G.cwd()}),DEBUG:C({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:k({default:P.join(T.homedir(),S)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}y(L,"getEnv");var D=function(e){return e.Error="error",e.Warning="warning",e}({});import M from"chalk";import A from"consola";import{GraphQLError as q}from"graphql";var F=L();F.DEBUG||(A.level=4);function B(e){var t=M[e];return typeof t=="function"?t:M.green}y(B,"chalkKeyword");var K={silent:A.silent,level:A.level,fatal:A.fatal,error:A.error,warn:A.warn,log:A.log,info:A.info,success:A.success,ready:A.ready,start:A.start,box:A.box,debug:A.debug,trace:A.trace,verbose:A.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){A.box(M.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;A.log("".concat(M.gray("File:")," ").concat(M.blue("".concat(t).concat(r?":".concat(r):"")))),s&&A.log(" ".concat(B(n)("Rule:")," ").concat(s)),A.log(" ".concat(B(n)("Message:")," ").concat(i))}),A.box(B(n)("".concat(e," : ").concat(t.length))),A.log(M.gray("─".repeat(40)))}};var W={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import Y from"node-fetch";import H from"fs-extra";var J=H.lstatSync,$=H.readdirSync,V=H.mkdirSync,z=H.readFileSync,Q=H.unlinkSync,X=H.statSync,Z=H.readJsonSync;function ee(e,t,n){H.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}y(ee,"writeFileSync");function et(e,t,n){H.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}y(et,"appendFileSync");function en(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return H.pathExistsSync(e)})}y(en,"pathExistsSync");function er(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){en(e)&&H.removeSync(e)})}y(er,"removeSync");import es,{join as ei,resolve as eo}from"node:path";var ec=L();function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return eo.apply(void 0,[ec.CWD].concat(p(t)))}y(ea,"resolveWorkingPath");function eu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return ei.apply(void 0,p(t))}y(eu,"join");var el=L(),ed=el.CWD,ep="@cyberskill/shared",ef="node_modules",eg="dist",em="package.json",ev="package-lock.json",ey="tsconfig.json",eh=".gitignore",e_=".simple-git-hooks.json",ex="pnpm-lock.yaml",ej=".git/hooks/",eb=".git/COMMIT_EDITMSG",eE=".migrate-mongo.config.js",eI=eu(ed,ef,ep,eg),ew="cyberskill",eS="src/nodejs/cli/index.ts",eR="eslint",eC="eslint",eO="vitest",ek="playwright",eT="vitest",eP="@commitlint/cli",eG="commitlint",eU="lint-staged",eN="lint-staged",eL="typescript",eD="tsc",eM="tsx",eA="git",eq="pnpm",eF="pnpm exec",eB="simple-git-hooks",eK="simple-git-hooks",eW="@eslint/config-inspector",eY="eslint-config-inspector",eH="node-modules-inspector",eJ="node-modules-inspector",e$="migrate-mongo",eV="./node_modules/migrate-mongo/bin/migrate-mongo",ez={CYBERSKILL_DIRECTORY:eI,WORKING_DIRECTORY:ed,TS_CONFIG:ea(ey),GIT_IGNORE:ea(eh),GIT_HOOK:ea(ej),GIT_COMMIT_MSG:ea(eb),SIMPLE_GIT_HOOKS_JSON:ea(e_),PACKAGE_JSON:ea(em),PACKAGE_LOCK_JSON:ea(ev),PNPM_LOCK_YAML:ea(ex),NODE_MODULES:ea(ef),MIGRATE_MONGO_CONFIG:ea(eE),LINT_STAGED_CONFIG:ea("".concat(eI,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:ea("".concat(eI,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:ea("".concat(eI,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ea("".concat(eI,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ea("".concat(eI,"/react/vitest/vitest.e2e.js"))};function eQ(e){var t=e.isCurrentProject;return l({"pre-commit":eN,"commit-msg":eG},t&&{"pre-push":tl("".concat(eA," pull"))})}y(eQ,"createGitHooksConfig");function eX(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case b.CLI:return[3,1];case b.STRING:return[3,3]}return[3,4];case 1:return[4,e8(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tp(tl("".concat(eF," ").concat(n))))];case 3:return[2,tp(tl(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}y(eX,"buildCommand");function eZ(e,t,n){return function(){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,eX(e,t,n)]})})()}}y(eZ,"commandFactory");var e0={simpleGitHooks:eZ(b.CLI,eB,eK),eslintInspect:eZ(b.CLI,eW,eY),nodeModulesInspect:eZ(b.CLI,eH,eJ),eslintCheck:eZ(b.CLI,eR,"".concat(eC," ").concat(ez.WORKING_DIRECTORY," --no-cache")),eslintFix:eZ(b.CLI,eR,"".concat(eC," ").concat(ez.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eZ(b.CLI,eL,"".concat(eD," -p ").concat(ez.TS_CONFIG," --noEmit")),configureGitHook:eZ(b.STRING,"".concat(eA," config core.hooksPath ").concat(ez.GIT_HOOK)),testUnit:eZ(b.CLI,eO,"".concat(eT," --config ").concat(ez.UNIT_TEST_CONFIG)),testE2e:eZ(b.CLI,"".concat(eO," ").concat(ek),"".concat(eT," --config ").concat(ez.E2E_TEST_CONFIG)),mongoMigrateCreate:y(function(e){return eZ(b.CLI,e$,"".concat(eM," ").concat(eV," create ").concat(e," -f ").concat(ez.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eZ(b.CLI,e$,"".concat(eM," ").concat(eV," up -f ").concat(ez.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eZ(b.CLI,e$,"".concat(eM," ").concat(eV," down -f ").concat(ez.MIGRATE_MONGO_CONFIG)),commitLint:eZ(b.CLI,eP,"".concat(eG," --edit ").concat(ez.GIT_COMMIT_MSG," --config ").concat(ez.COMMITLINT_CONFIG)),lintStaged:eZ(b.CLI,eU,"".concat(eN," --config ").concat(ez.LINT_STAGED_CONFIG)),stageBuildDirectory:eZ(b.STRING,"".concat(eA," add ").concat(eg)),build:eZ(b.STRING,"".concat(eq," run build")),pnpmInstallStandard:eZ(b.STRING,"".concat(eq," install")),pnpmInstallLegacy:eZ(b.STRING,"".concat(eq," install --legacy-peer-deps")),pnpmInstallForce:eZ(b.STRING,"".concat(eq," install --force"))};var e1=L();function e2(e){var t=eu(e1.CWD,em);if(!en(t))return!1;try{var n=Z(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,c=o===void 0?{}:o,a=r===e,u=e in i,l=e in c;return a||u||l?{path:t,file:n,isCurrentProject:a,isDepend:u,isDevDepend:l}:!1}catch(e){return K.warn("Failed to read package.json: ".concat(e.message)),!1}}y(e2,"getPackage");function e4(e){return /*#__PURE__*/s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,Y("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw K.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}y(e4,"getLatestPackageVersion");function e3(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,c,a,u,d,p,f,g,v,y,h,_,x,j,b,E,I;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e2(e);if(!n)return[2,l({},W)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},v=(s=u.devDependencies)!==null&&s!==void 0?s:{},y=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(c=v[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];x=y;return[3,3];case 1:return[4,e4(e)];case 2:x=m.sent();m.label=3;case 3:h=x,_=d||y===h;if(!_&&(t===null||t===void 0?void 0:t.update)){;b=p?"dependencies":f?"devDependencies":null;b&&((j=u[b])===null||j===void 0?void 0:j[e])!==h&&(u[b]=(E=u[b])!==null&&E!==void 0?E:{},u[b][e]=h,ee(a,JSON.stringify(u,null,4)),K.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:_}];case 4:I=m.sent();return[2,(K.error('Error checking package "'.concat(e,'": ').concat(I.message)),l({},W))];case 5:return[2]}})})()}y(e3,"checkPackage");function e5(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:y(function(){return e0.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:y(function(){return e0.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:y(function(){return e0.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,c=o.command,a=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tg("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();K.warn("Installation attempt failed: ".concat(a)),K.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}y(e5,"installDependencies");function e8(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!en(ez.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e3(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e5()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=a.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;c=f;return[3,12];case 11:try{if(!i&&a.return!=null){a.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:g=m.sent();throw K.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}y(e8,"setupPackages");import e6 from"node-persist";var e7=L();function e9(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e6.defaultInstance;if(e)return[3,2];return[4,e6.init({dir:e7.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}y(e9,"initNodePersist");var te={get:function e(e){return /*#__PURE__*/s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9()];case 1:r.sent();return[4,e6.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(K.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9()];case 1:r.sent();return[4,e6.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e9()];case 1:n.sent();return[4,e6.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();K.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e9()];case 1:n.sent();return[4,e6.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(K.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return /*#__PURE__*/s(function(){return m(this,function(t){try{return[2,"".concat(e7.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(K.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tt=L(),tn=w.promisify(E);function tr(e){return"error_list:".concat(e)}y(tr,"getErrorListKey");function ts(e){return /*#__PURE__*/s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tr(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,te.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,te.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();K.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}y(ts,"saveErrorListToStorage");function ti(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,te.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,te.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(K.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}y(ti,"getStoredErrorLists");function to(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,te.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return te.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}y(to,"clearAllErrorLists");function tc(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,v,y,h,_,x;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===D.Error?D.Error:D.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(v=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&v!==void 0?v:""}):f.length?t.push({file:(y=f===null||f===void 0?void 0:f[1])!==null&&y!==void 0?y:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===D.Error?D.Error:D.Warning,message:(h=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:D.Error,message:(_=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&_!==void 0?_:"",rule:(x=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&x!==void 0?x:""}):n.push(e.trim())}}),t.length&&ts(t),tt.DEBUG&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}y(tc,"parseTextErrors");function ta(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?D.Error:D.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&ts(n)}catch(t){tc(e)}}y(ta,"parseCommandOutput");function tu(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ta;n=new AbortController;I.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),I.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tn(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&K.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}y(tu,"executeCommand");function tl(e){return{raw:!0,cmd:e}}y(tl,"rawCommand");function td(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eF," ").concat(ep," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eF," ").concat(eM," ").concat(eS," ").concat(e):"".concat(eF," ").concat(ew," ").concat(e)}y(td,"formatCLI");function tp(e,t){return typeof e=="function"?td(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?td(e,t):e}y(tp,"formatCommand");function tf(e){return /*#__PURE__*/s(function(e){var t,n,r,s,i,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,e3(ep)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tp(r,i)]}))]}})}).apply(this,arguments)}y(tf,"resolveCommands");function tg(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),tt.DEBUG&&K.info("→ ".concat(t));return[4,tu(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw K.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}y(tg,"runCommand");function tm(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!en(ez.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e0.typescriptCheck()];case 1:return[4,tg.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=K.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}y(tm,"checkTypescript");function tv(){return /*#__PURE__*/s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e0.eslintFix()];case 1:return[4,tg.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e0.eslintCheck()];case 4:return[4,tg.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}y(tv,"checkEslint");function ty(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}y(ty,"printIssues");function th(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,ti()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===D.Error}),n=e.filter(function(e){return e.type===D.Warning});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ty("Warnings",n),ty("Errors",t),(t.length>0||n.length>0)&&h.exit(1));return[2]}})})()}y(th,"showCheckResult");function t_(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,to()];case 1:o.sent();return[4,e3(ep)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ep)];return[4,e0.build()];case 4:return[4,tg.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e0.stageBuildDirectory()];case 6:return[4,tg.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw K.error("Error building and staging ".concat(ep,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e0.lintStaged()];case 10:return[4,tg.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),th();return[2]}})})()}y(t_,"lintStaged");function tx(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e0.eslintInspect()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tx,"inspectLint");function tj(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,to()];case 1:e.sent();return[4,Promise.all([tm(),tv()])];case 2:e.sent(),th();return[2]}})})()}y(tj,"lintCheck");function tb(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,to()];case 1:e.sent();return[4,Promise.all([tm(),tv(!0)])];case 2:e.sent(),th();return[2]}})})()}y(tb,"lintFix");function tE(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,to()];case 1:t.sent();e=["Validating commit message"];return[4,e0.commitLint()];case 2:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),th();return[2]}})})()}y(tE,"commitLint");function tI(){return /*#__PURE__*/s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,e0.configureGitHook()];case 1:return[4,tg.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),er(ez.GIT_HOOK);return[4,tf(eQ)];case 3:t=s.sent();ee(ez.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(e_,"\n");en(ez.GIT_IGNORE)?z(ez.GIT_IGNORE,"utf-8").split("\n").includes(e_)||et(ez.GIT_IGNORE,n):ee(ez.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e0.simpleGitHooks()];case 4:return[4,tg.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}y(tI,"setupGitHook");function tw(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e8([ep],{update:!0,postInstallActions:[tI]})];case 1:e.sent();return[2]}})})()}y(tw,"setup");function tS(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:er(ez.NODE_MODULES,ez.PNPM_LOCK_YAML);return[4,e5()];case 1:e.sent();return[4,tI()];case 2:e.sent();return[2]}})})()}y(tS,"reset");function tR(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e0.nodeModulesInspect()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tR,"inspect");function tC(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e0.testUnit()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tC,"testUnit");function tO(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e0.testE2e()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tO,"testE2E");function tk(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e0.mongoMigrateCreate(e)];case 1:return[4,tg.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}y(tk,"mongoMigrateCreate");function tT(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e0.mongoMigrateUp()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tT,"mongoMigrateUp");function tP(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e0.mongoMigrateDown()];case 1:return[4,tg.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}y(tP,"mongoMigrateDown");(function(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,x(_(h.argv)).scriptName(ew).usage("$0 <command> [options]").command("lint","Check code for linting issues",tj).command("lint:fix","Fix linting issues automatically",tb).command("lint:inspect","View active ESLint configuration",tx).command("lint-staged","Run lint checks on staged files",t_).command("commitlint","Validate commit message format",tE).command("setup","Initialize project setup and dependencies",tw).command("reset","Reset the project and reinstall dependencies",tS).command("inspect","Analyze installed project dependencies",tR).command("test:unit","Run unit test suite",tC).command("test:e2e","Run end-to-end test suite",tO).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return /*#__PURE__*/s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){K.error("Migration name is required.");return[2]}return[4,tk(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tT).command("mongo:migrate:down","Rollback last MongoDB migration",tP).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(j.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();K.error("Fatal: ".concat(e.message)),h.exit(1);return[3,3];case 3:return[2]}})})()})();
|
|
2
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){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 u(){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 l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var y=Object.defineProperty;var v=function(e,t){return y(e,"name",{value:t,configurable:!0})};import h from"node:process";import{hideBin as x}from"yargs/helpers";import j from"yargs/yargs";var b={name:"@cyberskill/shared",type:"module",version:"1.125.0",description:"CyberSkill Shared",author:"Stephen Cheng",license:"MIT",homepage:"https://github.com/cyberskill-world/shared#readme",repository:{type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},bugs:{url:"https://github.com/cyberskill-world/shared/issues"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/index.cjs"},"./configs":{types:"./dist/configs/index.d.ts",import:"./dist/configs/index.js",require:"./dist/configs/index.cjs"},"./configs/commitlint":{types:"./dist/configs/commitlint/index.d.ts",import:"./dist/configs/commitlint/index.js",require:"./dist/configs/commitlint/index.cjs"},"./configs/env":{types:"./dist/configs/env/index.d.ts",import:"./dist/configs/env/index.js",require:"./dist/configs/env/index.cjs"},"./configs/eslint":{types:"./dist/configs/eslint/index.d.ts",import:"./dist/configs/eslint/index.js",require:"./dist/configs/eslint/index.cjs"},"./configs/graphql-codegen":{types:"./dist/configs/graphql-codegen/index.d.ts",import:"./dist/configs/graphql-codegen/index.js",require:"./dist/configs/graphql-codegen/index.cjs"},"./configs/lint-staged":{types:"./dist/configs/lint-staged/index.d.ts",import:"./dist/configs/lint-staged/index.js",require:"./dist/configs/lint-staged/index.cjs"},"./constants":{types:"./dist/constants/index.d.ts",import:"./dist/constants/index.js",require:"./dist/constants/index.cjs"},"./nodejs":{types:"./dist/nodejs/index.d.ts",import:"./dist/nodejs/index.js",require:"./dist/nodejs/index.cjs"},"./nodejs/apollo-server":{types:"./dist/nodejs/apollo-server/index.d.ts",import:"./dist/nodejs/apollo-server/index.js",require:"./dist/nodejs/apollo-server/index.cjs"},"./nodejs/cli":{types:"./dist/nodejs/cli/index.d.ts",import:"./dist/nodejs/cli/index.js",require:"./dist/nodejs/cli/index.cjs"},"./nodejs/command":{types:"./dist/nodejs/command/index.d.ts",import:"./dist/nodejs/command/index.js",require:"./dist/nodejs/command/index.cjs"},"./nodejs/express":{types:"./dist/nodejs/express/index.d.ts",import:"./dist/nodejs/express/index.js",require:"./dist/nodejs/express/index.cjs"},"./nodejs/fs":{types:"./dist/nodejs/fs/index.d.ts",import:"./dist/nodejs/fs/index.js",require:"./dist/nodejs/fs/index.cjs"},"./nodejs/log":{types:"./dist/nodejs/log/index.d.ts",import:"./dist/nodejs/log/index.js",require:"./dist/nodejs/log/index.cjs"},"./nodejs/mongo":{types:"./dist/nodejs/mongo/index.d.ts",import:"./dist/nodejs/mongo/index.js",require:"./dist/nodejs/mongo/index.cjs"},"./nodejs/package":{types:"./dist/nodejs/package/index.d.ts",import:"./dist/nodejs/package/index.js",require:"./dist/nodejs/package/index.cjs"},"./nodejs/path":{types:"./dist/nodejs/path/index.d.ts",import:"./dist/nodejs/path/index.js",require:"./dist/nodejs/path/index.cjs"},"./nodejs/storage":{types:"./dist/nodejs/storage/index.d.ts",import:"./dist/nodejs/storage/index.js",require:"./dist/nodejs/storage/index.cjs"},"./nodejs/ws":{types:"./dist/nodejs/ws/index.d.ts",import:"./dist/nodejs/ws/index.js",require:"./dist/nodejs/ws/index.cjs"},"./react":{types:"./dist/react/index.d.ts",import:"./dist/react/index.js",require:"./dist/react/index.cjs"},"./react/apollo-client":{types:"./dist/react/apollo-client/index.d.ts",import:"./dist/react/apollo-client/index.js",require:"./dist/react/apollo-client/index.cjs"},"./react/apollo-error":{types:"./dist/react/apollo-error/index.d.ts",import:"./dist/react/apollo-error/index.js",require:"./dist/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/react/i18next/index.d.ts",import:"./dist/react/i18next/index.js",require:"./dist/react/i18next/index.cjs"},"./react/loading":{types:"./dist/react/loading/index.d.ts",import:"./dist/react/loading/index.js",require:"./dist/react/loading/index.cjs"},"./react/log":{types:"./dist/react/log/index.d.ts",import:"./dist/react/log/index.js",require:"./dist/react/log/index.cjs"},"./react/next-intl":{types:"./dist/react/next-intl/index.d.ts",import:"./dist/react/next-intl/index.js",require:"./dist/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/react/storage/index.d.ts",import:"./dist/react/storage/index.js",require:"./dist/react/storage/index.cjs"},"./react/toast":{types:"./dist/react/toast/index.d.ts",import:"./dist/react/toast/index.js",require:"./dist/react/toast/index.cjs"},"./react/vitest":{types:"./dist/react/vitest/index.d.ts",import:"./dist/react/vitest/index.js",require:"./dist/react/vitest/index.cjs"},"./styles/reset.css":{import:"./dist/styles/reset.css",require:"./dist/styles/reset.css"},"./typescript":{types:"./dist/typescript/index.d.ts",import:"./dist/typescript/index.js",require:"./dist/typescript/index.cjs"},"./utils":{types:"./dist/utils/index.d.ts",import:"./dist/utils/index.js",require:"./dist/utils/index.cjs"}},main:"./dist/index.cjs",module:"./dist/index.js",types:"./dist/index.d.ts",bin:{cyberskill:"./dist/nodejs/cli/index.js"},files:["dist","public"],scripts:{build:"tsup",dev:"tsup --watch",lint:"tsx src/nodejs/cli/index.ts lint","lint:fix":"tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"tsx src/nodejs/cli/index.ts lint:inspect",reset:"tsx src/nodejs/cli/index.ts reset",setup:"tsx src/nodejs/cli/index.ts setup",inspect:"tsx src/nodejs/cli/index.ts inspect","test:unit":"tsx src/nodejs/cli/index.ts test:unit","test:e2e":"tsx src/nodejs/cli/index.ts test:e2e",commitlint:"tsx src/nodejs/cli/index.ts commitlint","lint-staged":"tsx src/nodejs/cli/index.ts lint-staged"},dependencies:{"@antfu/eslint-config":"4.12.0","@apollo/client":"3.13.8","@apollo/server":"4.12.0","@dotenvx/dotenvx":"1.41.0","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.5","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@nestjs/common":"11.1.0","@nestjs/core":"11.1.0","@next/eslint-plugin-next":"15.3.1","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.9.0","@vitest/browser":"3.1.2","body-parser":"2.2.0",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0",envalid:"8.0.0","eslint-config-next":"15.3.1","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.0.0",graphql:"16.11.0","graphql-ws":"6.0.4",i18next:"25.0.2",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.16.0",mongoose:"8.14.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.1.0","node-fetch":"3.3.2","node-persist":"4.0.4",playwright:"1.52.0","postcss-modules":"6.0.1",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.1","react-icons":"5.5.0",sass:"1.87.0",slugify:"1.6.6",tsup:"8.4.0",tsx:"4.19.4",typescript:"5.8.3",unorm:"1.6.0",uuid:"11.1.0",vite:"6.3.3",vitest:"3.1.2","vitest-browser-react":"0.1.1",ws:"8.18.1",yargs:"17.7.2"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},devDependencies:{"@commitlint/cli":"19.8.0","@eslint/config-inspector":"1.0.2","@types/body-parser":"1.19.5","@types/compression":"1.7.5","@types/cookie-parser":"1.4.8","@types/cors":"2.8.17","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.1","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node":"22.15.3","@types/node-persist":"3.1.8","@types/react":"19.1.2","@types/react-dom":"19.1.2","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33",eslint:"9.25.1","lint-staged":"15.5.1","node-modules-inspector":"0.6.7","simple-git-hooks":"2.13.0"}};var I=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as w}from"node:child_process";import E from"node:process";import*as S from"node:util";var C=".cyberskill-storage";import O from"@dotenvx/dotenvx";import{bool as k,cleanEnv as T,str as G}from"envalid";import _ from"node:os";import N from"node:path";import R from"node:process";var L=!1;function D(){L||(O.config(),L=!0)}v(D,"loadEnvFile");function M(){D();var e=T(R.env,{CWD:G({default:R.cwd()}),DEBUG:k({default:!1}),CYBERSKILL_STORAGE_DIRECTORY:G({default:N.join(_.homedir(),C)})});return{CWD:e.CWD,DEBUG:e.DEBUG,CYBERSKILL_STORAGE_DIRECTORY:e.CYBERSKILL_STORAGE_DIRECTORY}}v(M,"getEnv");var A=function(e){return e.Error="error",e.Warning="warning",e}({});import P from"chalk";import q from"consola";import{GraphQLError as F}from"graphql";var U=M();U.DEBUG||(q.level=4);function B(e){var t=P[e];return typeof t=="function"?t:P.green}v(B,"chalkKeyword");var K={silent:q.silent,level:q.level,fatal:q.fatal,error:q.error,warn:q.warn,log:q.log,info:q.info,success:q.success,ready:q.ready,start:q.start,box:q.box,debug:q.debug,trace:q.trace,verbose:q.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){q.box(P.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;q.log("".concat(P.gray("File:")," ").concat(P.blue("".concat(t).concat(r?":".concat(r):"")))),s&&q.log(" ".concat(B(n)("Rule:")," ").concat(s)),q.log(" ".concat(B(n)("Message:")," ").concat(i))}),q.box(B(n)("".concat(e," : ").concat(t.length))),q.log(P.gray("─".repeat(40)))}};var W={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import Y from"node-fetch";import H from"fs-extra";import J from"node:path";var $=M(),V=J;function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).resolve.apply(r,[$.CWD].concat(p(t)))}v(z,"resolveWorkingPath");function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).join.apply(r,p(t))}v(Q,"join");var X=M(),Z=X.CWD,ee="@cyberskill/shared",et="node_modules",en="dist",er="package.json",es="package-lock.json",ei="tsconfig.json",eo=".gitignore",ec=".simple-git-hooks.json",ea="pnpm-lock.yaml",eu=".git/hooks/",el=".git/COMMIT_EDITMSG",ed=".migrate-mongo.config.js",ep=Q(Z,et,ee,en),ef="cyberskill",eg="src/nodejs/cli/index.ts",em="eslint",ey="eslint",ev="vitest",eh="playwright",ex="vitest",ej="@commitlint/cli",eb="commitlint",eI="lint-staged",ew="lint-staged",eE="typescript",eS="tsc",eC="tsx",eO="git",ek="pnpm",eT="pnpm exec",eG="simple-git-hooks",e_="simple-git-hooks",eN="@eslint/config-inspector",eR="eslint-config-inspector",eL="node-modules-inspector",eD="node-modules-inspector",eM="migrate-mongo",eA="./node_modules/migrate-mongo/bin/migrate-mongo",eP={CYBERSKILL_DIRECTORY:ep,WORKING_DIRECTORY:Z,TS_CONFIG:z(ei),GIT_IGNORE:z(eo),GIT_HOOK:z(eu),GIT_COMMIT_MSG:z(el),SIMPLE_GIT_HOOKS_JSON:z(ec),PACKAGE_JSON:z(er),PACKAGE_LOCK_JSON:z(es),PNPM_LOCK_YAML:z(ea),NODE_MODULES:z(et),MIGRATE_MONGO_CONFIG:z(ed),LINT_STAGED_CONFIG:z("".concat(ep,"/configs/lint-staged/index.js")),COMMITLINT_CONFIG:z("".concat(ep,"/configs/commitlint/index.js")),UNIT_TEST_CONFIG:z("".concat(ep,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:z("".concat(ep,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:z("".concat(ep,"/react/vitest/vitest.e2e.js"))};function eq(e){var t=e.isCurrentProject;return l({"pre-commit":ew,"commit-msg":eb},t&&{"pre-push":tu("".concat(eO," pull"))})}v(eq,"createGitHooksConfig");function eF(e,t,n){return s(function(){return m(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case I.CLI:return[3,1];case I.STRING:return[3,3]}return[3,4];case 1:return[4,e5(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),td(tu("".concat(eT," ").concat(n))))];case 3:return[2,td(tu(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}v(eF,"buildCommand");function eU(e,t,n){return function(){return s(function(){return m(this,function(r){return[2,eF(e,t,n)]})})()}}v(eU,"commandFactory");var eB={simpleGitHooks:eU(I.CLI,eG,e_),eslintInspect:eU(I.CLI,eN,eR),nodeModulesInspect:eU(I.CLI,eL,eD),eslintCheck:eU(I.CLI,em,"".concat(ey," ").concat(eP.WORKING_DIRECTORY," --no-cache")),eslintFix:eU(I.CLI,em,"".concat(ey," ").concat(eP.WORKING_DIRECTORY," --fix --no-cache")),typescriptCheck:eU(I.CLI,eE,"".concat(eS," -p ").concat(eP.TS_CONFIG," --noEmit")),configureGitHook:eU(I.STRING,"".concat(eO," config core.hooksPath ").concat(eP.GIT_HOOK)),testUnit:eU(I.CLI,ev,"".concat(ex," --config ").concat(eP.UNIT_TEST_CONFIG)),testE2e:eU(I.CLI,"".concat(ev," ").concat(eh),"".concat(ex," --config ").concat(eP.E2E_TEST_CONFIG)),mongoMigrateCreate:v(function(e){return eU(I.CLI,eM,"".concat(eC," ").concat(eA," create ").concat(e," -f ").concat(eP.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eU(I.CLI,eM,"".concat(eC," ").concat(eA," up -f ").concat(eP.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eU(I.CLI,eM,"".concat(eC," ").concat(eA," down -f ").concat(eP.MIGRATE_MONGO_CONFIG)),commitLint:eU(I.CLI,ej,"".concat(eb," --edit ").concat(eP.GIT_COMMIT_MSG," --config ").concat(eP.COMMITLINT_CONFIG)),lintStaged:eU(I.CLI,eI,"".concat(ew," --config ").concat(eP.LINT_STAGED_CONFIG)),stageBuildDirectory:eU(I.STRING,"".concat(eO," add ").concat(en)),build:eU(I.STRING,"".concat(ek," run build")),pnpmInstallStandard:eU(I.STRING,"".concat(ek," install")),pnpmInstallLegacy:eU(I.STRING,"".concat(ek," install --legacy-peer-deps")),pnpmInstallForce:eU(I.STRING,"".concat(ek," install --force"))};var eK=H.lstatSync,eW=H.readdirSync,eY=H.mkdirSync,eH=H.readFileSync,eJ=H.unlinkSync,e$=H.statSync,eV=H.readJsonSync;function ez(e,t,n){H.writeFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}v(ez,"writeFileSync");function eQ(e,t,n){H.appendFileSync(e,t,n!==null&&n!==void 0?n:"utf-8")}v(eQ,"appendFileSync");function eX(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return H.pathExistsSync(e)})}v(eX,"pathExistsSync");function eZ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){eX(e)&&H.removeSync(e)})}v(eZ,"removeSync");var e0=M();function e1(e){var t=Q(e0.CWD,er);if(!eX(t))return!1;try{var n=eV(t),r=n.name,s=n.dependencies,i=s===void 0?{}:s,o=n.devDependencies,c=o===void 0?{}:o,a=r===e,u=e in i,l=e in c;return a||u||l?{path:t,file:n,isCurrentProject:a,isDepend:u,isDevDepend:l}:!1}catch(e){return K.warn("Failed to read package.json: ".concat(e.message)),!1}}v(e1,"getPackage");function e2(e){return s(function(){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,Y("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=i.sent(),r=n.version;return[2,r];case 3:s=i.sent();throw K.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}v(e2,"getLatestPackageVersion");function e4(e,t){return s(function(){var n,r,s,i,o,c,a,u,d,p,f,g,y,v,h,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e1(e);if(!n)return[2,l({},W)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(s=u.devDependencies)!==null&&s!==void 0?s:{},v=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(c=y[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];j=v;return[3,3];case 1:return[4,e2(e)];case 2:j=m.sent();m.label=3;case 3:h=j,x=d||v===h;if(!x&&(t===null||t===void 0?void 0:t.update)){;I=p?"dependencies":f?"devDependencies":null;I&&((b=u[I])===null||b===void 0?void 0:b[e])!==h&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=h,ez(a,JSON.stringify(u,null,4)),K.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(K.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},W))];case 5:return[2]}})})()}v(e4,"checkPackage");function e3(){return s(function(){var e,t,n,r,s,i,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:v(function(){return eB.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:v(function(){return eB.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:v(function(){return eB.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);s=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,8];o=i.value,c=o.command,a=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tf("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();K.warn("Installation attempt failed: ".concat(a)),K.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:d=p.sent();n=true;r=d;return[3,11];case 10:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})})()}v(e3,"installDependencies");function e5(e,t){return s(function(){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!eX(eP.PACKAGE_JSON)){K.error("package.json not found. Aborting setup.");return[2]}m.label=1;case 1:m.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return e4(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=m.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,e3()];case 3:r=m.sent();m.label=4;case 4:r;i=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();m.label=6;case 6:if(!!(i=(u=a.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;c=f;return[3,12];case 11:try{if(!i&&a.return!=null){a.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:g=m.sent();throw K.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}v(e5,"setupPackages");import e8 from"node-persist";var e6=M();function e7(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e8.defaultInstance;if(e)return[3,2];return[4,e8.init({dir:e6.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})})()}v(e7,"initNodePersist");var e9={get:function e(e){return s(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e7()];case 1:r.sent();return[4,e8.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(K.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e7()];case 1:r.sent();return[4,e8.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e7()];case 1:n.sent();return[4,e8.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();K.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e7()];case 1:n.sent();return[4,e8.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(K.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(K.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return m(this,function(t){try{return[2,"".concat(e6.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(K.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var te=M(),tt=S.promisify(w);function tn(e){return"error_list:".concat(e)}v(tn,"getErrorListKey");function tr(e){return s(function(){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tn(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,e9.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,e9.getLogLink(n)];case 1:e=t.sent();e&&K.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();K.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}v(tr,"saveErrorListToStorage");function ts(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,e9.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})})()}))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(K.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}v(ts,"getStoredErrorLists");function ti(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return e9.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();K.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}v(ti,"clearAllErrorLists");function to(e){var t=[],n=[],r="",s=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,y,v,h,x,j;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===A.Error?A.Error:A.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(y=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&y!==void 0?y:""}):f.length?t.push({file:(v=f===null||f===void 0?void 0:f[1])!==null&&v!==void 0?v:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===A.Error?A.Error:A.Warning,message:(h=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):g.length?t.push({file:"commitlint",type:A.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&tr(t),te.DEBUG&&n.length&&(K.warn("Unmatched lines:"),n.forEach(function(e){return K.info(" ".concat(e))}))}v(to,"parseTextErrors");function tc(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,s=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?A.Error:A.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&tr(n)}catch(t){to(e)}}v(tc,"parseCommandOutput");function ta(e){return s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return m(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tc;n=new AbortController;E.on("SIGINT",function(){K.warn("Process interrupted. Terminating..."),n.abort(),E.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,tt(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),s=r.stdout,i=r.stderr;[s,i].forEach(function(e){return e&&t(e)});d.label=3;case 3:return[3,5];case 4:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&K.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}v(ta,"executeCommand");function tu(e){return{raw:!0,cmd:e}}v(tu,"rawCommand");function tl(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eT," ").concat(ee," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eT," ").concat(eC," ").concat(eg," ").concat(e):"".concat(eT," ").concat(ef," ").concat(e)}v(tl,"formatCLI");function td(e,t){return typeof e=="function"?tl(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?tl(e,t):e}v(td,"formatCommand");function tp(e){return s(function(e){var t,n,r,s,i,o,c;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,e4(ee)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:s=c,i={isRemote:r,isCurrentProject:s},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,td(r,i)]}))]}})}).apply(this,arguments)}v(tp,"resolveCommands");function tf(e,t){return s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);K.start("".concat(e)),te.DEBUG&&K.info("→ ".concat(t));return[4,ta(t)];case 1:r.sent(),K.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw K.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}v(tf,"runCommand");function tg(){return s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!eX(eP.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eB.typescriptCheck()];case 1:return[4,tf.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=K.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}v(tg,"checkTypescript");function tm(){return s(function(){var e,t,n,r;var s=arguments;return m(this,function(i){switch(i.label){case 0:e=s.length>0&&s[0]!==void 0?s[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eB.eslintFix()];case 1:return[4,tf.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eB.eslintCheck()];case 4:return[4,tf.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}v(tm,"checkEslint");function ty(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";K.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}v(ty,"printIssues");function tv(){return s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,ts()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===A.Error}),n=e.filter(function(e){return e.type===A.Warning});!t.length&&!n.length?K.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ty("Warnings",n),ty("Errors",t),(t.length>0||n.length>0)&&h.exit(1));return[2]}})})()}v(tv,"showCheckResult");function th(){return s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,ti()];case 1:o.sent();return[4,e4(ee)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ee)];return[4,eB.build()];case 4:return[4,tf.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eB.stageBuildDirectory()];case 6:return[4,tf.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw K.error("Error building and staging ".concat(ee,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eB.lintStaged()];case 10:return[4,tf.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tv();return[2]}})})()}v(th,"lintStaged");function tx(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eB.eslintInspect()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tx,"inspectLint");function tj(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti()];case 1:e.sent();return[4,Promise.all([tg(),tm()])];case 2:e.sent(),tv();return[2]}})})()}v(tj,"lintCheck");function tb(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti()];case 1:e.sent();return[4,Promise.all([tg(),tm(!0)])];case 2:e.sent(),tv();return[2]}})})()}v(tb,"lintFix");function tI(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,ti()];case 1:t.sent();e=["Validating commit message"];return[4,eB.commitLint()];case 2:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tv();return[2]}})})()}v(tI,"commitLint");function tw(){return s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eB.configureGitHook()];case 1:return[4,tf.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eZ(eP.GIT_HOOK);return[4,tp(eq)];case 3:t=s.sent();ez(eP.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));n="\n".concat(ec,"\n");eX(eP.GIT_IGNORE)?eH(eP.GIT_IGNORE,"utf-8").split("\n").includes(ec)||eQ(eP.GIT_IGNORE,n):ez(eP.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eB.simpleGitHooks()];case 4:return[4,tf.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}v(tw,"setupGitHook");function tE(){return s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5([ee],{update:!0,postInstallActions:[tw]})];case 1:e.sent();return[2]}})})()}v(tE,"setup");function tS(){return s(function(){return m(this,function(e){switch(e.label){case 0:eZ(eP.NODE_MODULES,eP.PNPM_LOCK_YAML);return[4,e3()];case 1:e.sent();return[4,tw()];case 2:e.sent();return[2]}})})()}v(tS,"reset");function tC(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eB.nodeModulesInspect()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tC,"inspect");function tO(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eB.testUnit()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tO,"testUnit");function tk(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eB.testE2e()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tk,"testE2E");function tT(e){return s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eB.mongoMigrateCreate(e)];case 1:return[4,tf.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}v(tT,"mongoMigrateCreate");function tG(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eB.mongoMigrateUp()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(tG,"mongoMigrateUp");function t_(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eB.mongoMigrateDown()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}v(t_,"mongoMigrateDown");(function(){return s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j(x(h.argv)).scriptName(ef).usage("$0 <command> [options]").command("lint","Check code for linting issues",tj).command("lint:fix","Fix linting issues automatically",tb).command("lint:inspect","View active ESLint configuration",tx).command("lint-staged","Run lint checks on staged files",th).command("commitlint","Validate commit message format",tI).command("setup","Initialize project setup and dependencies",tE).command("reset","Reset the project and reinstall dependencies",tS).command("inspect","Analyze installed project dependencies",tC).command("test:unit","Run unit test suite",tO).command("test:e2e","Run end-to-end test suite",tk).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},function(e){return s(function(){return m(this,function(t){switch(t.label){case 0:if(!e.name){K.error("Migration name is required.");return[2]}return[4,tT(e.name)];case 1:t.sent();return[2]}})})()}).command("mongo:migrate:up","Apply all MongoDB migrations",tG).command("mongo:migrate:down","Rollback last MongoDB migration",t_).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();K.error("Fatal: ".concat(e.message)),h.exit(1);return[3,3];case 3:return[2]}})})()})();
|