@cyberskill/shared 1.95.0 → 1.96.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 +51 -17
- package/dist/_tsup-dts-rollup.d.ts +51 -17
- package/dist/configs/config.util.cjs +1 -1
- package/dist/configs/config.util.js +1 -1
- package/dist/configs/env/env.constant.cjs +1 -0
- package/dist/configs/env/env.constant.d.cts +1 -0
- package/dist/configs/env/env.constant.d.ts +1 -0
- package/dist/configs/env/env.constant.js +1 -0
- package/dist/configs/env/env.d.cjs +1 -0
- package/dist/configs/env/env.d.d.cts +1 -0
- package/dist/configs/env/env.d.d.ts +1 -0
- package/dist/configs/env/env.d.js +0 -0
- package/dist/configs/env/env.type.cjs +1 -0
- package/dist/configs/env/env.type.d.cts +1 -0
- package/dist/configs/env/env.type.d.ts +1 -0
- package/dist/configs/env/env.type.js +0 -0
- package/dist/configs/env/env.util.cjs +1 -0
- package/dist/configs/env/env.util.d.cts +1 -0
- package/dist/configs/env/env.util.d.ts +1 -0
- package/dist/configs/env/env.util.js +1 -0
- package/dist/configs/env/index.cjs +1 -0
- package/dist/configs/env/index.d.cts +3 -0
- package/dist/configs/env/index.d.ts +3 -0
- package/dist/configs/env/index.js +1 -0
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.d.cts +3 -0
- package/dist/configs/index.d.ts +3 -0
- package/dist/configs/index.js +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.cts +0 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +1 -1
- package/dist/nodejs/apollo-server/apollo-server.util.cjs +1 -1
- package/dist/nodejs/apollo-server/apollo-server.util.js +1 -1
- package/dist/nodejs/apollo-server/index.cjs +1 -1
- package/dist/nodejs/apollo-server/index.js +1 -1
- package/dist/nodejs/cli/cli.util.cjs +1 -1
- package/dist/nodejs/cli/cli.util.js +1 -1
- package/dist/nodejs/cli/index.cjs +1 -1
- package/dist/nodejs/cli/index.js +1 -1
- package/dist/nodejs/command/command.util.cjs +1 -1
- package/dist/nodejs/command/command.util.js +1 -1
- package/dist/nodejs/command/index.cjs +1 -1
- package/dist/nodejs/command/index.js +1 -1
- package/dist/nodejs/express/express.util.cjs +1 -1
- package/dist/nodejs/express/express.util.d.cts +0 -1
- package/dist/nodejs/express/express.util.d.ts +0 -1
- package/dist/nodejs/express/express.util.js +1 -1
- package/dist/nodejs/express/index.cjs +1 -1
- package/dist/nodejs/express/index.d.cts +0 -1
- package/dist/nodejs/express/index.d.ts +0 -1
- package/dist/nodejs/express/index.js +1 -1
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.d.cts +4 -2
- package/dist/nodejs/index.d.ts +4 -2
- package/dist/nodejs/index.js +1 -1
- package/dist/nodejs/log/index.cjs +1 -1
- package/dist/nodejs/log/index.js +1 -1
- package/dist/nodejs/log/log.util.cjs +1 -1
- package/dist/nodejs/log/log.util.js +1 -1
- package/dist/nodejs/mongo/index.cjs +1 -1
- package/dist/nodejs/mongo/index.d.cts +1 -0
- package/dist/nodejs/mongo/index.d.ts +1 -0
- package/dist/nodejs/mongo/index.js +1 -1
- package/dist/nodejs/mongo/migrate.util.cjs +1 -0
- package/dist/nodejs/mongo/migrate.util.d.cts +1 -0
- package/dist/nodejs/mongo/migrate.util.d.ts +1 -0
- package/dist/nodejs/mongo/migrate.util.js +1 -0
- 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 +3 -1
- package/dist/nodejs/path/index.d.ts +3 -1
- package/dist/nodejs/path/index.js +1 -1
- package/dist/nodejs/path/path.constant.cjs +1 -1
- package/dist/nodejs/path/path.constant.d.cts +2 -1
- package/dist/nodejs/path/path.constant.d.ts +2 -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/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 +7 -3
- package/dist/constants/nodejs.cjs +0 -1
- package/dist/constants/nodejs.d.cts +0 -1
- package/dist/constants/nodejs.d.ts +0 -1
- package/dist/constants/nodejs.js +0 -1
|
@@ -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
|
|
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 D={};S(D,{createApolloServer:function(){return K},expressMiddleware:function(){return A.expressMiddleware}});module.exports=O(D);var E=require("@apollo/server"),A=require("@apollo/server/express4"),j=require("@apollo/server/plugin/drainHttpServer"),P=require("@apollo/server/plugin/landingPage/default");var x=w(require("chalk"),1),R=w(require("consola"),1),I=require("graphql");var L=".cyberskill-storage";var _=w(require("dotenv"),1),q=require("envalid"),B=w(require("os"),1),G=w(require("path"),1),C=w(require("process"),1);_.default.config();function k(){var e={DEBUG:C.default.env.DEBUG,CWD:C.default.env.CWD,CYBERSKILL_STORAGE_DIR:C.default.env.CYBERSKILL_STORAGE_DIR},r=(0,q.cleanEnv)(e,{DEBUG:(0,q.bool)({default:!1}),CWD:(0,q.str)({default:C.default.cwd()}),CYBERSKILL_STORAGE_DIR:(0,q.str)({default:G.default.join(B.default.homedir(),L)})});return{DEBUG:r.DEBUG,CWD:r.CWD,CYBERSKILL_STORAGE_DIR:r.CYBERSKILL_STORAGE_DIR}}h(k,"getEnv");var M=k();M.DEBUG||(R.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:R.default.silent,level:R.default.level,fatal:R.default.fatal,error:R.default.error,warn:R.default.warn,log:R.default.log,info:R.default.info,success:R.default.success,ready:R.default.ready,start:R.default.start,box:R.default.box,debug:R.default.debug,trace:R.default.trace,verbose:R.default.verbose,printBoxedLog:function e(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(r===null||r===void 0?void 0:r.length)){R.default.box(x.default.green(e));return}r.forEach(function(e){var r=e.file,n=e.position,o=e.rule,a=e.message;R.default.log("".concat(x.default.gray("File:")," ").concat(x.default.blue("".concat(r).concat(n?":".concat(n):"")))),o&&R.default.log(" ".concat(T(t)("Rule:")," ").concat(o)),R.default.log(" ".concat(T(t)("Message:")," ").concat(a))}),R.default.box(T(t)("".concat(e," : ").concat(r.length))),R.default.log(x.default.gray("─".repeat(40)))}};function K(e){return new E.ApolloServer(u({schema:e.schema,plugins:[e.isDev?(0,P.ApolloServerPluginLandingPageLocalDefault)():(0,P.ApolloServerPluginLandingPageProductionDefault)(),(0,j.ApolloServerPluginDrainHttpServer)({httpServer:e.server})].concat(i(e.drainServer?[{serverWillStart:function r(){return n(function(){return s(this,function(r){return[2,{drainServer:function r(){return n(function(){var r;return s(this,function(t){(r=e.drainServer)===null||r===void 0?void 0:r.call(e),U.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},e.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}h(K,"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
|
|
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 D,cleanEnv as A,str as O}from"envalid";import R from"node:os";import I from"node:path";import L from"node:process";w.config();function P(){var r={DEBUG:L.env.DEBUG,CWD:L.env.CWD,CYBERSKILL_STORAGE_DIR:L.env.CYBERSKILL_STORAGE_DIR},e=A(r,{DEBUG:D({default:!1}),CWD:O({default:L.cwd()}),CYBERSKILL_STORAGE_DIR:O({default:I.join(R.homedir(),E)})});return{DEBUG:e.DEBUG,CWD:e.CWD,CYBERSKILL_STORAGE_DIR:e.CYBERSKILL_STORAGE_DIR}}p(P,"getEnv");var x=P();x.DEBUG||(h.level=4);function G(r){var e=y[r];return typeof e=="function"?e:y.green}p(G,"chalkKeyword");var j={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(G(t)("Rule:")," ").concat(o)),h.log(" ".concat(G(t)("Message:")," ").concat(a))}),h.box(G(t)("".concat(r," : ").concat(e.length))),h.log(y.gray("─".repeat(40)))}};function B(r){return new v(l({schema:r.schema,plugins:[r.isDev?g():m(),b({httpServer:r.server})].concat(c(r.drainServer?[{serverWillStart:function e(){return n(function(){return f(this,function(e){return[2,{drainServer:function e(){return n(function(){var e;return f(this,function(t){(e=r.drainServer)===null||e===void 0?void 0:e.call(r),j.info("Apollo Server drainServer hook called");return[2]})})()}}]})})()}}]:[]))},r.isDev&&{introspection:!0,includeStacktraceInErrorResponses:!0}))}p(B,"createApolloServer");export{B as createApolloServer,d as expressMiddleware};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var a=e[i](o);var c=a.value}catch(e){n(e);return}if(a.done){t(c)}else{Promise.resolve(c).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function a(e){r(o,s,i,a,c,"next",e)}function c(e){r(o,s,i,a,c,"throw",e)}a(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,a;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;a=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw a}}return r}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||a(e,n)||g(e,n)||c()}function 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 y(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 h=Object.create;var v=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var w=function(e,t){return v(e,"name",{value:t,configurable:!0})};var I=function(e,t,n,r){var s=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var a=function(){var s=u.value;!b.call(e,s)&&s!==n&&v(e,s,{get:function(){return t[s]},enumerable:!(r=m(t,s))||r.enumerable})};for(var c=j(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 S=function(e,t,n){return n=e!=null?h(x(e)):{},I(t||!e||!e.__esModule?v(n,"default",{value:e,enumerable:!0}):n,e)};var E=S(require("process"),1),O=require("yargs/helpers"),k=S(require("yargs/yargs"),1);var C={name:"@cyberskill/shared",type:"module",version:"1.94.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.3","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.4","@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.1",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-cli":"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.19",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.0",jsdom:"26.1.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","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.4.1","react-icons":"5.5.0",sass:"1.86.3",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.1","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/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.24.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var _=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});var T=require("child_process"),q=S(require("process"),1),L=S(require("util"),1);var P=S(require("process"),1),N=P.default.env.DEBUG==="true";var G=function(e){return e.Error="error",e.Warning="warning",e}({});var A=S(require("chalk"),1),R=S(require("consola"),1),D=require("graphql");N||(R.default.level=4);function F(e){var t=A.default[e];return typeof t=="function"?t:A.default.green}w(F,"chalkKeyword");var M={silent:R.default.silent,level:R.default.level,fatal:R.default.fatal,error:R.default.error,warn:R.default.warn,log:R.default.log,info:R.default.info,success:R.default.success,ready:R.default.ready,start:R.default.start,box:R.default.box,debug:R.default.debug,trace:R.default.trace,verbose:R.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){R.default.box(A.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;R.default.log("".concat(A.default.gray("File:")," ").concat(A.default.blue("".concat(t).concat(r?":".concat(r):"")))),s&&R.default.log(" ".concat(F(n)("Rule:")," ").concat(s)),R.default.log(" ".concat(F(n)("Message:")," ").concat(i))}),R.default.box(F(n)("".concat(e," : ").concat(t.length))),R.default.log(A.default.gray("─".repeat(40)))}};var W={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var U=S(require("node-fetch"),1);var J=S(require("fs"),1);function K(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return J.existsSync(e)})}w(K,"existsSync");function B(e,t){var n=J.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":f(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}w(B,"readFileSync");function H(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":f(t))=="object"?JSON.stringify(t,null,4):String(t);J.writeFileSync(e,i,"utf-8")}w(H,"writeFileSync");function Y(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":f(t))=="object"?JSON.stringify(t,null,4):String(t);J.appendFileSync(e,i,"utf-8")}w(Y,"appendFileSync");function $(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){K(e)&&J.rmSync(e,{recursive:!0,force:!0})})}w($,"rmSync");var V=S(require("process"),1);var z=S(require("path"),1);function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=z).resolve.apply(r,[Z].concat(p(t)))}w(Q,"resolveWorkingPath");function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=z).join.apply(r,p(t))}w(X,"join");var Z=V.default.env.INIT_CWD||V.default.cwd(),ee="@cyberskill/shared",et=".cyberskill-storage",en="node_modules",er="dist",es="package.json",ei="package-lock.json",eo="tsconfig.json",ea=".gitignore",ec=".simple-git-hooks.json",eu="pnpm-lock.yaml",el=".git/hooks/",ed=".git/COMMIT_EDITMSG",ep=X(Z,en,ee,er),ef="cyberskill",eg="src/nodejs/cli/index.ts",ey="eslint",eh="eslint",ev="vitest",em="playwright",ej="vitest",ex="@commitlint/cli",eb="commitlint",ew="lint-staged",eI="lint-staged",eS="typescript",eE="tsc",eO="tsx",ek="git",eC="pnpm",e_="pnpm exec",eT="simple-git-hooks",eq="simple-git-hooks",eL="@eslint/config-inspector",eP="eslint-config-inspector",eN="node-modules-inspector",eG="node-modules-inspector",eA={CYBERSKILL_DIRECTORY:ep,WORKING_DIRECTORY:Z,TS_CONFIG:Q(eo),GIT_IGNORE:Q(ea),GIT_HOOK:Q(el),GIT_COMMIT_MSG:Q(ed),SIMPLE_GIT_HOOKS_JSON:Q(ec),PACKAGE_JSON:Q(es),PACKAGE_LOCK_JSON:Q(ei),PNPM_LOCK_YAML:Q(eu),NODE_MODULES:Q(en),LINT_STAGED_CONFIG:Q("".concat(ep,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:Q("".concat(ep,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:Q("".concat(ep,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:Q("".concat(ep,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:Q("".concat(ep,"/react/vitest/vitest.e2e.js"))};function eR(e){var t=e.isCurrentProject;return l({"pre-commit":eI,"commit-msg":eb},t&&{"pre-push":to("".concat(ek," pull"))})}w(eR,"HOOK");function eD(e){return eF.apply(this,arguments)}function eF(){eF=s(function(e){var t,n,r,s,i,o;var a=arguments;return y(this,function(c){switch(c.label){case 0:for(t=a.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=a[r]}s=d(n,2),i=s[0],o=s[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case _.CLI:return[3,1];case _.RAW:return[3,3]}return[3,4];case 1:return[4,eV(i.split(" "),{update:!0})];case 2:return[2,(c.sent(),tc(to("".concat(e_," ").concat(o))))];case 3:return[2,tc(to(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return eF.apply(this,arguments)}w(eD,"buildCommand");function eM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return /*#__PURE__*/s(function(){return y(this,function(t){return[2,eD.apply(void 0,[e].concat(p(n)))]})})}w(eM,"commandFactory");var eW={simpleGitHooks:eM(_.CLI,eT,eq),eslintInspect:eM(_.CLI,eL,eP),nodeModulesInspect:eM(_.CLI,eN,eG),eslintCheck:eM(_.CLI,ey,"".concat(eh," ").concat(eA.WORKING_DIRECTORY)),eslintFix:eM(_.CLI,ey,"".concat(eh," ").concat(eA.WORKING_DIRECTORY," --fix")),typescriptCheck:eM(_.CLI,eS,"".concat(eE," -p ").concat(eA.TS_CONFIG," --noEmit")),configureGitHook:eM(_.RAW,"".concat(ek," config core.hooksPath ").concat(eA.GIT_HOOK)),testUnit:eM(_.CLI,ev,"".concat(ej," --config ").concat(eA.UNIT_TEST_CONFIG)),testE2e:eM(_.CLI,"".concat(ev," ").concat(em),"".concat(ej," --config ").concat(eA.E2E_TEST_CONFIG)),commitLint:eM(_.CLI,ex,"".concat(eb," --edit ").concat(eA.GIT_COMMIT_MSG," --config ").concat(eA.COMMITLINT_CONFIG)),lintStaged:eM(_.CLI,ew,"".concat(eI," --config ").concat(eA.LINT_STAGED_CONFIG)),stageBuildDirectory:eM(_.RAW,"".concat(ek," add ").concat(er)),build:eM(_.RAW,"".concat(eC," run build")),pnpmInstallStandard:eM(_.RAW,"".concat(eC," install")),pnpmInstallLegacy:eM(_.RAW,"".concat(eC," install --legacy-peer-deps")),pnpmInstallForce:eM(_.RAW,"".concat(eC," install --force"))};function eU(e){var t=X(Z,es);if(!K(t))return!1;try{var n=B(t,{asJson:!0}),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 M.warn("Failed to read package.json: ".concat(e.message)),!1}}w(eU,"getPackage");function eJ(e){return eK.apply(this,arguments)}function eK(){eK=s(function(e){var t,n,r,s;return y(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,U.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 M.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return eK.apply(this,arguments)}w(eJ,"getLatestPackageVersion");function eB(e,t){return eH.apply(this,arguments)}function eH(){eH=s(function(e,t){var n,r,s,i,o,a,c,u,d,p,f,g,h,v,m,j,x,b,w,I,S;return y(this,function(y){switch(y.label){case 0:y.trys.push([0,4,,5]);n=eU(e);if(!n)return[2,l({},W)];c=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:{},v=d?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=g[e])!==null&&o!==void 0?o:"0.0.0":f?(a=h[e])!==null&&a!==void 0?a:"0.0.0":"0.0.0";if(!d)return[3,1];x=v;return[3,3];case 1:return[4,eJ(e)];case 2:x=y.sent();y.label=3;case 3:m=x,j=d||v===m;if(!j&&(t===null||t===void 0?void 0:t.update)){;w=p?"dependencies":f?"devDependencies":null;w&&((b=u[w])===null||b===void 0?void 0:b[e])!==m&&(u[w]=(I=u[w])!==null&&I!==void 0?I:{},u[w][e]=m,H(c,u,{isJson:!0}),M.info('Updated "'.concat(e,'" to version ').concat(m)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:j}];case 4:S=y.sent();return[2,(M.error('Error checking package "'.concat(e,'": ').concat(S.message)),l({},W))];case 5:return[2]}})});return eH.apply(this,arguments)}w(eB,"checkPackage");function eY(){return e$.apply(this,arguments)}function e$(){e$=s(function(){var e,t,n,r,s,i,o,a,c,u,l,d;return y(this,function(p){switch(p.label){case 0:e=[{command:w(function(){return eW.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:w(function(){return eW.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:w(function(){return eW.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,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,td("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();M.warn("Installation attempt failed: ".concat(c)),M.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 e$.apply(this,arguments)}w(eY,"installDependencies");function eV(e,t){return ez.apply(this,arguments)}function ez(){ez=s(function(e,t){var n,r,s,i,o,a,c,u,d,f,g;return y(this,function(y){switch(y.label){case 0:if(!K(eA.PACKAGE_JSON)){M.error("package.json not found. Aborting setup.");return[2]}y.label=1;case 1:y.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return eB(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=y.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,eY()];case 3:r=y.sent();y.label=4;case 4:r;i=true,o=false,a=undefined;y.label=5;case 5:y.trys.push([5,10,11,12]);c=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();y.label=6;case 6:if(!!(i=(u=c.next()).done))return[3,9];d=u.value;return[4,d()];case 7:y.sent();y.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:f=y.sent();o=true;a=f;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=y.sent();throw M.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return ez.apply(this,arguments)}w(eV,"setupPackages");var eQ=S(require("node-persist"),1),eX=S(require("os"),1),eZ=S(require("process"),1);function e0(){return eZ.default.env.CYBERSKILL_STORAGE_DIR||X(eX.default.homedir(),et)}w(e0,"getStorageDir");function e1(){return e2.apply(this,arguments)}function e2(){e2=s(function(){var e;return y(this,function(t){switch(t.label){case 0:e=eQ.default.defaultInstance;if(e)return[3,2];return[4,eQ.default.init({dir:e0(),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 e2.apply(this,arguments)}w(e1,"initNodePersist");var e4={get:function e(e){return s(function(){var t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1()];case 1:r.sent();return[4,eQ.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(M.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 y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1()];case 1:r.sent();return[4,eQ.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();M.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 y(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e1()];case 1:n.sent();return[4,eQ.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();M.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 y(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e1()];case 1:n.sent();return[4,eQ.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(M.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(M.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return s(function(){return y(this,function(t){try{return[2,"".concat(e0()," (key: ").concat(e,")")]}catch(e){return[2,(M.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e3=L.promisify(T.exec);function e8(e){return"error_list:".concat(e)}w(e8,"getErrorListKey");function e5(e){return e6.apply(this,arguments)}function e6(){e6=s(function(e){var t,n,r;return y(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=e8(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,e4.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/s(function(){var e;return y(this,function(t){switch(t.label){case 0:return[4,e4.getLogLink(n)];case 1:e=t.sent();e&&M.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();M.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return e6.apply(this,arguments)}w(e5,"saveErrorListToStorage");function e9(){return e7.apply(this,arguments)}function e7(){e7=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e4.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 y(this,function(n){switch(n.label){case 0:return[4,e4.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,(M.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return e7.apply(this,arguments)}w(e9,"getStoredErrorLists");function te(){return tt.apply(this,arguments)}function tt(){tt=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e4.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 e4.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();M.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return tt.apply(this,arguments)}w(te,"clearAllErrorLists");function tn(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 p=s.exec(e)||[],f=i.exec(e)||[],g=o.exec(e)||[];var y,h,v,m,j,x;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===G.Error?G.Error:G.Warning,message:(y=p===null||p===void 0?void 0:(a=p[4])===null||a===void 0?void 0:a.trim())!==null&&y!==void 0?y:"",rule:(h=p===null||p===void 0?void 0:(c=p[5])===null||c===void 0?void 0:c.trim())!==null&&h!==void 0?h:""}):f.length?t.push({file:(v=f===null||f===void 0?void 0:f[1])!==null&&v!==void 0?v:"",position:"".concat(f[2],":").concat(f[3]),type:f[4]===G.Error?G.Error:G.Warning,message:(m=f===null||f===void 0?void 0:(u=f[5])===null||u===void 0?void 0:u.trim())!==null&&m!==void 0?m:""}):g.length?t.push({file:"commitlint",type:G.Error,message:(j=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&j!==void 0?j:"",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&&e5(t),N&&n.length&&(M.warn("Unmatched lines:"),n.forEach(function(e){return M.info(" ".concat(e))}))}w(tn,"parseTextErrors");function tr(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?G.Error:G.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:a})})}),n.length&&e5(n)}catch(t){tn(e)}}w(tr,"parseCommandOutput");function ts(e){return ti.apply(this,arguments)}function ti(){ti=s(function(e){var t,n,r,s,i,o,a,c,u;var l=arguments;return y(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tr;n=new AbortController;q.default.on("SIGINT",function(){M.warn("Process interrupted. Terminating..."),n.abort(),q.default.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,e3(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)});return[3,4];case 3:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&M.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return ti.apply(this,arguments)}w(ts,"executeCommand");function to(e){return{raw:!0,cmd:e}}w(to,"rawCommand");function ta(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e_," ").concat(ee," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e_," ").concat(eO," ").concat(eg," ").concat(e):"".concat(e_," ").concat(ef," ").concat(e)}w(ta,"formatCLI");function tc(e,t){return typeof e=="function"?ta(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"?ta(e,t):e}w(tc,"formatCommand");function tu(e){return tl.apply(this,arguments)}function tl(){tl=s(function(e){var t,n,r,s,i,o,a;var c=arguments;return y(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,eB(ee)];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,tc(r,i)]}))]}})});return tl.apply(this,arguments)}w(tu,"resolveCommands");function td(e,t){return tp.apply(this,arguments)}function tp(){tp=s(function(e,t){var n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);M.start("".concat(e)),N&&M.info("→ ".concat(t));return[4,ts(t)];case 1:r.sent(),M.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw M.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tp.apply(this,arguments)}w(td,"runCommand");function tf(){return tg.apply(this,arguments)}function tg(){tg=s(function(){var e,t;return y(this,function(n){switch(n.label){case 0:if(!K(eA.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eW.typescriptCheck()];case 1:return[4,td.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=M.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tg.apply(this,arguments)}w(tf,"checkTypescript");function ty(){return th.apply(this,arguments)}function th(){th=s(function(){var e,t,n,r;var s=arguments;return y(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,eW.eslintFix()];case 1:return[4,td.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eW.eslintCheck()];case 4:return[4,td.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return th.apply(this,arguments)}w(ty,"checkEslint");function tv(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";M.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}w(tv,"printIssues");function tm(){return tj.apply(this,arguments)}function tj(){tj=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:return[4,e9()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===G.Error}),n=e.filter(function(e){return e.type===G.Warning});!t.length&&!n.length?M.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tv("Warnings",n),tv("Errors",t),(t.length>0||n.length>0)&&E.default.exit(1));return[2]}})});return tj.apply(this,arguments)}w(tm,"showCheckResult");function tx(){return tb.apply(this,arguments)}function tb(){tb=s(function(){var e,t,n,r,s,i;return y(this,function(o){switch(o.label){case 0:return[4,te()];case 1:o.sent();return[4,eB(ee)];case 2:e=o.sent(),t=e.isCurrentProject;if(!t)return[3,9];o.label=3;case 3:o.trys.push([3,8,,9]);n=["Building package: ".concat(ee)];return[4,eW.build()];case 4:return[4,td.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eW.stageBuildDirectory()];case 6:return[4,td.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw M.error("Error building and staging ".concat(ee,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eW.lintStaged()];case 10:return[4,td.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tm();return[2]}})});return tb.apply(this,arguments)}w(tx,"lintStaged");function tw(){return tI.apply(this,arguments)}function tI(){tI=s(function(){var e;return y(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eW.eslintInspect()];case 1:return[4,td.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tI.apply(this,arguments)}w(tw,"inspectLint");function tS(){return tE.apply(this,arguments)}function tE(){tE=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,te()];case 1:e.sent();return[4,Promise.all([tf(),ty()])];case 2:e.sent(),tm();return[2]}})});return tE.apply(this,arguments)}w(tS,"lintCheck");function tO(){return tk.apply(this,arguments)}function tk(){tk=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,te()];case 1:e.sent();return[4,Promise.all([tf(),ty(!0)])];case 2:e.sent(),tm();return[2]}})});return tk.apply(this,arguments)}w(tO,"lintFix");function tC(){return t_.apply(this,arguments)}function t_(){t_=s(function(){var e;return y(this,function(t){switch(t.label){case 0:return[4,te()];case 1:t.sent();e=["Validating commit message"];return[4,eW.commitLint()];case 2:return[4,td.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tm();return[2]}})});return t_.apply(this,arguments)}w(tC,"commitLint");function tT(){return tq.apply(this,arguments)}function tq(){tq=s(function(){var e,t,n,r;return y(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eW.configureGitHook()];case 1:return[4,td.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),$(eA.GIT_HOOK);return[4,tu(eR)];case 3:t=s.sent();H(eA.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});n="\n".concat(ec,"\n");K(eA.GIT_IGNORE)?B(eA.GIT_IGNORE).split("\n").includes(ec)||Y(eA.GIT_IGNORE,n):H(eA.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eW.simpleGitHooks()];case 4:return[4,td.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return tq.apply(this,arguments)}w(tT,"setupGitHook");function tL(){return tP.apply(this,arguments)}function tP(){tP=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,eV([ee],{update:!0,postInstallActions:[tT]})];case 1:e.sent();return[2]}})});return tP.apply(this,arguments)}w(tL,"setup");function tN(){return tG.apply(this,arguments)}function tG(){tG=s(function(){return y(this,function(e){switch(e.label){case 0:$(eA.NODE_MODULES,eA.PNPM_LOCK_YAML);return[4,eY()];case 1:e.sent();return[4,tT()];case 2:e.sent();return[2]}})});return tG.apply(this,arguments)}w(tN,"reset");function tA(){return tR.apply(this,arguments)}function tR(){tR=s(function(){var e;return y(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eW.nodeModulesInspect()];case 1:return[4,td.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tR.apply(this,arguments)}w(tA,"inspect");function tD(){return tF.apply(this,arguments)}function tF(){tF=s(function(){var e;return y(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eW.testUnit()];case 1:return[4,td.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tF.apply(this,arguments)}w(tD,"testUnit");function tM(){return tW.apply(this,arguments)}function tW(){tW=s(function(){var e;return y(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eW.testE2e()];case 1:return[4,td.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tW.apply(this,arguments)}w(tM,"testE2E");s(function(){var e;return y(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,k.default)((0,O.hideBin)(E.default.argv)).scriptName(ef).usage("$0 <command> [options]").command("lint","Check code for linting issues",tS).command("lint:fix","Fix linting issues automatically",tO).command("lint:inspect","View active ESLint configuration",tw).command("lint-staged","Run lint checks on staged files",tx).command("commitlint","Validate commit message format",tC).command("setup","Initialize project setup and dependencies",tL).command("reset","Reset the project and reinstall dependencies",tN).command("inspect","Analyze installed project dependencies",tA).command("test:unit","Run unit test suite",tD).command("test:e2e","Run end-to-end test suite",tM).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(C.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();M.error("Fatal: ".concat(e.message)),E.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,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 j=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var w=function(e,t){return h(e,"name",{value:t,configurable:!0})};var I=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=j(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(x(e)):{},I(t||!e||!e.__esModule?h(n,"default",{value:e,enumerable:!0}):n,e)};var S=E(require("process"),1),C=require("yargs/helpers"),O=E(require("yargs/yargs"),1);var _={name:"@cyberskill/shared",type:"module",version:"1.95.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.4","@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.1",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.19",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.0",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","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.4.1","react-icons":"5.5.0",sass:"1.86.3",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.1","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/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.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var k=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});var L=require("child_process"),T=E(require("process"),1),R=E(require("util"),1);var D=".cyberskill-storage";var G=E(require("dotenv"),1),q=require("envalid"),A=E(require("os"),1),P=E(require("path"),1),N=E(require("process"),1);G.default.config();function M(){var e={DEBUG:N.default.env.DEBUG,CWD:N.default.env.CWD,CYBERSKILL_STORAGE_DIR:N.default.env.CYBERSKILL_STORAGE_DIR},t=(0,q.cleanEnv)(e,{DEBUG:(0,q.bool)({default:!1}),CWD:(0,q.str)({default:N.default.cwd()}),CYBERSKILL_STORAGE_DIR:(0,q.str)({default:P.default.join(A.default.homedir(),D)})});return{DEBUG:t.DEBUG,CWD:t.CWD,CYBERSKILL_STORAGE_DIR:t.CYBERSKILL_STORAGE_DIR}}w(M,"getEnv");var F=function(e){return e.Error="error",e.Warning="warning",e}({});var U=E(require("chalk"),1),W=E(require("consola"),1),B=require("graphql");var K=M();K.DEBUG||(W.default.level=4);function J(e){var t=U.default[e];return typeof t=="function"?t:U.default.green}w(J,"chalkKeyword");var Y={silent:W.default.silent,level:W.default.level,fatal:W.default.fatal,error:W.default.error,warn:W.default.warn,log:W.default.log,info:W.default.info,success:W.default.success,ready:W.default.ready,start:W.default.start,box:W.default.box,debug:W.default.debug,trace:W.default.trace,verbose:W.default.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){W.default.box(U.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;W.default.log("".concat(U.default.gray("File:")," ").concat(U.default.blue("".concat(t).concat(r?":".concat(r):"")))),i&&W.default.log(" ".concat(J(n)("Rule:")," ").concat(i)),W.default.log(" ".concat(J(n)("Message:")," ").concat(s))}),W.default.box(J(n)("".concat(e," : ").concat(t.length))),W.default.log(U.default.gray("─".repeat(40)))}};var H={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var $=E(require("node-fetch"),1);var V=E(require("fs"),1);function z(){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.existsSync(e)})}w(z,"existsSync");function Q(e,t){var n=V.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":f(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}w(Q,"readFileSync");function X(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,s=i&&(typeof t==="undefined"?"undefined":f(t))=="object"?JSON.stringify(t,null,4):String(t);V.writeFileSync(e,s,"utf-8")}w(X,"writeFileSync");function Z(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,s=i&&(typeof t==="undefined"?"undefined":f(t))=="object"?JSON.stringify(t,null,4):String(t);V.appendFileSync(e,s,"utf-8")}w(Z,"appendFileSync");function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){z(e)&&V.rmSync(e,{recursive:!0,force:!0})})}w(ee,"rmSync");var et=E(require("path"),1);function en(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;var i=M();return(r=et).resolve.apply(r,[i.CWD].concat(p(t)))}w(en,"resolveWorkingPath");function er(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=et).join.apply(r,p(t))}w(er,"join");var ei=M(),es=ei.CWD,eo="@cyberskill/shared",ea="node_modules",ec="dist",eu="package.json",el="package-lock.json",ed="tsconfig.json",ep=".gitignore",ef=".simple-git-hooks.json",eg="pnpm-lock.yaml",em=".git/hooks/",ey=".git/COMMIT_EDITMSG",eh=er(es,ea,eo,ec),ev="cyberskill",ej="src/nodejs/cli/index.ts",ex="eslint",eb="eslint",ew="vitest",eI="playwright",eE="vitest",eS="@commitlint/cli",eC="commitlint",eO="lint-staged",e_="lint-staged",ek="typescript",eL="tsc",eT="tsx",eR="git",eD="pnpm",eG="pnpm exec",eq="simple-git-hooks",eA="simple-git-hooks",eP="@eslint/config-inspector",eN="eslint-config-inspector",eM="node-modules-inspector",eF="node-modules-inspector",eU="migrate-mongo",eW="migrate-mongo",eB={CYBERSKILL_DIRECTORY:eh,WORKING_DIRECTORY:es,TS_CONFIG:en(ed),GIT_IGNORE:en(ep),GIT_HOOK:en(em),GIT_COMMIT_MSG:en(ey),SIMPLE_GIT_HOOKS_JSON:en(ef),PACKAGE_JSON:en(eu),PACKAGE_LOCK_JSON:en(el),PNPM_LOCK_YAML:en(eg),NODE_MODULES:en(ea),LINT_STAGED_CONFIG:en("".concat(eh,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:en("".concat(eh,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:en("".concat(eh,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:en("".concat(eh,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:en("".concat(eh,"/react/vitest/vitest.e2e.js"))};function eK(e){var t=e.isCurrentProject;return l({"pre-commit":e_,"commit-msg":eC},t&&{"pre-push":tp("".concat(eR," pull"))})}w(eK,"HOOK");function eJ(e){return eY.apply(this,arguments)}function eY(){eY=i(function(e){var t,n,r,i,s,o;var a=arguments;return m(this,function(c){switch(c.label){case 0:for(t=a.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=a[r]}i=d(n,2),s=i[0],o=i[1];if(!s)throw new Error("'first' argument is undefined");switch(e){case k.CLI:return[3,1];case k.RAW:return[3,3]}return[3,4];case 1:return[4,e2(s.split(" "),{update:!0})];case 2:return[2,(c.sent(),tg(tp("".concat(eG," ").concat(o))))];case 3:return[2,tg(tp(s))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return eY.apply(this,arguments)}w(eJ,"buildCommand");function eH(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return /*#__PURE__*/i(function(){return m(this,function(t){return[2,eJ.apply(void 0,[e].concat(p(n)))]})})}w(eH,"commandFactory");var e$={simpleGitHooks:eH(k.CLI,eq,eA),eslintInspect:eH(k.CLI,eP,eN),nodeModulesInspect:eH(k.CLI,eM,eF),eslintCheck:eH(k.CLI,ex,"".concat(eb," ").concat(eB.WORKING_DIRECTORY)),eslintFix:eH(k.CLI,ex,"".concat(eb," ").concat(eB.WORKING_DIRECTORY," --fix")),typescriptCheck:eH(k.CLI,ek,"".concat(eL," -p ").concat(eB.TS_CONFIG," --noEmit")),configureGitHook:eH(k.RAW,"".concat(eR," config core.hooksPath ").concat(eB.GIT_HOOK)),testUnit:eH(k.CLI,ew,"".concat(eE," --config ").concat(eB.UNIT_TEST_CONFIG)),testE2e:eH(k.CLI,"".concat(ew," ").concat(eI),"".concat(eE," --config ").concat(eB.E2E_TEST_CONFIG)),mongoMigrateCreate:w(function(e){return eH(k.CLI,"".concat(eU),"".concat(eW," create ").concat(e))()},"mongoMigrateCreate"),mongoMigrateUp:eH(k.CLI,"".concat(eU),"".concat(eW," up")),mongoMigrateDown:eH(k.CLI,"".concat(eU),"".concat(eW," down")),commitLint:eH(k.CLI,eS,"".concat(eC," --edit ").concat(eB.GIT_COMMIT_MSG," --config ").concat(eB.COMMITLINT_CONFIG)),lintStaged:eH(k.CLI,eO,"".concat(e_," --config ").concat(eB.LINT_STAGED_CONFIG)),stageBuildDirectory:eH(k.RAW,"".concat(eR," add ").concat(ec)),build:eH(k.RAW,"".concat(eD," run build")),pnpmInstallStandard:eH(k.RAW,"".concat(eD," install")),pnpmInstallLegacy:eH(k.RAW,"".concat(eD," install --legacy-peer-deps")),pnpmInstallForce:eH(k.RAW,"".concat(eD," install --force"))};function eV(e){var t=M(),n=er(t.CWD,eu);if(!z(n))return!1;try{var r=Q(n,{asJson:!0}),i=r.name,s=r.dependencies,o=s===void 0?{}:s,a=r.devDependencies,c=a===void 0?{}:a,u=i===e,l=e in o,d=e in c;return u||l||d?{path:n,file:r,isCurrentProject:u,isDepend:l,isDevDepend:d}:!1}catch(e){return Y.warn("Failed to read package.json: ".concat(e.message)),!1}}w(eV,"getPackage");function ez(e){return eQ.apply(this,arguments)}function eQ(){eQ=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 Y.error('Failed to fetch version for "'.concat(e,'": ').concat(i.message)),i;case 4:return[2]}})});return eQ.apply(this,arguments)}w(ez,"getLatestPackageVersion");function eX(e,t){return eZ.apply(this,arguments)}function eZ(){eZ=i(function(e,t){var n,r,i,s,o,a,c,u,d,p,f,g,y,h,v,j,x,b,w,I,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=eV(e);if(!n)return[2,l({},H)];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];x=h;return[3,3];case 1:return[4,ez(e)];case 2:x=m.sent();m.label=3;case 3:v=x,j=d||h===v;if(!j&&(t===null||t===void 0?void 0:t.update)){;w=p?"dependencies":f?"devDependencies":null;w&&((b=u[w])===null||b===void 0?void 0:b[e])!==v&&(u[w]=(I=u[w])!==null&&I!==void 0?I:{},u[w][e]=v,X(c,u,{isJson:!0}),Y.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:d,installedPath:c,file:u,isUpToDate:j}];case 4:E=m.sent();return[2,(Y.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},H))];case 5:return[2]}})});return eZ.apply(this,arguments)}w(eX,"checkPackage");function e0(){return e1.apply(this,arguments)}function e1(){e1=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:w(function(){return e$.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:w(function(){return e$.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:w(function(){return e$.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,th("".concat(c," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();Y.warn("Installation attempt failed: ".concat(c)),Y.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 e1.apply(this,arguments)}w(e0,"installDependencies");function e2(e,t){return e4.apply(this,arguments)}function e4(){e4=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(!z(eB.PACKAGE_JSON)){Y.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 eX(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,e0()];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 Y.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return e4.apply(this,arguments)}w(e2,"setupPackages");var e3=E(require("node-persist"),1);var e8=M();function e5(){return e6.apply(this,arguments)}function e6(){e6=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=e3.default.defaultInstance;if(e)return[3,2];return[4,e3.default.init({dir:e8.CYBERSKILL_STORAGE_DIR,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 e6.apply(this,arguments)}w(e5,"initNodePersist");var e9={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,e5()];case 1:r.sent();return[4,e3.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(Y.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,e5()];case 1:r.sent();return[4,e3.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();Y.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,e5()];case 1:n.sent();return[4,e3.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();Y.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,e5()];case 1:n.sent();return[4,e3.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(Y.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(Y.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(e8.CYBERSKILL_STORAGE_DIR," (key: ").concat(e,")")]}catch(e){return[2,(Y.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e7=M(),te=R.promisify(L.exec);function tt(e){return"error_list:".concat(e)}w(tt,"getErrorListKey");function tn(e){return tr.apply(this,arguments)}function tr(){tr=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=tt(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,e9.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,e9.getLogLink(n)];case 1:e=t.sent();e&&Y.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=s.sent();Y.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tr.apply(this,arguments)}w(tn,"saveErrorListToStorage");function ti(){return ts.apply(this,arguments)}function ts(){ts=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=i(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,e9.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(Y.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return ts.apply(this,arguments)}w(ti,"getStoredErrorLists");function to(){return ta.apply(this,arguments)}function ta(){ta=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e9.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return e9.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();Y.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return ta.apply(this,arguments)}w(to,"clearAllErrorLists");function tc(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,j,x;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:(j=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&j!==void 0?j:"",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&&tn(t),e7.DEBUG&&n.length&&(Y.warn("Unmatched lines:"),n.forEach(function(e){return Y.info(" ".concat(e))}))}w(tc,"parseTextErrors");function tu(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&&tn(n)}catch(t){tc(e)}}w(tu,"parseCommandOutput");function tl(e){return td.apply(this,arguments)}function td(){td=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]:tu;n=new AbortController;T.default.on("SIGINT",function(){Y.warn("Process interrupted. Terminating..."),n.abort(),T.default.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,te(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)});return[3,4];case 3:o=d.sent();a=o.stdout,c=o.stderr,u=o.message;[a,c].forEach(function(e){return e&&t(e)}),!c&&!a&&Y.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return td.apply(this,arguments)}w(tl,"executeCommand");function tp(e){return{raw:!0,cmd:e}}w(tp,"rawCommand");function tf(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eG," ").concat(eo," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eG," ").concat(eT," ").concat(ej," ").concat(e):"".concat(eG," ").concat(ev," ").concat(e)}w(tf,"formatCLI");function tg(e,t){return typeof e=="function"?tf(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"?tf(e,t):e}w(tg,"formatCommand");function tm(e){return ty.apply(this,arguments)}function ty(){ty=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,eX(eo)];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,tg(r,s)]}))]}})});return ty.apply(this,arguments)}w(tm,"resolveCommands");function th(e,t){return tv.apply(this,arguments)}function tv(){tv=i(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);Y.start("".concat(e)),e7.DEBUG&&Y.info("→ ".concat(t));return[4,tl(t)];case 1:r.sent(),Y.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw Y.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tv.apply(this,arguments)}w(th,"runCommand");function tj(){return tx.apply(this,arguments)}function tx(){tx=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!z(eB.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,e$.typescriptCheck()];case 1:return[4,th.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=Y.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tx.apply(this,arguments)}w(tj,"checkTypescript");function tb(){return tw.apply(this,arguments)}function tw(){tw=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,e$.eslintFix()];case 1:return[4,th.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,e$.eslintCheck()];case 4:return[4,th.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})});return tw.apply(this,arguments)}w(tb,"checkEslint");function tI(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";Y.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}w(tI,"printIssues");function tE(){return tS.apply(this,arguments)}function tS(){tS=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,ti()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===F.Error}),n=e.filter(function(e){return e.type===F.Warning});!t.length&&!n.length?Y.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tI("Warnings",n),tI("Errors",t),(t.length>0||n.length>0)&&S.default.exit(1));return[2]}})});return tS.apply(this,arguments)}w(tE,"showCheckResult");function tC(){return tO.apply(this,arguments)}function tO(){tO=i(function(){var e,t,n,r,i,s;return m(this,function(o){switch(o.label){case 0:return[4,to()];case 1:o.sent();return[4,eX(eo)];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(eo)];return[4,e$.build()];case 4:return[4,th.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,e$.stageBuildDirectory()];case 6:return[4,th.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:i=o.sent();throw Y.error("Error building and staging ".concat(eo,": ").concat(i.message)),i;case 9:s=["Executing lint-staged"];return[4,e$.lintStaged()];case 10:return[4,th.apply(void 0,s.concat([o.sent()]))];case 11:o.sent(),tE();return[2]}})});return tO.apply(this,arguments)}w(tC,"lintStaged");function t_(){return tk.apply(this,arguments)}function tk(){tk=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,e$.eslintInspect()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tk.apply(this,arguments)}w(t_,"inspectLint");function tL(){return tT.apply(this,arguments)}function tT(){tT=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,to()];case 1:e.sent();return[4,Promise.all([tj(),tb()])];case 2:e.sent(),tE();return[2]}})});return tT.apply(this,arguments)}w(tL,"lintCheck");function tR(){return tD.apply(this,arguments)}function tD(){tD=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,to()];case 1:e.sent();return[4,Promise.all([tj(),tb(!0)])];case 2:e.sent(),tE();return[2]}})});return tD.apply(this,arguments)}w(tR,"lintFix");function tG(){return tq.apply(this,arguments)}function tq(){tq=i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,to()];case 1:t.sent();e=["Validating commit message"];return[4,e$.commitLint()];case 2:return[4,th.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tE();return[2]}})});return tq.apply(this,arguments)}w(tG,"commitLint");function tA(){return tP.apply(this,arguments)}function tP(){tP=i(function(){var e,t,n,r;return m(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,e$.configureGitHook()];case 1:return[4,th.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),ee(eB.GIT_HOOK);return[4,tm(eK)];case 3:t=i.sent();X(eB.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});n="\n".concat(ef,"\n");z(eB.GIT_IGNORE)?Q(eB.GIT_IGNORE).split("\n").includes(ef)||Z(eB.GIT_IGNORE,n):X(eB.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,e$.simpleGitHooks()];case 4:return[4,th.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})});return tP.apply(this,arguments)}w(tA,"setupGitHook");function tN(){return tM.apply(this,arguments)}function tM(){tM=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e2([eo],{update:!0,postInstallActions:[tA]})];case 1:e.sent();return[2]}})});return tM.apply(this,arguments)}w(tN,"setup");function tF(){return tU.apply(this,arguments)}function tU(){tU=i(function(){return m(this,function(e){switch(e.label){case 0:ee(eB.NODE_MODULES,eB.PNPM_LOCK_YAML);return[4,e0()];case 1:e.sent();return[4,tA()];case 2:e.sent();return[2]}})});return tU.apply(this,arguments)}w(tF,"reset");function tW(){return tB.apply(this,arguments)}function tB(){tB=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,e$.nodeModulesInspect()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tB.apply(this,arguments)}w(tW,"inspect");function tK(){return tJ.apply(this,arguments)}function tJ(){tJ=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,e$.testUnit()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tJ.apply(this,arguments)}w(tK,"testUnit");function tY(){return tH.apply(this,arguments)}function tH(){tH=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,e$.testE2e()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tH.apply(this,arguments)}w(tY,"testE2E");function t$(e){return tV.apply(this,arguments)}function tV(){tV=i(function(e){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,e$.mongoMigrateCreate(e)];case 1:return[4,th.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return tV.apply(this,arguments)}w(t$,"mongoMigrateCreate");function tz(){return tQ.apply(this,arguments)}function tQ(){tQ=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,e$.mongoMigrateUp()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tQ.apply(this,arguments)}w(tz,"mongoMigrateUp");function tX(){return tZ.apply(this,arguments)}function tZ(){tZ=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,e$.mongoMigrateDown()];case 1:return[4,th.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tZ.apply(this,arguments)}w(tX,"mongoMigrateDown");i(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,O.default)((0,C.hideBin)(S.default.argv)).scriptName(ev).usage("$0 <command> [options]").command("lint","Check code for linting issues",tL).command("lint:fix","Fix linting issues automatically",tR).command("lint:inspect","View active ESLint configuration",t_).command("lint-staged","Run lint checks on staged files",tC).command("commitlint","Validate commit message format",tG).command("setup","Initialize project setup and dependencies",tN).command("reset","Reset the project and reinstall dependencies",tF).command("inspect","Analyze installed project dependencies",tW).command("test:unit","Run unit test suite",tK).command("test:e2e","Run end-to-end test suite",tY).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){Y.error("Migration name is required.");return[2]}return[4,t$(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",tz).command("mongo:migrate:down","Rollback last MongoDB migration",tX).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();Y.error("Fatal: ".concat(e.message)),S.default.exit(1);return[3,3];case 3:return[2]}})})();
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,s,i,o){try{var c=e[i](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).then(r,s)}}function s(e){return function(){var t=this,n=arguments;return new Promise(function(s,i){var o=e.apply(t,n);function c(e){r(o,s,i,c,a,"next",e)}function a(e){r(o,s,i,c,a,"throw",e)}c(undefined)})}}function i(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var s=true;var i=false;var o,c;try{for(n=n.call(e);!(s=(o=n.next()).done);s=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!s&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function d(e,n){return t(e)||c(e,n)||g(e,n)||a()}function p(e){return n(e)||o(e)||g(e)||u()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function g(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,s,i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},o=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return o.next=c(0),o["throw"]=c(1),o["return"]=c(2),typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function c(e){return function(t){return a([e,t])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(s=c[0]&2?r["return"]:c[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,c[1])).done)return s;if(r=0,s)c=[c[0]&2,s.value];switch(c[0]){case 0:case 1:s=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;r=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!s||c[1]>s[0]&&c[1]<s[3])){i.label=c[1];break}if(c[0]===6&&i.label<s[1]){i.label=s[1];s=c;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(c);break}if(s[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=s=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var 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.94.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.3","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@microsoft/api-extractor":"7.52.4","@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.1",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-cli":"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.19",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.0",jsdom:"26.1.0",localforage:"1.10.0","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","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.4.1","react-icons":"5.5.0",sass:"1.86.3",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.1","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/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.24.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var w=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as I}from"node:child_process";import S from"node:process";import*as E from"node:util";import k from"node:process";var O=k.env.DEBUG==="true";var C=function(e){return e.Error="error",e.Warning="warning",e}({});import _ from"chalk";import T from"consola";import{GraphQLError as L}from"graphql";O||(T.level=4);function G(e){var t=_[e];return typeof t=="function"?t:_.green}y(G,"chalkKeyword");var N={silent:T.silent,level:T.level,fatal:T.fatal,error:T.error,warn:T.warn,log:T.log,info:T.info,success:T.success,ready:T.ready,start:T.start,box:T.box,debug:T.debug,trace:T.trace,verbose:T.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)){T.box(_.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;T.log("".concat(_.gray("File:")," ").concat(_.blue("".concat(t).concat(r?":".concat(r):"")))),s&&T.log(" ".concat(G(n)("Rule:")," ").concat(s)),T.log(" ".concat(G(n)("Message:")," ").concat(i))}),T.box(G(n)("".concat(e," : ").concat(t.length))),T.log(_.gray("─".repeat(40)))}};var P={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import A from"node-fetch";import*as R from"node:fs";function q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return R.existsSync(e)})}y(q,"existsSync");function F(e,t){var n=R.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":f(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}y(F,"readFileSync");function D(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":f(t))=="object"?JSON.stringify(t,null,4):String(t);R.writeFileSync(e,i,"utf-8")}y(D,"writeFileSync");function M(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,s=r===void 0?!1:r,i=s&&(typeof t==="undefined"?"undefined":f(t))=="object"?JSON.stringify(t,null,4):String(t);R.appendFileSync(e,i,"utf-8")}y(M,"appendFileSync");function W(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){q(e)&&R.rmSync(e,{recursive:!0,force:!0})})}y(W,"rmSync");import U from"node:process";import*as J from"node:path";function K(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=J).resolve.apply(r,[H].concat(p(t)))}y(K,"resolveWorkingPath");function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=J).join.apply(r,p(t))}y(B,"join");var H=U.env.INIT_CWD||U.cwd(),Y="@cyberskill/shared",$=".cyberskill-storage",V="node_modules",z="dist",Q="package.json",X="package-lock.json",Z="tsconfig.json",ee=".gitignore",et=".simple-git-hooks.json",en="pnpm-lock.yaml",er=".git/hooks/",es=".git/COMMIT_EDITMSG",ei=B(H,V,Y,z),eo="cyberskill",ec="src/nodejs/cli/index.ts",ea="eslint",eu="eslint",el="vitest",ed="playwright",ep="vitest",ef="@commitlint/cli",eg="commitlint",em="lint-staged",eh="lint-staged",ey="typescript",ev="tsc",ex="tsx",ej="git",eb="pnpm",ew="pnpm exec",eI="simple-git-hooks",eS="simple-git-hooks",eE="@eslint/config-inspector",ek="eslint-config-inspector",eO="node-modules-inspector",eC="node-modules-inspector",e_={CYBERSKILL_DIRECTORY:ei,WORKING_DIRECTORY:H,TS_CONFIG:K(Z),GIT_IGNORE:K(ee),GIT_HOOK:K(er),GIT_COMMIT_MSG:K(es),SIMPLE_GIT_HOOKS_JSON:K(et),PACKAGE_JSON:K(Q),PACKAGE_LOCK_JSON:K(X),PNPM_LOCK_YAML:K(en),NODE_MODULES:K(V),LINT_STAGED_CONFIG:K("".concat(ei,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:K("".concat(ei,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:K("".concat(ei,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:K("".concat(ei,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:K("".concat(ei,"/react/vitest/vitest.e2e.js"))};function eT(e){var t=e.isCurrentProject;return l({"pre-commit":eh,"commit-msg":eg},t&&{"pre-push":e7("".concat(ej," pull"))})}y(eT,"HOOK");function eL(e){return eG.apply(this,arguments)}function eG(){eG=s(function(e){var t,n,r,s,i,o;var c=arguments;return m(this,function(a){switch(a.label){case 0:for(t=c.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=c[r]}s=d(n,2),i=s[0],o=s[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case w.CLI:return[3,1];case w.RAW:return[3,3]}return[3,4];case 1:return[4,eU(i.split(" "),{update:!0})];case 2:return[2,(a.sent(),tt(e7("".concat(ew," ").concat(o))))];case 3:return[2,tt(e7(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return eG.apply(this,arguments)}y(eL,"buildCommand");function eN(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return /*#__PURE__*/s(function(){return m(this,function(t){return[2,eL.apply(void 0,[e].concat(p(n)))]})})}y(eN,"commandFactory");var eP={simpleGitHooks:eN(w.CLI,eI,eS),eslintInspect:eN(w.CLI,eE,ek),nodeModulesInspect:eN(w.CLI,eO,eC),eslintCheck:eN(w.CLI,ea,"".concat(eu," ").concat(e_.WORKING_DIRECTORY)),eslintFix:eN(w.CLI,ea,"".concat(eu," ").concat(e_.WORKING_DIRECTORY," --fix")),typescriptCheck:eN(w.CLI,ey,"".concat(ev," -p ").concat(e_.TS_CONFIG," --noEmit")),configureGitHook:eN(w.RAW,"".concat(ej," config core.hooksPath ").concat(e_.GIT_HOOK)),testUnit:eN(w.CLI,el,"".concat(ep," --config ").concat(e_.UNIT_TEST_CONFIG)),testE2e:eN(w.CLI,"".concat(el," ").concat(ed),"".concat(ep," --config ").concat(e_.E2E_TEST_CONFIG)),commitLint:eN(w.CLI,ef,"".concat(eg," --edit ").concat(e_.GIT_COMMIT_MSG," --config ").concat(e_.COMMITLINT_CONFIG)),lintStaged:eN(w.CLI,em,"".concat(eh," --config ").concat(e_.LINT_STAGED_CONFIG)),stageBuildDirectory:eN(w.RAW,"".concat(ej," add ").concat(z)),build:eN(w.RAW,"".concat(eb," run build")),pnpmInstallStandard:eN(w.RAW,"".concat(eb," install")),pnpmInstallLegacy:eN(w.RAW,"".concat(eb," install --legacy-peer-deps")),pnpmInstallForce:eN(w.RAW,"".concat(eb," install --force"))};function eA(e){var t=B(H,Q);if(!q(t))return!1;try{var n=F(t,{asJson:!0}),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 N.warn("Failed to read package.json: ".concat(e.message)),!1}}y(eA,"getPackage");function eR(e){return eq.apply(this,arguments)}function eq(){eq=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,A("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 N.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return eq.apply(this,arguments)}y(eR,"getLatestPackageVersion");function eF(e,t){return eD.apply(this,arguments)}function eD(){eD=s(function(e,t){var n,r,s,i,o,c,a,u,d,p,f,g,h,y,v,x,j,b,w,I,S;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=eA(e);if(!n)return[2,l({},P)];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,eR(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)){;w=p?"dependencies":f?"devDependencies":null;w&&((b=u[w])===null||b===void 0?void 0:b[e])!==v&&(u[w]=(I=u[w])!==null&&I!==void 0?I:{},u[w][e]=v,D(a,u,{isJson:!0}),N.info('Updated "'.concat(e,'" to version ').concat(v)))}return[2,{isCurrentProject:d,installedPath:a,file:u,isUpToDate:x}];case 4:S=m.sent();return[2,(N.error('Error checking package "'.concat(e,'": ').concat(S.message)),l({},P))];case 5:return[2]}})});return eD.apply(this,arguments)}y(eF,"checkPackage");function eM(){return eW.apply(this,arguments)}function eW(){eW=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 eP.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:y(function(){return eP.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:y(function(){return eP.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,ts("".concat(a," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();N.warn("Installation attempt failed: ".concat(a)),N.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 eW.apply(this,arguments)}y(eM,"installDependencies");function eU(e,t){return eJ.apply(this,arguments)}function eJ(){eJ=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(!q(e_.PACKAGE_JSON)){N.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 eF(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,eM()];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 N.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return eJ.apply(this,arguments)}y(eU,"setupPackages");import eK from"node-persist";import eB from"node:os";import eH from"node:process";function eY(){return eH.env.CYBERSKILL_STORAGE_DIR||B(eB.homedir(),$)}y(eY,"getStorageDir");function e$(){return eV.apply(this,arguments)}function eV(){eV=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=eK.defaultInstance;if(e)return[3,2];return[4,eK.init({dir:eY(),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 eV.apply(this,arguments)}y(e$,"initNodePersist");var ez={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,e$()];case 1:r.sent();return[4,eK.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(N.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,e$()];case 1:r.sent();return[4,eK.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();N.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,e$()];case 1:n.sent();return[4,eK.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();N.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,e$()];case 1:n.sent();return[4,eK.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(N.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(N.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(eY()," (key: ").concat(e,")")]}catch(e){return[2,(N.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eQ=E.promisify(I);function eX(e){return"error_list:".concat(e)}y(eX,"getErrorListKey");function eZ(e){return e0.apply(this,arguments)}function e0(){e0=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=eX(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ez.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,ez.getLogLink(n)];case 1:e=t.sent();e&&N.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();N.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return e0.apply(this,arguments)}y(eZ,"saveErrorListToStorage");function e1(){return e2.apply(this,arguments)}function e2(){e2=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ez.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,ez.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,(N.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return e2.apply(this,arguments)}y(e1,"getStoredErrorLists");function e4(){return e3.apply(this,arguments)}function e3(){e3=s(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ez.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 ez.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();N.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return e3.apply(this,arguments)}y(e4,"clearAllErrorLists");function e8(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]===C.Error?C.Error:C.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]===C.Error?C.Error:C.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:C.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&&eZ(t),O&&n.length&&(N.warn("Unmatched lines:"),n.forEach(function(e){return N.info(" ".concat(e))}))}y(e8,"parseTextErrors");function e5(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?C.Error:C.Warning,file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&eZ(n)}catch(t){e8(e)}}y(e5,"parseCommandOutput");function e6(e){return e9.apply(this,arguments)}function e9(){e9=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]:e5;n=new AbortController;S.on("SIGINT",function(){N.warn("Process interrupted. Terminating..."),n.abort(),S.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,eQ(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)});return[3,4];case 3:o=d.sent();c=o.stdout,a=o.stderr,u=o.message;[c,a].forEach(function(e){return e&&t(e)}),!a&&!c&&N.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return e9.apply(this,arguments)}y(e6,"executeCommand");function e7(e){return{raw:!0,cmd:e}}y(e7,"rawCommand");function te(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(ew," ").concat(Y," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ew," ").concat(ex," ").concat(ec," ").concat(e):"".concat(ew," ").concat(eo," ").concat(e)}y(te,"formatCLI");function tt(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}y(tt,"formatCommand");function tn(e){return tr.apply(this,arguments)}function tr(){tr=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,eF(Y)];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,tt(r,i)]}))]}})});return tr.apply(this,arguments)}y(tn,"resolveCommands");function ts(e,t){return ti.apply(this,arguments)}function ti(){ti=s(function(e,t){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);N.start("".concat(e)),O&&N.info("→ ".concat(t));return[4,e6(t)];case 1:r.sent(),N.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw N.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return ti.apply(this,arguments)}y(ts,"runCommand");function to(){return tc.apply(this,arguments)}function tc(){tc=s(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!q(e_.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eP.typescriptCheck()];case 1:return[4,ts.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=N.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return tc.apply(this,arguments)}y(to,"checkTypescript");function ta(){return tu.apply(this,arguments)}function tu(){tu=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,eP.eslintFix()];case 1:return[4,ts.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eP.eslintCheck()];case 4:return[4,ts.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tu.apply(this,arguments)}y(ta,"checkEslint");function tl(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";N.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}y(tl,"printIssues");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:return[4,e1()];case 1:e=r.sent(),t=e.filter(function(e){return e.type===C.Error}),n=e.filter(function(e){return e.type===C.Warning});!t.length&&!n.length?N.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tl("Warnings",n),tl("Errors",t),(t.length>0||n.length>0)&&v.exit(1));return[2]}})});return tp.apply(this,arguments)}y(td,"showCheckResult");function tf(){return tg.apply(this,arguments)}function tg(){tg=s(function(){var e,t,n,r,s,i;return m(this,function(o){switch(o.label){case 0:return[4,e4()];case 1:o.sent();return[4,eF(Y)];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(Y)];return[4,eP.build()];case 4:return[4,ts.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eP.stageBuildDirectory()];case 6:return[4,ts.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:s=o.sent();throw N.error("Error building and staging ".concat(Y,": ").concat(s.message)),s;case 9:i=["Executing lint-staged"];return[4,eP.lintStaged()];case 10:return[4,ts.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),td();return[2]}})});return tg.apply(this,arguments)}y(tf,"lintStaged");function tm(){return th.apply(this,arguments)}function th(){th=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eP.eslintInspect()];case 1:return[4,ts.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return th.apply(this,arguments)}y(tm,"inspectLint");function ty(){return tv.apply(this,arguments)}function tv(){tv=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e4()];case 1:e.sent();return[4,Promise.all([to(),ta()])];case 2:e.sent(),td();return[2]}})});return tv.apply(this,arguments)}y(ty,"lintCheck");function tx(){return tj.apply(this,arguments)}function tj(){tj=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,e4()];case 1:e.sent();return[4,Promise.all([to(),ta(!0)])];case 2:e.sent(),td();return[2]}})});return tj.apply(this,arguments)}y(tx,"lintFix");function tb(){return tw.apply(this,arguments)}function tw(){tw=s(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,e4()];case 1:t.sent();e=["Validating commit message"];return[4,eP.commitLint()];case 2:return[4,ts.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),td();return[2]}})});return tw.apply(this,arguments)}y(tb,"commitLint");function tI(){return tS.apply(this,arguments)}function tS(){tS=s(function(){var e,t,n,r;return m(this,function(s){switch(s.label){case 0:e=["Configuring Git hooks"];return[4,eP.configureGitHook()];case 1:return[4,ts.apply(void 0,e.concat([s.sent()]))];case 2:s.sent(),W(e_.GIT_HOOK);return[4,tn(eT)];case 3:t=s.sent();D(e_.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});n="\n".concat(et,"\n");q(e_.GIT_IGNORE)?F(e_.GIT_IGNORE).split("\n").includes(et)||M(e_.GIT_IGNORE,n):D(e_.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eP.simpleGitHooks()];case 4:return[4,ts.apply(void 0,r.concat([s.sent()]))];case 5:s.sent();return[2]}})});return tS.apply(this,arguments)}y(tI,"setupGitHook");function tE(){return tk.apply(this,arguments)}function tk(){tk=s(function(){return m(this,function(e){switch(e.label){case 0:return[4,eU([Y],{update:!0,postInstallActions:[tI]})];case 1:e.sent();return[2]}})});return tk.apply(this,arguments)}y(tE,"setup");function tO(){return tC.apply(this,arguments)}function tC(){tC=s(function(){return m(this,function(e){switch(e.label){case 0:W(e_.NODE_MODULES,e_.PNPM_LOCK_YAML);return[4,eM()];case 1:e.sent();return[4,tI()];case 2:e.sent();return[2]}})});return tC.apply(this,arguments)}y(tO,"reset");function t_(){return tT.apply(this,arguments)}function tT(){tT=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eP.nodeModulesInspect()];case 1:return[4,ts.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tT.apply(this,arguments)}y(t_,"inspect");function tL(){return tG.apply(this,arguments)}function tG(){tG=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eP.testUnit()];case 1:return[4,ts.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tG.apply(this,arguments)}y(tL,"testUnit");function tN(){return tP.apply(this,arguments)}function tP(){tP=s(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eP.testE2e()];case 1:return[4,ts.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tP.apply(this,arguments)}y(tN,"testE2E");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(eo).usage("$0 <command> [options]").command("lint","Check code for linting issues",ty).command("lint:fix","Fix linting issues automatically",tx).command("lint:inspect","View active ESLint configuration",tm).command("lint-staged","Run lint checks on staged files",tf).command("commitlint","Validate commit message format",tb).command("setup","Initialize project setup and dependencies",tE).command("reset","Reset the project and reinstall dependencies",tO).command("inspect","Analyze installed project dependencies",t_).command("test:unit","Run unit test suite",tL).command("test:e2e","Run end-to-end test suite",tN).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();N.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,i,s,o){try{var c=e[s](o);var a=c.value}catch(e){n(e);return}if(c.done){t(a)}else{Promise.resolve(a).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 c(e){r(o,i,s,c,a,"next",e)}function a(e){r(o,i,s,c,a,"throw",e)}c(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 c(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,c;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;c=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(s)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){s(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,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=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]&&(s=0)),s)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:s.label++;return{value:c[1],done:false};case 5:s.label++;r=c[1];c=[0];continue;case 7:c=s.ops.pop();s.trys.pop();continue;default:if(!(i=s.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){s=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){s.label=c[1];break}if(c[0]===6&&s.label<i[1]){s.label=i[1];i=c;break}if(i&&s.label<i[2]){s.label=i[2];s.ops.push(c);break}if(i[2])s.ops.pop();s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e];r=0}finally{n=i=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.95.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.4","@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.1",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.19",express:"4.21.2","express-device":"0.4.2","express-session":"1.18.1",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"25.0.0",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3","modern-normalize":"3.0.1",mongodb:"6.15.0",mongoose:"8.13.2","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.0","next-intl":"4.0.2","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.4.1","react-icons":"5.5.0",sass:"1.86.3",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.1","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/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.0","lint-staged":"15.5.1","node-modules-inspector":"0.6.6","simple-git-hooks":"2.12.1"}};var w=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as I}from"node:child_process";import E from"node:process";import*as S from"node:util";var C=".cyberskill-storage";import _ from"dotenv";import{bool as O,cleanEnv as k,str as L}from"envalid";import T from"node:os";import R from"node:path";import G from"node:process";_.config();function D(){var e={DEBUG:G.env.DEBUG,CWD:G.env.CWD,CYBERSKILL_STORAGE_DIR:G.env.CYBERSKILL_STORAGE_DIR},t=k(e,{DEBUG:O({default:!1}),CWD:L({default:G.cwd()}),CYBERSKILL_STORAGE_DIR:L({default:R.join(T.homedir(),C)})});return{DEBUG:t.DEBUG,CWD:t.CWD,CYBERSKILL_STORAGE_DIR:t.CYBERSKILL_STORAGE_DIR}}y(D,"getEnv");var A=function(e){return e.Error="error",e.Warning="warning",e}({});import N from"chalk";import P from"consola";import{GraphQLError as M}from"graphql";var q=D();q.DEBUG||(P.level=4);function F(e){var t=N[e];return typeof t=="function"?t:N.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(N.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;P.log("".concat(N.gray("File:")," ").concat(N.blue("".concat(t).concat(r?":".concat(r):"")))),i&&P.log(" ".concat(F(n)("Rule:")," ").concat(i)),P.log(" ".concat(F(n)("Message:")," ").concat(s))}),P.box(F(n)("".concat(e," : ").concat(t.length))),P.log(N.gray("─".repeat(40)))}};var W={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import B from"node-fetch";import*as K from"node:fs";function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return K.existsSync(e)})}y(J,"existsSync");function Y(e,t){var n=K.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":f(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}y(Y,"readFileSync");function H(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,s=i&&(typeof t==="undefined"?"undefined":f(t))=="object"?JSON.stringify(t,null,4):String(t);K.writeFileSync(e,s,"utf-8")}y(H,"writeFileSync");function $(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,s=i&&(typeof t==="undefined"?"undefined":f(t))=="object"?JSON.stringify(t,null,4):String(t);K.appendFileSync(e,s,"utf-8")}y($,"appendFileSync");function V(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){J(e)&&K.rmSync(e,{recursive:!0,force:!0})})}y(V,"rmSync");import*as z from"node:path";function Q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;var i=D();return(r=z).resolve.apply(r,[i.CWD].concat(p(t)))}y(Q,"resolveWorkingPath");function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=z).join.apply(r,p(t))}y(X,"join");var Z=D(),ee=Z.CWD,et="@cyberskill/shared",en="node_modules",er="dist",ei="package.json",es="package-lock.json",eo="tsconfig.json",ec=".gitignore",ea=".simple-git-hooks.json",eu="pnpm-lock.yaml",el=".git/hooks/",ed=".git/COMMIT_EDITMSG",ep=X(ee,en,et,er),ef="cyberskill",eg="src/nodejs/cli/index.ts",em="eslint",eh="eslint",ey="vitest",ev="playwright",ex="vitest",ej="@commitlint/cli",eb="commitlint",ew="lint-staged",eI="lint-staged",eE="typescript",eS="tsc",eC="tsx",e_="git",eO="pnpm",ek="pnpm exec",eL="simple-git-hooks",eT="simple-git-hooks",eR="@eslint/config-inspector",eG="eslint-config-inspector",eD="node-modules-inspector",eA="node-modules-inspector",eN="migrate-mongo",eP="migrate-mongo",eM={CYBERSKILL_DIRECTORY:ep,WORKING_DIRECTORY:ee,TS_CONFIG:Q(eo),GIT_IGNORE:Q(ec),GIT_HOOK:Q(el),GIT_COMMIT_MSG:Q(ed),SIMPLE_GIT_HOOKS_JSON:Q(ea),PACKAGE_JSON:Q(ei),PACKAGE_LOCK_JSON:Q(es),PNPM_LOCK_YAML:Q(eu),NODE_MODULES:Q(en),LINT_STAGED_CONFIG:Q("".concat(ep,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:Q("".concat(ep,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:Q("".concat(ep,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:Q("".concat(ep,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:Q("".concat(ep,"/react/vitest/vitest.e2e.js"))};function eq(e){var t=e.isCurrentProject;return l({"pre-commit":eI,"commit-msg":eb},t&&{"pre-push":tc("".concat(e_," pull"))})}y(eq,"HOOK");function eF(e){return eU.apply(this,arguments)}function eU(){eU=i(function(e){var t,n,r,i,s,o;var c=arguments;return m(this,function(a){switch(a.label){case 0:for(t=c.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=c[r]}i=d(n,2),s=i[0],o=i[1];if(!s)throw new Error("'first' argument is undefined");switch(e){case w.CLI:return[3,1];case w.RAW:return[3,3]}return[3,4];case 1:return[4,eQ(s.split(" "),{update:!0})];case 2:return[2,(a.sent(),tu(tc("".concat(ek," ").concat(o))))];case 3:return[2,tu(tc(s))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return eU.apply(this,arguments)}y(eF,"buildCommand");function eW(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return /*#__PURE__*/i(function(){return m(this,function(t){return[2,eF.apply(void 0,[e].concat(p(n)))]})})}y(eW,"commandFactory");var eB={simpleGitHooks:eW(w.CLI,eL,eT),eslintInspect:eW(w.CLI,eR,eG),nodeModulesInspect:eW(w.CLI,eD,eA),eslintCheck:eW(w.CLI,em,"".concat(eh," ").concat(eM.WORKING_DIRECTORY)),eslintFix:eW(w.CLI,em,"".concat(eh," ").concat(eM.WORKING_DIRECTORY," --fix")),typescriptCheck:eW(w.CLI,eE,"".concat(eS," -p ").concat(eM.TS_CONFIG," --noEmit")),configureGitHook:eW(w.RAW,"".concat(e_," config core.hooksPath ").concat(eM.GIT_HOOK)),testUnit:eW(w.CLI,ey,"".concat(ex," --config ").concat(eM.UNIT_TEST_CONFIG)),testE2e:eW(w.CLI,"".concat(ey," ").concat(ev),"".concat(ex," --config ").concat(eM.E2E_TEST_CONFIG)),mongoMigrateCreate:y(function(e){return eW(w.CLI,"".concat(eN),"".concat(eP," create ").concat(e))()},"mongoMigrateCreate"),mongoMigrateUp:eW(w.CLI,"".concat(eN),"".concat(eP," up")),mongoMigrateDown:eW(w.CLI,"".concat(eN),"".concat(eP," down")),commitLint:eW(w.CLI,ej,"".concat(eb," --edit ").concat(eM.GIT_COMMIT_MSG," --config ").concat(eM.COMMITLINT_CONFIG)),lintStaged:eW(w.CLI,ew,"".concat(eI," --config ").concat(eM.LINT_STAGED_CONFIG)),stageBuildDirectory:eW(w.RAW,"".concat(e_," add ").concat(er)),build:eW(w.RAW,"".concat(eO," run build")),pnpmInstallStandard:eW(w.RAW,"".concat(eO," install")),pnpmInstallLegacy:eW(w.RAW,"".concat(eO," install --legacy-peer-deps")),pnpmInstallForce:eW(w.RAW,"".concat(eO," install --force"))};function eK(e){var t=D(),n=X(t.CWD,ei);if(!J(n))return!1;try{var r=Y(n,{asJson:!0}),i=r.name,s=r.dependencies,o=s===void 0?{}:s,c=r.devDependencies,a=c===void 0?{}:c,u=i===e,l=e in o,d=e in a;return u||l||d?{path:n,file:r,isCurrentProject:u,isDepend:l,isDevDepend:d}:!1}catch(e){return U.warn("Failed to read package.json: ".concat(e.message)),!1}}y(eK,"getPackage");function eJ(e){return eY.apply(this,arguments)}function eY(){eY=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,B("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 U.error('Failed to fetch version for "'.concat(e,'": ').concat(i.message)),i;case 4:return[2]}})});return eY.apply(this,arguments)}y(eJ,"getLatestPackageVersion");function eH(e,t){return e$.apply(this,arguments)}function e$(){e$=i(function(e,t){var n,r,i,s,o,c,a,u,d,p,f,g,h,y,v,x,j,b,w,I,E;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);n=eK(e);if(!n)return[2,l({},W)];a=n.path,u=n.file,d=n.isCurrentProject,p=n.isDepend,f=n.isDevDepend,g=(r=u.dependencies)!==null&&r!==void 0?r:{},h=(i=u.devDependencies)!==null&&i!==void 0?i:{},y=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?(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,eJ(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)){;w=p?"dependencies":f?"devDependencies":null;w&&((b=u[w])===null||b===void 0?void 0:b[e])!==v&&(u[w]=(I=u[w])!==null&&I!==void 0?I:{},u[w][e]=v,H(a,u,{isJson:!0}),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({},W))];case 5:return[2]}})});return e$.apply(this,arguments)}y(eH,"checkPackage");function eV(){return ez.apply(this,arguments)}function ez(){ez=i(function(){var e,t,n,r,i,s,o,c,a,u,l,d;return m(this,function(p){switch(p.label){case 0:e=[{command:y(function(){return eB.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:y(function(){return eB.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:y(function(){return eB.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);i=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,8];o=s.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,tp("".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&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return ez.apply(this,arguments)}y(eV,"installDependencies");function eQ(e,t){return eX.apply(this,arguments)}function eX(){eX=i(function(e,t){var n,r,i,s,o,c,a,u,d,f,g;return m(this,function(m){switch(m.label){case 0:if(!J(eM.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 eH(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,eV()];case 3:r=m.sent();m.label=4;case 4:r;s=true,o=false,c=undefined;m.label=5;case 5:m.trys.push([5,10,11,12]);a=((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=a.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;c=f;return[3,12];case 11:try{if(!s&&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 eX.apply(this,arguments)}y(eQ,"setupPackages");import eZ from"node-persist";var e0=D();function e1(){return e2.apply(this,arguments)}function e2(){e2=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=eZ.defaultInstance;if(e)return[3,2];return[4,eZ.init({dir:e0.CYBERSKILL_STORAGE_DIR,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 e2.apply(this,arguments)}y(e1,"initNodePersist");var e4={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,e1()];case 1:r.sent();return[4,eZ.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 i(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1()];case 1:r.sent();return[4,eZ.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 i(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e1()];case 1:n.sent();return[4,eZ.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 i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e1()];case 1:n.sent();return[4,eZ.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 i(function(){return m(this,function(t){try{return[2,"".concat(e0.CYBERSKILL_STORAGE_DIR," (key: ").concat(e,")")]}catch(e){return[2,(U.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e3=D(),e8=S.promisify(I);function e5(e){return"error_list:".concat(e)}y(e5,"getErrorListKey");function e6(e){return e9.apply(this,arguments)}function e9(){e9=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=e5(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,e4.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,e4.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=s.sent();U.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return e9.apply(this,arguments)}y(e6,"saveErrorListToStorage");function e7(){return te.apply(this,arguments)}function te(){te=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e4.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,e4.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 te.apply(this,arguments)}y(e7,"getStoredErrorLists");function tt(){return tn.apply(this,arguments)}function tn(){tn=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e4.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 e4.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 tn.apply(this,arguments)}y(tt,"clearAllErrorLists");function tr(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 c,a,u,l,d;var p=i.exec(e)||[],f=s.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]===A.Error?A.Error:A.Warning,message:(m=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&m!==void 0?m:"",rule:(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]===A.Error?A.Error:A.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:A.Error,message:(x=g===null||g===void 0?void 0:(l=g[1])===null||l===void 0?void 0:l.trim())!==null&&x!==void 0?x:"",rule:(j=g===null||g===void 0?void 0:(d=g[2])===null||d===void 0?void 0:d.trim())!==null&&j!==void 0?j:""}):n.push(e.trim())}}),t.length&&e6(t),e3.DEBUG&&n.length&&(U.warn("Unmatched lines:"),n.forEach(function(e){return U.info(" ".concat(e))}))}y(tr,"parseTextErrors");function ti(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,c=e.message;n.push({type:r===2?A.Error:A.Warning,file:t,position:"".concat(i,":").concat(s),rule:o,message:c})})}),n.length&&e6(n)}catch(t){tr(e)}}y(ti,"parseCommandOutput");function ts(e){return to.apply(this,arguments)}function to(){to=i(function(e){var t,n,r,i,s,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]:ti;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,3,,4]);return[4,e8(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)});return[3,4];case 3: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,4];case 4:return[2]}})});return to.apply(this,arguments)}y(ts,"executeCommand");function tc(e){return{raw:!0,cmd:e}}y(tc,"rawCommand");function ta(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(ek," ").concat(et," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ek," ").concat(eC," ").concat(eg," ").concat(e):"".concat(ek," ").concat(ef," ").concat(e)}y(ta,"formatCLI");function tu(e,t){return typeof e=="function"?ta(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"?ta(e,t):e}y(tu,"formatCommand");function tl(e){return td.apply(this,arguments)}function td(){td=i(function(e){var t,n,r,i,s,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,eH(et)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:i=c,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,tu(r,s)]}))]}})});return td.apply(this,arguments)}y(tl,"resolveCommands");function tp(e,t){return tf.apply(this,arguments)}function tf(){tf=i(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)),e3.DEBUG&&U.info("→ ".concat(t));return[4,ts(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 tf.apply(this,arguments)}y(tp,"runCommand");function tg(){return tm.apply(this,arguments)}function tm(){tm=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:if(!J(eM.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eB.typescriptCheck()];case 1:return[4,tp.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 tm.apply(this,arguments)}y(tg,"checkTypescript");function th(){return ty.apply(this,arguments)}function ty(){ty=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,eB.eslintFix()];case 1:return[4,tp.apply(void 0,n.concat([s.sent()]))];case 2:t=s.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eB.eslintCheck()];case 4:return[4,tp.apply(void 0,r.concat([s.sent()]))];case 5:t=s.sent();s.label=6;case 6:t;return[2]}})});return ty.apply(this,arguments)}y(th,"checkEslint");function tv(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";U.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}y(tv,"printIssues");function tx(){return tj.apply(this,arguments)}function tj(){tj=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,e7()];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?U.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(tv("Warnings",n),tv("Errors",t),(t.length>0||n.length>0)&&v.exit(1));return[2]}})});return tj.apply(this,arguments)}y(tx,"showCheckResult");function tb(){return tw.apply(this,arguments)}function tw(){tw=i(function(){var e,t,n,r,i,s;return m(this,function(o){switch(o.label){case 0:return[4,tt()];case 1:o.sent();return[4,eH(et)];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(et)];return[4,eB.build()];case 4:return[4,tp.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eB.stageBuildDirectory()];case 6:return[4,tp.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:i=o.sent();throw U.error("Error building and staging ".concat(et,": ").concat(i.message)),i;case 9:s=["Executing lint-staged"];return[4,eB.lintStaged()];case 10:return[4,tp.apply(void 0,s.concat([o.sent()]))];case 11:o.sent(),tx();return[2]}})});return tw.apply(this,arguments)}y(tb,"lintStaged");function tI(){return tE.apply(this,arguments)}function tE(){tE=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eB.eslintInspect()];case 1:return[4,tp.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tE.apply(this,arguments)}y(tI,"inspectLint");function tS(){return tC.apply(this,arguments)}function tC(){tC=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tt()];case 1:e.sent();return[4,Promise.all([tg(),th()])];case 2:e.sent(),tx();return[2]}})});return tC.apply(this,arguments)}y(tS,"lintCheck");function t_(){return tO.apply(this,arguments)}function tO(){tO=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tt()];case 1:e.sent();return[4,Promise.all([tg(),th(!0)])];case 2:e.sent(),tx();return[2]}})});return tO.apply(this,arguments)}y(t_,"lintFix");function tk(){return tL.apply(this,arguments)}function tL(){tL=i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,tt()];case 1:t.sent();e=["Validating commit message"];return[4,eB.commitLint()];case 2:return[4,tp.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tx();return[2]}})});return tL.apply(this,arguments)}y(tk,"commitLint");function tT(){return tR.apply(this,arguments)}function tR(){tR=i(function(){var e,t,n,r;return m(this,function(i){switch(i.label){case 0:e=["Configuring Git hooks"];return[4,eB.configureGitHook()];case 1:return[4,tp.apply(void 0,e.concat([i.sent()]))];case 2:i.sent(),V(eM.GIT_HOOK);return[4,tl(eq)];case 3:t=i.sent();H(eM.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});n="\n".concat(ea,"\n");J(eM.GIT_IGNORE)?Y(eM.GIT_IGNORE).split("\n").includes(ea)||$(eM.GIT_IGNORE,n):H(eM.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eB.simpleGitHooks()];case 4:return[4,tp.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})});return tR.apply(this,arguments)}y(tT,"setupGitHook");function tG(){return tD.apply(this,arguments)}function tD(){tD=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,eQ([et],{update:!0,postInstallActions:[tT]})];case 1:e.sent();return[2]}})});return tD.apply(this,arguments)}y(tG,"setup");function tA(){return tN.apply(this,arguments)}function tN(){tN=i(function(){return m(this,function(e){switch(e.label){case 0:V(eM.NODE_MODULES,eM.PNPM_LOCK_YAML);return[4,eV()];case 1:e.sent();return[4,tT()];case 2:e.sent();return[2]}})});return tN.apply(this,arguments)}y(tA,"reset");function tP(){return tM.apply(this,arguments)}function tM(){tM=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eB.nodeModulesInspect()];case 1:return[4,tp.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tM.apply(this,arguments)}y(tP,"inspect");function tq(){return tF.apply(this,arguments)}function tF(){tF=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eB.testUnit()];case 1:return[4,tp.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tF.apply(this,arguments)}y(tq,"testUnit");function tU(){return tW.apply(this,arguments)}function tW(){tW=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eB.testE2e()];case 1:return[4,tp.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tW.apply(this,arguments)}y(tU,"testE2E");function tB(e){return tK.apply(this,arguments)}function tK(){tK=i(function(e){var t;return m(this,function(n){switch(n.label){case 0:t=["Creating MongoDB migration"];return[4,eB.mongoMigrateCreate(e)];case 1:return[4,tp.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return tK.apply(this,arguments)}y(tB,"mongoMigrateCreate");function tJ(){return tY.apply(this,arguments)}function tY(){tY=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Running MongoDB migrations"];return[4,eB.mongoMigrateUp()];case 1:return[4,tp.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tY.apply(this,arguments)}y(tJ,"mongoMigrateUp");function tH(){return t$.apply(this,arguments)}function t$(){t$=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=["Rolling back MongoDB migration"];return[4,eB.mongoMigrateDown()];case 1:return[4,tp.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return t$.apply(this,arguments)}y(tH,"mongoMigrateDown");i(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(ef).usage("$0 <command> [options]").command("lint","Check code for linting issues",tS).command("lint:fix","Fix linting issues automatically",t_).command("lint:inspect","View active ESLint configuration",tI).command("lint-staged","Run lint checks on staged files",tb).command("commitlint","Validate commit message format",tk).command("setup","Initialize project setup and dependencies",tG).command("reset","Reset the project and reinstall dependencies",tA).command("inspect","Analyze installed project dependencies",tP).command("test:unit","Run unit test suite",tq).command("test:e2e","Run end-to-end test suite",tU).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){U.error("Migration name is required.");return[2]}return[4,tB(e.name)];case 1:t.sent();return[2]}})});return function(t){return e.apply(this,arguments)}}()).command("mongo:migrate:up","Apply all MongoDB migrations",tJ).command("mongo:migrate:down","Rollback last MongoDB migration",tH).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]}})})();
|