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