@cyberskill/shared 1.107.0 → 1.109.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 +19 -0
- package/dist/_tsup-dts-rollup.d.ts +19 -0
- 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 +5 -2
- package/dist/index.d.ts +5 -2
- 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/fs/fs.util.cjs +1 -1
- package/dist/nodejs/fs/fs.util.d.cts +4 -2
- package/dist/nodejs/fs/fs.util.d.ts +4 -2
- package/dist/nodejs/fs/fs.util.js +1 -1
- package/dist/nodejs/fs/index.cjs +1 -1
- package/dist/nodejs/fs/index.d.cts +4 -2
- package/dist/nodejs/fs/index.d.ts +4 -2
- package/dist/nodejs/fs/index.js +1 -1
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.d.cts +5 -2
- package/dist/nodejs/index.d.ts +5 -2
- 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.d.cts +1 -0
- package/dist/nodejs/path/index.d.ts +1 -0
- 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.d.cts +1 -0
- package/dist/nodejs/path/path.util.d.ts +1 -0
- 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 +5 -5
|
@@ -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
|
|
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 Y},expressMiddleware:function(){return A.expressMiddleware}});module.exports=O(E);var P=require("@apollo/server"),A=require("@apollo/server/express4"),j=require("@apollo/server/plugin/drainHttpServer"),_=require("@apollo/server/plugin/landingPage/default");var x=w(require("chalk"),1),D=w(require("consola"),1),R=require("graphql");var q=".cyberskill-storage";var I=w(require("dotenv"),1),k=require("envalid"),C=w(require("os"),1),L=w(require("path"),1),B=w(require("process"),1);I.default.config();function G(){var e={DEBUG:B.default.env.DEBUG||!1,CWD:B.default.env.CWD||B.default.cwd(),CYBERSKILL_STORAGE_DIRECTORY:B.default.env.CYBERSKILL_STORAGE_DIRECTORY||L.default.join(C.default.homedir(),q)};return(0,k.cleanEnv)(e,{DEBUG:(0,k.bool)(),CWD:(0,k.str)(),CYBERSKILL_STORAGE_DIRECTORY:(0,k.str)()})}h(G,"getEnv");var M=G();M.DEBUG||(D.default.level=4);function T(e){var r=x.default[e];return typeof r=="function"?r:x.default.green}h(T,"chalkKeyword");var U={silent:D.default.silent,level:D.default.level,fatal:D.default.fatal,error:D.default.error,warn:D.default.warn,log:D.default.log,info:D.default.info,success:D.default.success,ready:D.default.ready,start:D.default.start,box:D.default.box,debug:D.default.debug,trace:D.default.trace,verbose:D.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)){D.default.box(x.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,o=e.rule,a=e.message;D.default.log("".concat(x.default.gray("File:")," ").concat(x.default.blue("".concat(r).concat(n?":".concat(n):"")))),o&&D.default.log(" ".concat(T(t)("Rule:")," ").concat(o)),D.default.log(" ".concat(T(t)("Message:")," ").concat(a))}),D.default.box(T(t)("".concat(e," : ").concat(r.length))),D.default.log(x.default.gray("─".repeat(40)))}};function Y(e){return new P.ApolloServer(u({schema:e.schema,plugins:[e.isDev?(0,_.ApolloServerPluginLandingPageLocalDefault)():(0,_.ApolloServerPluginLandingPageProductionDefault)(),(0,j.ApolloServerPluginDrainHttpServer)({httpServer:e.server})].concat(i(e.drainServer?[{serverWillStart:function r(){return /*#__PURE__*/n(function(){return s(this,function(r){return[2,{drainServer:function r(){return /*#__PURE__*/n(function(){var r;return s(this,function(t){(r=e.drainServer)===null||r===void 0?void 0:r.call(e),U.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}h(Y,"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 E=".cyberskill-storage";import w from"dotenv";import{bool as O,cleanEnv as A,str as D}from"envalid";import P from"node:os";import R from"node:path";import _ from"node:process";w.config();function x(){var r={DEBUG:_.env.DEBUG||!1,CWD:_.env.CWD||_.cwd(),CYBERSKILL_STORAGE_DIRECTORY:_.env.CYBERSKILL_STORAGE_DIRECTORY||R.join(P.homedir(),E)};return A(r,{DEBUG:O(),CWD:D(),CYBERSKILL_STORAGE_DIRECTORY:D()})}p(x,"getEnv");var I=x();I.DEBUG||(h.level=4);function j(r){var e=y[r];return typeof e=="function"?e:y.green}p(j,"chalkKeyword");var C={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(j(t)("Rule:")," ").concat(o)),h.log(" ".concat(j(t)("Message:")," ").concat(a))}),h.box(j(t)("".concat(r," : ").concat(e.length))),h.log(y.gray("─".repeat(40)))}};function L(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 /*#__PURE__*/n(function(){return f(this,function(e){return[2,{drainServer:function e(){return /*#__PURE__*/n(function(){var e;return f(this,function(t){(e=r.drainServer)===null||e===void 0?void 0:e.call(r),C.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},r.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}p(L,"createApolloServer");export{L 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,i,s,o){try{var a=e[s](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,s){var o=e.apply(t,n);function a(e){r(o,i,s,a,c,"next",e)}function c(e){r(o,i,s,a,c,"throw",e)}a(undefined)})}}function s(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 i=true;var s=false;var o,a;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){s=true;a=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)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){s(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}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,i,s={label:0,sent:function(){if(i[0]&1)throw i[1];return i[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]&&(s=0)),s)try{if(n=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:s.label++;return{value:a[1],done:false};case 5:s.label++;r=a[1];a=[0];continue;case 7:a=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){s=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(a[0]===6&&s.label<i[1]){s.label=i[1];i=a;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(a);break}if(i[2])s.ops.pop();s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e];r=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var y=Object.create;var h=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var I=function(e,t){return h(e,"name",{value:t,configurable:!0})};var w=function(e,t,n,r){var i=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var a=function(){var i=u.value;!b.call(e,i)&&i!==n&&h(e,i,{get:function(){return t[i]},enumerable:!(r=v(t,i))||r.enumerable})};for(var c=x(t)[Symbol.iterator](),u;!(i=(u=c.next()).done);i=true)a()}catch(e){s=true;o=e}finally{try{if(!i&&c.return!=null){c.return()}}finally{if(s){throw o}}}return e};var E=function(e,t,n){return n=e!=null?y(j(e)):{},w(t||!e||!e.__esModule?h(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 _={name:"@cyberskill/shared",type:"module",version:"1.106.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/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:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- 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","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@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",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.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.10.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.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.3","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",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.2",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/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.6","simple-git-hooks":"2.12.1"}};var T=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var k=require("child_process"),G=E(require("process"),1),R=E(require("util"),1);var N=".cyberskill-storage";var L=E(require("dotenv"),1),q=require("envalid"),D=E(require("os"),1),M=E(require("path"),1),P=E(require("process"),1);L.default.config();function A(){var e={DEBUG:P.default.env.DEBUG||!1,CWD:P.default.env.CWD||P.default.cwd(),CYBERSKILL_STORAGE_DIRECTORY:P.default.env.CYBERSKILL_STORAGE_DIRECTORY||M.default.join(D.default.homedir(),N)};return(0,q.cleanEnv)(e,{DEBUG:(0,q.bool)(),CWD:(0,q.str)(),CYBERSKILL_STORAGE_DIRECTORY:(0,q.str)()})}I(A,"getEnv");var F=function(e){return e.Error="error",e.Warning="warning",e}({});var U=E(require("chalk"),1),B=E(require("consola"),1),K=require("graphql");var W=A();W.DEBUG||(B.default.level=4);function Y(e){var t=U.default[e];return typeof t=="function"?t:U.default.green}I(Y,"chalkKeyword");var H={silent:B.default.silent,level:B.default.level,fatal:B.default.fatal,error:B.default.error,warn:B.default.warn,log:B.default.log,info:B.default.info,success:B.default.success,ready:B.default.ready,start:B.default.start,box:B.default.box,debug:B.default.debug,trace:B.default.trace,verbose:B.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)){B.default.box(U.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;B.default.log("".concat(U.default.gray("File:")," ").concat(U.default.blue("".concat(t).concat(r?":".concat(r):"")))),i&&B.default.log(" ".concat(Y(n)("Rule:")," ").concat(i)),B.default.log(" ".concat(Y(n)("Message:")," ").concat(s))}),B.default.box(Y(n)("".concat(e," : ").concat(t.length))),B.default.log(U.default.gray("─".repeat(40)))}};var J={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var $=E(require("node-fetch"),1);var V=E(require("fs-extra"),1),z=require("path");var Q=V.default,X=Q.appendFileSync,Z=Q.lstatSync,ee=Q.mkdirSync,et=Q.readFileSync,en=Q.unlinkSync,er=Q.writeFileSync,ei=Q.statSync,es=V.default.readJsonSync,eo=V.default.writeJsonSync;function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return V.default.pathExistsSync(e)})}I(ea,"pathExistsSync");function ec(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ea(e)&&V.default.removeSync(e)})}I(ec,"removeSync");var eu=require("path");var el=A();function ed(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,eu.resolve).apply(this,[el.CWD].concat(p(t)))}I(ed,"resolveWorkingPath");function ep(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,eu.join).apply(this,p(t))}I(ep,"join");var ef=A(),eg=ef.CWD,em="@cyberskill/shared",ey="node_modules",eh="dist",ev="package.json",ex="package-lock.json",ej="tsconfig.json",eb=".gitignore",eI=".simple-git-hooks.json",ew="pnpm-lock.yaml",eE=".git/hooks/",eS=".git/COMMIT_EDITMSG",eO=".migrate-mongo.config.js",eC=ep(eg,ey,em,eh),e_="cyberskill",eT="src/nodejs/cli/index.ts",ek="eslint",eG="eslint",eR="vitest",eN="playwright",eL="vitest",eq="@commitlint/cli",eD="commitlint",eM="lint-staged",eP="lint-staged",eA="typescript",eF="tsc",eU="tsx",eB="git",eK="pnpm",eW="pnpm exec",eY="simple-git-hooks",eH="simple-git-hooks",eJ="@eslint/config-inspector",e$="eslint-config-inspector",eV="node-modules-inspector",ez="node-modules-inspector",eQ="migrate-mongo",eX="./node_modules/migrate-mongo/bin/migrate-mongo",eZ={CYBERSKILL_DIRECTORY:eC,WORKING_DIRECTORY:eg,TS_CONFIG:ed(ej),GIT_IGNORE:ed(eb),GIT_HOOK:ed(eE),GIT_COMMIT_MSG:ed(eS),SIMPLE_GIT_HOOKS_JSON:ed(eI),PACKAGE_JSON:ed(ev),PACKAGE_LOCK_JSON:ed(ex),PNPM_LOCK_YAML:ed(ew),NODE_MODULES:ed(ey),MIGRATE_MONGO_CONFIG:ed(eO),LINT_STAGED_CONFIG:ed("".concat(eC,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ed("".concat(eC,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ed("".concat(eC,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ed("".concat(eC,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ed("".concat(eC,"/react/vitest/vitest.e2e.js"))};function e0(e){var t=e.isCurrentProject;return l({"pre-commit":eP,"commit-msg":eD},t&&{"pre-push":tw("".concat(eB," pull"))})}I(e0,"createGitHooksConfig");function e1(e,t,n){return e2.apply(this,arguments)}function e2(){e2=i(function(e,t,n){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,tr(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tS(tw("".concat(eW," ").concat(n))))];case 3:return[2,tS(tw(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return e2.apply(this,arguments)}I(e1,"buildCommand");function e4(e,t,n){return /*#__PURE__*/i(function(){return m(this,function(r){return[2,e1(e,t,n)]})})}I(e4,"commandFactory");var e3={simpleGitHooks:e4(T.CLI,eY,eH),eslintInspect:e4(T.CLI,eJ,e$),nodeModulesInspect:e4(T.CLI,eV,ez),eslintCheck:e4(T.CLI,ek,"".concat(eG," ").concat(eZ.WORKING_DIRECTORY)),eslintFix:e4(T.CLI,ek,"".concat(eG," ").concat(eZ.WORKING_DIRECTORY," --fix")),typescriptCheck:e4(T.CLI,eA,"".concat(eF," -p ").concat(eZ.TS_CONFIG," --noEmit")),configureGitHook:e4(T.STRING,"".concat(eB," config core.hooksPath ").concat(eZ.GIT_HOOK)),testUnit:e4(T.CLI,eR,"".concat(eL," --config ").concat(eZ.UNIT_TEST_CONFIG)),testE2e:e4(T.CLI,"".concat(eR," ").concat(eN),"".concat(eL," --config ").concat(eZ.E2E_TEST_CONFIG)),mongoMigrateCreate:I(function(e){return e4(T.CLI,eQ,"".concat(eU," ").concat(eX," create ").concat(e," -f ").concat(eZ.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e4(T.CLI,eQ,"".concat(eU," ").concat(eX," up -f ").concat(eZ.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e4(T.CLI,eQ,"".concat(eU," ").concat(eX," down -f ").concat(eZ.MIGRATE_MONGO_CONFIG)),commitLint:e4(T.CLI,eq,"".concat(eD," --edit ").concat(eZ.GIT_COMMIT_MSG," --config ").concat(eZ.COMMITLINT_CONFIG)),lintStaged:e4(T.CLI,eM,"".concat(eP," --config ").concat(eZ.LINT_STAGED_CONFIG)),stageBuildDirectory:e4(T.STRING,"".concat(eB," add ").concat(eh)),build:e4(T.STRING,"".concat(eK," run build")),pnpmInstallStandard:e4(T.STRING,"".concat(eK," install")),pnpmInstallLegacy:e4(T.STRING,"".concat(eK," install --legacy-peer-deps")),pnpmInstallForce:e4(T.STRING,"".concat(eK," install --force"))};var e5=A();function e8(e){var t=ep(e5.CWD,ev);if(!ea(t))return!1;try{var n=es(t),r=n.name,i=n.dependencies,s=i===void 0?{}:i,o=n.devDependencies,a=o===void 0?{}:o,c=r===e,u=e in s,l=e in a;return c||u||l?{path:t,file:n,isCurrentProject:c,isDepend:u,isDevDepend:l}:!1}catch(e){return H.warn("Failed to read package.json: ".concat(e.message)),!1}}I(e8,"getPackage");function e6(e){return e9.apply(this,arguments)}function e9(){e9=i(function(e){var t,n,r,i;return m(this,function(s){switch(s.label){case 0:s.trys.push([0,3,,4]);return[4,(0,$.default)("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=s.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=s.sent(),r=n.version;return[2,r];case 3:i=s.sent();throw H.error('Failed to fetch version for "'.concat(e,'": ').concat(i.message)),i;case 4:return[2]}})});return e9.apply(this,arguments)}I(e6,"getLatestPackageVersion");function e7(e,t){return te.apply(this,arguments)}function te(){te=i(function(e,t){var n,r,i,s,o,a,c,u,d,p,f,g,y,h,v,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e8(e);if(!n)return[2,l({},J)];c=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(i=u.devDependencies)!==null&&i!==void 0?i:{},h=d?(s=u.version)!==null&&s!==void 0?s:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(a=y[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];j=h;return[3,3];case 1:return[4,e6(e)];case 2:j=m.sent();m.label=3;case 3:v=j,x=d||h===v;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])!==v&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=v,eo(c,u),H.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(H.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},J))];case 5:return[2]}})});return te.apply(this,arguments)}I(e7,"checkPackage");function tt(){return tn.apply(this,arguments)}function tn(){tn=i(function(){var e,t,n,r,i,s,o,a,c,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:I(function(){return e3.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:I(function(){return e3.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:I(function(){return e3.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]);i=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,8];o=s.value,a=o.command,c=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,a()];case 4:u=p.sent();return[4,t_("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();H.warn("Installation attempt failed: ".concat(c)),H.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&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return tn.apply(this,arguments)}I(tt,"installDependencies");function tr(e,t){return ti.apply(this,arguments)}function ti(){ti=i(function(e,t){var n,r,i,s,o,a,c,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!ea(eZ.PACKAGE_JSON)){H.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 e7(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,tt()];case 3:r=m.sent();m.label=4;case 4:r;s=true,o=false,a=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);c=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();m.label=6;case 6:if(!!(s=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:m.sent();m.label=8;case 8:s=true;return[3,6];case 9:return[3,12];case 10:f=m.sent();o=true;a=f;return[3,12];case 11:try{if(!s&&c.return!=null){c.return()}}finally{if(o){throw a}}return[7];case 12:return[3,14];case 13:g=m.sent();throw H.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return ti.apply(this,arguments)}I(tr,"setupPackages");var ts=E(require("node-persist"),1);var to=A();function ta(){return tc.apply(this,arguments)}function tc(){tc=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=ts.default.defaultInstance;if(e)return[3,2];return[4,ts.default.init({dir:to.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]}})});return tc.apply(this,arguments)}I(ta,"initNodePersist");var tu={get:function e(e){return i(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta()];case 1:r.sent();return[4,ts.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(H.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ta()];case 1:r.sent();return[4,ts.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();H.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ta()];case 1:n.sent();return[4,ts.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();H.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ta()];case 1:n.sent();return[4,ts.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(H.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(H.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return m(this,function(t){try{return[2,"".concat(to.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(H.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var tl=A(),td=R.promisify(k.exec);function tp(e){return"error_list:".concat(e)}I(tp,"getErrorListKey");function tf(e){return tg.apply(this,arguments)}function tg(){tg=i(function(e){var t,n,r;return m(this,function(s){switch(s.label){case 0:if(e.length===0)return[2];t=Date.now(),n=tp(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,tu.set(n,{errors:e,timestamp:t})];case 2:s.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tu.getLogLink(n)];case 1:e=t.sent();e&&H.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=s.sent();H.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tg.apply(this,arguments)}I(tf,"saveErrorListToStorage");function tm(){return ty.apply(this,arguments)}function ty(){ty=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tu.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(/*#__PURE__*/function(){var e=i(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,tu.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(H.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return ty.apply(this,arguments)}I(tm,"getStoredErrorLists");function th(){return tv.apply(this,arguments)}function tv(){tv=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tu.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 tu.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();H.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return tv.apply(this,arguments)}I(th,"clearAllErrorLists");function tx(e){var t=[],n=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,s=/^(.+?)\((\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 p=i.exec(e)||[],f=s.exec(e)||[],g=o.exec(e)||[];var m,y,h,v,x,j;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===F.Error?F.Error:F.Warning,message:(m=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&m!==void 0?m:"",rule:(y=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&y!==void 0?y:""}):f.length?t.push({file:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===F.Error?F.Error:F.Warning,message:(v=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):g.length?t.push({file:"commitlint",type:F.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&&tf(t),tl.DEBUG&&n.length&&(H.warn("Unmatched lines:"),n.forEach(function(e){return H.info(" ".concat(e))}))}I(tx,"parseTextErrors");function tj(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,i=e.line,s=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?F.Error:F.Warning,file:t,position:"".concat(i,":").concat(s),rule:o,message:a})})}),n.length&&tf(n)}catch(t){tx(e)}}I(tj,"parseCommandOutput");function tb(e){return tI.apply(this,arguments)}function tI(){tI=i(function(e){var t,n,r,i,s,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]:tj;n=new AbortController;G.default.on("SIGINT",function(){H.warn("Process interrupted. Terminating..."),n.abort(),G.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,td(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=d.sent(),i=r.stdout,s=r.stderr;[i,s].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&&H.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return tI.apply(this,arguments)}I(tb,"executeCommand");function tw(e){return{raw:!0,cmd:e}}I(tw,"rawCommand");function tE(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eW," ").concat(em," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eW," ").concat(eU," ").concat(eT," ").concat(e):"".concat(eW," ").concat(e_," ").concat(e)}I(tE,"formatCLI");function tS(e,t){return typeof e=="function"?tE(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"?tE(e,t):e}I(tS,"formatCommand");function tO(e){return tC.apply(this,arguments)}function tC(){tC=i(function(e){var t,n,r,i,s,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,e7(em)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:i=a,s={isRemote:r,isCurrentProject:i},o=typeof e=="function"?e(s):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,tS(r,s)]}))]}})});return tC.apply(this,arguments)}I(tO,"resolveCommands");function t_(e,t){return tT.apply(this,arguments)}function tT(){tT=i(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);H.start("".concat(e)),tl.DEBUG&&H.info("→ ".concat(t));return[4,tb(t)];case 1:r.sent(),H.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw H.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tT.apply(this,arguments)}I(t_,"runCommand");function tk(){return tG.apply(this,arguments)}function tG(){tG=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!ea(eZ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e3.typescriptCheck()];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=H.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tG.apply(this,arguments)}I(tk,"checkTypescript");function tR(){return tN.apply(this,arguments)}function tN(){tN=i(function(){var e,t,n,r;var i=arguments;return m(this,function(s){switch(s.label){case 0:e=i.length>0&&i[0]!==void 0?i[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,e3.eslintFix()];case 1:return[4,t_.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e3.eslintCheck()];case 4:return[4,t_.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})});return tN.apply(this,arguments)}I(tR,"checkEslint");function tL(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";H.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}I(tL,"printIssues");function tq(){return tD.apply(this,arguments)}function tD(){tD=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tm()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===F.Error}),n=e.filter(function(e){return e.type===F.Warning});!t.length&&!n.length?H.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tL("Warnings",n),tL("Errors",t),(t.length>0||n.length>0)&&S.default.exit(1));return[2]}})});return tD.apply(this,arguments)}I(tq,"showCheckResult");function tM(){return tP.apply(this,arguments)}function tP(){tP=i(function(){var e,t,n,r,i,s;return m(this,function(o){switch(o.label){case 0:return[4,th()];case 1:o.sent();return[4,e7(em)];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(em)];return[4,e3.build()];case 4:return[4,t_.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e3.stageBuildDirectory()];case 6:return[4,t_.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:i=o.sent();throw H.error("Error building and staging ".concat(em,": ").concat(i.message)),i;case 9:s=["Executing lint-staged"];return[4,e3.lintStaged()];case 10:return[4,t_.apply(void 0,s.concat([o.sent()]))];case 11:o.sent(),tq();return[2]}})});return tP.apply(this,arguments)}I(tM,"lintStaged");function tA(){return tF.apply(this,arguments)}function tF(){tF=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e3.eslintInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tF.apply(this,arguments)}I(tA,"inspectLint");function tU(){return tB.apply(this,arguments)}function tB(){tB=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,th()];case 1:e.sent();return[4,Promise.all([tk(),tR()])];case 2:e.sent(),tq();return[2]}})});return tB.apply(this,arguments)}I(tU,"lintCheck");function tK(){return tW.apply(this,arguments)}function tW(){tW=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,th()];case 1:e.sent();return[4,Promise.all([tk(),tR(!0)])];case 2:e.sent(),tq();return[2]}})});return tW.apply(this,arguments)}I(tK,"lintFix");function tY(){return tH.apply(this,arguments)}function tH(){tH=i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,th()];case 1:t.sent();e=["Validating commit message"];return[4,e3.commitLint()];case 2:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tq();return[2]}})});return tH.apply(this,arguments)}I(tY,"commitLint");function tJ(){return t$.apply(this,arguments)}function t$(){t$=i(function(){var e,t,n,r;return m(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,e3.configureGitHook()];case 1:return[4,t_.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),ec(eZ.GIT_HOOK);return[4,tO(e0)];case 3:t=i.sent();eo(eZ.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(eI,"\n");ea(eZ.GIT_IGNORE)?et(eZ.GIT_IGNORE,"utf-8").split("\n").includes(eI)||X(eZ.GIT_IGNORE,n,"utf-8"):er(eZ.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,e3.simpleGitHooks()];case 4:return[4,t_.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})});return t$.apply(this,arguments)}I(tJ,"setupGitHook");function tV(){return tz.apply(this,arguments)}function tz(){tz=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tr([em],{update:!0,postInstallActions:[tJ]})];case 1:e.sent();return[2]}})});return tz.apply(this,arguments)}I(tV,"setup");function tQ(){return tX.apply(this,arguments)}function tX(){tX=i(function(){return m(this,function(e){switch(e.label){case 0:ec(eZ.NODE_MODULES,eZ.PNPM_LOCK_YAML);return[4,tt()];case 1:e.sent();return[4,tJ()];case 2:e.sent();return[2]}})});return tX.apply(this,arguments)}I(tQ,"reset");function tZ(){return t0.apply(this,arguments)}function t0(){t0=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e3.nodeModulesInspect()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t0.apply(this,arguments)}I(tZ,"inspect");function t1(){return t2.apply(this,arguments)}function t2(){t2=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e3.testUnit()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t2.apply(this,arguments)}I(t1,"testUnit");function t4(){return t3.apply(this,arguments)}function t3(){t3=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e3.testE2e()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t3.apply(this,arguments)}I(t4,"testE2E");function t5(e){return t8.apply(this,arguments)}function t8(){t8=i(function(e){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e3.mongoMigrateCreate(e)];case 1:return[4,t_.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return t8.apply(this,arguments)}I(t5,"mongoMigrateCreate");function t6(){return t9.apply(this,arguments)}function t9(){t9=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e3.mongoMigrateUp()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t9.apply(this,arguments)}I(t6,"mongoMigrateUp");function t7(){return ne.apply(this,arguments)}function ne(){ne=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e3.mongoMigrateDown()];case 1:return[4,t_.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return ne.apply(this,arguments)}I(t7,"mongoMigrateDown");i(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(e_).usage("$0 <command> [options]").command("lint","Check code for linting issues",tU).command("lint:fix","Fix linting issues automatically",tK).command("lint:inspect","View active ESLint configuration",tA).command("lint-staged","Run lint checks on staged files",tM).command("commitlint","Validate commit message format",tY).command("setup","Initialize project setup and dependencies",tV).command("reset","Reset the project and reinstall dependencies",tQ).command("inspect","Analyze installed project dependencies",tZ).command("test:unit","Run unit test suite",t1).command("test:e2e","Run end-to-end test suite",t4).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},/*#__PURE__*/function(){var e=i(function(e){return m(this,function(t){switch(t.label){case 0:if(!e.name){H.error("Migration name is required.");return[2]}return[4,t5(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",t6).command("mongo:migrate:down","Rollback last MongoDB migration",t7).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(_.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();H.error("Fatal: ".concat(e.message)),S.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 _=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"),R=I(require("yargs/yargs"),1);var O={name:"@cyberskill/shared",type:"module",version:"1.108.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/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:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- 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","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.22","@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",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.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.10.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.13.2","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",ora:"8.2.0",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/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.6","simple-git-hooks":"2.13.0"}};var C=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});var P=require("child_process"),T=I(require("process"),1),k=I(require("util"),1);var G=".cyberskill-storage";var U=I(require("dotenv"),1),N=require("envalid"),L=I(require("os"),1),q=I(require("path"),1),D=I(require("process"),1);U.default.config();function M(){var e={DEBUG:D.default.env.DEBUG||!1,CWD:D.default.env.CWD||D.default.cwd(),CYBERSKILL_STORAGE_DIRECTORY:D.default.env.CYBERSKILL_STORAGE_DIRECTORY||q.default.join(L.default.homedir(),G)};return(0,N.cleanEnv)(e,{DEBUG:(0,N.bool)(),CWD:(0,N.str)(),CYBERSKILL_STORAGE_DIRECTORY:(0,N.str)()})}b(M,"getEnv");var A=function(e){return e.Error="error",e.Warning="warning",e}({});var F=I(require("chalk"),1),B=I(require("consola"),1),K=require("graphql");var W=M();W.DEBUG||(B.default.level=4);function Y(e){var t=F.default[e];return typeof t=="function"?t:F.default.green}b(Y,"chalkKeyword");var H={silent:B.default.silent,level:B.default.level,fatal:B.default.fatal,error:B.default.error,warn:B.default.warn,log:B.default.log,info:B.default.info,success:B.default.success,ready:B.default.ready,start:B.default.start,box:B.default.box,debug:B.default.debug,trace:B.default.trace,verbose:B.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)){B.default.box(F.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;B.default.log("".concat(F.default.gray("File:")," ").concat(F.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&B.default.log(" ".concat(Y(n)("Rule:")," ").concat(s)),B.default.log(" ".concat(Y(n)("Message:")," ").concat(i))}),B.default.box(Y(n)("".concat(e," : ").concat(t.length))),B.default.log(F.default.gray("─".repeat(40)))}};var J={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var $=I(require("node-fetch"),1);var V=I(require("fs-extra"),1),z=require("path");var Q=V.default,X=Q.lstatSync,Z=Q.readdirSync,ee=Q.mkdirSync,et=Q.readFileSync,en=Q.writeFileSync,er=Q.appendFileSync,es=Q.unlinkSync,ei=Q.statSync,eo=V.default.readJsonSync,ea=V.default.writeJsonSync;function ec(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return V.default.pathExistsSync(e)})}b(ec,"pathExistsSync");function eu(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ec(e)&&V.default.removeSync(e)})}b(eu,"removeSync");var el=I(require("path"),1);var ed=M();function ef(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,el.resolve).apply(this,[ed.CWD].concat(f(t)))}b(ef,"resolveWorkingPath");function ep(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return(0,el.join).apply(this,f(t))}b(ep,"join");var eg=M(),em=eg.CWD,ev="@cyberskill/shared",ey="node_modules",eh="dist",e_="package.json",ex="package-lock.json",ej="tsconfig.json",eb=".gitignore",eE=".simple-git-hooks.json",eI="pnpm-lock.yaml",ew=".git/hooks/",eS=".git/COMMIT_EDITMSG",eR=".migrate-mongo.config.js",eO=ep(em,ey,ev,eh),eC="cyberskill",eP="src/nodejs/cli/index.ts",eT="eslint",ek="eslint",eG="vitest",eU="playwright",eN="vitest",eL="@commitlint/cli",eq="commitlint",eD="lint-staged",eM="lint-staged",eA="typescript",eF="tsc",eB="tsx",eK="git",eW="pnpm",eY="pnpm exec",eH="simple-git-hooks",eJ="simple-git-hooks",e$="@eslint/config-inspector",eV="eslint-config-inspector",ez="node-modules-inspector",eQ="node-modules-inspector",eX="migrate-mongo",eZ="./node_modules/migrate-mongo/bin/migrate-mongo",e0={CYBERSKILL_DIRECTORY:eO,WORKING_DIRECTORY:em,TS_CONFIG:ef(ej),GIT_IGNORE:ef(eb),GIT_HOOK:ef(ew),GIT_COMMIT_MSG:ef(eS),SIMPLE_GIT_HOOKS_JSON:ef(eE),PACKAGE_JSON:ef(e_),PACKAGE_LOCK_JSON:ef(ex),PNPM_LOCK_YAML:ef(eI),NODE_MODULES:ef(ey),MIGRATE_MONGO_CONFIG:ef(eR),LINT_STAGED_CONFIG:ef("".concat(eO,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ef("".concat(eO,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ef("".concat(eO,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ef("".concat(eO,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ef("".concat(eO,"/react/vitest/vitest.e2e.js"))};function e1(e){var t=e.isCurrentProject;return l({"pre-commit":eM,"commit-msg":eq},t&&{"pre-push":tg("".concat(eK," pull"))})}b(e1,"createGitHooksConfig");function e2(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,te(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tv(tg("".concat(eY," ").concat(n))))];case 3:return[2,tv(tg(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}b(e2,"buildCommand");function e4(e,t,n){return function(){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,e2(e,t,n)]})})()}}b(e4,"commandFactory");var e3={simpleGitHooks:e4(C.CLI,eH,eJ),eslintInspect:e4(C.CLI,e$,eV),nodeModulesInspect:e4(C.CLI,ez,eQ),eslintCheck:e4(C.CLI,eT,"".concat(ek," ").concat(e0.WORKING_DIRECTORY)),eslintFix:e4(C.CLI,eT,"".concat(ek," ").concat(e0.WORKING_DIRECTORY," --fix")),typescriptCheck:e4(C.CLI,eA,"".concat(eF," -p ").concat(e0.TS_CONFIG," --noEmit")),configureGitHook:e4(C.STRING,"".concat(eK," config core.hooksPath ").concat(e0.GIT_HOOK)),testUnit:e4(C.CLI,eG,"".concat(eN," --config ").concat(e0.UNIT_TEST_CONFIG)),testE2e:e4(C.CLI,"".concat(eG," ").concat(eU),"".concat(eN," --config ").concat(e0.E2E_TEST_CONFIG)),mongoMigrateCreate:b(function(e){return e4(C.CLI,eX,"".concat(eB," ").concat(eZ," create ").concat(e," -f ").concat(e0.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:e4(C.CLI,eX,"".concat(eB," ").concat(eZ," up -f ").concat(e0.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:e4(C.CLI,eX,"".concat(eB," ").concat(eZ," down -f ").concat(e0.MIGRATE_MONGO_CONFIG)),commitLint:e4(C.CLI,eL,"".concat(eq," --edit ").concat(e0.GIT_COMMIT_MSG," --config ").concat(e0.COMMITLINT_CONFIG)),lintStaged:e4(C.CLI,eD,"".concat(eM," --config ").concat(e0.LINT_STAGED_CONFIG)),stageBuildDirectory:e4(C.STRING,"".concat(eK," add ").concat(eh)),build:e4(C.STRING,"".concat(eW," run build")),pnpmInstallStandard:e4(C.STRING,"".concat(eW," install")),pnpmInstallLegacy:e4(C.STRING,"".concat(eW," install --legacy-peer-deps")),pnpmInstallForce:e4(C.STRING,"".concat(eW," install --force"))};var e8=M();function e5(e){var t=ep(e8.CWD,e_);if(!ec(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 H.warn("Failed to read package.json: ".concat(e.message)),!1}}b(e5,"getPackage");function e6(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,$.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 H.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}b(e6,"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=e5(e);if(!n)return[2,l({},J)];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,e6(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,u),H.info('Updated "'.concat(e,'" to version ').concat(h)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:_}];case 4:I=m.sent();return[2,(H.error('Error checking package "'.concat(e,'": ').concat(I.message)),l({},J))];case 5:return[2]}})})()}b(e9,"checkPackage");function e7(){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 e3.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:b(function(){return e3.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:b(function(){return e3.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,th("".concat(c," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();H.warn("Installation attempt failed: ".concat(c)),H.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(e7,"installDependencies");function te(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(!ec(e0.PACKAGE_JSON)){H.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,e7()];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 H.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}b(te,"setupPackages");var tt=I(require("node-persist"),1);var tn=M();function tr(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=tt.default.defaultInstance;if(e)return[3,2];return[4,tt.default.init({dir:tn.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(tr,"initNodePersist");var ts={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,tr()];case 1:r.sent();return[4,tt.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(H.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,tr()];case 1:r.sent();return[4,tt.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();H.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,tr()];case 1:n.sent();return[4,tt.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();H.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,tr()];case 1:n.sent();return[4,tt.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(H.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(H.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(tn.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(H.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ti=M(),to=k.promisify(P.exec);function ta(e){return"error_list:".concat(e)}b(ta,"getErrorListKey");function tc(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=ta(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ts.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,ts.getLogLink(n)];case 1:e=t.sent();e&&H.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();H.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}b(tc,"saveErrorListToStorage");function tu(){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,ts.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,ts.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,(H.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}b(tu,"getStoredErrorLists");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,ts.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 ts.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();H.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}b(tl,"clearAllErrorLists");function td(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]===A.Error?A.Error:A.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]===A.Error?A.Error:A.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:A.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&&tc(t),ti.DEBUG&&n.length&&(H.warn("Unmatched lines:"),n.forEach(function(e){return H.info(" ".concat(e))}))}b(td,"parseTextErrors");function tf(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?A.Error:A.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&tc(n)}catch(t){td(e)}}b(tf,"parseCommandOutput");function tp(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]:tf;n=new AbortController;T.default.on("SIGINT",function(){H.warn("Process interrupted. Terminating..."),n.abort(),T.default.exit()});d.label=1;case 1:d.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,to(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&&H.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}b(tp,"executeCommand");function tg(e){return{raw:!0,cmd:e}}b(tg,"rawCommand");function tm(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eY," ").concat(ev," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eY," ").concat(eB," ").concat(eP," ").concat(e):"".concat(eY," ").concat(eC," ").concat(e)}b(tm,"formatCLI");function tv(e,t){return typeof e=="function"?tm(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"?tm(e,t):e}b(tv,"formatCommand");function ty(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(ev)];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,tv(r,i)]}))]}})}).apply(this,arguments)}b(ty,"resolveCommands");function th(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);H.start("".concat(e)),ti.DEBUG&&H.info("→ ".concat(t));return[4,tp(t)];case 1:r.sent(),H.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw H.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}b(th,"runCommand");function t_(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!ec(e0.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e3.typescriptCheck()];case 1:return[4,th.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=H.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}b(t_,"checkTypescript");function tx(){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,e3.eslintFix()];case 1:return[4,th.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e3.eslintCheck()];case 4:return[4,th.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})}).apply(this,arguments)}b(tx,"checkEslint");function tj(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";H.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}b(tj,"printIssues");function tb(){return /*#__PURE__*/s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tu()];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?H.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tj("Warnings",n),tj("Errors",t),(t.length>0||n.length>0)&&w.default.exit(1));return[2]}})})()}b(tb,"showCheckResult");function tE(){return /*#__PURE__*/s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,tl()];case 1:o.sent();return[4,e9(ev)];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(ev)];return[4,e3.build()];case 4:return[4,th.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e3.stageBuildDirectory()];case 6:return[4,th.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw H.error("Error building and staging ".concat(ev,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,e3.lintStaged()];case 10:return[4,th.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tb();return[2]}})})()}b(tE,"lintStaged");function tI(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e3.eslintInspect()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tI,"inspectLint");function tw(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tl()];case 1:e.sent();return[4,Promise.all([t_(),tx()])];case 2:e.sent(),tb();return[2]}})})()}b(tw,"lintCheck");function tS(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,tl()];case 1:e.sent();return[4,Promise.all([t_(),tx(!0)])];case 2:e.sent(),tb();return[2]}})})()}b(tS,"lintFix");function tR(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tl()];case 1:t.sent();e=["Validating commit message"];return[4,e3.commitLint()];case 2:return[4,th.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tb();return[2]}})})()}b(tR,"commitLint");function tO(){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,e3.configureGitHook()];case 1:return[4,th.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),eu(e0.GIT_HOOK);return[4,ty(e1)];case 3:t=s.sent();ea(e0.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(eE,"\n");ec(e0.GIT_IGNORE)?et(e0.GIT_IGNORE,"utf-8").split("\n").includes(eE)||er(e0.GIT_IGNORE,n,"utf-8"):en(e0.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,e3.simpleGitHooks()];case 4:return[4,th.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}b(tO,"setupGitHook");function tC(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,te([ev],{update:!0,postInstallActions:[tO]})];case 1:e.sent();return[2]}})})()}b(tC,"setup");function tP(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:eu(e0.NODE_MODULES,e0.PNPM_LOCK_YAML);return[4,e7()];case 1:e.sent();return[4,tO()];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,e3.nodeModulesInspect()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tT,"inspect");function tk(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e3.testUnit()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tk,"testUnit");function tG(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e3.testE2e()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tG,"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,e3.mongoMigrateCreate(e)];case 1:return[4,th.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}b(tU,"mongoMigrateCreate");function tN(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e3.mongoMigrateUp()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tN,"mongoMigrateUp");function tL(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e3.mongoMigrateDown()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}b(tL,"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,R.default)((0,S.hideBin)(w.default.argv)).scriptName(eC).usage("$0 <command> [options]").command("lint","Check code for linting issues",tw).command("lint:fix","Fix linting issues automatically",tS).command("lint:inspect","View active ESLint configuration",tI).command("lint-staged","Run lint checks on staged files",tE).command("commitlint","Validate commit message format",tR).command("setup","Initialize project setup and dependencies",tC).command("reset","Reset the project and reinstall dependencies",tP).command("inspect","Analyze installed project dependencies",tT).command("test:unit","Run unit test suite",tk).command("test:e2e","Run end-to-end test suite",tG).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){H.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",tN).command("mongo:migrate:down","Rollback last MongoDB migration",tL).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(O.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();H.error("Fatal: ".concat(e.message)),w.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 h=Object.defineProperty;var y=function(e,t){return h(e,"name",{value:t,configurable:!0})};import v from"node:process";import{hideBin as x}from"yargs/helpers";import j from"yargs/yargs";var b={name:"@cyberskill/shared",type:"module",version:"1.106.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/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:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- 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","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.21","@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",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.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.10.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.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.3","node-fetch":"3.3.2","node-persist":"4.0.4",ora:"8.2.0",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.2",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/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.6","simple-git-hooks":"2.12.1"}};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"dotenv";import{bool as _,cleanEnv as T,str as k}from"envalid";import G from"node:os";import R from"node:path";import L from"node:process";O.config();function N(){var e={DEBUG:L.env.DEBUG||!1,CWD:L.env.CWD||L.cwd(),CYBERSKILL_STORAGE_DIRECTORY:L.env.CYBERSKILL_STORAGE_DIRECTORY||R.join(G.homedir(),C)};return T(e,{DEBUG:_(),CWD:k(),CYBERSKILL_STORAGE_DIRECTORY:k()})}y(N,"getEnv");var D=function(e){return e.Error="error",e.Warning="warning",e}({});import M from"chalk";import P from"consola";import{GraphQLError as A}from"graphql";var q=N();q.DEBUG||(P.level=4);function F(e){var t=M[e];return typeof t=="function"?t:M.green}y(F,"chalkKeyword");var U={silent:P.silent,level:P.level,fatal:P.fatal,error:P.error,warn:P.warn,log:P.log,info:P.info,success:P.success,ready:P.ready,start:P.start,box:P.box,debug:P.debug,trace:P.trace,verbose:P.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)){P.box(M.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;P.log("".concat(M.gray("File:")," ").concat(M.blue("".concat(t).concat(r?":".concat(r):"")))),s&&P.log(" ".concat(F(n)("Rule:")," ").concat(s)),P.log(" ".concat(F(n)("Message:")," ").concat(i))}),P.box(F(n)("".concat(e," : ").concat(t.length))),P.log(M.gray("─".repeat(40)))}};var B={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import K from"node-fetch";import W from"fs-extra";var Y=W.appendFileSync,H=W.lstatSync,J=W.mkdirSync,$=W.readFileSync,V=W.unlinkSync,z=W.writeFileSync,Q=W.statSync,X=W.readJsonSync,Z=W.writeJsonSync;function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return W.pathExistsSync(e)})}y(ee,"pathExistsSync");function et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){ee(e)&&W.removeSync(e)})}y(et,"removeSync");import{join as en,resolve as er}from"node:path";var es=N();function ei(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return er.apply(void 0,[es.CWD].concat(p(t)))}y(ei,"resolveWorkingPath");function eo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return en.apply(void 0,p(t))}y(eo,"join");var ec=N(),ea=ec.CWD,eu="@cyberskill/shared",el="node_modules",ed="dist",ep="package.json",ef="package-lock.json",eg="tsconfig.json",em=".gitignore",eh=".simple-git-hooks.json",ey="pnpm-lock.yaml",ev=".git/hooks/",ex=".git/COMMIT_EDITMSG",ej=".migrate-mongo.config.js",eb=eo(ea,el,eu,ed),eI="cyberskill",ew="src/nodejs/cli/index.ts",eE="eslint",eS="eslint",eC="vitest",eO="playwright",e_="vitest",eT="@commitlint/cli",ek="commitlint",eG="lint-staged",eR="lint-staged",eL="typescript",eN="tsc",eD="tsx",eM="git",eP="pnpm",eA="pnpm exec",eq="simple-git-hooks",eF="simple-git-hooks",eU="@eslint/config-inspector",eB="eslint-config-inspector",eK="node-modules-inspector",eW="node-modules-inspector",eY="migrate-mongo",eH="./node_modules/migrate-mongo/bin/migrate-mongo",eJ={CYBERSKILL_DIRECTORY:eb,WORKING_DIRECTORY:ea,TS_CONFIG:ei(eg),GIT_IGNORE:ei(em),GIT_HOOK:ei(ev),GIT_COMMIT_MSG:ei(ex),SIMPLE_GIT_HOOKS_JSON:ei(eh),PACKAGE_JSON:ei(ep),PACKAGE_LOCK_JSON:ei(ef),PNPM_LOCK_YAML:ei(ey),NODE_MODULES:ei(el),MIGRATE_MONGO_CONFIG:ei(ej),LINT_STAGED_CONFIG:ei("".concat(eb,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ei("".concat(eb,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ei("".concat(eb,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ei("".concat(eb,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ei("".concat(eb,"/react/vitest/vitest.e2e.js"))};function e$(e){var t=e.isCurrentProject;return l({"pre-commit":eR,"commit-msg":ek},t&&{"pre-push":ty("".concat(eM," pull"))})}y(e$,"createGitHooksConfig");function eV(e,t,n){return ez.apply(this,arguments)}function ez(){ez=s(function(e,t,n){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,e6(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),tx(ty("".concat(eA," ").concat(n))))];case 3:return[2,tx(ty(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return ez.apply(this,arguments)}y(eV,"buildCommand");function eQ(e,t,n){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,eV(e,t,n)]})})}y(eQ,"commandFactory");var eX={simpleGitHooks:eQ(I.CLI,eq,eF),eslintInspect:eQ(I.CLI,eU,eB),nodeModulesInspect:eQ(I.CLI,eK,eW),eslintCheck:eQ(I.CLI,eE,"".concat(eS," ").concat(eJ.WORKING_DIRECTORY)),eslintFix:eQ(I.CLI,eE,"".concat(eS," ").concat(eJ.WORKING_DIRECTORY," --fix")),typescriptCheck:eQ(I.CLI,eL,"".concat(eN," -p ").concat(eJ.TS_CONFIG," --noEmit")),configureGitHook:eQ(I.STRING,"".concat(eM," config core.hooksPath ").concat(eJ.GIT_HOOK)),testUnit:eQ(I.CLI,eC,"".concat(e_," --config ").concat(eJ.UNIT_TEST_CONFIG)),testE2e:eQ(I.CLI,"".concat(eC," ").concat(eO),"".concat(e_," --config ").concat(eJ.E2E_TEST_CONFIG)),mongoMigrateCreate:y(function(e){return eQ(I.CLI,eY,"".concat(eD," ").concat(eH," create ").concat(e," -f ").concat(eJ.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eQ(I.CLI,eY,"".concat(eD," ").concat(eH," up -f ").concat(eJ.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eQ(I.CLI,eY,"".concat(eD," ").concat(eH," down -f ").concat(eJ.MIGRATE_MONGO_CONFIG)),commitLint:eQ(I.CLI,eT,"".concat(ek," --edit ").concat(eJ.GIT_COMMIT_MSG," --config ").concat(eJ.COMMITLINT_CONFIG)),lintStaged:eQ(I.CLI,eG,"".concat(eR," --config ").concat(eJ.LINT_STAGED_CONFIG)),stageBuildDirectory:eQ(I.STRING,"".concat(eM," add ").concat(ed)),build:eQ(I.STRING,"".concat(eP," run build")),pnpmInstallStandard:eQ(I.STRING,"".concat(eP," install")),pnpmInstallLegacy:eQ(I.STRING,"".concat(eP," install --legacy-peer-deps")),pnpmInstallForce:eQ(I.STRING,"".concat(eP," install --force"))};var eZ=N();function e0(e){var t=eo(eZ.CWD,ep);if(!ee(t))return!1;try{var n=X(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 U.warn("Failed to read package.json: ".concat(e.message)),!1}}y(e0,"getPackage");function e1(e){return e2.apply(this,arguments)}function e2(){e2=s(function(e){var t,n,r,s;return m(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,K("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 U.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return e2.apply(this,arguments)}y(e1,"getLatestPackageVersion");function e4(e,t){return e3.apply(this,arguments)}function e3(){e3=s(function(e,t){var n,r,s,i,o,c,a,u,d,p,f,g,h,y,v,x,j,b,I,w,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e0(e);if(!n)return[2,l({},B)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},h=(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=h[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!d)return[3,1];j=y;return[3,3];case 1:return[4,e1(e)];case 2:j=m.sent();m.label=3;case 3:v=j,x=d||y===v;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])!==v&&(u[I]=(w=u[I])!==null&&w!==void 0?w:{},u[I][e]=v,Z(a,u),U.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:x}];case 4:E=m.sent();return[2,(U.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},B))];case 5:return[2]}})});return e3.apply(this,arguments)}y(e4,"checkPackage");function e5(){return e8.apply(this,arguments)}function e8(){e8=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 eX.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:y(function(){return eX.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:y(function(){return eX.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,tI("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();U.warn("Installation attempt failed: ".concat(a)),U.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.")}})});return e8.apply(this,arguments)}y(e5,"installDependencies");function e6(e,t){return e9.apply(this,arguments)}function e9(){e9=s(function(e,t){var n,r,s,i,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!ee(eJ.PACKAGE_JSON)){U.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,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 U.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return e9.apply(this,arguments)}y(e6,"setupPackages");import e7 from"node-persist";var te=N();function tt(){return tn.apply(this,arguments)}function tn(){tn=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e7.defaultInstance;if(e)return[3,2];return[4,e7.init({dir:te.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]}})});return tn.apply(this,arguments)}y(tt,"initNodePersist");var tr={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,tt()];case 1:r.sent();return[4,e7.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(U.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,tt()];case 1:r.sent();return[4,e7.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();U.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,tt()];case 1:n.sent();return[4,e7.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();U.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,tt()];case 1:n.sent();return[4,e7.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(U.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(U.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(te.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(U.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ts=N(),ti=S.promisify(w);function to(e){return"error_list:".concat(e)}y(to,"getErrorListKey");function tc(e){return ta.apply(this,arguments)}function ta(){ta=s(function(e){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=to(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,tr.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tr.getLogLink(n)];case 1:e=t.sent();e&&U.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();U.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return ta.apply(this,arguments)}y(tc,"saveErrorListToStorage");function tu(){return tl.apply(this,arguments)}function tl(){tl=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tr.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(/*#__PURE__*/function(){var e=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,tr.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(U.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return tl.apply(this,arguments)}y(tu,"getStoredErrorLists");function td(){return tp.apply(this,arguments)}function tp(){tp=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tr.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 tr.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();U.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return tp.apply(this,arguments)}y(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 c,a,u,l,d;var p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var m,h,y,v,x,j;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:(h=p===null||p===void 0?void 0:(a=p[5])===null||a===void 0?void 0:a.trim())!==null&&h!==void 0?h:""}):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:(v=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&v!==void 0?v:""}):g.length?t.push({file:"commitlint",type:D.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&&tc(t),ts.DEBUG&&n.length&&(U.warn("Unmatched lines:"),n.forEach(function(e){return U.info(" ".concat(e))}))}y(tf,"parseTextErrors");function tg(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&&tc(n)}catch(t){tf(e)}}y(tg,"parseCommandOutput");function tm(e){return th.apply(this,arguments)}function th(){th=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]:tg;n=new AbortController;E.on("SIGINT",function(){U.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,ti(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&&U.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return th.apply(this,arguments)}y(tm,"executeCommand");function ty(e){return{raw:!0,cmd:e}}y(ty,"rawCommand");function tv(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eA," ").concat(eu," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eA," ").concat(eD," ").concat(ew," ").concat(e):"".concat(eA," ").concat(eI," ").concat(e)}y(tv,"formatCLI");function tx(e,t){return typeof e=="function"?tv(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"?tv(e,t):e}y(tx,"formatCommand");function tj(e){return tb.apply(this,arguments)}function tb(){tb=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(eu)];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,tx(r,i)]}))]}})});return tb.apply(this,arguments)}y(tj,"resolveCommands");function tI(e,t){return tw.apply(this,arguments)}function tw(){tw=s(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);U.start("".concat(e)),ts.DEBUG&&U.info("→ ".concat(t));return[4,tm(t)];case 1:r.sent(),U.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw U.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tw.apply(this,arguments)}y(tI,"runCommand");function tE(){return tS.apply(this,arguments)}function tS(){tS=s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!ee(eJ.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eX.typescriptCheck()];case 1:return[4,tI.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=U.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tS.apply(this,arguments)}y(tE,"checkTypescript");function tC(){return tO.apply(this,arguments)}function tO(){tO=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,eX.eslintFix()];case 1:return[4,tI.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eX.eslintCheck()];case 4:return[4,tI.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tO.apply(this,arguments)}y(tC,"checkEslint");function t_(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";U.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}y(t_,"printIssues");function tT(){return tk.apply(this,arguments)}function tk(){tk=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,tu()];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?U.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(t_("Warnings",n),t_("Errors",t),(t.length>0||n.length>0)&&v.exit(1));return[2]}})});return tk.apply(this,arguments)}y(tT,"showCheckResult");function tG(){return tR.apply(this,arguments)}function tR(){tR=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,e4(eu)];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(eu)];return[4,eX.build()];case 4:return[4,tI.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eX.stageBuildDirectory()];case 6:return[4,tI.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw U.error("Error building and staging ".concat(eu,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eX.lintStaged()];case 10:return[4,tI.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tT();return[2]}})});return tR.apply(this,arguments)}y(tG,"lintStaged");function tL(){return tN.apply(this,arguments)}function tN(){tN=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eX.eslintInspect()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tN.apply(this,arguments)}y(tL,"inspectLint");function tD(){return tM.apply(this,arguments)}function tM(){tM=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tE(),tC()])];case 2:e.sent(),tT();return[2]}})});return tM.apply(this,arguments)}y(tD,"lintCheck");function tP(){return tA.apply(this,arguments)}function tA(){tA=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,td()];case 1:e.sent();return[4,Promise.all([tE(),tC(!0)])];case 2:e.sent(),tT();return[2]}})});return tA.apply(this,arguments)}y(tP,"lintFix");function tq(){return tF.apply(this,arguments)}function tF(){tF=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,eX.commitLint()];case 2:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tT();return[2]}})});return tF.apply(this,arguments)}y(tq,"commitLint");function tU(){return tB.apply(this,arguments)}function tB(){tB=s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eX.configureGitHook()];case 1:return[4,tI.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),et(eJ.GIT_HOOK);return[4,tj(e$)];case 3:t=s.sent();Z(eJ.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(eh,"\n");ee(eJ.GIT_IGNORE)?$(eJ.GIT_IGNORE,"utf-8").split("\n").includes(eh)||Y(eJ.GIT_IGNORE,n,"utf-8"):z(eJ.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,eX.simpleGitHooks()];case 4:return[4,tI.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return tB.apply(this,arguments)}y(tU,"setupGitHook");function tK(){return tW.apply(this,arguments)}function tW(){tW=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e6([eu],{update:!0,postInstallActions:[tU]})];case 1:e.sent();return[2]}})});return tW.apply(this,arguments)}y(tK,"setup");function tY(){return tH.apply(this,arguments)}function tH(){tH=s(function(){return m(this,function(e){switch(e.label){case 0:et(eJ.NODE_MODULES,eJ.PNPM_LOCK_YAML);return[4,e5()];case 1:e.sent();return[4,tU()];case 2:e.sent();return[2]}})});return tH.apply(this,arguments)}y(tY,"reset");function tJ(){return t$.apply(this,arguments)}function t$(){t$=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eX.nodeModulesInspect()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t$.apply(this,arguments)}y(tJ,"inspect");function tV(){return tz.apply(this,arguments)}function tz(){tz=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eX.testUnit()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tz.apply(this,arguments)}y(tV,"testUnit");function tQ(){return tX.apply(this,arguments)}function tX(){tX=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eX.testE2e()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tX.apply(this,arguments)}y(tQ,"testE2E");function tZ(e){return t0.apply(this,arguments)}function t0(){t0=s(function(e){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eX.mongoMigrateCreate(e)];case 1:return[4,tI.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return t0.apply(this,arguments)}y(tZ,"mongoMigrateCreate");function t1(){return t2.apply(this,arguments)}function t2(){t2=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eX.mongoMigrateUp()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t2.apply(this,arguments)}y(t1,"mongoMigrateUp");function t4(){return t3.apply(this,arguments)}function t3(){t3=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eX.mongoMigrateDown()];case 1:return[4,tI.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t3.apply(this,arguments)}y(t4,"mongoMigrateDown");s(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,j(x(v.argv)).scriptName(eI).usage("$0 <command> [options]").command("lint","Check code for linting issues",tD).command("lint:fix","Fix linting issues automatically",tP).command("lint:inspect","View active ESLint configuration",tL).command("lint-staged","Run lint checks on staged files",tG).command("commitlint","Validate commit message format",tq).command("setup","Initialize project setup and dependencies",tK).command("reset","Reset the project and reinstall dependencies",tY).command("inspect","Analyze installed project dependencies",tJ).command("test:unit","Run unit test suite",tV).command("test:e2e","Run end-to-end test suite",tQ).command("mongo:migrate:create <name>","Create a MongoDB migration",function(e){return e.positional("name",{describe:"Migration name",type:"string"})},/*#__PURE__*/function(){var e=s(function(e){return m(this,function(t){switch(t.label){case 0:if(!e.name){U.error("Migration name is required.");return[2]}return[4,tZ(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",t1).command("mongo:migrate:down","Rollback last MongoDB migration",t4).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();U.error("Fatal: ".concat(e.message)),v.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 v=Object.defineProperty;var h=function(e,t){return v(e,"name",{value:t,configurable:!0})};import y from"node:process";import{hideBin as _}from"yargs/helpers";import x from"yargs/yargs";var j={name:"@cyberskill/shared",type:"module",version:"1.108.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/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:"dotenv -e .env -- tsup --watch",lint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint","lint:fix":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:fix","lint:inspect":"dotenv -e .env -- tsx src/nodejs/cli/index.ts lint:inspect",reset:"dotenv -e .env -- tsx src/nodejs/cli/index.ts reset",setup:"dotenv -e .env -- tsx src/nodejs/cli/index.ts setup",inspect:"dotenv -e .env -- tsx src/nodejs/cli/index.ts inspect","test:unit":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:unit","test:e2e":"dotenv -e .env -- tsx src/nodejs/cli/index.ts test:e2e",commitlint:"dotenv -e .env -- tsx src/nodejs/cli/index.ts commitlint","lint-staged":"dotenv -e .env -- 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","@eddeee888/gcg-typescript-resolver-files":"0.12.0","@eslint-react/eslint-plugin":"1.48.4","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.5","@next/eslint-plugin-next":"15.3.1","@swc/core":"1.11.22","@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",chalk:"5.4.1",classnames:"2.5.1",compression:"1.8.0",consola:"3.4.2",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",dotenv:"16.5.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.10.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.13.2","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",ora:"8.2.0",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/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.6","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"dotenv";import{bool as C,cleanEnv as O,str as T}from"envalid";import k from"node:os";import P from"node:path";import G from"node:process";R.config();function U(){var e={DEBUG:G.env.DEBUG||!1,CWD:G.env.CWD||G.cwd(),CYBERSKILL_STORAGE_DIRECTORY:G.env.CYBERSKILL_STORAGE_DIRECTORY||P.join(k.homedir(),S)};return O(e,{DEBUG:C(),CWD:T(),CYBERSKILL_STORAGE_DIRECTORY:T()})}h(U,"getEnv");var L=function(e){return e.Error="error",e.Warning="warning",e}({});import N from"chalk";import D from"consola";import{GraphQLError as M}from"graphql";var A=U();A.DEBUG||(D.level=4);function q(e){var t=N[e];return typeof t=="function"?t:N.green}h(q,"chalkKeyword");var F={silent:D.silent,level:D.level,fatal:D.fatal,error:D.error,warn:D.warn,log:D.log,info:D.info,success:D.success,ready:D.ready,start:D.start,box:D.box,debug:D.debug,trace:D.trace,verbose:D.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)){D.box(N.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;D.log("".concat(N.gray("File:")," ").concat(N.blue("".concat(t).concat(r?":".concat(r):"")))),s&&D.log(" ".concat(q(n)("Rule:")," ").concat(s)),D.log(" ".concat(q(n)("Message:")," ").concat(i))}),D.box(q(n)("".concat(e," : ").concat(t.length))),D.log(N.gray("─".repeat(40)))}};var B={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import K from"node-fetch";import W from"fs-extra";var Y=W.lstatSync,H=W.readdirSync,J=W.mkdirSync,$=W.readFileSync,V=W.writeFileSync,z=W.appendFileSync,Q=W.unlinkSync,X=W.statSync,Z=W.readJsonSync,ee=W.writeJsonSync;function et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return W.pathExistsSync(e)})}h(et,"pathExistsSync");function en(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){et(e)&&W.removeSync(e)})}h(en,"removeSync");import er,{join as es,resolve as ei}from"node:path";var eo=U();function ec(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return ei.apply(void 0,[eo.CWD].concat(p(t)))}h(ec,"resolveWorkingPath");function ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return es.apply(void 0,p(t))}h(ea,"join");var eu=U(),el=eu.CWD,ed="@cyberskill/shared",ep="node_modules",ef="dist",eg="package.json",em="package-lock.json",ev="tsconfig.json",eh=".gitignore",ey=".simple-git-hooks.json",e_="pnpm-lock.yaml",ex=".git/hooks/",ej=".git/COMMIT_EDITMSG",eb=".migrate-mongo.config.js",eE=ea(el,ep,ed,ef),eI="cyberskill",ew="src/nodejs/cli/index.ts",eS="eslint",eR="eslint",eC="vitest",eO="playwright",eT="vitest",ek="@commitlint/cli",eP="commitlint",eG="lint-staged",eU="lint-staged",eL="typescript",eN="tsc",eD="tsx",eM="git",eA="pnpm",eq="pnpm exec",eF="simple-git-hooks",eB="simple-git-hooks",eK="@eslint/config-inspector",eW="eslint-config-inspector",eY="node-modules-inspector",eH="node-modules-inspector",eJ="migrate-mongo",e$="./node_modules/migrate-mongo/bin/migrate-mongo",eV={CYBERSKILL_DIRECTORY:eE,WORKING_DIRECTORY:el,TS_CONFIG:ec(ev),GIT_IGNORE:ec(eh),GIT_HOOK:ec(ex),GIT_COMMIT_MSG:ec(ej),SIMPLE_GIT_HOOKS_JSON:ec(ey),PACKAGE_JSON:ec(eg),PACKAGE_LOCK_JSON:ec(em),PNPM_LOCK_YAML:ec(e_),NODE_MODULES:ec(ep),MIGRATE_MONGO_CONFIG:ec(eb),LINT_STAGED_CONFIG:ec("".concat(eE,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ec("".concat(eE,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ec("".concat(eE,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ec("".concat(eE,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ec("".concat(eE,"/react/vitest/vitest.e2e.js"))};function ez(e){var t=e.isCurrentProject;return l({"pre-commit":eU,"commit-msg":eP},t&&{"pre-push":tu("".concat(eM," pull"))})}h(ez,"createGitHooksConfig");function eQ(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(),td(tu("".concat(eq," ").concat(n))))];case 3:return[2,td(tu(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})})()}h(eQ,"buildCommand");function eX(e,t,n){return function(){return /*#__PURE__*/s(function(){return m(this,function(r){return[2,eQ(e,t,n)]})})()}}h(eX,"commandFactory");var eZ={simpleGitHooks:eX(b.CLI,eF,eB),eslintInspect:eX(b.CLI,eK,eW),nodeModulesInspect:eX(b.CLI,eY,eH),eslintCheck:eX(b.CLI,eS,"".concat(eR," ").concat(eV.WORKING_DIRECTORY)),eslintFix:eX(b.CLI,eS,"".concat(eR," ").concat(eV.WORKING_DIRECTORY," --fix")),typescriptCheck:eX(b.CLI,eL,"".concat(eN," -p ").concat(eV.TS_CONFIG," --noEmit")),configureGitHook:eX(b.STRING,"".concat(eM," config core.hooksPath ").concat(eV.GIT_HOOK)),testUnit:eX(b.CLI,eC,"".concat(eT," --config ").concat(eV.UNIT_TEST_CONFIG)),testE2e:eX(b.CLI,"".concat(eC," ").concat(eO),"".concat(eT," --config ").concat(eV.E2E_TEST_CONFIG)),mongoMigrateCreate:h(function(e){return eX(b.CLI,eJ,"".concat(eD," ").concat(e$," create ").concat(e," -f ").concat(eV.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:eX(b.CLI,eJ,"".concat(eD," ").concat(e$," up -f ").concat(eV.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:eX(b.CLI,eJ,"".concat(eD," ").concat(e$," down -f ").concat(eV.MIGRATE_MONGO_CONFIG)),commitLint:eX(b.CLI,ek,"".concat(eP," --edit ").concat(eV.GIT_COMMIT_MSG," --config ").concat(eV.COMMITLINT_CONFIG)),lintStaged:eX(b.CLI,eG,"".concat(eU," --config ").concat(eV.LINT_STAGED_CONFIG)),stageBuildDirectory:eX(b.STRING,"".concat(eM," add ").concat(ef)),build:eX(b.STRING,"".concat(eA," run build")),pnpmInstallStandard:eX(b.STRING,"".concat(eA," install")),pnpmInstallLegacy:eX(b.STRING,"".concat(eA," install --legacy-peer-deps")),pnpmInstallForce:eX(b.STRING,"".concat(eA," install --force"))};var e0=U();function e1(e){var t=ea(e0.CWD,eg);if(!et(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 F.warn("Failed to read package.json: ".concat(e.message)),!1}}h(e1,"getPackage");function e2(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,K("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 F.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})})()}h(e2,"getLatestPackageVersion");function e4(e,t){return /*#__PURE__*/s(function(){var n,r,s,i,o,c,a,u,d,p,f,g,v,h,y,_,x,j,b,E,I;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=e1(e);if(!n)return[2,l({},B)];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:{},h=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=h;return[3,3];case 1:return[4,e2(e)];case 2:x=m.sent();m.label=3;case 3:y=x,_=d||h===y;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])!==y&&(u[b]=(E=u[b])!==null&&E!==void 0?E:{},u[b][e]=y,ee(a,u),F.info('Updated "'.concat(e,'" to version ').concat(y)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:_}];case 4:I=m.sent();return[2,(F.error('Error checking package "'.concat(e,'": ').concat(I.message)),l({},B))];case 5:return[2]}})})()}h(e4,"checkPackage");function e3(){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:h(function(){return eZ.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:h(function(){return eZ.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:h(function(){return eZ.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();F.warn("Installation attempt failed: ".concat(a)),F.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.")}})})()}h(e3,"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(!et(eV.PACKAGE_JSON)){F.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 F.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})})()}h(e8,"setupPackages");import e5 from"node-persist";var e6=U();function e9(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e5.defaultInstance;if(e)return[3,2];return[4,e5.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]}})})()}h(e9,"initNodePersist");var e7={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,e5.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(F.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,e5.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();F.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,e5.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();F.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,e5.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(F.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(F.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(e6.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(F.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var te=U(),tt=w.promisify(E);function tn(e){return"error_list:".concat(e)}h(tn,"getErrorListKey");function tr(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=tn(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,e7.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,e7.getLogLink(n)];case 1:e=t.sent();e&&F.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})})()},10);return[3,4];case 3:r=i.sent();F.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})})()}h(tr,"saveErrorListToStorage");function ts(){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,e7.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,e7.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,(F.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})})()}h(ts,"getStoredErrorLists");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,e7.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 e7.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();F.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})})()}h(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,v,h,y,_,x;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===L.Error?L.Error:L.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:(h=f===null||f===void 0?void 0:f[1])!==null&&h!==void 0?h:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===L.Error?L.Error:L.Warning,message:(y=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):g.length?t.push({file:"commitlint",type:L.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&&tr(t),te.DEBUG&&n.length&&(F.warn("Unmatched lines:"),n.forEach(function(e){return F.info(" ".concat(e))}))}h(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?L.Error:L.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&tr(n)}catch(t){to(e)}}h(tc,"parseCommandOutput");function ta(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]:tc;n=new AbortController;I.on("SIGINT",function(){F.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,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&&F.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})}).apply(this,arguments)}h(ta,"executeCommand");function tu(e){return{raw:!0,cmd:e}}h(tu,"rawCommand");function tl(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eq," ").concat(ed," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eq," ").concat(eD," ").concat(ew," ").concat(e):"".concat(eq," ").concat(eI," ").concat(e)}h(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}h(td,"formatCommand");function tp(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,e4(ed)];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)}h(tp,"resolveCommands");function tf(e,t){return /*#__PURE__*/s(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);F.start("".concat(e)),te.DEBUG&&F.info("→ ".concat(t));return[4,ta(t)];case 1:r.sent(),F.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw F.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})})()}h(tf,"runCommand");function tg(){return /*#__PURE__*/s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!et(eV.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eZ.typescriptCheck()];case 1:return[4,tf.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=F.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})})()}h(tg,"checkTypescript");function tm(){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,eZ.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,eZ.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)}h(tm,"checkEslint");function tv(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";F.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}h(tv,"printIssues");function th(){return /*#__PURE__*/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===L.Error}),n=e.filter(function(e){return e.type===L.Warning});!t.length&&!n.length?F.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tv("Warnings",n),tv("Errors",t),(t.length>0||n.length>0)&&y.exit(1));return[2]}})})()}h(th,"showCheckResult");function ty(){return /*#__PURE__*/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(ed)];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(ed)];return[4,eZ.build()];case 4:return[4,tf.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eZ.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 F.error("Error building and staging ".concat(ed,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eZ.lintStaged()];case 10:return[4,tf.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),th();return[2]}})})()}h(ty,"lintStaged");function t_(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eZ.eslintInspect()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(t_,"inspectLint");function tx(){return /*#__PURE__*/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(),th();return[2]}})})()}h(tx,"lintCheck");function tj(){return /*#__PURE__*/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(),th();return[2]}})})()}h(tj,"lintFix");function tb(){return /*#__PURE__*/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,eZ.commitLint()];case 2:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),th();return[2]}})})()}h(tb,"commitLint");function tE(){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,eZ.configureGitHook()];case 1:return[4,tf.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),en(eV.GIT_HOOK);return[4,tp(ez)];case 3:t=s.sent();ee(eV.SIMPLE_GIT_HOOKS_JSON,t);n="\n".concat(ey,"\n");et(eV.GIT_IGNORE)?$(eV.GIT_IGNORE,"utf-8").split("\n").includes(ey)||z(eV.GIT_IGNORE,n,"utf-8"):V(eV.GIT_IGNORE,n,"utf-8");r=["Setting up simple-git-hooks"];return[4,eZ.simpleGitHooks()];case 4:return[4,tf.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})})()}h(tE,"setupGitHook");function tI(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e8([ed],{update:!0,postInstallActions:[tE]})];case 1:e.sent();return[2]}})})()}h(tI,"setup");function tw(){return /*#__PURE__*/s(function(){return m(this,function(e){switch(e.label){case 0:en(eV.NODE_MODULES,eV.PNPM_LOCK_YAML);return[4,e3()];case 1:e.sent();return[4,tE()];case 2:e.sent();return[2]}})})()}h(tw,"reset");function tS(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eZ.nodeModulesInspect()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tS,"inspect");function tR(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eZ.testUnit()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tR,"testUnit");function tC(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eZ.testE2e()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tC,"testE2E");function tO(e){return /*#__PURE__*/s(function(){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eZ.mongoMigrateCreate(e)];case 1:return[4,tf.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})})()}h(tO,"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,eZ.mongoMigrateUp()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tT,"mongoMigrateUp");function tk(){return /*#__PURE__*/s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eZ.mongoMigrateDown()];case 1:return[4,tf.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})})()}h(tk,"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(_(y.argv)).scriptName(eI).usage("$0 <command> [options]").command("lint","Check code for linting issues",tx).command("lint:fix","Fix linting issues automatically",tj).command("lint:inspect","View active ESLint configuration",t_).command("lint-staged","Run lint checks on staged files",ty).command("commitlint","Validate commit message format",tb).command("setup","Initialize project setup and dependencies",tI).command("reset","Reset the project and reinstall dependencies",tw).command("inspect","Analyze installed project dependencies",tS).command("test:unit","Run unit test suite",tR).command("test:e2e","Run end-to-end test suite",tC).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){F.error("Migration name is required.");return[2]}return[4,tO(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",tk).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();F.error("Fatal: ".concat(e.message)),y.exit(1);return[3,3];case 3:return[2]}})})()})();
|