@cyberskill/shared 1.67.0 → 1.69.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.
Files changed (38) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +12 -8
  2. package/dist/_tsup-dts-rollup.d.ts +12 -8
  3. package/dist/configs/config.util.cjs +1 -1
  4. package/dist/configs/config.util.js +1 -1
  5. package/dist/configs/eslint/index.cjs +1 -1
  6. package/dist/configs/eslint/index.js +1 -1
  7. package/dist/configs/index.cjs +1 -1
  8. package/dist/configs/index.js +1 -1
  9. package/dist/index.cjs +1 -1
  10. package/dist/index.d.cts +2 -1
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.js +1 -1
  13. package/dist/nodejs/cli/cli.util.cjs +1 -1
  14. package/dist/nodejs/cli/cli.util.js +1 -1
  15. package/dist/nodejs/cli/index.cjs +1 -1
  16. package/dist/nodejs/cli/index.js +1 -1
  17. package/dist/nodejs/index.cjs +1 -1
  18. package/dist/nodejs/index.js +1 -1
  19. package/dist/react/i18next/i18next.hook.cjs +1 -0
  20. package/dist/react/i18next/i18next.hook.d.cts +1 -0
  21. package/dist/react/i18next/i18next.hook.d.ts +1 -0
  22. package/dist/react/i18next/i18next.hook.js +1 -0
  23. package/dist/react/i18next/{i18next.cjs → i18next.util.cjs} +1 -1
  24. package/dist/react/i18next/i18next.util.d.cts +1 -0
  25. package/dist/react/i18next/i18next.util.d.ts +1 -0
  26. package/dist/react/i18next/i18next.util.js +1 -0
  27. package/dist/react/i18next/index.cjs +1 -1
  28. package/dist/react/i18next/index.d.cts +2 -1
  29. package/dist/react/i18next/index.d.ts +2 -1
  30. package/dist/react/i18next/index.js +1 -1
  31. package/dist/react/index.cjs +1 -1
  32. package/dist/react/index.d.cts +2 -1
  33. package/dist/react/index.d.ts +2 -1
  34. package/dist/react/index.js +1 -1
  35. package/package.json +1 -1
  36. package/dist/react/i18next/i18next.d.cts +0 -1
  37. package/dist/react/i18next/i18next.d.ts +0 -1
  38. package/dist/react/i18next/i18next.js +0 -1
@@ -1 +1 @@
1
- "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 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,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{d(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function f(e,n){return t(e)||c(e,n)||y(e,n)||a()}function g(e){return n(e)||o(e)||y(e)||u()}function h(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(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,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return s={next:c(0),"throw":c(1),"return":c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}}var v=Object.create;var j=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var S=function(e,t){for(var n in t)j(e,n,{get:t[n],enumerable:!0})},I=function(e,t,n,r){var i=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":h(t))=="object"||typeof t=="function")try{var c=function(){var i=u.value;!E.call(e,i)&&i!==n&&j(e,i,{get:function(){return t[i]},enumerable:!(r=b(t,i))||r.enumerable})};for(var a=_(t)[Symbol.iterator](),u;!(i=(u=a.next()).done);i=true)c()}catch(e){s=true;o=e}finally{try{if(!i&&a.return!=null){a.return()}}finally{if(s){throw o}}}return e};var O=function(e,t,n){return n=e!=null?v(x(e)):{},I(t||!e||!e.__esModule?j(n,"default",{value:e,enumerable:!0}):n,e)},w=function(e){return I(j({},"__esModule",{value:!0}),e)};var N={};S(N,{COMMAND_DESCRIPTIONS:function(){return T}});module.exports=w(N);var T={lint:"Check code for linting issues","lint:fix":"Fix linting issues automatically","lint:inspect":"View active ESLint configuration","lint-staged":"Run lint checks on staged files",commitlint:"Validate commit message format",setup:"Initialize project setup and dependencies",reset:"Reset the project and reinstall dependencies",inspect:"Analyze installed project dependencies","test:unit":"Run unit test suite","test:e2e":"Run end-to-end test suite"};var D=O(require("process"),1),P=require("yargs/helpers"),C=O(require("yargs/yargs"),1);var A=O(require("process"),1),L=A.default.env.DEBUG==="true";var R={name:"@cyberskill/shared",type:"module",version:"1.66.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":{types:"./dist/configs/graphql/index.d.ts",import:"./dist/configs/graphql/index.js",require:"./dist/configs/graphql/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"},"./configs/vitest/react/e2e":{types:"./dist/configs/vitest/react/e2e.d.ts",import:"./dist/configs/vitest/react/e2e.js",require:"./dist/configs/vitest/react/e2e.cjs"},"./configs/vitest/react/unit":{types:"./dist/configs/vitest/react/unit.d.ts",import:"./dist/configs/vitest/react/unit.js",require:"./dist/configs/vitest/react/unit.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/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/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"},"./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.11.0","@apollo/client":"3.13.6","@eslint-react/eslint-plugin":"1.41.0","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@graphql-codegen/typescript-react-apollo":"4.3.2","@microsoft/api-extractor":"7.52.3","@next/eslint-plugin-next":"15.2.4","@swc/core":"1.11.18","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.8.1","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",consola:"3.4.2","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.2.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"24.2.3",jsdom:"26.0.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.51.1","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.2.5",vitest:"3.1.1","vitest-browser-react":"0.1.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/crypto-js":"4.2.2","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.0","@types/react-dom":"19.1.1","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.0","node-modules-inspector":"0.6.3","simple-git-hooks":"2.12.1"}};var k=require("child_process"),q=O(require("process"),1),M=O(require("util"),1);var G=O(require("chalk"),1),K=O(require("consola"),1),F=require("graphql");L||(K.default.level=4);function U(e){var t=G.default[e];return typeof t=="function"?t:G.default.green}var Y={silent:K.default.silent,level:K.default.level,fatal:K.default.fatal,error:K.default.error,warn:K.default.warn,log:K.default.log,info:K.default.info,success:K.default.success,ready:K.default.ready,start:K.default.start,box:K.default.box,debug:K.default.debug,trace:K.default.trace,verbose:K.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)){K.default.box(G.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;K.default.log("".concat(G.default.gray("File:")," ").concat(G.default.blue("".concat(t).concat(r?":".concat(r):"")))),i&&K.default.log(" ".concat(U(n)("Rule:")," ").concat(i)),K.default.log(" ".concat(U(n)("Message:")," ").concat(s))}),K.default.box(U(n)("".concat(e," : ").concat(t.length))),K.default.log(G.default.gray("─".repeat(40)))}};var B={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var J=O(require("node-fetch"),1);var W=O(require("fs"),1);function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return W.existsSync(e)})}function H(e,t){var n=W.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":h(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}function V(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":h(t))=="object"?JSON.stringify(t,null,4):String(t);W.writeFileSync(e,s,"utf-8")}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":h(t))=="object"?JSON.stringify(t,null,4):String(t);W.appendFileSync(e,s,"utf-8")}function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){X(e)&&W.rmSync(e,{recursive:!0,force:!0})})}var Q=O(require("process"),1);var Z=O(require("path"),1);function ee(){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,[en].concat(g(t)))}function et(){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,g(t))}var en=Q.default.env.INIT_CWD||Q.default.cwd(),er="@cyberskill/shared",ei=".cyberskill-storage",es="node_modules",eo="dist",ec="package.json",ea="package-lock.json",eu="tsconfig.json",el=".gitignore",ed=".simple-git-hooks.json",ep="pnpm-lock.yaml",ef=".git/hooks/",eg=".git/COMMIT_EDITMSG",eh=et(en,es,er,eo),ey="cyberskill",em="src/nodejs/cli/index.ts",ev="eslint",ej="eslint",eb="vitest",e_="playwright",ex="vitest",eE="@commitlint/cli",eS="commitlint",eI="lint-staged",eO="lint-staged",ew="typescript",eN="tsc",eT="tsx",eD="git",eP="pnpm",eC="pnpm exec",eA="simple-git-hooks",eL="simple-git-hooks",eR="@eslint/config-inspector",ek="eslint-config-inspector",eq="node-modules-inspector",eM="node-modules-inspector",eG={CYBERSKILL_DIRECTORY:eh,WORKING_DIRECTORY:en,TS_CONFIG:ee(eu),GIT_IGNORE:ee(el),GIT_HOOK:ee(ef),GIT_COMMIT_MSG:ee(eg),SIMPLE_GIT_HOOKS_JSON:ee(ed),PACKAGE_JSON:ee(ec),PACKAGE_LOCK_JSON:ee(ea),PNPM_LOCK_YAML:ee(ep),NODE_MODULES:ee(es),CYBERSKILL:{LINT_STAGED_CONFIG:ee("".concat(eh,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ee("".concat(eh,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ee("".concat(eh,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ee("".concat(eh,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ee("".concat(eh,"/react/vitest/vitest.e2e.js"))}};function eK(e){var t=e.isCurrentProject;return l({"pre-commit":eO,"commit-msg":eS},t&&{"pre-push":ti("".concat(eD," pull"))})}function eF(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var i=f(n,2),s=i[0],o=i[1],c=e==="RAW"?!0:X.apply(void 0,g(s.split(" ").map(function(e){return et(eG.NODE_MODULES,e)})));switch(e){case"PNPM_ADD_AND_EXEC":return to(ti("".concat(c?"":"".concat(eP," add ").concat(s," && ")).concat(eC," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return to(ti("".concat(c?"":"".concat(eP," add -D ").concat(s," && ")).concat(eC," ").concat(o)));case"RAW":return to(ti(s))}}var eU={SIMPLE_GIT_HOOKS:eF("PNPM_ADD_DEV_AND_EXEC",eA,eL),ESLINT_INSPECT:eF("PNPM_ADD_DEV_AND_EXEC",eR,ek),NODE_MODULES_INSPECT:eF("PNPM_ADD_DEV_AND_EXEC",eq,eM),ESLINT_CHECK:eF("PNPM_ADD_DEV_AND_EXEC",ev,"".concat(ej," ").concat(eG.WORKING_DIRECTORY)),ESLINT_FIX:eF("PNPM_ADD_DEV_AND_EXEC",ev,"".concat(ej," ").concat(eG.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eF("PNPM_ADD_AND_EXEC",ew,"".concat(eN," -p ").concat(eG.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eF("RAW","".concat(eD," config core.hooksPath ").concat(eG.GIT_HOOK)),BUILD:eF("RAW","".concat(eP," run build")),STAGE_BUILD_DIRECTORY:eF("RAW","".concat(eD," add ").concat(eo)),PNPM_INSTALL_STANDARD:eF("RAW","".concat(eP," install")),PNPM_INSTALL_LEGACY:eF("RAW","".concat(eP," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eF("RAW","".concat(eP," install --force")),CYBERSKILL:{TEST_UNIT:eF("PNPM_ADD_AND_EXEC",eb,"".concat(ex," --config ").concat(eG.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eF("PNPM_ADD_AND_EXEC","".concat(eb," ").concat(e_),"".concat(ex," --config ").concat(eG.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eF("PNPM_ADD_DEV_AND_EXEC",eE,"".concat(eS," --edit ").concat(eG.GIT_COMMIT_MSG," --config ").concat(eG.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eF("PNPM_ADD_DEV_AND_EXEC",eI,"".concat(eO," --config ").concat(eG.CYBERSKILL.LINT_STAGED_CONFIG))}};var eY={};function eB(e){if(e in eY)return eY[e];var t=et(en,ec);if(!X(t))return eY[e]=!1;try{var n,r;var i=H(t,{asJson:!0}),s=i.name===e,o=!!((n=i.dependencies)===null||n===void 0?void 0:n[e]),c=!!((r=i.devDependencies)===null||r===void 0?void 0:r[e]);return s||o||c?eY[e]={path:t,file:i,isCurrentProject:s,isDepend:o,isDevDepend:c}:eY[e]=!1}catch(t){return Y.warn("Failed to read package.json: ".concat(t.message)),eY[e]=!1}}function eJ(e){return eW.apply(this,arguments)}function eW(){eW=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,J.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 eW.apply(this,arguments)}function eX(e,t){return eH.apply(this,arguments)}function eH(){eH=i(function(e,t){var n,r,i,o,c,a,u,d,f,g,h,y,v,j,b;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);c=eB(e);if(!c)return[2,l({},B)];a=c.path,u=c.file,d=c.isCurrentProject,f=c.isDepend,g=c.isDevDepend,h="0.0.0";d&&u.version?h=u.version:f&&((n=u.dependencies)===null||n===void 0?void 0:n[e])?h=(r=u.dependencies)===null||r===void 0?void 0:r[e]:g&&((i=u.devDependencies)===null||i===void 0?void 0:i[e])&&(h=(o=u.devDependencies)===null||o===void 0?void 0:o[e]);if(!d)return[3,1];j=h;return[3,3];case 1:return[4,eJ(e)];case 2:j=m.sent();m.label=3;case 3:y=j,v=d||h===y;return[2,(!v&&(t===null||t===void 0?void 0:t.update)&&(f?u.dependencies=p(l({},u.dependencies||{}),s({},e,y)):g&&(u.devDependencies=p(l({},u.devDependencies||{}),s({},e,y))),Y.info('Updating package "'.concat(e,'" to version ').concat(y)),V(a,u,{isJson:!0})),{isCurrentProject:d,installedPath:a,file:u,isUpToDate:v})];case 4:b=m.sent();return[2,(Y.error('Error checking package "'.concat(e,'": ').concat(b.message)),l({},B))];case 5:return[2]}})});return eH.apply(this,arguments)}var eV=O(require("node-persist"),1),e$=O(require("os"),1),ez=O(require("process"),1);function eQ(){return ez.default.env.CYBERSKILL_STORAGE_DIR||et(e$.default.homedir(),ei)}function eZ(){return e0.apply(this,arguments)}function e0(){e0=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=eV.default.defaultInstance;if(e)return[3,2];return[4,eV.default.init({dir:eQ(),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 e0.apply(this,arguments)}var e1={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,eZ()];case 1:r.sent();return[4,eV.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,eZ()];case 1:r.sent();return[4,eV.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,eZ()];case 1:n.sent();return[4,eV.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,eZ()];case 1:n.sent();return[4,eV.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(eQ()," (key: ").concat(e,")")]}catch(e){return[2,(Y.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e2=M.promisify(k.exec);function e4(e){return"error_list:".concat(e)}function e3(e){return e5.apply(this,arguments)}function e5(){e5=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=e4(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,e1.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,e1.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 e5.apply(this,arguments)}function e6(){return e8.apply(this,arguments)}function e8(){e8=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1.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,e1.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 e8.apply(this,arguments)}function e7(){return e9.apply(this,arguments)}function e9(){e9=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1.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 e1.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 e9.apply(this,arguments)}function te(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=i.exec(e)||[],a=s.exec(e)||[],u=o.exec(e)||[];c.length&&r?t.push({file:r,position:"".concat(c[1],":").concat(c[2]),type:c[3]==="error"?"error":"warning",message:c[4].trim(),rule:c[5].trim()}):a.length?t.push({file:a[1],position:"".concat(a[2],":").concat(a[3]),type:a[4]==="error"?"error":"warning",message:a[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&e3(t),L&&n.length&&(Y.warn("Unmatched lines:"),n.forEach(function(e){return Y.info(" ".concat(e))}))}function tt(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?"error":"warning",file:t,position:"".concat(i,":").concat(s),rule:o,message:c})})}),n.length&&e3(n)}catch(t){te(e)}}function tn(e){return tr.apply(this,arguments)}function tr(){tr=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]:tt;n=new AbortController;q.default.on("SIGINT",function(){Y.warn("Process interrupted. Terminating..."),n.abort(),q.default.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,e2(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&&Y.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return tr.apply(this,arguments)}function ti(e){return{raw:!0,cmd:e}}function ts(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eC," ").concat(er," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eC," ").concat(eT," ").concat(em," ").concat(e):"".concat(eC," ").concat(ey," ").concat(e)}function to(e,t){return typeof e=="function"?ts(e(t),t):(typeof e==="undefined"?"undefined":h(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ts(e,t):e}function tc(e){return ta.apply(this,arguments)}function ta(){ta=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,eX(er)];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=f(e,2),n=t[0],r=t[1];return[n,to(r,s)]}))]}})});return ta.apply(this,arguments)}function tu(e,t){return tl.apply(this,arguments)}function tl(){tl=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)),L&&Y.info("→ ".concat(t));return[4,tn(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 tl.apply(this,arguments)}function td(){return tp.apply(this,arguments)}function tp(){tp=i(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!X(eG.TS_CONFIG))return[3,2];return[4,tu("Performing TypeScript validation",eU.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=Y.warn("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tp.apply(this,arguments)}function tf(){return tg.apply(this,arguments)}function tg(){tg=i(function(){var e,t;var n=arguments;return m(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,tu("Running ESLint with auto-fix",eU.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,tu("Running ESLint check",eU.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tg.apply(this,arguments)}function th(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";Y.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}function ty(){return tm.apply(this,arguments)}function tm(){tm=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,e6()];case 1:e=r.sent(),t=e.filter(function(e){return e.type==="error"}),n=e.filter(function(e){return e.type==="warning"});!t.length&&!n.length?Y.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(th("Warnings",n),th("Errors",t));return[2]}})});return tm.apply(this,arguments)}function tv(){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:r.sent();return[4,eX(er)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,tu("Building package: ".concat(er),eU.BUILD)];case 4:r.sent();return[4,tu("Staging build artifacts",eU.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw Y.error("Error building and staging ".concat(er,": ").concat(n.message)),n;case 7:return[4,tu("Executing lint-staged",eU.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),ty();return[2]}})});return tj.apply(this,arguments)}function tb(){return t_.apply(this,arguments)}function t_(){t_=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tu("Inspecting ESLint configuration",eU.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return t_.apply(this,arguments)}function tx(){return tE.apply(this,arguments)}function tE(){tE=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e7()];case 1:e.sent();return[4,Promise.all([td(),tf()])];case 2:e.sent(),ty();return[2]}})});return tE.apply(this,arguments)}function tS(){return tI.apply(this,arguments)}function tI(){tI=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e7()];case 1:e.sent();return[4,Promise.all([td(),tf(!0)])];case 2:e.sent(),ty();return[2]}})});return tI.apply(this,arguments)}function tO(){return tw.apply(this,arguments)}function tw(){tw=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e7()];case 1:e.sent();return[4,tu("Validating commit message",eU.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),ty();return[2]}})});return tw.apply(this,arguments)}function tN(){return tT.apply(this,arguments)}function tT(){tT=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,tu("Configuring Git hooks",eU.CONFIGURE_GIT_HOOK)];case 1:n.sent(),z(eG.GIT_HOOK);return[4,tc(eK)];case 2:e=n.sent();V(eG.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(ed,"\n");X(eG.GIT_IGNORE)?H(eG.GIT_IGNORE).split("\n").includes(ed)||$(eG.GIT_IGNORE,t):V(eG.GIT_IGNORE,t);return[4,tu("Setting up simple-git-hooks",eU.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tT.apply(this,arguments)}function tD(){return tP.apply(this,arguments)}function tP(){tP=i(function(){var e,t,n,r,i,s,o,c,a,u,l;return m(this,function(d){switch(d.label){case 0:e=[{command:eU.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:eU.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:eU.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;d.label=1;case 1:d.trys.push([1,8,9,10]);i=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,7];o=s.value,c=o.command,a=o.message;d.label=3;case 3:d.trys.push([3,5,,6]);return[4,tu("".concat(a," using: ").concat(c),c)];case 4:d.sent();return[2];case 5:u=d.sent();Y.warn("Installation attempt failed: ".concat(c)),Y.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=d.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return tP.apply(this,arguments)}function tC(e,t){return tA.apply(this,arguments)}function tA(){tA=i(function(e,t){var n,r,i,s,o,c,a,u,l,d,p,f;return m(this,function(g){switch(g.label){case 0:if(!X(eG.PACKAGE_JSON)){Y.error("package.json not found. Aborting setup.");return[2]}g.label=1;case 1:g.trys.push([1,14,,15]);return[4,eX(e,{update:t===null||t===void 0?void 0:t.update})];case 2:n=g.sent(),r=n.isUpToDate;i=r;if(i)return[3,5];return[4,tD()];case 3:g.sent();return[4,tS()];case 4:i=g.sent();g.label=5;case 5:i;o=true,c=false,a=undefined;g.label=6;case 6:g.trys.push([6,11,12,13]);u=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();g.label=7;case 7:if(!!(o=(l=u.next()).done))return[3,10];d=l.value;return[4,d()];case 8:g.sent();g.label=9;case 9:o=true;return[3,7];case 10:return[3,13];case 11:p=g.sent();c=true;a=p;return[3,13];case 12:try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}return[7];case 13:Y.success('"'.concat(e,'" setup completed.'));return[3,15];case 14:f=g.sent();throw Y.error('Failed to setup "'.concat(e,'": ').concat(f.message)),f;case 15:return[2]}})});return tA.apply(this,arguments)}function tL(){return tR.apply(this,arguments)}function tR(){tR=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tC(er,{update:!0,postInstallActions:[tN]})];case 1:e.sent();return[2]}})});return tR.apply(this,arguments)}function tk(){return tq.apply(this,arguments)}function tq(){tq=i(function(){return m(this,function(e){switch(e.label){case 0:z(eG.NODE_MODULES,eG.PNPM_LOCK_YAML);return[4,tD()];case 1:e.sent();return[4,tN()];case 2:e.sent();return[2]}})});return tq.apply(this,arguments)}function tM(){return tG.apply(this,arguments)}function tG(){tG=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tu("Inspecting project dependencies",eU.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tG.apply(this,arguments)}function tK(){return tF.apply(this,arguments)}function tF(){tF=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tu("Running unit tests",eU.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tF.apply(this,arguments)}function tU(){return tY.apply(this,arguments)}function tY(){tY=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tu("Running end-to-end tests",eU.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tY.apply(this,arguments)}i(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,C.default)((0,P.hideBin)(D.default.argv)).scriptName(ey).usage("$0 <command> [options]").command("lint",T.lint,tx).command("lint:fix",T["lint:fix"],tS).command("lint:inspect",T["lint:inspect"],tb).command("lint-staged",T["lint-staged"],tv).command("commitlint",T.commitlint,tO).command("setup",T.setup,tL).command("reset",T.reset,tk).command("inspect",T.inspect,tM).command("test:unit",T["test:unit"],tK).command("test:e2e",T["test:e2e"],tU).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(R.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();Y.error("Fatal: ".concat(e.message)),D.default.exit(1);return[3,3];case 3:return[2]}})})();0&&(module.exports={COMMAND_DESCRIPTIONS:COMMAND_DESCRIPTIONS});
1
+ "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 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,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{d(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function f(e,n){return t(e)||c(e,n)||y(e,n)||a()}function g(e){return n(e)||o(e)||y(e)||u()}function h(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(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,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return s={next:c(0),"throw":c(1),"return":c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(t){return a([e,t])}}function a(s){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(i=s[0]&2?r["return"]:s[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;if(r=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:o.label++;return{value:s[1],done:false};case 5:o.label++;r=s[1];s=[0];continue;case 7:s=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1];i=s;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(s);break}if(i[2])o.ops.pop();o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e];r=0}finally{n=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}}var v=Object.create;var j=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var x=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var S=function(e,t){for(var n in t)j(e,n,{get:t[n],enumerable:!0})},I=function(e,t,n,r){var i=true,s=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":h(t))=="object"||typeof t=="function")try{var c=function(){var i=u.value;!E.call(e,i)&&i!==n&&j(e,i,{get:function(){return t[i]},enumerable:!(r=b(t,i))||r.enumerable})};for(var a=_(t)[Symbol.iterator](),u;!(i=(u=a.next()).done);i=true)c()}catch(e){s=true;o=e}finally{try{if(!i&&a.return!=null){a.return()}}finally{if(s){throw o}}}return e};var O=function(e,t,n){return n=e!=null?v(x(e)):{},I(t||!e||!e.__esModule?j(n,"default",{value:e,enumerable:!0}):n,e)},w=function(e){return I(j({},"__esModule",{value:!0}),e)};var N={};S(N,{COMMAND_DESCRIPTIONS:function(){return T}});module.exports=w(N);var T={lint:"Check code for linting issues","lint:fix":"Fix linting issues automatically","lint:inspect":"View active ESLint configuration","lint-staged":"Run lint checks on staged files",commitlint:"Validate commit message format",setup:"Initialize project setup and dependencies",reset:"Reset the project and reinstall dependencies",inspect:"Analyze installed project dependencies","test:unit":"Run unit test suite","test:e2e":"Run end-to-end test suite"};var D=O(require("process"),1),P=require("yargs/helpers"),C=O(require("yargs/yargs"),1);var A=O(require("process"),1),L=A.default.env.DEBUG==="true";var R={name:"@cyberskill/shared",type:"module",version:"1.68.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":{types:"./dist/configs/graphql/index.d.ts",import:"./dist/configs/graphql/index.js",require:"./dist/configs/graphql/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"},"./configs/vitest/react/e2e":{types:"./dist/configs/vitest/react/e2e.d.ts",import:"./dist/configs/vitest/react/e2e.js",require:"./dist/configs/vitest/react/e2e.cjs"},"./configs/vitest/react/unit":{types:"./dist/configs/vitest/react/unit.d.ts",import:"./dist/configs/vitest/react/unit.js",require:"./dist/configs/vitest/react/unit.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/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/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"},"./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.11.0","@apollo/client":"3.13.6","@eslint-react/eslint-plugin":"1.41.0","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@graphql-codegen/typescript-react-apollo":"4.3.2","@microsoft/api-extractor":"7.52.3","@next/eslint-plugin-next":"15.2.4","@swc/core":"1.11.18","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.8.1","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",consola:"3.4.2","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.2.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"24.2.3",jsdom:"26.0.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.51.1","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.2.5",vitest:"3.1.1","vitest-browser-react":"0.1.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/crypto-js":"4.2.2","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.0","@types/react-dom":"19.1.1","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.0","node-modules-inspector":"0.6.3","simple-git-hooks":"2.12.1"}};var k=require("child_process"),q=O(require("process"),1),M=O(require("util"),1);var G=O(require("chalk"),1),K=O(require("consola"),1),F=require("graphql");L||(K.default.level=4);function U(e){var t=G.default[e];return typeof t=="function"?t:G.default.green}var Y={silent:K.default.silent,level:K.default.level,fatal:K.default.fatal,error:K.default.error,warn:K.default.warn,log:K.default.log,info:K.default.info,success:K.default.success,ready:K.default.ready,start:K.default.start,box:K.default.box,debug:K.default.debug,trace:K.default.trace,verbose:K.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)){K.default.box(G.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,i=e.rule,s=e.message;K.default.log("".concat(G.default.gray("File:")," ").concat(G.default.blue("".concat(t).concat(r?":".concat(r):"")))),i&&K.default.log(" ".concat(U(n)("Rule:")," ").concat(i)),K.default.log(" ".concat(U(n)("Message:")," ").concat(s))}),K.default.box(U(n)("".concat(e," : ").concat(t.length))),K.default.log(G.default.gray("─".repeat(40)))}};var B={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var J=O(require("node-fetch"),1);var W=O(require("fs"),1);function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return W.existsSync(e)})}function H(e,t){var n=W.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":h(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}function V(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":h(t))=="object"?JSON.stringify(t,null,4):String(t);W.writeFileSync(e,s,"utf-8")}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":h(t))=="object"?JSON.stringify(t,null,4):String(t);W.appendFileSync(e,s,"utf-8")}function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){X(e)&&W.rmSync(e,{recursive:!0,force:!0})})}var Q=O(require("process"),1);var Z=O(require("path"),1);function ee(){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,[en].concat(g(t)))}function et(){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,g(t))}var en=Q.default.env.INIT_CWD||Q.default.cwd(),er="@cyberskill/shared",ei=".cyberskill-storage",es="node_modules",eo="dist",ec="package.json",ea="package-lock.json",eu="tsconfig.json",el=".gitignore",ed=".simple-git-hooks.json",ep="pnpm-lock.yaml",ef=".git/hooks/",eg=".git/COMMIT_EDITMSG",eh=et(en,es,er,eo),ey="cyberskill",em="src/nodejs/cli/index.ts",ev="eslint",ej="eslint",eb="vitest",e_="playwright",ex="vitest",eE="@commitlint/cli",eS="commitlint",eI="lint-staged",eO="lint-staged",ew="typescript",eN="tsc",eT="tsx",eD="git",eP="pnpm",eC="pnpm exec",eA="simple-git-hooks",eL="simple-git-hooks",eR="@eslint/config-inspector",ek="eslint-config-inspector",eq="node-modules-inspector",eM="node-modules-inspector",eG={CYBERSKILL_DIRECTORY:eh,WORKING_DIRECTORY:en,TS_CONFIG:ee(eu),GIT_IGNORE:ee(el),GIT_HOOK:ee(ef),GIT_COMMIT_MSG:ee(eg),SIMPLE_GIT_HOOKS_JSON:ee(ed),PACKAGE_JSON:ee(ec),PACKAGE_LOCK_JSON:ee(ea),PNPM_LOCK_YAML:ee(ep),NODE_MODULES:ee(es),CYBERSKILL:{LINT_STAGED_CONFIG:ee("".concat(eh,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ee("".concat(eh,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ee("".concat(eh,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ee("".concat(eh,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ee("".concat(eh,"/react/vitest/vitest.e2e.js"))}};function eK(e){var t=e.isCurrentProject;return l({"pre-commit":eO,"commit-msg":eS},t&&{"pre-push":ti("".concat(eD," pull"))})}function eF(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var i=f(n,2),s=i[0],o=i[1],c=e==="RAW"?!0:X.apply(void 0,g(s.split(" ").map(function(e){return et(eG.NODE_MODULES,e)})));switch(e){case"PNPM_ADD_AND_EXEC":return to(ti("".concat(c?"":"".concat(eP," add ").concat(s," && ")).concat(eC," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return to(ti("".concat(c?"":"".concat(eP," add -D ").concat(s," && ")).concat(eC," ").concat(o)));case"RAW":return to(ti(s))}}var eU={SIMPLE_GIT_HOOKS:eF("PNPM_ADD_DEV_AND_EXEC",eA,eL),ESLINT_INSPECT:eF("PNPM_ADD_DEV_AND_EXEC",eR,ek),NODE_MODULES_INSPECT:eF("PNPM_ADD_DEV_AND_EXEC",eq,eM),ESLINT_CHECK:eF("PNPM_ADD_DEV_AND_EXEC",ev,"".concat(ej," ").concat(eG.WORKING_DIRECTORY)),ESLINT_FIX:eF("PNPM_ADD_DEV_AND_EXEC",ev,"".concat(ej," ").concat(eG.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eF("PNPM_ADD_AND_EXEC",ew,"".concat(eN," -p ").concat(eG.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eF("RAW","".concat(eD," config core.hooksPath ").concat(eG.GIT_HOOK)),BUILD:eF("RAW","".concat(eP," run build")),STAGE_BUILD_DIRECTORY:eF("RAW","".concat(eD," add ").concat(eo)),PNPM_INSTALL_STANDARD:eF("RAW","".concat(eP," install")),PNPM_INSTALL_LEGACY:eF("RAW","".concat(eP," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eF("RAW","".concat(eP," install --force")),CYBERSKILL:{TEST_UNIT:eF("PNPM_ADD_AND_EXEC",eb,"".concat(ex," --config ").concat(eG.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eF("PNPM_ADD_AND_EXEC","".concat(eb," ").concat(e_),"".concat(ex," --config ").concat(eG.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eF("PNPM_ADD_DEV_AND_EXEC",eE,"".concat(eS," --edit ").concat(eG.GIT_COMMIT_MSG," --config ").concat(eG.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eF("PNPM_ADD_DEV_AND_EXEC",eI,"".concat(eO," --config ").concat(eG.CYBERSKILL.LINT_STAGED_CONFIG))}};var eY={};function eB(e){if(e in eY)return eY[e];var t=et(en,ec);if(!X(t))return eY[e]=!1;try{var n,r;var i=H(t,{asJson:!0}),s=i.name===e,o=!!((n=i.dependencies)===null||n===void 0?void 0:n[e]),c=!!((r=i.devDependencies)===null||r===void 0?void 0:r[e]);return s||o||c?eY[e]={path:t,file:i,isCurrentProject:s,isDepend:o,isDevDepend:c}:eY[e]=!1}catch(t){return Y.warn("Failed to read package.json: ".concat(t.message)),eY[e]=!1}}function eJ(e){return eW.apply(this,arguments)}function eW(){eW=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,J.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 eW.apply(this,arguments)}function eX(e,t){return eH.apply(this,arguments)}function eH(){eH=i(function(e,t){var n,r,i,o,c,a,u,d,f,g,h,y,v,j,b;return m(this,function(m){switch(m.label){case 0:m.trys.push([0,4,,5]);c=eB(e);if(!c)return[2,l({},B)];a=c.path,u=c.file,d=c.isCurrentProject,f=c.isDepend,g=c.isDevDepend,h="0.0.0";d&&u.version?h=u.version:f&&((n=u.dependencies)===null||n===void 0?void 0:n[e])?h=(r=u.dependencies)===null||r===void 0?void 0:r[e]:g&&((i=u.devDependencies)===null||i===void 0?void 0:i[e])&&(h=(o=u.devDependencies)===null||o===void 0?void 0:o[e]);if(!d)return[3,1];j=h;return[3,3];case 1:return[4,eJ(e)];case 2:j=m.sent();m.label=3;case 3:y=j,v=d||h===y;return[2,(!v&&(t===null||t===void 0?void 0:t.update)&&(f?u.dependencies=p(l({},u.dependencies||{}),s({},e,y)):g&&(u.devDependencies=p(l({},u.devDependencies||{}),s({},e,y))),Y.info('Updating package "'.concat(e,'" to version ').concat(y)),V(a,u,{isJson:!0})),{isCurrentProject:d,installedPath:a,file:u,isUpToDate:v})];case 4:b=m.sent();return[2,(Y.error('Error checking package "'.concat(e,'": ').concat(b.message)),l({},B))];case 5:return[2]}})});return eH.apply(this,arguments)}var eV=O(require("node-persist"),1),e$=O(require("os"),1),ez=O(require("process"),1);function eQ(){return ez.default.env.CYBERSKILL_STORAGE_DIR||et(e$.default.homedir(),ei)}function eZ(){return e0.apply(this,arguments)}function e0(){e0=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=eV.default.defaultInstance;if(e)return[3,2];return[4,eV.default.init({dir:eQ(),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 e0.apply(this,arguments)}var e1={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,eZ()];case 1:r.sent();return[4,eV.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,eZ()];case 1:r.sent();return[4,eV.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,eZ()];case 1:n.sent();return[4,eV.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,eZ()];case 1:n.sent();return[4,eV.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(eQ()," (key: ").concat(e,")")]}catch(e){return[2,(Y.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e2=M.promisify(k.exec);function e4(e){return"error_list:".concat(e)}function e3(e){return e5.apply(this,arguments)}function e5(){e5=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=e4(t);s.label=1;case 1:s.trys.push([1,3,,4]);return[4,e1.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,e1.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 e5.apply(this,arguments)}function e6(){return e8.apply(this,arguments)}function e8(){e8=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1.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,e1.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 e8.apply(this,arguments)}function e7(){return e9.apply(this,arguments)}function e9(){e9=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e1.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 e1.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 e9.apply(this,arguments)}function te(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=i.exec(e)||[],a=s.exec(e)||[],u=o.exec(e)||[];c.length&&r?t.push({file:r,position:"".concat(c[1],":").concat(c[2]),type:c[3]==="error"?"error":"warning",message:c[4].trim(),rule:c[5].trim()}):a.length?t.push({file:a[1],position:"".concat(a[2],":").concat(a[3]),type:a[4]==="error"?"error":"warning",message:a[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&e3(t),L&&n.length&&(Y.warn("Unmatched lines:"),n.forEach(function(e){return Y.info(" ".concat(e))}))}function tt(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?"error":"warning",file:t,position:"".concat(i,":").concat(s),rule:o,message:c})})}),n.length&&e3(n)}catch(t){te(e)}}function tn(e){return tr.apply(this,arguments)}function tr(){tr=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]:tt;n=new AbortController;q.default.on("SIGINT",function(){Y.warn("Process interrupted. Terminating..."),n.abort(),q.default.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,e2(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&&Y.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return tr.apply(this,arguments)}function ti(e){return{raw:!0,cmd:e}}function ts(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eC," ").concat(er," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eC," ").concat(eT," ").concat(em," ").concat(e):"".concat(eC," ").concat(ey," ").concat(e)}function to(e,t){return typeof e=="function"?ts(e(t),t):(typeof e==="undefined"?"undefined":h(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ts(e,t):e}function tc(e){return ta.apply(this,arguments)}function ta(){ta=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,eX(er)];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=f(e,2),n=t[0],r=t[1];return[n,to(r,s)]}))]}})});return ta.apply(this,arguments)}function tu(e,t){return tl.apply(this,arguments)}function tl(){tl=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)),L&&Y.info("→ ".concat(t));return[4,tn(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 tl.apply(this,arguments)}function td(){return tp.apply(this,arguments)}function tp(){tp=i(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!X(eG.TS_CONFIG))return[3,2];return[4,tu("Performing TypeScript validation",eU.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=Y.warn("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tp.apply(this,arguments)}function tf(){return tg.apply(this,arguments)}function tg(){tg=i(function(){var e,t;var n=arguments;return m(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,tu("Running ESLint with auto-fix",eU.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,tu("Running ESLint check",eU.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tg.apply(this,arguments)}function th(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";Y.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}function ty(){return tm.apply(this,arguments)}function tm(){tm=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,e6()];case 1:e=r.sent(),t=e.filter(function(e){return e.type==="error"}),n=e.filter(function(e){return e.type==="warning"});!t.length&&!n.length?Y.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(th("Warnings",n),th("Errors",t));return[2]}})});return tm.apply(this,arguments)}function tv(){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:r.sent();return[4,eX(er)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,tu("Building package: ".concat(er),eU.BUILD)];case 4:r.sent();return[4,tu("Staging build artifacts",eU.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw Y.error("Error building and staging ".concat(er,": ").concat(n.message)),n;case 7:return[4,tu("Executing lint-staged",eU.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),ty();return[2]}})});return tj.apply(this,arguments)}function tb(){return t_.apply(this,arguments)}function t_(){t_=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tu("Inspecting ESLint configuration",eU.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return t_.apply(this,arguments)}function tx(){return tE.apply(this,arguments)}function tE(){tE=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e7()];case 1:e.sent();return[4,Promise.all([td(),tf()])];case 2:e.sent(),ty();return[2]}})});return tE.apply(this,arguments)}function tS(){return tI.apply(this,arguments)}function tI(){tI=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e7()];case 1:e.sent();return[4,Promise.all([td(),tf(!0)])];case 2:e.sent(),ty();return[2]}})});return tI.apply(this,arguments)}function tO(){return tw.apply(this,arguments)}function tw(){tw=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e7()];case 1:e.sent();return[4,tu("Validating commit message",eU.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),ty();return[2]}})});return tw.apply(this,arguments)}function tN(){return tT.apply(this,arguments)}function tT(){tT=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,tu("Configuring Git hooks",eU.CONFIGURE_GIT_HOOK)];case 1:n.sent(),z(eG.GIT_HOOK);return[4,tc(eK)];case 2:e=n.sent();V(eG.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(ed,"\n");X(eG.GIT_IGNORE)?H(eG.GIT_IGNORE).split("\n").includes(ed)||$(eG.GIT_IGNORE,t):V(eG.GIT_IGNORE,t);return[4,tu("Setting up simple-git-hooks",eU.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tT.apply(this,arguments)}function tD(){return tP.apply(this,arguments)}function tP(){tP=i(function(){var e,t,n,r,i,s,o,c,a,u,l;return m(this,function(d){switch(d.label){case 0:e=[{command:eU.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:eU.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:eU.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;d.label=1;case 1:d.trys.push([1,8,9,10]);i=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(s=i.next()).done))return[3,7];o=s.value,c=o.command,a=o.message;d.label=3;case 3:d.trys.push([3,5,,6]);return[4,tu("".concat(a," using: ").concat(c),c)];case 4:d.sent();return[2];case 5:u=d.sent();Y.warn("Installation attempt failed: ".concat(c)),Y.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=d.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return tP.apply(this,arguments)}function tC(e,t){return tA.apply(this,arguments)}function tA(){tA=i(function(e,t){var n,r,i,s,o,c,a,u,l,d,p,f;return m(this,function(g){switch(g.label){case 0:if(!X(eG.PACKAGE_JSON)){Y.error("package.json not found. Aborting setup.");return[2]}g.label=1;case 1:g.trys.push([1,14,,15]);return[4,eX(e,{update:t===null||t===void 0?void 0:t.update})];case 2:n=g.sent(),r=n.isUpToDate;i=r;if(i)return[3,5];return[4,tD()];case 3:g.sent();return[4,tS()];case 4:i=g.sent();g.label=5;case 5:i;o=true,c=false,a=undefined;g.label=6;case 6:g.trys.push([6,11,12,13]);u=((s=t===null||t===void 0?void 0:t.postInstallActions)!==null&&s!==void 0?s:[])[Symbol.iterator]();g.label=7;case 7:if(!!(o=(l=u.next()).done))return[3,10];d=l.value;return[4,d()];case 8:g.sent();g.label=9;case 9:o=true;return[3,7];case 10:return[3,13];case 11:p=g.sent();c=true;a=p;return[3,13];case 12:try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}return[7];case 13:Y.success('"'.concat(e,'" setup completed.'));return[3,15];case 14:f=g.sent();throw Y.error('Failed to setup "'.concat(e,'": ').concat(f.message)),f;case 15:return[2]}})});return tA.apply(this,arguments)}function tL(){return tR.apply(this,arguments)}function tR(){tR=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tC(er,{update:!0,postInstallActions:[tN]})];case 1:e.sent();return[2]}})});return tR.apply(this,arguments)}function tk(){return tq.apply(this,arguments)}function tq(){tq=i(function(){return m(this,function(e){switch(e.label){case 0:z(eG.NODE_MODULES,eG.PNPM_LOCK_YAML);return[4,tD()];case 1:e.sent();return[4,tN()];case 2:e.sent();return[2]}})});return tq.apply(this,arguments)}function tM(){return tG.apply(this,arguments)}function tG(){tG=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tu("Inspecting project dependencies",eU.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tG.apply(this,arguments)}function tK(){return tF.apply(this,arguments)}function tF(){tF=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tu("Running unit tests",eU.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tF.apply(this,arguments)}function tU(){return tY.apply(this,arguments)}function tY(){tY=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tu("Running end-to-end tests",eU.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tY.apply(this,arguments)}i(function(){var e;return m(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,C.default)((0,P.hideBin)(D.default.argv)).scriptName(ey).usage("$0 <command> [options]").command("lint",T.lint,tx).command("lint:fix",T["lint:fix"],tS).command("lint:inspect",T["lint:inspect"],tb).command("lint-staged",T["lint-staged"],tv).command("commitlint",T.commitlint,tO).command("setup",T.setup,tL).command("reset",T.reset,tk).command("inspect",T.inspect,tM).command("test:unit",T["test:unit"],tK).command("test:e2e",T["test:e2e"],tU).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(R.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();Y.error("Fatal: ".concat(e.message)),D.default.exit(1);return[3,3];case 3:return[2]}})})();0&&(module.exports={COMMAND_DESCRIPTIONS:COMMAND_DESCRIPTIONS});
@@ -1 +1 @@
1
- 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,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{d(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function f(e,n){return t(e)||c(e,n)||m(e,n)||a()}function g(e){return n(e)||o(e)||m(e)||u()}function h(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(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,o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]};return i={next:c(0),"throw":c(1),"return":c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return a([e,t])}}function a(i){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(s=i[0]&2?r["return"]:i[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,i[1])).done)return s;if(r=0,s)i=[i[0]&2,s.value];switch(i[0]){case 0:case 1:s=i;break;case 4:o.label++;return{value:i[1],done:false};case 5:o.label++;r=i[1];i=[0];continue;case 7:i=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(i[0]===6||i[0]===2)){o=0;continue}if(i[0]===3&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(i[0]===6&&o.label<s[1]){o.label=s[1];s=i;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(i);break}if(s[2])o.ops.pop();o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e];r=0}finally{n=s=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var v={lint:"Check code for linting issues","lint:fix":"Fix linting issues automatically","lint:inspect":"View active ESLint configuration","lint-staged":"Run lint checks on staged files",commitlint:"Validate commit message format",setup:"Initialize project setup and dependencies",reset:"Reset the project and reinstall dependencies",inspect:"Analyze installed project dependencies","test:unit":"Run unit test suite","test:e2e":"Run end-to-end test suite"};import j from"node:process";import{hideBin as x}from"yargs/helpers";import E from"yargs/yargs";import _ from"node:process";var b=_.env.DEBUG==="true";var I={name:"@cyberskill/shared",type:"module",version:"1.66.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":{types:"./dist/configs/graphql/index.d.ts",import:"./dist/configs/graphql/index.js",require:"./dist/configs/graphql/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"},"./configs/vitest/react/e2e":{types:"./dist/configs/vitest/react/e2e.d.ts",import:"./dist/configs/vitest/react/e2e.js",require:"./dist/configs/vitest/react/e2e.cjs"},"./configs/vitest/react/unit":{types:"./dist/configs/vitest/react/unit.d.ts",import:"./dist/configs/vitest/react/unit.js",require:"./dist/configs/vitest/react/unit.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/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/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"},"./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.11.0","@apollo/client":"3.13.6","@eslint-react/eslint-plugin":"1.41.0","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@graphql-codegen/typescript-react-apollo":"4.3.2","@microsoft/api-extractor":"7.52.3","@next/eslint-plugin-next":"15.2.4","@swc/core":"1.11.18","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.8.1","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",consola:"3.4.2","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.2.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"24.2.3",jsdom:"26.0.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.51.1","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.2.5",vitest:"3.1.1","vitest-browser-react":"0.1.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/crypto-js":"4.2.2","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.0","@types/react-dom":"19.1.1","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.0","node-modules-inspector":"0.6.3","simple-git-hooks":"2.12.1"}};import{exec as S}from"node:child_process";import w from"node:process";import*as O from"node:util";import N from"chalk";import T from"consola";import{GraphQLError as D}from"graphql";b||(T.level=4);function C(e){var t=N[e];return typeof t=="function"?t:N.green}var P={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(N.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;T.log("".concat(N.gray("File:")," ").concat(N.blue("".concat(t).concat(r?":".concat(r):"")))),s&&T.log(" ".concat(C(n)("Rule:")," ").concat(s)),T.log(" ".concat(C(n)("Message:")," ").concat(i))}),T.box(C(n)("".concat(e," : ").concat(t.length))),T.log(N.gray("─".repeat(40)))}};var A={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import L from"node-fetch";import*as R from"node:fs";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 R.existsSync(e)})}function G(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":h(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}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":h(t))=="object"?JSON.stringify(t,null,4):String(t);R.writeFileSync(e,i,"utf-8")}function q(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":h(t))=="object"?JSON.stringify(t,null,4):String(t);R.appendFileSync(e,i,"utf-8")}function K(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){k(e)&&R.rmSync(e,{recursive:!0,force:!0})})}import F from"node:process";import*as U from"node:path";function Y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=U).resolve.apply(r,[J].concat(g(t)))}function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=U).join.apply(r,g(t))}var J=F.env.INIT_CWD||F.cwd(),W="@cyberskill/shared",X=".cyberskill-storage",H="node_modules",V="dist",$="package.json",z="package-lock.json",Q="tsconfig.json",Z=".gitignore",ee=".simple-git-hooks.json",et="pnpm-lock.yaml",en=".git/hooks/",er=".git/COMMIT_EDITMSG",es=B(J,H,W,V),ei="cyberskill",eo="src/nodejs/cli/index.ts",ec="eslint",ea="eslint",eu="vitest",el="playwright",ed="vitest",ep="@commitlint/cli",ef="commitlint",eg="lint-staged",eh="lint-staged",em="typescript",ey="tsc",ev="tsx",ej="git",ex="pnpm",eE="pnpm exec",e_="simple-git-hooks",eb="simple-git-hooks",eI="@eslint/config-inspector",eS="eslint-config-inspector",ew="node-modules-inspector",eO="node-modules-inspector",eN={CYBERSKILL_DIRECTORY:es,WORKING_DIRECTORY:J,TS_CONFIG:Y(Q),GIT_IGNORE:Y(Z),GIT_HOOK:Y(en),GIT_COMMIT_MSG:Y(er),SIMPLE_GIT_HOOKS_JSON:Y(ee),PACKAGE_JSON:Y($),PACKAGE_LOCK_JSON:Y(z),PNPM_LOCK_YAML:Y(et),NODE_MODULES:Y(H),CYBERSKILL:{LINT_STAGED_CONFIG:Y("".concat(es,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:Y("".concat(es,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:Y("".concat(es,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:Y("".concat(es,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:Y("".concat(es,"/react/vitest/vitest.e2e.js"))}};function eT(e){var t=e.isCurrentProject;return l({"pre-commit":eh,"commit-msg":ef},t&&{"pre-push":e4("".concat(ej," pull"))})}function eD(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var s=f(n,2),i=s[0],o=s[1],c=e==="RAW"?!0:k.apply(void 0,g(i.split(" ").map(function(e){return B(eN.NODE_MODULES,e)})));switch(e){case"PNPM_ADD_AND_EXEC":return e5(e4("".concat(c?"":"".concat(ex," add ").concat(i," && ")).concat(eE," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return e5(e4("".concat(c?"":"".concat(ex," add -D ").concat(i," && ")).concat(eE," ").concat(o)));case"RAW":return e5(e4(i))}}var eC={SIMPLE_GIT_HOOKS:eD("PNPM_ADD_DEV_AND_EXEC",e_,eb),ESLINT_INSPECT:eD("PNPM_ADD_DEV_AND_EXEC",eI,eS),NODE_MODULES_INSPECT:eD("PNPM_ADD_DEV_AND_EXEC",ew,eO),ESLINT_CHECK:eD("PNPM_ADD_DEV_AND_EXEC",ec,"".concat(ea," ").concat(eN.WORKING_DIRECTORY)),ESLINT_FIX:eD("PNPM_ADD_DEV_AND_EXEC",ec,"".concat(ea," ").concat(eN.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eD("PNPM_ADD_AND_EXEC",em,"".concat(ey," -p ").concat(eN.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eD("RAW","".concat(ej," config core.hooksPath ").concat(eN.GIT_HOOK)),BUILD:eD("RAW","".concat(ex," run build")),STAGE_BUILD_DIRECTORY:eD("RAW","".concat(ej," add ").concat(V)),PNPM_INSTALL_STANDARD:eD("RAW","".concat(ex," install")),PNPM_INSTALL_LEGACY:eD("RAW","".concat(ex," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eD("RAW","".concat(ex," install --force")),CYBERSKILL:{TEST_UNIT:eD("PNPM_ADD_AND_EXEC",eu,"".concat(ed," --config ").concat(eN.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eD("PNPM_ADD_AND_EXEC","".concat(eu," ").concat(el),"".concat(ed," --config ").concat(eN.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eD("PNPM_ADD_DEV_AND_EXEC",ep,"".concat(ef," --edit ").concat(eN.GIT_COMMIT_MSG," --config ").concat(eN.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eD("PNPM_ADD_DEV_AND_EXEC",eg,"".concat(eh," --config ").concat(eN.CYBERSKILL.LINT_STAGED_CONFIG))}};var eP={};function eA(e){if(e in eP)return eP[e];var t=B(J,$);if(!k(t))return eP[e]=!1;try{var n,r;var s=G(t,{asJson:!0}),i=s.name===e,o=!!((n=s.dependencies)===null||n===void 0?void 0:n[e]),c=!!((r=s.devDependencies)===null||r===void 0?void 0:r[e]);return i||o||c?eP[e]={path:t,file:s,isCurrentProject:i,isDepend:o,isDevDepend:c}:eP[e]=!1}catch(t){return P.warn("Failed to read package.json: ".concat(t.message)),eP[e]=!1}}function eL(e){return eR.apply(this,arguments)}function eR(){eR=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,L("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 P.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return eR.apply(this,arguments)}function ek(e,t){return eG.apply(this,arguments)}function eG(){eG=s(function(e,t){var n,r,s,o,c,a,u,d,f,g,h,m,v,j,x;return y(this,function(y){switch(y.label){case 0:y.trys.push([0,4,,5]);c=eA(e);if(!c)return[2,l({},A)];a=c.path,u=c.file,d=c.isCurrentProject,f=c.isDepend,g=c.isDevDepend,h="0.0.0";d&&u.version?h=u.version:f&&((n=u.dependencies)===null||n===void 0?void 0:n[e])?h=(r=u.dependencies)===null||r===void 0?void 0:r[e]:g&&((s=u.devDependencies)===null||s===void 0?void 0:s[e])&&(h=(o=u.devDependencies)===null||o===void 0?void 0:o[e]);if(!d)return[3,1];j=h;return[3,3];case 1:return[4,eL(e)];case 2:j=y.sent();y.label=3;case 3:m=j,v=d||h===m;return[2,(!v&&(t===null||t===void 0?void 0:t.update)&&(f?u.dependencies=p(l({},u.dependencies||{}),i({},e,m)):g&&(u.devDependencies=p(l({},u.devDependencies||{}),i({},e,m))),P.info('Updating package "'.concat(e,'" to version ').concat(m)),M(a,u,{isJson:!0})),{isCurrentProject:d,installedPath:a,file:u,isUpToDate:v})];case 4:x=y.sent();return[2,(P.error('Error checking package "'.concat(e,'": ').concat(x.message)),l({},A))];case 5:return[2]}})});return eG.apply(this,arguments)}import eM from"node-persist";import eq from"node:os";import eK from"node:process";function eF(){return eK.env.CYBERSKILL_STORAGE_DIR||B(eq.homedir(),X)}function eU(){return eY.apply(this,arguments)}function eY(){eY=s(function(){var e;return y(this,function(t){switch(t.label){case 0:e=eM.defaultInstance;if(e)return[3,2];return[4,eM.init({dir:eF(),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 eY.apply(this,arguments)}var eB={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,eU()];case 1:r.sent();return[4,eM.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(P.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,eU()];case 1:r.sent();return[4,eM.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();P.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,eU()];case 1:n.sent();return[4,eM.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();P.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,eU()];case 1:n.sent();return[4,eM.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(P.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(P.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(eF()," (key: ").concat(e,")")]}catch(e){return[2,(P.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eJ=O.promisify(S);function eW(e){return"error_list:".concat(e)}function eX(e){return eH.apply(this,arguments)}function eH(){eH=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=eW(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,eB.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,eB.getLogLink(n)];case 1:e=t.sent();e&&P.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();P.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return eH.apply(this,arguments)}function eV(){return e$.apply(this,arguments)}function e$(){e$=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eB.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,eB.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,(P.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return e$.apply(this,arguments)}function ez(){return eQ.apply(this,arguments)}function eQ(){eQ=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eB.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 eB.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();P.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return eQ.apply(this,arguments)}function eZ(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=s.exec(e)||[],a=i.exec(e)||[],u=o.exec(e)||[];c.length&&r?t.push({file:r,position:"".concat(c[1],":").concat(c[2]),type:c[3]==="error"?"error":"warning",message:c[4].trim(),rule:c[5].trim()}):a.length?t.push({file:a[1],position:"".concat(a[2],":").concat(a[3]),type:a[4]==="error"?"error":"warning",message:a[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&eX(t),b&&n.length&&(P.warn("Unmatched lines:"),n.forEach(function(e){return P.info(" ".concat(e))}))}function e0(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?"error":"warning",file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&eX(n)}catch(t){eZ(e)}}function e1(e){return e2.apply(this,arguments)}function e2(){e2=s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return y(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:e0;n=new AbortController;w.on("SIGINT",function(){P.warn("Process interrupted. Terminating..."),n.abort(),w.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,eJ(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&&P.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return e2.apply(this,arguments)}function e4(e){return{raw:!0,cmd:e}}function e3(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eE," ").concat(W," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eE," ").concat(ev," ").concat(eo," ").concat(e):"".concat(eE," ").concat(ei," ").concat(e)}function e5(e,t){return typeof e=="function"?e3(e(t),t):(typeof e==="undefined"?"undefined":h(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?e3(e,t):e}function e6(e){return e8.apply(this,arguments)}function e8(){e8=s(function(e){var t,n,r,s,i,o,c;var a=arguments;return y(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,ek(W)];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=f(e,2),n=t[0],r=t[1];return[n,e5(r,i)]}))]}})});return e8.apply(this,arguments)}function e7(e,t){return e9.apply(this,arguments)}function e9(){e9=s(function(e,t){var n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);P.start("".concat(e)),b&&P.info("→ ".concat(t));return[4,e1(t)];case 1:r.sent(),P.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw P.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return e9.apply(this,arguments)}function te(){return tt.apply(this,arguments)}function tt(){tt=s(function(){var e;return y(this,function(t){switch(t.label){case 0:if(!k(eN.TS_CONFIG))return[3,2];return[4,e7("Performing TypeScript validation",eC.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=P.warn("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tt.apply(this,arguments)}function tn(){return tr.apply(this,arguments)}function tr(){tr=s(function(){var e,t;var n=arguments;return y(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,e7("Running ESLint with auto-fix",eC.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,e7("Running ESLint check",eC.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tr.apply(this,arguments)}function ts(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";P.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}function ti(){return to.apply(this,arguments)}function to(){to=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:return[4,eV()];case 1:e=r.sent(),t=e.filter(function(e){return e.type==="error"}),n=e.filter(function(e){return e.type==="warning"});!t.length&&!n.length?P.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ts("Warnings",n),ts("Errors",t));return[2]}})});return to.apply(this,arguments)}function tc(){return ta.apply(this,arguments)}function ta(){ta=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:return[4,ez()];case 1:r.sent();return[4,ek(W)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,e7("Building package: ".concat(W),eC.BUILD)];case 4:r.sent();return[4,e7("Staging build artifacts",eC.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw P.error("Error building and staging ".concat(W,": ").concat(n.message)),n;case 7:return[4,e7("Executing lint-staged",eC.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),ti();return[2]}})});return ta.apply(this,arguments)}function tu(){return tl.apply(this,arguments)}function tl(){tl=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Inspecting ESLint configuration",eC.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tl.apply(this,arguments)}function td(){return tp.apply(this,arguments)}function tp(){tp=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,Promise.all([te(),tn()])];case 2:e.sent(),ti();return[2]}})});return tp.apply(this,arguments)}function tf(){return tg.apply(this,arguments)}function tg(){tg=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,Promise.all([te(),tn(!0)])];case 2:e.sent(),ti();return[2]}})});return tg.apply(this,arguments)}function th(){return tm.apply(this,arguments)}function tm(){tm=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,e7("Validating commit message",eC.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),ti();return[2]}})});return tm.apply(this,arguments)}function ty(){return tv.apply(this,arguments)}function tv(){tv=s(function(){var e,t;return y(this,function(n){switch(n.label){case 0:return[4,e7("Configuring Git hooks",eC.CONFIGURE_GIT_HOOK)];case 1:n.sent(),K(eN.GIT_HOOK);return[4,e6(eT)];case 2:e=n.sent();M(eN.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(ee,"\n");k(eN.GIT_IGNORE)?G(eN.GIT_IGNORE).split("\n").includes(ee)||q(eN.GIT_IGNORE,t):M(eN.GIT_IGNORE,t);return[4,e7("Setting up simple-git-hooks",eC.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tv.apply(this,arguments)}function tj(){return tx.apply(this,arguments)}function tx(){tx=s(function(){var e,t,n,r,s,i,o,c,a,u,l;return y(this,function(d){switch(d.label){case 0:e=[{command:eC.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:eC.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:eC.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;d.label=1;case 1:d.trys.push([1,8,9,10]);s=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,7];o=i.value,c=o.command,a=o.message;d.label=3;case 3:d.trys.push([3,5,,6]);return[4,e7("".concat(a," using: ").concat(c),c)];case 4:d.sent();return[2];case 5:u=d.sent();P.warn("Installation attempt failed: ".concat(c)),P.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=d.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return tx.apply(this,arguments)}function tE(e,t){return t_.apply(this,arguments)}function t_(){t_=s(function(e,t){var n,r,s,i,o,c,a,u,l,d,p,f;return y(this,function(g){switch(g.label){case 0:if(!k(eN.PACKAGE_JSON)){P.error("package.json not found. Aborting setup.");return[2]}g.label=1;case 1:g.trys.push([1,14,,15]);return[4,ek(e,{update:t===null||t===void 0?void 0:t.update})];case 2:n=g.sent(),r=n.isUpToDate;s=r;if(s)return[3,5];return[4,tj()];case 3:g.sent();return[4,tf()];case 4:s=g.sent();g.label=5;case 5:s;o=true,c=false,a=undefined;g.label=6;case 6:g.trys.push([6,11,12,13]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();g.label=7;case 7:if(!!(o=(l=u.next()).done))return[3,10];d=l.value;return[4,d()];case 8:g.sent();g.label=9;case 9:o=true;return[3,7];case 10:return[3,13];case 11:p=g.sent();c=true;a=p;return[3,13];case 12:try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}return[7];case 13:P.success('"'.concat(e,'" setup completed.'));return[3,15];case 14:f=g.sent();throw P.error('Failed to setup "'.concat(e,'": ').concat(f.message)),f;case 15:return[2]}})});return t_.apply(this,arguments)}function tb(){return tI.apply(this,arguments)}function tI(){tI=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,tE(W,{update:!0,postInstallActions:[ty]})];case 1:e.sent();return[2]}})});return tI.apply(this,arguments)}function tS(){return tw.apply(this,arguments)}function tw(){tw=s(function(){return y(this,function(e){switch(e.label){case 0:K(eN.NODE_MODULES,eN.PNPM_LOCK_YAML);return[4,tj()];case 1:e.sent();return[4,ty()];case 2:e.sent();return[2]}})});return tw.apply(this,arguments)}function tO(){return tN.apply(this,arguments)}function tN(){tN=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Inspecting project dependencies",eC.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tN.apply(this,arguments)}function tT(){return tD.apply(this,arguments)}function tD(){tD=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Running unit tests",eC.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tD.apply(this,arguments)}function tC(){return tP.apply(this,arguments)}function tP(){tP=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Running end-to-end tests",eC.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tP.apply(this,arguments)}s(function(){var e;return y(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,E(x(j.argv)).scriptName(ei).usage("$0 <command> [options]").command("lint",v.lint,td).command("lint:fix",v["lint:fix"],tf).command("lint:inspect",v["lint:inspect"],tu).command("lint-staged",v["lint-staged"],tc).command("commitlint",v.commitlint,th).command("setup",v.setup,tb).command("reset",v.reset,tS).command("inspect",v.inspect,tO).command("test:unit",v["test:unit"],tT).command("test:e2e",v["test:e2e"],tC).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(I.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();P.error("Fatal: ".concat(e.message)),j.exit(1);return[3,3];case 3:return[2]}})})();export{v as COMMAND_DESCRIPTIONS};
1
+ 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,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{d(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function f(e,n){return t(e)||c(e,n)||m(e,n)||a()}function g(e){return n(e)||o(e)||m(e)||u()}function h(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(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,o={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]};return i={next:c(0),"throw":c(1),"return":c(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function c(e){return function(t){return a([e,t])}}function a(i){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(s=i[0]&2?r["return"]:i[0]?r["throw"]||((s=r["return"])&&s.call(r),0):r.next)&&!(s=s.call(r,i[1])).done)return s;if(r=0,s)i=[i[0]&2,s.value];switch(i[0]){case 0:case 1:s=i;break;case 4:o.label++;return{value:i[1],done:false};case 5:o.label++;r=i[1];i=[0];continue;case 7:i=o.ops.pop();o.trys.pop();continue;default:if(!(s=o.trys,s=s.length>0&&s[s.length-1])&&(i[0]===6||i[0]===2)){o=0;continue}if(i[0]===3&&(!s||i[1]>s[0]&&i[1]<s[3])){o.label=i[1];break}if(i[0]===6&&o.label<s[1]){o.label=s[1];s=i;break}if(s&&o.label<s[2]){o.label=s[2];o.ops.push(i);break}if(s[2])o.ops.pop();o.trys.pop();continue}i=t.call(e,o)}catch(e){i=[6,e];r=0}finally{n=s=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}var v={lint:"Check code for linting issues","lint:fix":"Fix linting issues automatically","lint:inspect":"View active ESLint configuration","lint-staged":"Run lint checks on staged files",commitlint:"Validate commit message format",setup:"Initialize project setup and dependencies",reset:"Reset the project and reinstall dependencies",inspect:"Analyze installed project dependencies","test:unit":"Run unit test suite","test:e2e":"Run end-to-end test suite"};import j from"node:process";import{hideBin as x}from"yargs/helpers";import E from"yargs/yargs";import _ from"node:process";var b=_.env.DEBUG==="true";var I={name:"@cyberskill/shared",type:"module",version:"1.68.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":{types:"./dist/configs/graphql/index.d.ts",import:"./dist/configs/graphql/index.js",require:"./dist/configs/graphql/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"},"./configs/vitest/react/e2e":{types:"./dist/configs/vitest/react/e2e.d.ts",import:"./dist/configs/vitest/react/e2e.js",require:"./dist/configs/vitest/react/e2e.cjs"},"./configs/vitest/react/unit":{types:"./dist/configs/vitest/react/unit.d.ts",import:"./dist/configs/vitest/react/unit.js",require:"./dist/configs/vitest/react/unit.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/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/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"},"./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.11.0","@apollo/client":"3.13.6","@eslint-react/eslint-plugin":"1.41.0","@graphql-codegen/cli":"5.0.5","@graphql-codegen/client-preset":"4.8.0","@graphql-codegen/typescript-react-apollo":"4.3.2","@microsoft/api-extractor":"7.52.3","@next/eslint-plugin-next":"15.2.4","@swc/core":"1.11.18","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@vitejs/plugin-react-swc":"3.8.1","@vitest/browser":"3.1.1",chalk:"5.4.1",classnames:"2.5.1",consola:"3.4.2","crypto-js":"4.2.0","date-fns":"4.1.0","dotenv-cli":"8.0.0","eslint-config-next":"15.2.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.19",globals:"16.0.0",graphql:"16.10.0","graphql-ws":"6.0.4",i18next:"24.2.3",jsdom:"26.0.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.51.1","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.2.5",vitest:"3.1.1","vitest-browser-react":"0.1.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/crypto-js":"4.2.2","@types/mongoose-aggregate-paginate-v2":"1.0.12","@types/node-persist":"3.1.8","@types/react":"19.1.0","@types/react-dom":"19.1.1","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/yargs":"17.0.33",eslint:"9.24.0","lint-staged":"15.5.0","node-modules-inspector":"0.6.3","simple-git-hooks":"2.12.1"}};import{exec as S}from"node:child_process";import w from"node:process";import*as O from"node:util";import N from"chalk";import T from"consola";import{GraphQLError as D}from"graphql";b||(T.level=4);function C(e){var t=N[e];return typeof t=="function"?t:N.green}var P={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(N.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,s=e.rule,i=e.message;T.log("".concat(N.gray("File:")," ").concat(N.blue("".concat(t).concat(r?":".concat(r):"")))),s&&T.log(" ".concat(C(n)("Rule:")," ").concat(s)),T.log(" ".concat(C(n)("Message:")," ").concat(i))}),T.box(C(n)("".concat(e," : ").concat(t.length))),T.log(N.gray("─".repeat(40)))}};var A={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import L from"node-fetch";import*as R from"node:fs";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 R.existsSync(e)})}function G(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":h(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}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":h(t))=="object"?JSON.stringify(t,null,4):String(t);R.writeFileSync(e,i,"utf-8")}function q(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":h(t))=="object"?JSON.stringify(t,null,4):String(t);R.appendFileSync(e,i,"utf-8")}function K(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){k(e)&&R.rmSync(e,{recursive:!0,force:!0})})}import F from"node:process";import*as U from"node:path";function Y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=U).resolve.apply(r,[J].concat(g(t)))}function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=U).join.apply(r,g(t))}var J=F.env.INIT_CWD||F.cwd(),W="@cyberskill/shared",X=".cyberskill-storage",H="node_modules",V="dist",$="package.json",z="package-lock.json",Q="tsconfig.json",Z=".gitignore",ee=".simple-git-hooks.json",et="pnpm-lock.yaml",en=".git/hooks/",er=".git/COMMIT_EDITMSG",es=B(J,H,W,V),ei="cyberskill",eo="src/nodejs/cli/index.ts",ec="eslint",ea="eslint",eu="vitest",el="playwright",ed="vitest",ep="@commitlint/cli",ef="commitlint",eg="lint-staged",eh="lint-staged",em="typescript",ey="tsc",ev="tsx",ej="git",ex="pnpm",eE="pnpm exec",e_="simple-git-hooks",eb="simple-git-hooks",eI="@eslint/config-inspector",eS="eslint-config-inspector",ew="node-modules-inspector",eO="node-modules-inspector",eN={CYBERSKILL_DIRECTORY:es,WORKING_DIRECTORY:J,TS_CONFIG:Y(Q),GIT_IGNORE:Y(Z),GIT_HOOK:Y(en),GIT_COMMIT_MSG:Y(er),SIMPLE_GIT_HOOKS_JSON:Y(ee),PACKAGE_JSON:Y($),PACKAGE_LOCK_JSON:Y(z),PNPM_LOCK_YAML:Y(et),NODE_MODULES:Y(H),CYBERSKILL:{LINT_STAGED_CONFIG:Y("".concat(es,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:Y("".concat(es,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:Y("".concat(es,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:Y("".concat(es,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:Y("".concat(es,"/react/vitest/vitest.e2e.js"))}};function eT(e){var t=e.isCurrentProject;return l({"pre-commit":eh,"commit-msg":ef},t&&{"pre-push":e4("".concat(ej," pull"))})}function eD(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var s=f(n,2),i=s[0],o=s[1],c=e==="RAW"?!0:k.apply(void 0,g(i.split(" ").map(function(e){return B(eN.NODE_MODULES,e)})));switch(e){case"PNPM_ADD_AND_EXEC":return e5(e4("".concat(c?"":"".concat(ex," add ").concat(i," && ")).concat(eE," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return e5(e4("".concat(c?"":"".concat(ex," add -D ").concat(i," && ")).concat(eE," ").concat(o)));case"RAW":return e5(e4(i))}}var eC={SIMPLE_GIT_HOOKS:eD("PNPM_ADD_DEV_AND_EXEC",e_,eb),ESLINT_INSPECT:eD("PNPM_ADD_DEV_AND_EXEC",eI,eS),NODE_MODULES_INSPECT:eD("PNPM_ADD_DEV_AND_EXEC",ew,eO),ESLINT_CHECK:eD("PNPM_ADD_DEV_AND_EXEC",ec,"".concat(ea," ").concat(eN.WORKING_DIRECTORY)),ESLINT_FIX:eD("PNPM_ADD_DEV_AND_EXEC",ec,"".concat(ea," ").concat(eN.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eD("PNPM_ADD_AND_EXEC",em,"".concat(ey," -p ").concat(eN.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eD("RAW","".concat(ej," config core.hooksPath ").concat(eN.GIT_HOOK)),BUILD:eD("RAW","".concat(ex," run build")),STAGE_BUILD_DIRECTORY:eD("RAW","".concat(ej," add ").concat(V)),PNPM_INSTALL_STANDARD:eD("RAW","".concat(ex," install")),PNPM_INSTALL_LEGACY:eD("RAW","".concat(ex," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eD("RAW","".concat(ex," install --force")),CYBERSKILL:{TEST_UNIT:eD("PNPM_ADD_AND_EXEC",eu,"".concat(ed," --config ").concat(eN.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eD("PNPM_ADD_AND_EXEC","".concat(eu," ").concat(el),"".concat(ed," --config ").concat(eN.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eD("PNPM_ADD_DEV_AND_EXEC",ep,"".concat(ef," --edit ").concat(eN.GIT_COMMIT_MSG," --config ").concat(eN.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eD("PNPM_ADD_DEV_AND_EXEC",eg,"".concat(eh," --config ").concat(eN.CYBERSKILL.LINT_STAGED_CONFIG))}};var eP={};function eA(e){if(e in eP)return eP[e];var t=B(J,$);if(!k(t))return eP[e]=!1;try{var n,r;var s=G(t,{asJson:!0}),i=s.name===e,o=!!((n=s.dependencies)===null||n===void 0?void 0:n[e]),c=!!((r=s.devDependencies)===null||r===void 0?void 0:r[e]);return i||o||c?eP[e]={path:t,file:s,isCurrentProject:i,isDepend:o,isDevDepend:c}:eP[e]=!1}catch(t){return P.warn("Failed to read package.json: ".concat(t.message)),eP[e]=!1}}function eL(e){return eR.apply(this,arguments)}function eR(){eR=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,L("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 P.error('Failed to fetch version for "'.concat(e,'": ').concat(s.message)),s;case 4:return[2]}})});return eR.apply(this,arguments)}function ek(e,t){return eG.apply(this,arguments)}function eG(){eG=s(function(e,t){var n,r,s,o,c,a,u,d,f,g,h,m,v,j,x;return y(this,function(y){switch(y.label){case 0:y.trys.push([0,4,,5]);c=eA(e);if(!c)return[2,l({},A)];a=c.path,u=c.file,d=c.isCurrentProject,f=c.isDepend,g=c.isDevDepend,h="0.0.0";d&&u.version?h=u.version:f&&((n=u.dependencies)===null||n===void 0?void 0:n[e])?h=(r=u.dependencies)===null||r===void 0?void 0:r[e]:g&&((s=u.devDependencies)===null||s===void 0?void 0:s[e])&&(h=(o=u.devDependencies)===null||o===void 0?void 0:o[e]);if(!d)return[3,1];j=h;return[3,3];case 1:return[4,eL(e)];case 2:j=y.sent();y.label=3;case 3:m=j,v=d||h===m;return[2,(!v&&(t===null||t===void 0?void 0:t.update)&&(f?u.dependencies=p(l({},u.dependencies||{}),i({},e,m)):g&&(u.devDependencies=p(l({},u.devDependencies||{}),i({},e,m))),P.info('Updating package "'.concat(e,'" to version ').concat(m)),M(a,u,{isJson:!0})),{isCurrentProject:d,installedPath:a,file:u,isUpToDate:v})];case 4:x=y.sent();return[2,(P.error('Error checking package "'.concat(e,'": ').concat(x.message)),l({},A))];case 5:return[2]}})});return eG.apply(this,arguments)}import eM from"node-persist";import eq from"node:os";import eK from"node:process";function eF(){return eK.env.CYBERSKILL_STORAGE_DIR||B(eq.homedir(),X)}function eU(){return eY.apply(this,arguments)}function eY(){eY=s(function(){var e;return y(this,function(t){switch(t.label){case 0:e=eM.defaultInstance;if(e)return[3,2];return[4,eM.init({dir:eF(),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 eY.apply(this,arguments)}var eB={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,eU()];case 1:r.sent();return[4,eM.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(P.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,eU()];case 1:r.sent();return[4,eM.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();P.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,eU()];case 1:n.sent();return[4,eM.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();P.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,eU()];case 1:n.sent();return[4,eM.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(P.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(P.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(eF()," (key: ").concat(e,")")]}catch(e){return[2,(P.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var eJ=O.promisify(S);function eW(e){return"error_list:".concat(e)}function eX(e){return eH.apply(this,arguments)}function eH(){eH=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=eW(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,eB.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,eB.getLogLink(n)];case 1:e=t.sent();e&&P.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();P.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return eH.apply(this,arguments)}function eV(){return e$.apply(this,arguments)}function e$(){e$=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eB.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,eB.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,(P.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return e$.apply(this,arguments)}function ez(){return eQ.apply(this,arguments)}function eQ(){eQ=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eB.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 eB.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();P.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return eQ.apply(this,arguments)}function eZ(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=s.exec(e)||[],a=i.exec(e)||[],u=o.exec(e)||[];c.length&&r?t.push({file:r,position:"".concat(c[1],":").concat(c[2]),type:c[3]==="error"?"error":"warning",message:c[4].trim(),rule:c[5].trim()}):a.length?t.push({file:a[1],position:"".concat(a[2],":").concat(a[3]),type:a[4]==="error"?"error":"warning",message:a[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&eX(t),b&&n.length&&(P.warn("Unmatched lines:"),n.forEach(function(e){return P.info(" ".concat(e))}))}function e0(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?"error":"warning",file:t,position:"".concat(s,":").concat(i),rule:o,message:c})})}),n.length&&eX(n)}catch(t){eZ(e)}}function e1(e){return e2.apply(this,arguments)}function e2(){e2=s(function(e){var t,n,r,s,i,o,c,a,u;var l=arguments;return y(this,function(d){switch(d.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:e0;n=new AbortController;w.on("SIGINT",function(){P.warn("Process interrupted. Terminating..."),n.abort(),w.exit()});d.label=1;case 1:d.trys.push([1,3,,4]);return[4,eJ(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&&P.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return e2.apply(this,arguments)}function e4(e){return{raw:!0,cmd:e}}function e3(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eE," ").concat(W," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eE," ").concat(ev," ").concat(eo," ").concat(e):"".concat(eE," ").concat(ei," ").concat(e)}function e5(e,t){return typeof e=="function"?e3(e(t),t):(typeof e==="undefined"?"undefined":h(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?e3(e,t):e}function e6(e){return e8.apply(this,arguments)}function e8(){e8=s(function(e){var t,n,r,s,i,o,c;var a=arguments;return y(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,ek(W)];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=f(e,2),n=t[0],r=t[1];return[n,e5(r,i)]}))]}})});return e8.apply(this,arguments)}function e7(e,t){return e9.apply(this,arguments)}function e9(){e9=s(function(e,t){var n;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);P.start("".concat(e)),b&&P.info("→ ".concat(t));return[4,e1(t)];case 1:r.sent(),P.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw P.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return e9.apply(this,arguments)}function te(){return tt.apply(this,arguments)}function tt(){tt=s(function(){var e;return y(this,function(t){switch(t.label){case 0:if(!k(eN.TS_CONFIG))return[3,2];return[4,e7("Performing TypeScript validation",eC.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=P.warn("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tt.apply(this,arguments)}function tn(){return tr.apply(this,arguments)}function tr(){tr=s(function(){var e,t;var n=arguments;return y(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,e7("Running ESLint with auto-fix",eC.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,e7("Running ESLint check",eC.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tr.apply(this,arguments)}function ts(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";P.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}function ti(){return to.apply(this,arguments)}function to(){to=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:return[4,eV()];case 1:e=r.sent(),t=e.filter(function(e){return e.type==="error"}),n=e.filter(function(e){return e.type==="warning"});!t.length&&!n.length?P.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ts("Warnings",n),ts("Errors",t));return[2]}})});return to.apply(this,arguments)}function tc(){return ta.apply(this,arguments)}function ta(){ta=s(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:return[4,ez()];case 1:r.sent();return[4,ek(W)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,e7("Building package: ".concat(W),eC.BUILD)];case 4:r.sent();return[4,e7("Staging build artifacts",eC.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw P.error("Error building and staging ".concat(W,": ").concat(n.message)),n;case 7:return[4,e7("Executing lint-staged",eC.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),ti();return[2]}})});return ta.apply(this,arguments)}function tu(){return tl.apply(this,arguments)}function tl(){tl=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Inspecting ESLint configuration",eC.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tl.apply(this,arguments)}function td(){return tp.apply(this,arguments)}function tp(){tp=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,Promise.all([te(),tn()])];case 2:e.sent(),ti();return[2]}})});return tp.apply(this,arguments)}function tf(){return tg.apply(this,arguments)}function tg(){tg=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,Promise.all([te(),tn(!0)])];case 2:e.sent(),ti();return[2]}})});return tg.apply(this,arguments)}function th(){return tm.apply(this,arguments)}function tm(){tm=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,ez()];case 1:e.sent();return[4,e7("Validating commit message",eC.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),ti();return[2]}})});return tm.apply(this,arguments)}function ty(){return tv.apply(this,arguments)}function tv(){tv=s(function(){var e,t;return y(this,function(n){switch(n.label){case 0:return[4,e7("Configuring Git hooks",eC.CONFIGURE_GIT_HOOK)];case 1:n.sent(),K(eN.GIT_HOOK);return[4,e6(eT)];case 2:e=n.sent();M(eN.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(ee,"\n");k(eN.GIT_IGNORE)?G(eN.GIT_IGNORE).split("\n").includes(ee)||q(eN.GIT_IGNORE,t):M(eN.GIT_IGNORE,t);return[4,e7("Setting up simple-git-hooks",eC.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tv.apply(this,arguments)}function tj(){return tx.apply(this,arguments)}function tx(){tx=s(function(){var e,t,n,r,s,i,o,c,a,u,l;return y(this,function(d){switch(d.label){case 0:e=[{command:eC.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:eC.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:eC.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;d.label=1;case 1:d.trys.push([1,8,9,10]);s=e[Symbol.iterator]();d.label=2;case 2:if(!!(t=(i=s.next()).done))return[3,7];o=i.value,c=o.command,a=o.message;d.label=3;case 3:d.trys.push([3,5,,6]);return[4,e7("".concat(a," using: ").concat(c),c)];case 4:d.sent();return[2];case 5:u=d.sent();P.warn("Installation attempt failed: ".concat(c)),P.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=d.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&s.return!=null){s.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return tx.apply(this,arguments)}function tE(e,t){return t_.apply(this,arguments)}function t_(){t_=s(function(e,t){var n,r,s,i,o,c,a,u,l,d,p,f;return y(this,function(g){switch(g.label){case 0:if(!k(eN.PACKAGE_JSON)){P.error("package.json not found. Aborting setup.");return[2]}g.label=1;case 1:g.trys.push([1,14,,15]);return[4,ek(e,{update:t===null||t===void 0?void 0:t.update})];case 2:n=g.sent(),r=n.isUpToDate;s=r;if(s)return[3,5];return[4,tj()];case 3:g.sent();return[4,tf()];case 4:s=g.sent();g.label=5;case 5:s;o=true,c=false,a=undefined;g.label=6;case 6:g.trys.push([6,11,12,13]);u=((i=t===null||t===void 0?void 0:t.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();g.label=7;case 7:if(!!(o=(l=u.next()).done))return[3,10];d=l.value;return[4,d()];case 8:g.sent();g.label=9;case 9:o=true;return[3,7];case 10:return[3,13];case 11:p=g.sent();c=true;a=p;return[3,13];case 12:try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}return[7];case 13:P.success('"'.concat(e,'" setup completed.'));return[3,15];case 14:f=g.sent();throw P.error('Failed to setup "'.concat(e,'": ').concat(f.message)),f;case 15:return[2]}})});return t_.apply(this,arguments)}function tb(){return tI.apply(this,arguments)}function tI(){tI=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,tE(W,{update:!0,postInstallActions:[ty]})];case 1:e.sent();return[2]}})});return tI.apply(this,arguments)}function tS(){return tw.apply(this,arguments)}function tw(){tw=s(function(){return y(this,function(e){switch(e.label){case 0:K(eN.NODE_MODULES,eN.PNPM_LOCK_YAML);return[4,tj()];case 1:e.sent();return[4,ty()];case 2:e.sent();return[2]}})});return tw.apply(this,arguments)}function tO(){return tN.apply(this,arguments)}function tN(){tN=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Inspecting project dependencies",eC.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tN.apply(this,arguments)}function tT(){return tD.apply(this,arguments)}function tD(){tD=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Running unit tests",eC.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tD.apply(this,arguments)}function tC(){return tP.apply(this,arguments)}function tP(){tP=s(function(){return y(this,function(e){switch(e.label){case 0:return[4,e7("Running end-to-end tests",eC.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tP.apply(this,arguments)}s(function(){var e;return y(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,E(x(j.argv)).scriptName(ei).usage("$0 <command> [options]").command("lint",v.lint,td).command("lint:fix",v["lint:fix"],tf).command("lint:inspect",v["lint:inspect"],tu).command("lint-staged",v["lint-staged"],tc).command("commitlint",v.commitlint,th).command("setup",v.setup,tb).command("reset",v.reset,tS).command("inspect",v.inspect,tO).command("test:unit",v["test:unit"],tT).command("test:e2e",v["test:e2e"],tC).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(I.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();P.error("Fatal: ".concat(e.message)),j.exit(1);return[3,3];case 3:return[2]}})})();export{v as COMMAND_DESCRIPTIONS};