@cyberskill/shared 1.80.0 → 1.82.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 +30 -8
- package/dist/_tsup-dts-rollup.d.ts +30 -8
- package/dist/configs/commitlint/index.d.cts +1 -1
- package/dist/configs/commitlint/index.d.ts +1 -1
- package/dist/configs/eslint/index.d.cts +1 -1
- package/dist/configs/eslint/index.d.ts +1 -1
- package/dist/configs/lint-staged/index.d.cts +1 -1
- package/dist/configs/lint-staged/index.d.ts +1 -1
- package/dist/configs/tsconfig/tsconfig.base.json +0 -8
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- 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/index.cjs +1 -1
- package/dist/nodejs/index.js +1 -1
- package/dist/{package-MZ24VJKI.json → package-KSSCGX3B.json} +1 -2
- package/dist/react/apollo-client/apollo-client.component.d.cts +1 -1
- package/dist/react/apollo-client/apollo-client.component.d.ts +1 -1
- package/dist/react/apollo-client/index.d.cts +1 -1
- package/dist/react/apollo-client/index.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.component.d.cts +1 -1
- package/dist/react/apollo-error/apollo-error.component.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.context.d.cts +1 -1
- package/dist/react/apollo-error/apollo-error.context.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.hook.d.cts +1 -1
- package/dist/react/apollo-error/apollo-error.hook.d.ts +1 -1
- package/dist/react/apollo-error/apollo-error.provider.d.cts +2 -2
- package/dist/react/apollo-error/apollo-error.provider.d.ts +2 -2
- package/dist/react/apollo-error/index.d.cts +5 -5
- package/dist/react/apollo-error/index.d.ts +5 -5
- package/dist/react/index.d.cts +1 -0
- package/dist/react/index.d.ts +1 -0
- package/dist/react/next-intl/index.d.cts +1 -0
- package/dist/react/next-intl/index.d.ts +1 -0
- package/dist/react/next-intl/next-intl.constant.d.cts +1 -0
- package/dist/react/next-intl/next-intl.constant.d.ts +1 -0
- package/package.json +1 -2
- package/dist/configs/tsconfig/tsconfig.nodejs.d.cts +0 -1
- package/dist/configs/tsconfig/tsconfig.nodejs.d.ts +0 -1
- /package/dist/{configs/tsconfig/tsconfig.nextjs.d.cts → react/loading/loading.module.scss.d.d.cts} +0 -0
- /package/dist/{configs/tsconfig/tsconfig.nextjs.d.ts → react/loading/loading.module.scss.d.d.ts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
function t(t,n){if(n==null||n>t.length)n=t.length;for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function n(t){if(Array.isArray(t))return t}function e(n){if(Array.isArray(n))return t(n)}function r(t,n,e,r,i,o,a){try{var c=t[o](a);var s=c.value}catch(t){e(t);return}if(c.done){n(s)}else{Promise.resolve(s).then(r,i)}}function i(t){return function(){var n=this,e=arguments;return new Promise(function(i,o){var a=t.apply(n,e);function c(t){r(a,i,o,c,s,"next",t)}function s(t){r(a,i,o,c,s,"throw",t)}c(undefined)})}}function o(t,n,e){if(n in t){Object.defineProperty(t,n,{value:e,enumerable:true,configurable:true,writable:true})}else{t[n]=e}return t}function a(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,n){var e=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(e==null)return;var r=[];var i=true;var o=false;var a,c;try{for(e=e.call(t);!(i=(a=e.next()).done);i=true){r.push(a.value);if(n&&r.length===n)break}}catch(t){o=true;c=t}finally{try{if(!i&&e["return"]!=null)e["return"]()}finally{if(o)throw c}}return r}function s(){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(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};var r=Object.keys(e);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))}r.forEach(function(n){o(t,n,e[n])})}return t}function f(t,e){return n(t)||c(t,e)||h(t,e)||s()}function p(t){return e(t)||a(t)||h(t)||u()}function d(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function h(n,e){if(!n)return;if(typeof n==="string")return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);if(r==="Object"&&n.constructor)r=n.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 t(n,e)}function v(t,n){var e,r,i,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(n){return s([t,n])}}function s(c){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(o=0)),o)try{if(e=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;r=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(c[0]===6&&o.label<i[1]){o.label=i[1];i=c;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(c);break}if(i[2])o.ops.pop();o.trys.pop();continue}c=n.call(t,o)}catch(t){c=[6,t];r=0}finally{e=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}import y from"node:process";import{hideBin as m}from"yargs/helpers";import g from"yargs/yargs";import b from"../../package-MZ24VJKI.json";import{exec as w}from"node:child_process";import I from"node:process";import*as S from"node:util";import E from"node:process";var O=E.env.DEBUG==="true";import _ from"chalk";import T from"consola";import{GraphQLError as C}from"graphql";O||(T.level=4);function k(t){var n=_[t];return typeof n=="function"?n:_.green}var G={silent:T.silent,level:T.level,fatal:T.fatal,error:T.error,warn:T.warn,log:T.log,info:T.info,success:T.success,ready:T.ready,start:T.start,box:T.box,debug:T.debug,trace:T.trace,verbose:T.verbose,printBoxedLog:function t(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(n===null||n===void 0?void 0:n.length)){T.box(_.green(t));return}n.forEach(function(t){var n=t.file,r=t.position,i=t.rule,o=t.message;T.log("".concat(_.gray("File:")," ").concat(_.blue("".concat(n).concat(r?":".concat(r):"")))),i&&T.log(" ".concat(k(e)("Rule:")," ").concat(i)),T.log(" ".concat(k(e)("Message:")," ").concat(o))}),T.box(k(e)("".concat(t," : ").concat(n.length))),T.log(_.gray("─".repeat(40)))}};var N={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import j from"node-fetch";import*as L from"node:fs";function A(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}return n.every(function(t){return L.existsSync(t)})}function R(t,n){var e=L.readFileSync(t,"utf-8");if(n===null||n===void 0?void 0:n.asJson)try{var r=JSON.parse(e);if((typeof r==="undefined"?"undefined":d(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(n){throw new Error("Failed to parse JSON from file: ".concat(t))}return e}function P(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=e.isJson,i=r===void 0?!1:r,o=i&&(typeof n==="undefined"?"undefined":d(n))=="object"?JSON.stringify(n,null,4):String(n);L.writeFileSync(t,o,"utf-8")}function x(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=e.isJson,i=r===void 0?!1:r,o=i&&(typeof n==="undefined"?"undefined":d(n))=="object"?JSON.stringify(n,null,4):String(n);L.appendFileSync(t,o,"utf-8")}function D(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}n.forEach(function(t){A(t)&&L.rmSync(t,{recursive:!0,force:!0})})}import F from"node:process";import*as M from"node:path";function U(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var r;return(r=M).resolve.apply(r,[K].concat(p(n)))}function J(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var r;return(r=M).join.apply(r,p(n))}var K=F.env.INIT_CWD||F.cwd(),W="@cyberskill/shared",B=".cyberskill-storage",H="node_modules",Y="dist",$="package.json",V="package-lock.json",z="tsconfig.json",q=".gitignore",Q=".simple-git-hooks.json",Z="pnpm-lock.yaml",X=".git/hooks/",tt=".git/COMMIT_EDITMSG",tn=J(K,H,W,Y),te="cyberskill",tr="src/nodejs/cli/index.ts",ti="eslint",to="eslint",ta="vitest",tc="playwright",ts="vitest",tu="@commitlint/cli",tl="commitlint",tf="lint-staged",tp="lint-staged",td="typescript",th="tsc",tv="tsx",ty="git",tm="pnpm",tg="pnpm exec",tb="simple-git-hooks",tw="simple-git-hooks",tI="@eslint/config-inspector",tS="eslint-config-inspector",tE="node-modules-inspector",tO="node-modules-inspector",t_={CYBERSKILL_DIRECTORY:tn,WORKING_DIRECTORY:K,TS_CONFIG:U(z),GIT_IGNORE:U(q),GIT_HOOK:U(X),GIT_COMMIT_MSG:U(tt),SIMPLE_GIT_HOOKS_JSON:U(Q),PACKAGE_JSON:U($),PACKAGE_LOCK_JSON:U(V),PNPM_LOCK_YAML:U(Z),NODE_MODULES:U(H),LINT_STAGED_CONFIG:U("".concat(tn,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:U("".concat(tn,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:U("".concat(tn,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:U("".concat(tn,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:U("".concat(tn,"/react/vitest/vitest.e2e.js"))};function tT(t){var n=t.isCurrentProject;return l({"pre-commit":tp,"commit-msg":tl},n&&{"pre-push":t5("".concat(ty," pull"))})}function tC(t){return tk.apply(this,arguments)}function tk(){tk=i(function(t){var n,e,r,i,o,a;var c=arguments;return v(this,function(s){switch(s.label){case 0:for(n=c.length,e=new Array(n>1?n-1:0),r=1;r<n;r++){e[r-1]=c[r]}i=f(e,2),o=i[0],a=i[1];if(!o)throw new Error("'first' argument is undefined");switch(t){case"CLI":return[3,1];case"RAW":return[3,3]}return[3,4];case 1:return[4,tF(o.split(" "),{update:!0})];case 2:return[2,(s.sent(),t8(t5("".concat(tg," ").concat(a))))];case 3:return[2,t8(t5(o))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tk.apply(this,arguments)}function tG(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++){e[r-1]=arguments[r]}return /*#__PURE__*/i(function(){return v(this,function(n){return[2,tC.apply(void 0,[t].concat(p(e)))]})})}var tN={simpleGitHooks:tG("CLI",tb,tw),eslintInspect:tG("CLI",tI,tS),nodeModulesInspect:tG("CLI",tE,tO),eslintCheck:tG("CLI",ti,"".concat(to," ").concat(t_.WORKING_DIRECTORY)),eslintFix:tG("CLI",ti,"".concat(to," ").concat(t_.WORKING_DIRECTORY," --fix")),typescriptCheck:tG("CLI",td,"".concat(th," -p ").concat(t_.TS_CONFIG," --noEmit")),configureGitHook:tG("RAW","".concat(ty," config core.hooksPath ").concat(t_.GIT_HOOK)),testUnit:tG("CLI",ta,"".concat(ts," --config ").concat(t_.UNIT_TEST_CONFIG)),testE2e:tG("CLI","".concat(ta," ").concat(tc),"".concat(ts," --config ").concat(t_.E2E_TEST_CONFIG)),commitLint:tG("CLI",tu,"".concat(tl," --edit ").concat(t_.GIT_COMMIT_MSG," --config ").concat(t_.COMMITLINT_CONFIG)),lintStaged:tG("CLI",tf,"".concat(tp," --config ").concat(t_.LINT_STAGED_CONFIG)),stageBuildDirectory:tG("RAW","".concat(ty," add ").concat(Y)),build:tG("RAW","".concat(tm," run build")),pnpmInstallStandard:tG("RAW","".concat(tm," install")),pnpmInstallLegacy:tG("RAW","".concat(tm," install --legacy-peer-deps")),pnpmInstallForce:tG("RAW","".concat(tm," install --force"))};function tj(t){var n=J(K,$);if(!A(n))return!1;try{var e=R(n,{asJson:!0}),r=e.name,i=e.dependencies,o=i===void 0?{}:i,a=e.devDependencies,c=a===void 0?{}:a,s=r===t,u=t in o,l=t in c;return s||u||l?{path:n,file:e,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(t){return G.warn("Failed to read package.json: ".concat(t.message)),!1}}function tL(t){return tA.apply(this,arguments)}function tA(){tA=i(function(t){var n,e,r,i;return v(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,j("https://registry.npmjs.org/".concat(t,"/latest"))];case 1:n=o.sent();if(!n.ok)throw new Error("Failed to fetch latest version: ".concat(n.status," ").concat(n.statusText));return[4,n.json()];case 2:e=o.sent(),r=e.version;return[2,r];case 3:i=o.sent();throw G.error('Failed to fetch version for "'.concat(t,'": ').concat(i.message)),i;case 4:return[2]}})});return tA.apply(this,arguments)}function tR(t,n){return tP.apply(this,arguments)}function tP(){tP=i(function(t,n){var e,r,i,o,a,c,s,u,f,p,d,h,y,m,g,b,w,I,S,E,O;return v(this,function(v){switch(v.label){case 0:v.trys.push([0,4,,5]);e=tj(t);if(!e)return[2,l({},N)];s=e.path,u=e.file,f=e.isCurrentProject,p=e.isDepend,d=e.isDevDepend,h=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(i=u.devDependencies)!==null&&i!==void 0?i:{},m=f?(o=u.version)!==null&&o!==void 0?o:"0.0.0":p?(a=h[t])!==null&&a!==void 0?a:"0.0.0":d?(c=y[t])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=m;return[3,3];case 1:return[4,tL(t)];case 2:w=v.sent();v.label=3;case 3:g=w,b=f||m===g;if(!b&&(n===null||n===void 0?void 0:n.update)){;S=p?"dependencies":d?"devDependencies":null;S&&((I=u[S])===null||I===void 0?void 0:I[t])!==g&&(u[S]=(E=u[S])!==null&&E!==void 0?E:{},u[S][t]=g,P(s,u,{isJson:!0}),G.info('Updated "'.concat(t,'" to version ').concat(g)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:b}];case 4:O=v.sent();return[2,(G.error('Error checking package "'.concat(t,'": ').concat(O.message)),l({},N))];case 5:return[2]}})});return tP.apply(this,arguments)}function tx(){return tD.apply(this,arguments)}function tD(){tD=i(function(){var t,n,e,r,i,o,a,c,s,u,l,f;return v(this,function(p){switch(p.label){case 0:t=[{command:function(){return tN.pnpmInstallStandard()},message:"Installing dependencies (standard)"},{command:function(){return tN.pnpmInstallLegacy()},message:"Retrying with legacy peer dependencies"},{command:function(){return tN.pnpmInstallForce()},message:"Retrying with force install"}];n=true,e=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);i=t[Symbol.iterator]();p.label=2;case 2:if(!!(n=(o=i.next()).done))return[3,8];a=o.value,c=a.command,s=a.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,nt("".concat(s," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();G.warn("Installation attempt failed: ".concat(s)),G.error("Details: ".concat(l.message));return[3,7];case 7:n=true;return[3,2];case 8:return[3,11];case 9:f=p.sent();e=true;r=f;return[3,11];case 10:try{if(!n&&i.return!=null){i.return()}}finally{if(e){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return tD.apply(this,arguments)}function tF(t,n){return tM.apply(this,arguments)}function tM(){tM=i(function(t,n){var e,r,i,o,a,c,s,u,f,d,h;return v(this,function(v){switch(v.label){case 0:if(!A(t_.PACKAGE_JSON)){G.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);e=p(new Set(t)).sort();return[4,Promise.all(e.map(function(t){return tR(t,l({},(n===null||n===void 0?void 0:n.update)&&{update:n.update}))}))];case 2:r=v.sent().every(function(t){return t.isUpToDate});if(r)return[3,4];return[4,tx()];case 3:r=v.sent();v.label=4;case 4:r;o=true,a=false,c=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((i=n===null||n===void 0?void 0:n.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();v.label=6;case 6:if(!!(o=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=v.sent();a=true;c=d;return[3,12];case 11:try{if(!o&&s.return!=null){s.return()}}finally{if(a){throw c}}return[7];case 12:return[3,14];case 13:h=v.sent();throw G.error('Failed to setup "'.concat(t.join(", "),'": ').concat(h.message)),h;case 14:return[2]}})});return tM.apply(this,arguments)}import tU from"node-persist";import tJ from"node:os";import tK from"node:process";function tW(){return tK.env.CYBERSKILL_STORAGE_DIR||J(tJ.homedir(),B)}function tB(){return tH.apply(this,arguments)}function tH(){tH=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=tU.defaultInstance;if(t)return[3,2];return[4,tU.init({dir:tW(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:t=n.sent();n.label=2;case 2:t;return[2]}})});return tH.apply(this,arguments)}var tY={get:function t(t){return i(function(){var n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tB()];case 1:r.sent();return[4,tU.getItem(t)];case 2:return[2,(n=r.sent())!==null&&n!==void 0?n:null];case 3:e=r.sent();return[2,(G.error('[Storage:get] Error getting key "'.concat(t,'":'),e),null)];case 4:return[2]}})})()},set:function t(t,n){return i(function(){var e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tB()];case 1:r.sent();return[4,tU.setItem(t,n)];case 2:r.sent();return[3,4];case 3:e=r.sent();G.error('[Storage:set] Error setting key "'.concat(t,'":'),e);return[3,4];case 4:return[2]}})})()},remove:function t(t){return i(function(){var n;return v(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,tB()];case 1:e.sent();return[4,tU.removeItem(t)];case 2:e.sent();return[3,4];case 3:n=e.sent();G.error('[Storage:remove] Error removing key "'.concat(t,'":'),n);return[3,4];case 4:return[2]}})})()},keys:function t(){return i(function(){var t,n;return v(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,tB()];case 1:e.sent();return[4,tU.keys()];case 2:t=e.sent();return[2,Array.isArray(t)?t:(G.warn("[Storage:keys] Invalid keys response:",t),[])];case 3:n=e.sent();return[2,(G.error("[Storage:keys] Error getting keys:",n),[])];case 4:return[2]}})})()},getLogLink:function t(t){return i(function(){return v(this,function(n){try{return[2,"".concat(tW()," (key: ").concat(t,")")]}catch(t){return[2,(G.error("[Storage:getLogLink] Error getting log link:",t),null)]}return[2]})})()}};var t$=S.promisify(w);function tV(t){return"error_list:".concat(t)}function tz(t){return tq.apply(this,arguments)}function tq(){tq=i(function(t){var n,e,r;return v(this,function(o){switch(o.label){case 0:if(t.length===0)return[2];n=Date.now(),e=tV(n);o.label=1;case 1:o.trys.push([1,3,,4]);return[4,tY.set(e,{errors:t,timestamp:n})];case 2:o.sent(),setTimeout(/*#__PURE__*/i(function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,tY.getLogLink(e)];case 1:t=n.sent();t&&G.info("\uD83D\uDCC2 Open the error list manually: ".concat(t));return[2]}})}),10);return[3,4];case 3:r=o.sent();G.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tq.apply(this,arguments)}function tQ(){return tZ.apply(this,arguments)}function tZ(){tZ=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tY.keys()];case 1:t=r.sent(),n=Array.isArray(t)?t.filter(function(t){var n;return t===null||t===void 0?void 0:(n=t.startsWith)===null||n===void 0?void 0:n.call(t,"error_list:")}):[];return[4,Promise.all(n.map(/*#__PURE__*/function(){var t=i(function(t){var n;return v(this,function(e){switch(e.label){case 0:return[4,tY.get(t)];case 1:return[2,((n=e.sent())===null||n===void 0?void 0:n.errors)||[]]}})});return function(n){return t.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:e=r.sent();return[2,(G.error("Failed to retrieve stored errors: ".concat(e.message)),[])];case 4:return[2]}})});return tZ.apply(this,arguments)}function tX(){return t0.apply(this,arguments)}function t0(){t0=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tY.keys()];case 1:t=r.sent(),n=Array.isArray(t)?t.filter(function(t){var n;return t===null||t===void 0?void 0:(n=t.startsWith)===null||n===void 0?void 0:n.call(t,"error_list:")}):[];return[4,Promise.all(n.map(function(t){return tY.remove(t)}))];case 2:r.sent();return[3,4];case 3:e=r.sent();G.error("Failed to clear error lists: ".concat(e.message));return[3,4];case 4:return[2]}})});return t0.apply(this,arguments)}function t1(t){var n=[],e=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;t.split("\n").forEach(function(t){if(t.startsWith("/"))r=t.trim();else{var c,s,u,l,f;var p=i.exec(t)||[],d=o.exec(t)||[],h=a.exec(t)||[];var v,y,m,g,b,w;p.length&&r?n.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]==="error"?"error":"warning",message:(v=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:"",rule:(y=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&y!==void 0?y:""}):d.length?n.push({file:(m=d===null||d===void 0?void 0:d[1])!==null&&m!==void 0?m:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]==="error"?"error":"warning",message:(g=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&g!==void 0?g:""}):h.length?n.push({file:"commitlint",type:"error",message:(b=h===null||h===void 0?void 0:(l=h[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=h===null||h===void 0?void 0:(f=h[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):e.push(t.trim())}}),n.length&&tz(n),O&&e.length&&(G.warn("Unmatched lines:"),e.forEach(function(t){return G.info(" ".concat(t))}))}function t4(t){try{var n=JSON.parse(t),e=[];n.forEach(function(t){var n=t.filePath,r=t.messages;r.forEach(function(t){var r=t.severity,i=t.line,o=t.column,a=t.ruleId,c=t.message;e.push({type:r===2?"error":"warning",file:n,position:"".concat(i,":").concat(o),rule:a,message:c})})}),e.length&&tz(e)}catch(n){t1(t)}}function t2(t){return t3.apply(this,arguments)}function t3(){t3=i(function(t){var n,e,r,i,o,a,c,s,u;var l=arguments;return v(this,function(f){switch(f.label){case 0:n=l.length>1&&l[1]!==void 0?l[1]:t4;e=new AbortController;I.on("SIGINT",function(){G.warn("Process interrupted. Terminating..."),e.abort(),I.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,t$(t,{maxBuffer:0x6400000,signal:e.signal})];case 2:r=f.sent(),i=r.stdout,o=r.stderr;[i,o].forEach(function(t){return t&&n(t)});return[3,4];case 3:a=f.sent();c=a.stdout,s=a.stderr,u=a.message;[c,s].forEach(function(t){return t&&n(t)}),!s&&!c&&G.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return t3.apply(this,arguments)}function t5(t){return{raw:!0,cmd:t}}function t6(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tg," ").concat(W," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tg," ").concat(tv," ").concat(tr," ").concat(t):"".concat(tg," ").concat(te," ").concat(t)}function t8(t,n){return typeof t=="function"?t6(t(n),n):(typeof t==="undefined"?"undefined":d(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?t6(t,n):t}function t7(t){return t9.apply(this,arguments)}function t9(){t9=i(function(t){var n,e,r,i,o,a,c;var s=arguments;return v(this,function(u){switch(u.label){case 0:n=s.length>1&&s[1]!==void 0?s[1]:{};r=(e=n===null||n===void 0?void 0:n.isRemote)!==null&&e!==void 0?e:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,tR(W)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:i=c,o={isRemote:r,isCurrentProject:i},a=typeof t=="function"?t(o):t;return[2,Object.fromEntries(Object.entries(a).map(function(t){var n=f(t,2),e=n[0],r=n[1];return[e,t8(r,o)]}))]}})});return t9.apply(this,arguments)}function nt(t,n){return nn.apply(this,arguments)}function nn(){nn=i(function(t,n){var e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);G.start("".concat(t)),O&&G.info("→ ".concat(n));return[4,t2(n)];case 1:r.sent(),G.success("".concat(t," done."));return[3,3];case 2:e=r.sent();throw G.error("".concat(t," failed: ").concat(e.message)),e;case 3:return[2]}})});return nn.apply(this,arguments)}function ne(){return nr.apply(this,arguments)}function nr(){nr=i(function(){var t,n;return v(this,function(e){switch(e.label){case 0:if(!A(t_.TS_CONFIG))return[3,3];n=["Performing TypeScript validation"];return[4,tN.typescriptCheck()];case 1:return[4,nt.apply(void 0,n.concat([e.sent()]))];case 2:t=e.sent();return[3,4];case 3:t=G.warn("No TypeScript configuration found. Skipping type check.");e.label=4;case 4:t;return[2]}})});return nr.apply(this,arguments)}function ni(){return no.apply(this,arguments)}function no(){no=i(function(){var t,n,e,r;var i=arguments;return v(this,function(o){switch(o.label){case 0:t=i.length>0&&i[0]!==void 0?i[0]:!1;if(!t)return[3,3];e=["Running ESLint with auto-fix"];return[4,tN.eslintFix()];case 1:return[4,nt.apply(void 0,e.concat([o.sent()]))];case 2:n=o.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tN.eslintCheck()];case 4:return[4,nt.apply(void 0,r.concat([o.sent()]))];case 5:n=o.sent();o.label=6;case 6:n;return[2]}})});return no.apply(this,arguments)}function na(t,n){if(!n.length)return;var e=t==="Errors"?"red":"yellow";G.printBoxedLog(t==="Errors"?"✖ Errors":"⚠ Warnings",n,e)}function nc(){return ns.apply(this,arguments)}function ns(){ns=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:return[4,tQ()];case 1:t=r.sent(),n=t.filter(function(t){return t.type==="error"}),e=t.filter(function(t){return t.type==="warning"});!n.length&&!e.length?G.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(na("Warnings",e),na("Errors",n));return[2]}})});return ns.apply(this,arguments)}function nu(){return nl.apply(this,arguments)}function nl(){nl=i(function(){var t,n,e,r,i,o;return v(this,function(a){switch(a.label){case 0:return[4,tX()];case 1:a.sent();return[4,tR(W)];case 2:t=a.sent(),n=t.isCurrentProject;if(!n)return[3,9];a.label=3;case 3:a.trys.push([3,8,,9]);e=["Building package: ".concat(W)];return[4,tN.build()];case 4:return[4,nt.apply(void 0,e.concat([a.sent()]))];case 5:a.sent();r=["Staging build artifacts"];return[4,tN.stageBuildDirectory()];case 6:return[4,nt.apply(void 0,r.concat([a.sent()]))];case 7:a.sent();return[3,9];case 8:i=a.sent();throw G.error("Error building and staging ".concat(W,": ").concat(i.message)),i;case 9:o=["Executing lint-staged"];return[4,tN.lintStaged()];case 10:return[4,nt.apply(void 0,o.concat([a.sent()]))];case 11:a.sent(),nc();return[2]}})});return nl.apply(this,arguments)}function nf(){return np.apply(this,arguments)}function np(){np=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Inspecting ESLint configuration"];return[4,tN.eslintInspect()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return np.apply(this,arguments)}function nd(){return nh.apply(this,arguments)}function nh(){nh=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tX()];case 1:t.sent();return[4,Promise.all([ne(),ni()])];case 2:t.sent(),nc();return[2]}})});return nh.apply(this,arguments)}function nv(){return ny.apply(this,arguments)}function ny(){ny=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tX()];case 1:t.sent();return[4,Promise.all([ne(),ni(!0)])];case 2:t.sent(),nc();return[2]}})});return ny.apply(this,arguments)}function nm(){return ng.apply(this,arguments)}function ng(){ng=i(function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,tX()];case 1:n.sent();t=["Validating commit message"];return[4,tN.commitLint()];case 2:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 3:n.sent(),nc();return[2]}})});return ng.apply(this,arguments)}function nb(){return nw.apply(this,arguments)}function nw(){nw=i(function(){var t,n,e,r;return v(this,function(i){switch(i.label){case 0:t=["Configuring Git hooks"];return[4,tN.configureGitHook()];case 1:return[4,nt.apply(void 0,t.concat([i.sent()]))];case 2:i.sent(),D(t_.GIT_HOOK);return[4,t7(tT)];case 3:n=i.sent();P(t_.SIMPLE_GIT_HOOKS_JSON,n,{isJson:!0});e="\n".concat(Q,"\n");A(t_.GIT_IGNORE)?R(t_.GIT_IGNORE).split("\n").includes(Q)||x(t_.GIT_IGNORE,e):P(t_.GIT_IGNORE,e);r=["Setting up simple-git-hooks"];return[4,tN.simpleGitHooks()];case 4:return[4,nt.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})});return nw.apply(this,arguments)}function nI(){return nS.apply(this,arguments)}function nS(){nS=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tF([W],{update:!0,postInstallActions:[nb]})];case 1:t.sent();return[2]}})});return nS.apply(this,arguments)}function nE(){return nO.apply(this,arguments)}function nO(){nO=i(function(){return v(this,function(t){switch(t.label){case 0:D(t_.NODE_MODULES,t_.PNPM_LOCK_YAML);return[4,tx()];case 1:t.sent();return[4,nb()];case 2:t.sent();return[2]}})});return nO.apply(this,arguments)}function n_(){return nT.apply(this,arguments)}function nT(){nT=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Inspecting project dependencies"];return[4,tN.nodeModulesInspect()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nT.apply(this,arguments)}function nC(){return nk.apply(this,arguments)}function nk(){nk=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Running unit tests"];return[4,tN.testUnit()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nk.apply(this,arguments)}function nG(){return nN.apply(this,arguments)}function nN(){nN=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Running end-to-end tests"];return[4,tN.testE2e()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nN.apply(this,arguments)}i(function(){var t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,g(m(y.argv)).scriptName(te).usage("$0 <command> [options]").command("lint","Check code for linting issues",nd).command("lint:fix","Fix linting issues automatically",nv).command("lint:inspect","View active ESLint configuration",nf).command("lint-staged","Run lint checks on staged files",nu).command("commitlint","Validate commit message format",nm).command("setup","Initialize project setup and dependencies",nI).command("reset","Reset the project and reinstall dependencies",nE).command("inspect","Analyze installed project dependencies",n_).command("test:unit","Run unit test suite",nC).command("test:e2e","Run end-to-end test suite",nG).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:n.sent();return[3,3];case 2:t=n.sent();G.error("Fatal: ".concat(t.message)),y.exit(1);return[3,3];case 3:return[2]}})})();
|
|
2
|
+
function t(t,n){if(n==null||n>t.length)n=t.length;for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function n(t){if(Array.isArray(t))return t}function e(n){if(Array.isArray(n))return t(n)}function r(t,n,e,r,i,o,a){try{var c=t[o](a);var s=c.value}catch(t){e(t);return}if(c.done){n(s)}else{Promise.resolve(s).then(r,i)}}function i(t){return function(){var n=this,e=arguments;return new Promise(function(i,o){var a=t.apply(n,e);function c(t){r(a,i,o,c,s,"next",t)}function s(t){r(a,i,o,c,s,"throw",t)}c(undefined)})}}function o(t,n,e){if(n in t){Object.defineProperty(t,n,{value:e,enumerable:true,configurable:true,writable:true})}else{t[n]=e}return t}function a(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,n){var e=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(e==null)return;var r=[];var i=true;var o=false;var a,c;try{for(e=e.call(t);!(i=(a=e.next()).done);i=true){r.push(a.value);if(n&&r.length===n)break}}catch(t){o=true;c=t}finally{try{if(!i&&e["return"]!=null)e["return"]()}finally{if(o)throw c}}return r}function s(){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(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};var r=Object.keys(e);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))}r.forEach(function(n){o(t,n,e[n])})}return t}function f(t,e){return n(t)||c(t,e)||h(t,e)||s()}function p(t){return e(t)||a(t)||h(t)||u()}function d(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function h(n,e){if(!n)return;if(typeof n==="string")return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);if(r==="Object"&&n.constructor)r=n.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 t(n,e)}function v(t,n){var e,r,i,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(n){return s([t,n])}}function s(c){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(o=0)),o)try{if(e=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;r=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(c[0]===6&&o.label<i[1]){o.label=i[1];i=c;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(c);break}if(i[2])o.ops.pop();o.trys.pop();continue}c=n.call(t,o)}catch(t){c=[6,t];r=0}finally{e=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}import y from"node:process";import{hideBin as m}from"yargs/helpers";import g from"yargs/yargs";import b from"../../package-KSSCGX3B.json";import{exec as w}from"node:child_process";import I from"node:process";import*as S from"node:util";import E from"node:process";var O=E.env.DEBUG==="true";import _ from"chalk";import C from"consola";import{GraphQLError as T}from"graphql";O||(C.level=4);function k(t){var n=_[t];return typeof n=="function"?n:_.green}var G={silent:C.silent,level:C.level,fatal:C.fatal,error:C.error,warn:C.warn,log:C.log,info:C.info,success:C.success,ready:C.ready,start:C.start,box:C.box,debug:C.debug,trace:C.trace,verbose:C.verbose,printBoxedLog:function t(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(n===null||n===void 0?void 0:n.length)){C.box(_.green(t));return}n.forEach(function(t){var n=t.file,r=t.position,i=t.rule,o=t.message;C.log("".concat(_.gray("File:")," ").concat(_.blue("".concat(n).concat(r?":".concat(r):"")))),i&&C.log(" ".concat(k(e)("Rule:")," ").concat(i)),C.log(" ".concat(k(e)("Message:")," ").concat(o))}),C.box(k(e)("".concat(t," : ").concat(n.length))),C.log(_.gray("─".repeat(40)))}};var N={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import j from"node-fetch";import*as L from"node:fs";function A(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}return n.every(function(t){return L.existsSync(t)})}function R(t,n){var e=L.readFileSync(t,"utf-8");if(n===null||n===void 0?void 0:n.asJson)try{var r=JSON.parse(e);if((typeof r==="undefined"?"undefined":d(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(n){throw new Error("Failed to parse JSON from file: ".concat(t))}return e}function P(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=e.isJson,i=r===void 0?!1:r,o=i&&(typeof n==="undefined"?"undefined":d(n))=="object"?JSON.stringify(n,null,4):String(n);L.writeFileSync(t,o,"utf-8")}function x(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=e.isJson,i=r===void 0?!1:r,o=i&&(typeof n==="undefined"?"undefined":d(n))=="object"?JSON.stringify(n,null,4):String(n);L.appendFileSync(t,o,"utf-8")}function D(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}n.forEach(function(t){A(t)&&L.rmSync(t,{recursive:!0,force:!0})})}import F from"node:process";import*as M from"node:path";function U(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var r;return(r=M).resolve.apply(r,[K].concat(p(n)))}function J(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var r;return(r=M).join.apply(r,p(n))}var K=F.env.INIT_CWD||F.cwd(),W="@cyberskill/shared",B=".cyberskill-storage",H="node_modules",Y="dist",$="package.json",V="package-lock.json",z="tsconfig.json",q=".gitignore",Q=".simple-git-hooks.json",X="pnpm-lock.yaml",Z=".git/hooks/",tt=".git/COMMIT_EDITMSG",tn=J(K,H,W,Y),te="cyberskill",tr="src/nodejs/cli/index.ts",ti="eslint",to="eslint",ta="vitest",tc="playwright",ts="vitest",tu="@commitlint/cli",tl="commitlint",tf="lint-staged",tp="lint-staged",td="typescript",th="tsc",tv="tsx",ty="git",tm="pnpm",tg="pnpm exec",tb="simple-git-hooks",tw="simple-git-hooks",tI="@eslint/config-inspector",tS="eslint-config-inspector",tE="node-modules-inspector",tO="node-modules-inspector",t_={CYBERSKILL_DIRECTORY:tn,WORKING_DIRECTORY:K,TS_CONFIG:U(z),GIT_IGNORE:U(q),GIT_HOOK:U(Z),GIT_COMMIT_MSG:U(tt),SIMPLE_GIT_HOOKS_JSON:U(Q),PACKAGE_JSON:U($),PACKAGE_LOCK_JSON:U(V),PNPM_LOCK_YAML:U(X),NODE_MODULES:U(H),LINT_STAGED_CONFIG:U("".concat(tn,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:U("".concat(tn,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:U("".concat(tn,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:U("".concat(tn,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:U("".concat(tn,"/react/vitest/vitest.e2e.js"))};function tC(t){var n=t.isCurrentProject;return l({"pre-commit":tp,"commit-msg":tl},n&&{"pre-push":t5("".concat(ty," pull"))})}function tT(t){return tk.apply(this,arguments)}function tk(){tk=i(function(t){var n,e,r,i,o,a;var c=arguments;return v(this,function(s){switch(s.label){case 0:for(n=c.length,e=new Array(n>1?n-1:0),r=1;r<n;r++){e[r-1]=c[r]}i=f(e,2),o=i[0],a=i[1];if(!o)throw new Error("'first' argument is undefined");switch(t){case"CLI":return[3,1];case"RAW":return[3,3]}return[3,4];case 1:return[4,tF(o.split(" "),{update:!0})];case 2:return[2,(s.sent(),t8(t5("".concat(tg," ").concat(a))))];case 3:return[2,t8(t5(o))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tk.apply(this,arguments)}function tG(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++){e[r-1]=arguments[r]}return /*#__PURE__*/i(function(){return v(this,function(n){return[2,tT.apply(void 0,[t].concat(p(e)))]})})}var tN={simpleGitHooks:tG("CLI",tb,tw),eslintInspect:tG("CLI",tI,tS),nodeModulesInspect:tG("CLI",tE,tO),eslintCheck:tG("CLI",ti,"".concat(to," ").concat(t_.WORKING_DIRECTORY)),eslintFix:tG("CLI",ti,"".concat(to," ").concat(t_.WORKING_DIRECTORY," --fix")),typescriptCheck:tG("CLI",td,"".concat(th," -p ").concat(t_.TS_CONFIG," --noEmit")),configureGitHook:tG("RAW","".concat(ty," config core.hooksPath ").concat(t_.GIT_HOOK)),testUnit:tG("CLI",ta,"".concat(ts," --config ").concat(t_.UNIT_TEST_CONFIG)),testE2e:tG("CLI","".concat(ta," ").concat(tc),"".concat(ts," --config ").concat(t_.E2E_TEST_CONFIG)),commitLint:tG("CLI",tu,"".concat(tl," --edit ").concat(t_.GIT_COMMIT_MSG," --config ").concat(t_.COMMITLINT_CONFIG)),lintStaged:tG("CLI",tf,"".concat(tp," --config ").concat(t_.LINT_STAGED_CONFIG)),stageBuildDirectory:tG("RAW","".concat(ty," add ").concat(Y)),build:tG("RAW","".concat(tm," run build")),pnpmInstallStandard:tG("RAW","".concat(tm," install")),pnpmInstallLegacy:tG("RAW","".concat(tm," install --legacy-peer-deps")),pnpmInstallForce:tG("RAW","".concat(tm," install --force"))};function tj(t){var n=J(K,$);if(!A(n))return!1;try{var e=R(n,{asJson:!0}),r=e.name,i=e.dependencies,o=i===void 0?{}:i,a=e.devDependencies,c=a===void 0?{}:a,s=r===t,u=t in o,l=t in c;return s||u||l?{path:n,file:e,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(t){return G.warn("Failed to read package.json: ".concat(t.message)),!1}}function tL(t){return tA.apply(this,arguments)}function tA(){tA=i(function(t){var n,e,r,i;return v(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,j("https://registry.npmjs.org/".concat(t,"/latest"))];case 1:n=o.sent();if(!n.ok)throw new Error("Failed to fetch latest version: ".concat(n.status," ").concat(n.statusText));return[4,n.json()];case 2:e=o.sent(),r=e.version;return[2,r];case 3:i=o.sent();throw G.error('Failed to fetch version for "'.concat(t,'": ').concat(i.message)),i;case 4:return[2]}})});return tA.apply(this,arguments)}function tR(t,n){return tP.apply(this,arguments)}function tP(){tP=i(function(t,n){var e,r,i,o,a,c,s,u,f,p,d,h,y,m,g,b,w,I,S,E,O;return v(this,function(v){switch(v.label){case 0:v.trys.push([0,4,,5]);e=tj(t);if(!e)return[2,l({},N)];s=e.path,u=e.file,f=e.isCurrentProject,p=e.isDepend,d=e.isDevDepend,h=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(i=u.devDependencies)!==null&&i!==void 0?i:{},m=f?(o=u.version)!==null&&o!==void 0?o:"0.0.0":p?(a=h[t])!==null&&a!==void 0?a:"0.0.0":d?(c=y[t])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=m;return[3,3];case 1:return[4,tL(t)];case 2:w=v.sent();v.label=3;case 3:g=w,b=f||m===g;if(!b&&(n===null||n===void 0?void 0:n.update)){;S=p?"dependencies":d?"devDependencies":null;S&&((I=u[S])===null||I===void 0?void 0:I[t])!==g&&(u[S]=(E=u[S])!==null&&E!==void 0?E:{},u[S][t]=g,P(s,u,{isJson:!0}),G.info('Updated "'.concat(t,'" to version ').concat(g)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:b}];case 4:O=v.sent();return[2,(G.error('Error checking package "'.concat(t,'": ').concat(O.message)),l({},N))];case 5:return[2]}})});return tP.apply(this,arguments)}function tx(){return tD.apply(this,arguments)}function tD(){tD=i(function(){var t,n,e,r,i,o,a,c,s,u,l,f;return v(this,function(p){switch(p.label){case 0:t=[{command:function(){return tN.pnpmInstallStandard()},message:"Installing dependencies (standard)"},{command:function(){return tN.pnpmInstallLegacy()},message:"Retrying with legacy peer dependencies"},{command:function(){return tN.pnpmInstallForce()},message:"Retrying with force install"}];n=true,e=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);i=t[Symbol.iterator]();p.label=2;case 2:if(!!(n=(o=i.next()).done))return[3,8];a=o.value,c=a.command,s=a.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,nt("".concat(s," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();G.warn("Installation attempt failed: ".concat(s)),G.error("Details: ".concat(l.message));return[3,7];case 7:n=true;return[3,2];case 8:return[3,11];case 9:f=p.sent();e=true;r=f;return[3,11];case 10:try{if(!n&&i.return!=null){i.return()}}finally{if(e){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return tD.apply(this,arguments)}function tF(t,n){return tM.apply(this,arguments)}function tM(){tM=i(function(t,n){var e,r,i,o,a,c,s,u,f,d,h;return v(this,function(v){switch(v.label){case 0:if(!A(t_.PACKAGE_JSON)){G.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);e=p(new Set(t)).sort();return[4,Promise.all(e.map(function(t){return tR(t,l({},(n===null||n===void 0?void 0:n.update)&&{update:n.update}))}))];case 2:r=v.sent().every(function(t){return t.isUpToDate});if(r)return[3,4];return[4,tx()];case 3:r=v.sent();v.label=4;case 4:r;o=true,a=false,c=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((i=n===null||n===void 0?void 0:n.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();v.label=6;case 6:if(!!(o=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=v.sent();a=true;c=d;return[3,12];case 11:try{if(!o&&s.return!=null){s.return()}}finally{if(a){throw c}}return[7];case 12:return[3,14];case 13:h=v.sent();throw G.error('Failed to setup "'.concat(t.join(", "),'": ').concat(h.message)),h;case 14:return[2]}})});return tM.apply(this,arguments)}import tU from"node-persist";import tJ from"node:os";import tK from"node:process";function tW(){return tK.env.CYBERSKILL_STORAGE_DIR||J(tJ.homedir(),B)}function tB(){return tH.apply(this,arguments)}function tH(){tH=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=tU.defaultInstance;if(t)return[3,2];return[4,tU.init({dir:tW(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:t=n.sent();n.label=2;case 2:t;return[2]}})});return tH.apply(this,arguments)}var tY={get:function t(t){return i(function(){var n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tB()];case 1:r.sent();return[4,tU.getItem(t)];case 2:return[2,(n=r.sent())!==null&&n!==void 0?n:null];case 3:e=r.sent();return[2,(G.error('[Storage:get] Error getting key "'.concat(t,'":'),e),null)];case 4:return[2]}})})()},set:function t(t,n){return i(function(){var e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tB()];case 1:r.sent();return[4,tU.setItem(t,n)];case 2:r.sent();return[3,4];case 3:e=r.sent();G.error('[Storage:set] Error setting key "'.concat(t,'":'),e);return[3,4];case 4:return[2]}})})()},remove:function t(t){return i(function(){var n;return v(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,tB()];case 1:e.sent();return[4,tU.removeItem(t)];case 2:e.sent();return[3,4];case 3:n=e.sent();G.error('[Storage:remove] Error removing key "'.concat(t,'":'),n);return[3,4];case 4:return[2]}})})()},keys:function t(){return i(function(){var t,n;return v(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,tB()];case 1:e.sent();return[4,tU.keys()];case 2:t=e.sent();return[2,Array.isArray(t)?t:(G.warn("[Storage:keys] Invalid keys response:",t),[])];case 3:n=e.sent();return[2,(G.error("[Storage:keys] Error getting keys:",n),[])];case 4:return[2]}})})()},getLogLink:function t(t){return i(function(){return v(this,function(n){try{return[2,"".concat(tW()," (key: ").concat(t,")")]}catch(t){return[2,(G.error("[Storage:getLogLink] Error getting log link:",t),null)]}return[2]})})()}};var t$=S.promisify(w);function tV(t){return"error_list:".concat(t)}function tz(t){return tq.apply(this,arguments)}function tq(){tq=i(function(t){var n,e,r;return v(this,function(o){switch(o.label){case 0:if(t.length===0)return[2];n=Date.now(),e=tV(n);o.label=1;case 1:o.trys.push([1,3,,4]);return[4,tY.set(e,{errors:t,timestamp:n})];case 2:o.sent(),setTimeout(/*#__PURE__*/i(function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,tY.getLogLink(e)];case 1:t=n.sent();t&&G.info("\uD83D\uDCC2 Open the error list manually: ".concat(t));return[2]}})}),10);return[3,4];case 3:r=o.sent();G.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tq.apply(this,arguments)}function tQ(){return tX.apply(this,arguments)}function tX(){tX=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tY.keys()];case 1:t=r.sent(),n=Array.isArray(t)?t.filter(function(t){var n;return t===null||t===void 0?void 0:(n=t.startsWith)===null||n===void 0?void 0:n.call(t,"error_list:")}):[];return[4,Promise.all(n.map(/*#__PURE__*/function(){var t=i(function(t){var n;return v(this,function(e){switch(e.label){case 0:return[4,tY.get(t)];case 1:return[2,((n=e.sent())===null||n===void 0?void 0:n.errors)||[]]}})});return function(n){return t.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:e=r.sent();return[2,(G.error("Failed to retrieve stored errors: ".concat(e.message)),[])];case 4:return[2]}})});return tX.apply(this,arguments)}function tZ(){return t0.apply(this,arguments)}function t0(){t0=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tY.keys()];case 1:t=r.sent(),n=Array.isArray(t)?t.filter(function(t){var n;return t===null||t===void 0?void 0:(n=t.startsWith)===null||n===void 0?void 0:n.call(t,"error_list:")}):[];return[4,Promise.all(n.map(function(t){return tY.remove(t)}))];case 2:r.sent();return[3,4];case 3:e=r.sent();G.error("Failed to clear error lists: ".concat(e.message));return[3,4];case 4:return[2]}})});return t0.apply(this,arguments)}function t1(t){var n=[],e=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;t.split("\n").forEach(function(t){if(t.startsWith("/"))r=t.trim();else{var c,s,u,l,f;var p=i.exec(t)||[],d=o.exec(t)||[],h=a.exec(t)||[];var v,y,m,g,b,w;p.length&&r?n.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]==="error"?"error":"warning",message:(v=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:"",rule:(y=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&y!==void 0?y:""}):d.length?n.push({file:(m=d===null||d===void 0?void 0:d[1])!==null&&m!==void 0?m:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]==="error"?"error":"warning",message:(g=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&g!==void 0?g:""}):h.length?n.push({file:"commitlint",type:"error",message:(b=h===null||h===void 0?void 0:(l=h[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=h===null||h===void 0?void 0:(f=h[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):e.push(t.trim())}}),n.length&&tz(n),O&&e.length&&(G.warn("Unmatched lines:"),e.forEach(function(t){return G.info(" ".concat(t))}))}function t4(t){try{var n=JSON.parse(t),e=[];n.forEach(function(t){var n=t.filePath,r=t.messages;r.forEach(function(t){var r=t.severity,i=t.line,o=t.column,a=t.ruleId,c=t.message;e.push({type:r===2?"error":"warning",file:n,position:"".concat(i,":").concat(o),rule:a,message:c})})}),e.length&&tz(e)}catch(n){t1(t)}}function t2(t){return t3.apply(this,arguments)}function t3(){t3=i(function(t){var n,e,r,i,o,a,c,s,u;var l=arguments;return v(this,function(f){switch(f.label){case 0:n=l.length>1&&l[1]!==void 0?l[1]:t4;e=new AbortController;I.on("SIGINT",function(){G.warn("Process interrupted. Terminating..."),e.abort(),I.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,t$(t,{maxBuffer:0x6400000,signal:e.signal})];case 2:r=f.sent(),i=r.stdout,o=r.stderr;[i,o].forEach(function(t){return t&&n(t)});return[3,4];case 3:a=f.sent();c=a.stdout,s=a.stderr,u=a.message;[c,s].forEach(function(t){return t&&n(t)}),!s&&!c&&G.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return t3.apply(this,arguments)}function t5(t){return{raw:!0,cmd:t}}function t6(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tg," ").concat(W," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tg," ").concat(tv," ").concat(tr," ").concat(t):"".concat(tg," ").concat(te," ").concat(t)}function t8(t,n){return typeof t=="function"?t6(t(n),n):(typeof t==="undefined"?"undefined":d(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?t6(t,n):t}function t7(t){return t9.apply(this,arguments)}function t9(){t9=i(function(t){var n,e,r,i,o,a,c;var s=arguments;return v(this,function(u){switch(u.label){case 0:n=s.length>1&&s[1]!==void 0?s[1]:{};r=(e=n===null||n===void 0?void 0:n.isRemote)!==null&&e!==void 0?e:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,tR(W)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:i=c,o={isRemote:r,isCurrentProject:i},a=typeof t=="function"?t(o):t;return[2,Object.fromEntries(Object.entries(a).map(function(t){var n=f(t,2),e=n[0],r=n[1];return[e,t8(r,o)]}))]}})});return t9.apply(this,arguments)}function nt(t,n){return nn.apply(this,arguments)}function nn(){nn=i(function(t,n){var e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);G.start("".concat(t)),O&&G.info("→ ".concat(n));return[4,t2(n)];case 1:r.sent(),G.success("".concat(t," done."));return[3,3];case 2:e=r.sent();throw G.error("".concat(t," failed: ").concat(e.message)),e;case 3:return[2]}})});return nn.apply(this,arguments)}function ne(){return nr.apply(this,arguments)}function nr(){nr=i(function(){var t,n;return v(this,function(e){switch(e.label){case 0:if(!A(t_.TS_CONFIG))return[3,3];n=["Performing TypeScript validation"];return[4,tN.typescriptCheck()];case 1:return[4,nt.apply(void 0,n.concat([e.sent()]))];case 2:t=e.sent();return[3,4];case 3:t=G.warn("No TypeScript configuration found. Skipping type check.");e.label=4;case 4:t;return[2]}})});return nr.apply(this,arguments)}function ni(){return no.apply(this,arguments)}function no(){no=i(function(){var t,n,e,r;var i=arguments;return v(this,function(o){switch(o.label){case 0:t=i.length>0&&i[0]!==void 0?i[0]:!1;if(!t)return[3,3];e=["Running ESLint with auto-fix"];return[4,tN.eslintFix()];case 1:return[4,nt.apply(void 0,e.concat([o.sent()]))];case 2:n=o.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tN.eslintCheck()];case 4:return[4,nt.apply(void 0,r.concat([o.sent()]))];case 5:n=o.sent();o.label=6;case 6:n;return[2]}})});return no.apply(this,arguments)}function na(t,n){if(!n.length)return;var e=t==="Errors"?"red":"yellow";G.printBoxedLog(t==="Errors"?"✖ Errors":"⚠ Warnings",n,e)}function nc(){return ns.apply(this,arguments)}function ns(){ns=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:return[4,tQ()];case 1:t=r.sent(),n=t.filter(function(t){return t.type==="error"}),e=t.filter(function(t){return t.type==="warning"});!n.length&&!e.length?G.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(na("Warnings",e),na("Errors",n));return[2]}})});return ns.apply(this,arguments)}function nu(){return nl.apply(this,arguments)}function nl(){nl=i(function(){var t,n,e,r,i,o;return v(this,function(a){switch(a.label){case 0:return[4,tZ()];case 1:a.sent();return[4,tR(W)];case 2:t=a.sent(),n=t.isCurrentProject;if(!n)return[3,9];a.label=3;case 3:a.trys.push([3,8,,9]);e=["Building package: ".concat(W)];return[4,tN.build()];case 4:return[4,nt.apply(void 0,e.concat([a.sent()]))];case 5:a.sent();r=["Staging build artifacts"];return[4,tN.stageBuildDirectory()];case 6:return[4,nt.apply(void 0,r.concat([a.sent()]))];case 7:a.sent();return[3,9];case 8:i=a.sent();throw G.error("Error building and staging ".concat(W,": ").concat(i.message)),i;case 9:o=["Executing lint-staged"];return[4,tN.lintStaged()];case 10:return[4,nt.apply(void 0,o.concat([a.sent()]))];case 11:a.sent(),nc();return[2]}})});return nl.apply(this,arguments)}function nf(){return np.apply(this,arguments)}function np(){np=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Inspecting ESLint configuration"];return[4,tN.eslintInspect()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return np.apply(this,arguments)}function nd(){return nh.apply(this,arguments)}function nh(){nh=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tZ()];case 1:t.sent();return[4,Promise.all([ne(),ni()])];case 2:t.sent(),nc();return[2]}})});return nh.apply(this,arguments)}function nv(){return ny.apply(this,arguments)}function ny(){ny=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tZ()];case 1:t.sent();return[4,Promise.all([ne(),ni(!0)])];case 2:t.sent(),nc();return[2]}})});return ny.apply(this,arguments)}function nm(){return ng.apply(this,arguments)}function ng(){ng=i(function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,tZ()];case 1:n.sent();t=["Validating commit message"];return[4,tN.commitLint()];case 2:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 3:n.sent(),nc();return[2]}})});return ng.apply(this,arguments)}function nb(){return nw.apply(this,arguments)}function nw(){nw=i(function(){var t,n,e,r;return v(this,function(i){switch(i.label){case 0:t=["Configuring Git hooks"];return[4,tN.configureGitHook()];case 1:return[4,nt.apply(void 0,t.concat([i.sent()]))];case 2:i.sent(),D(t_.GIT_HOOK);return[4,t7(tC)];case 3:n=i.sent();P(t_.SIMPLE_GIT_HOOKS_JSON,n,{isJson:!0});e="\n".concat(Q,"\n");A(t_.GIT_IGNORE)?R(t_.GIT_IGNORE).split("\n").includes(Q)||x(t_.GIT_IGNORE,e):P(t_.GIT_IGNORE,e);r=["Setting up simple-git-hooks"];return[4,tN.simpleGitHooks()];case 4:return[4,nt.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})});return nw.apply(this,arguments)}function nI(){return nS.apply(this,arguments)}function nS(){nS=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tF([W],{update:!0,postInstallActions:[nb]})];case 1:t.sent();return[2]}})});return nS.apply(this,arguments)}function nE(){return nO.apply(this,arguments)}function nO(){nO=i(function(){return v(this,function(t){switch(t.label){case 0:D(t_.NODE_MODULES,t_.PNPM_LOCK_YAML);return[4,tx()];case 1:t.sent();return[4,nb()];case 2:t.sent();return[2]}})});return nO.apply(this,arguments)}function n_(){return nC.apply(this,arguments)}function nC(){nC=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Inspecting project dependencies"];return[4,tN.nodeModulesInspect()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nC.apply(this,arguments)}function nT(){return nk.apply(this,arguments)}function nk(){nk=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Running unit tests"];return[4,tN.testUnit()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nk.apply(this,arguments)}function nG(){return nN.apply(this,arguments)}function nN(){nN=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Running end-to-end tests"];return[4,tN.testE2e()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nN.apply(this,arguments)}i(function(){var t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,g(m(y.argv)).scriptName(te).usage("$0 <command> [options]").command("lint","Check code for linting issues",nd).command("lint:fix","Fix linting issues automatically",nv).command("lint:inspect","View active ESLint configuration",nf).command("lint-staged","Run lint checks on staged files",nu).command("commitlint","Validate commit message format",nm).command("setup","Initialize project setup and dependencies",nI).command("reset","Reset the project and reinstall dependencies",nE).command("inspect","Analyze installed project dependencies",n_).command("test:unit","Run unit test suite",nT).command("test:e2e","Run end-to-end test suite",nG).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:n.sent();return[3,3];case 2:t=n.sent();G.error("Fatal: ".concat(t.message)),y.exit(1);return[3,3];case 3:return[2]}})})();
|
|
@@ -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,a,i,o){try{var c=e[i](o);var s=c.value}catch(e){n(e);return}if(c.done){t(s)}else{Promise.resolve(s).then(r,a)}}function a(e){return function(){var t=this,n=arguments;return new Promise(function(a,i){var o=e.apply(t,n);function c(e){r(o,a,i,c,s,"next",e)}function s(e){r(o,a,i,c,s,"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 a=true;var i=false;var o,c;try{for(n=n.call(e);!(a=(o=n.next()).done);a=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!a&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function s(){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 f(e,n){return t(e)||c(e,n)||h(e,n)||s()}function p(e){return n(e)||o(e)||h(e)||u()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function h(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 v(e,t){var n,r,a,i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[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 s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(a=c[0]&2?r["return"]:c[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;if(r=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=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(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){i.label=c[1];break}if(c[0]===6&&i.label<a[1]){i.label=a[1];a=c;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(c);break}if(a[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var y=Object.create;var g=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var O=function(e,t,n,r){var a=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":d(t))=="object"||typeof t=="function")try{var c=function(){var a=u.value;!I.call(e,a)&&a!==n&&g(e,a,{get:function(){return t[a]},enumerable:!(r=m(t,a))||r.enumerable})};for(var s=b(t)[Symbol.iterator](),u;!(a=(u=s.next()).done);a=true)c()}catch(e){i=true;o=e}finally{try{if(!a&&s.return!=null){s.return()}}finally{if(i){throw o}}}return e};var S=function(e,t,n){return n=e!=null?y(w(e)):{},O(t||!e||!e.__esModule?g(n,"default",{value:e,enumerable:!0}):n,e)},E=function(e){return O(g({},"__esModule",{value:!0}),e)};var _={};module.exports=E(_);var T=S(require("process"),1),C=require("yargs/helpers"),k=S(require("yargs/yargs"),1),j=S(require("../../package-MZ24VJKI.json"),1);var N=require("child_process"),G=S(require("process"),1),P=S(require("util"),1);var A=S(require("process"),1),L=A.default.env.DEBUG==="true";var R=S(require("chalk"),1),x=S(require("consola"),1),D=require("graphql");L||(x.default.level=4);function F(e){var t=R.default[e];return typeof t=="function"?t:R.default.green}var M={silent:x.default.silent,level:x.default.level,fatal:x.default.fatal,error:x.default.error,warn:x.default.warn,log:x.default.log,info:x.default.info,success:x.default.success,ready:x.default.ready,start:x.default.start,box:x.default.box,debug:x.default.debug,trace:x.default.trace,verbose:x.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)){x.default.box(R.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,a=e.rule,i=e.message;x.default.log("".concat(R.default.gray("File:")," ").concat(R.default.blue("".concat(t).concat(r?":".concat(r):"")))),a&&x.default.log(" ".concat(F(n)("Rule:")," ").concat(a)),x.default.log(" ".concat(F(n)("Message:")," ").concat(i))}),x.default.box(F(n)("".concat(e," : ").concat(t.length))),x.default.log(R.default.gray("─".repeat(40)))}};var U={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var J=S(require("node-fetch"),1);var q=S(require("fs"),1);function K(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return q.existsSync(e)})}function W(e,t){var n=q.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":d(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}function B(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,a=r===void 0?!1:r,i=a&&(typeof t==="undefined"?"undefined":d(t))=="object"?JSON.stringify(t,null,4):String(t);q.writeFileSync(e,i,"utf-8")}function H(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,a=r===void 0?!1:r,i=a&&(typeof t==="undefined"?"undefined":d(t))=="object"?JSON.stringify(t,null,4):String(t);q.appendFileSync(e,i,"utf-8")}function Y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){K(e)&&q.rmSync(e,{recursive:!0,force:!0})})}var $=S(require("process"),1);var V=S(require("path"),1);function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).resolve.apply(r,[Q].concat(p(t)))}function Z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).join.apply(r,p(t))}var Q=$.default.env.INIT_CWD||$.default.cwd(),X="@cyberskill/shared",ee=".cyberskill-storage",et="node_modules",en="dist",er="package.json",ea="package-lock.json",ei="tsconfig.json",eo=".gitignore",ec=".simple-git-hooks.json",es="pnpm-lock.yaml",eu=".git/hooks/",el=".git/COMMIT_EDITMSG",ef=Z(Q,et,X,en),ep="cyberskill",ed="src/nodejs/cli/index.ts",eh="eslint",ev="eslint",ey="vitest",eg="playwright",em="vitest",eb="@commitlint/cli",ew="commitlint",eI="lint-staged",eO="lint-staged",eS="typescript",eE="tsc",e_="tsx",eT="git",eC="pnpm",ek="pnpm exec",ej="simple-git-hooks",eN="simple-git-hooks",eG="@eslint/config-inspector",eP="eslint-config-inspector",eA="node-modules-inspector",eL="node-modules-inspector",eR={CYBERSKILL_DIRECTORY:ef,WORKING_DIRECTORY:Q,TS_CONFIG:z(ei),GIT_IGNORE:z(eo),GIT_HOOK:z(eu),GIT_COMMIT_MSG:z(el),SIMPLE_GIT_HOOKS_JSON:z(ec),PACKAGE_JSON:z(er),PACKAGE_LOCK_JSON:z(ea),PNPM_LOCK_YAML:z(es),NODE_MODULES:z(et),LINT_STAGED_CONFIG:z("".concat(ef,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:z("".concat(ef,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:z("".concat(ef,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:z("".concat(ef,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:z("".concat(ef,"/react/vitest/vitest.e2e.js"))};function ex(e){var t=e.isCurrentProject;return l({"pre-commit":eO,"commit-msg":ew},t&&{"pre-push":ti("".concat(eT," pull"))})}function eD(e){return eF.apply(this,arguments)}function eF(){eF=a(function(e){var t,n,r,a,i,o;var c=arguments;return v(this,function(s){switch(s.label){case 0:for(t=c.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=c[r]}a=f(n,2),i=a[0],o=a[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case"CLI":return[3,1];case"RAW":return[3,3]}return[3,4];case 1:return[4,e$(i.split(" "),{update:!0})];case 2:return[2,(s.sent(),tc(ti("".concat(ek," ").concat(o))))];case 3:return[2,tc(ti(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return eF.apply(this,arguments)}function eM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return /*#__PURE__*/a(function(){return v(this,function(t){return[2,eD.apply(void 0,[e].concat(p(n)))]})})}var eU={simpleGitHooks:eM("CLI",ej,eN),eslintInspect:eM("CLI",eG,eP),nodeModulesInspect:eM("CLI",eA,eL),eslintCheck:eM("CLI",eh,"".concat(ev," ").concat(eR.WORKING_DIRECTORY)),eslintFix:eM("CLI",eh,"".concat(ev," ").concat(eR.WORKING_DIRECTORY," --fix")),typescriptCheck:eM("CLI",eS,"".concat(eE," -p ").concat(eR.TS_CONFIG," --noEmit")),configureGitHook:eM("RAW","".concat(eT," config core.hooksPath ").concat(eR.GIT_HOOK)),testUnit:eM("CLI",ey,"".concat(em," --config ").concat(eR.UNIT_TEST_CONFIG)),testE2e:eM("CLI","".concat(ey," ").concat(eg),"".concat(em," --config ").concat(eR.E2E_TEST_CONFIG)),commitLint:eM("CLI",eb,"".concat(ew," --edit ").concat(eR.GIT_COMMIT_MSG," --config ").concat(eR.COMMITLINT_CONFIG)),lintStaged:eM("CLI",eI,"".concat(eO," --config ").concat(eR.LINT_STAGED_CONFIG)),stageBuildDirectory:eM("RAW","".concat(eT," add ").concat(en)),build:eM("RAW","".concat(eC," run build")),pnpmInstallStandard:eM("RAW","".concat(eC," install")),pnpmInstallLegacy:eM("RAW","".concat(eC," install --legacy-peer-deps")),pnpmInstallForce:eM("RAW","".concat(eC," install --force"))};function eJ(e){var t=Z(Q,er);if(!K(t))return!1;try{var n=W(t,{asJson:!0}),r=n.name,a=n.dependencies,i=a===void 0?{}:a,o=n.devDependencies,c=o===void 0?{}:o,s=r===e,u=e in i,l=e in c;return s||u||l?{path:t,file:n,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return M.warn("Failed to read package.json: ".concat(e.message)),!1}}function eq(e){return eK.apply(this,arguments)}function eK(){eK=a(function(e){var t,n,r,a;return v(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,J.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:a=i.sent();throw M.error('Failed to fetch version for "'.concat(e,'": ').concat(a.message)),a;case 4:return[2]}})});return eK.apply(this,arguments)}function eW(e,t){return eB.apply(this,arguments)}function eB(){eB=a(function(e,t){var n,r,a,i,o,c,s,u,f,p,d,h,y,g,m,b,w,I,O,S,E;return v(this,function(v){switch(v.label){case 0:v.trys.push([0,4,,5]);n=eJ(e);if(!n)return[2,l({},U)];s=n.path,u=n.file,f=n.isCurrentProject,p=n.isDepend,d=n.isDevDepend,h=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(a=u.devDependencies)!==null&&a!==void 0?a:{},g=f?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=h[e])!==null&&o!==void 0?o:"0.0.0":d?(c=y[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=g;return[3,3];case 1:return[4,eq(e)];case 2:w=v.sent();v.label=3;case 3:m=w,b=f||g===m;if(!b&&(t===null||t===void 0?void 0:t.update)){;O=p?"dependencies":d?"devDependencies":null;O&&((I=u[O])===null||I===void 0?void 0:I[e])!==m&&(u[O]=(S=u[O])!==null&&S!==void 0?S:{},u[O][e]=m,B(s,u,{isJson:!0}),M.info('Updated "'.concat(e,'" to version ').concat(m)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:b}];case 4:E=v.sent();return[2,(M.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},U))];case 5:return[2]}})});return eB.apply(this,arguments)}function eH(){return eY.apply(this,arguments)}function eY(){eY=a(function(){var e,t,n,r,a,i,o,c,s,u,l,f;return v(this,function(p){switch(p.label){case 0:e=[{command:function(){return eU.pnpmInstallStandard()},message:"Installing dependencies (standard)"},{command:function(){return eU.pnpmInstallLegacy()},message:"Retrying with legacy peer dependencies"},{command:function(){return eU.pnpmInstallForce()},message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);a=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=a.next()).done))return[3,8];o=i.value,c=o.command,s=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tl("".concat(s," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();M.warn("Installation attempt failed: ".concat(s)),M.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=p.sent();n=true;r=f;return[3,11];case 10:try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return eY.apply(this,arguments)}function e$(e,t){return eV.apply(this,arguments)}function eV(){eV=a(function(e,t){var n,r,a,i,o,c,s,u,f,d,h;return v(this,function(v){switch(v.label){case 0:if(!K(eR.PACKAGE_JSON)){M.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return eW(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=v.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,eH()];case 3:r=v.sent();v.label=4;case 4:r;i=true,o=false,c=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((a=t===null||t===void 0?void 0:t.postInstallActions)!==null&&a!==void 0?a:[])[Symbol.iterator]();v.label=6;case 6:if(!!(i=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:d=v.sent();o=true;c=d;return[3,12];case 11:try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:h=v.sent();throw M.error('Failed to setup "'.concat(e.join(", "),'": ').concat(h.message)),h;case 14:return[2]}})});return eV.apply(this,arguments)}var ez=S(require("node-persist"),1),eZ=S(require("os"),1),eQ=S(require("process"),1);function eX(){return eQ.default.env.CYBERSKILL_STORAGE_DIR||Z(eZ.default.homedir(),ee)}function e0(){return e1.apply(this,arguments)}function e1(){e1=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=ez.default.defaultInstance;if(e)return[3,2];return[4,ez.default.init({dir:eX(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return e1.apply(this,arguments)}var e4={get:function e(e){return a(function(){var t,n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e0()];case 1:r.sent();return[4,ez.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(M.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return a(function(){var n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e0()];case 1:r.sent();return[4,ez.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();M.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return a(function(){var t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e0()];case 1:n.sent();return[4,ez.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();M.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return a(function(){var e,t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e0()];case 1:n.sent();return[4,ez.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(M.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(M.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return a(function(){return v(this,function(t){try{return[2,"".concat(eX()," (key: ").concat(e,")")]}catch(e){return[2,(M.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e2=P.promisify(N.exec);function e3(e){return"error_list:".concat(e)}function e5(e){return e6.apply(this,arguments)}function e6(){e6=a(function(e){var t,n,r;return v(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=e3(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,e4.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/a(function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,e4.getLogLink(n)];case 1:e=t.sent();e&&M.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();M.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return e6.apply(this,arguments)}function e8(){return e7.apply(this,arguments)}function e7(){e7=a(function(){var e,t,n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e4.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=a(function(e){var t;return v(this,function(n){switch(n.label){case 0:return[4,e4.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(M.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return e7.apply(this,arguments)}function e9(){return te.apply(this,arguments)}function te(){te=a(function(){var e,t,n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e4.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return e4.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();M.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return te.apply(this,arguments)}function tt(e){var t=[],n=[],r="",a=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,s,u,l,f;var p=a.exec(e)||[],d=i.exec(e)||[],h=o.exec(e)||[];var v,y,g,m,b,w;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]==="error"?"error":"warning",message:(v=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:"",rule:(y=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&y!==void 0?y:""}):d.length?t.push({file:(g=d===null||d===void 0?void 0:d[1])!==null&&g!==void 0?g:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]==="error"?"error":"warning",message:(m=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&m!==void 0?m:""}):h.length?t.push({file:"commitlint",type:"error",message:(b=h===null||h===void 0?void 0:(l=h[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=h===null||h===void 0?void 0:(f=h[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):n.push(e.trim())}}),t.length&&e5(t),L&&n.length&&(M.warn("Unmatched lines:"),n.forEach(function(e){return M.info(" ".concat(e))}))}function tn(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,a=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(a,":").concat(i),rule:o,message:c})})}),n.length&&e5(n)}catch(t){tt(e)}}function tr(e){return ta.apply(this,arguments)}function ta(){ta=a(function(e){var t,n,r,a,i,o,c,s,u;var l=arguments;return v(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tn;n=new AbortController;G.default.on("SIGINT",function(){M.warn("Process interrupted. Terminating..."),n.abort(),G.default.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,e2(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),a=r.stdout,i=r.stderr;[a,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:o=f.sent();c=o.stdout,s=o.stderr,u=o.message;[c,s].forEach(function(e){return e&&t(e)}),!s&&!c&&M.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return ta.apply(this,arguments)}function ti(e){return{raw:!0,cmd:e}}function to(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(ek," ").concat(X," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ek," ").concat(e_," ").concat(ed," ").concat(e):"".concat(ek," ").concat(ep," ").concat(e)}function tc(e,t){return typeof e=="function"?to(e(t),t):(typeof e==="undefined"?"undefined":d(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?to(e,t):e}function ts(e){return tu.apply(this,arguments)}function tu(){tu=a(function(e){var t,n,r,a,i,o,c;var s=arguments;return v(this,function(u){switch(u.label){case 0:t=s.length>1&&s[1]!==void 0?s[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,eW(X)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:a=c,i={isRemote:r,isCurrentProject:a},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=f(e,2),n=t[0],r=t[1];return[n,tc(r,i)]}))]}})});return tu.apply(this,arguments)}function tl(e,t){return tf.apply(this,arguments)}function tf(){tf=a(function(e,t){var n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);M.start("".concat(e)),L&&M.info("→ ".concat(t));return[4,tr(t)];case 1:r.sent(),M.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw M.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tf.apply(this,arguments)}function tp(){return td.apply(this,arguments)}function td(){td=a(function(){var e,t;return v(this,function(n){switch(n.label){case 0:if(!K(eR.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eU.typescriptCheck()];case 1:return[4,tl.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=M.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return td.apply(this,arguments)}function th(){return tv.apply(this,arguments)}function tv(){tv=a(function(){var e,t,n,r;var a=arguments;return v(this,function(i){switch(i.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eU.eslintFix()];case 1:return[4,tl.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eU.eslintCheck()];case 4:return[4,tl.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tv.apply(this,arguments)}function ty(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";M.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}function tg(){return tm.apply(this,arguments)}function tm(){tm=a(function(){var e,t,n;return v(this,function(r){switch(r.label){case 0:return[4,e8()];case 1:e=r.sent(),t=e.filter(function(e){return e.type==="error"}),n=e.filter(function(e){return e.type==="warning"});!t.length&&!n.length?M.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ty("Warnings",n),ty("Errors",t));return[2]}})});return tm.apply(this,arguments)}function tb(){return tw.apply(this,arguments)}function tw(){tw=a(function(){var e,t,n,r,a,i;return v(this,function(o){switch(o.label){case 0:return[4,e9()];case 1:o.sent();return[4,eW(X)];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(X)];return[4,eU.build()];case 4:return[4,tl.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eU.stageBuildDirectory()];case 6:return[4,tl.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:a=o.sent();throw M.error("Error building and staging ".concat(X,": ").concat(a.message)),a;case 9:i=["Executing lint-staged"];return[4,eU.lintStaged()];case 10:return[4,tl.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tg();return[2]}})});return tw.apply(this,arguments)}function tI(){return tO.apply(this,arguments)}function tO(){tO=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eU.eslintInspect()];case 1:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tO.apply(this,arguments)}function tS(){return tE.apply(this,arguments)}function tE(){tE=a(function(){return v(this,function(e){switch(e.label){case 0:return[4,e9()];case 1:e.sent();return[4,Promise.all([tp(),th()])];case 2:e.sent(),tg();return[2]}})});return tE.apply(this,arguments)}function t_(){return tT.apply(this,arguments)}function tT(){tT=a(function(){return v(this,function(e){switch(e.label){case 0:return[4,e9()];case 1:e.sent();return[4,Promise.all([tp(),th(!0)])];case 2:e.sent(),tg();return[2]}})});return tT.apply(this,arguments)}function tC(){return tk.apply(this,arguments)}function tk(){tk=a(function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,e9()];case 1:t.sent();e=["Validating commit message"];return[4,eU.commitLint()];case 2:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tg();return[2]}})});return tk.apply(this,arguments)}function tj(){return tN.apply(this,arguments)}function tN(){tN=a(function(){var e,t,n,r;return v(this,function(a){switch(a.label){case 0:e=["Configuring Git hooks"];return[4,eU.configureGitHook()];case 1:return[4,tl.apply(void 0,e.concat([a.sent()]))];case 2:a.sent(),Y(eR.GIT_HOOK);return[4,ts(ex)];case 3:t=a.sent();B(eR.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});n="\n".concat(ec,"\n");K(eR.GIT_IGNORE)?W(eR.GIT_IGNORE).split("\n").includes(ec)||H(eR.GIT_IGNORE,n):B(eR.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eU.simpleGitHooks()];case 4:return[4,tl.apply(void 0,r.concat([a.sent()]))];case 5:a.sent();return[2]}})});return tN.apply(this,arguments)}function tG(){return tP.apply(this,arguments)}function tP(){tP=a(function(){return v(this,function(e){switch(e.label){case 0:return[4,e$([X],{update:!0,postInstallActions:[tj]})];case 1:e.sent();return[2]}})});return tP.apply(this,arguments)}function tA(){return tL.apply(this,arguments)}function tL(){tL=a(function(){return v(this,function(e){switch(e.label){case 0:Y(eR.NODE_MODULES,eR.PNPM_LOCK_YAML);return[4,eH()];case 1:e.sent();return[4,tj()];case 2:e.sent();return[2]}})});return tL.apply(this,arguments)}function tR(){return tx.apply(this,arguments)}function tx(){tx=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eU.nodeModulesInspect()];case 1:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tx.apply(this,arguments)}function tD(){return tF.apply(this,arguments)}function tF(){tF=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eU.testUnit()];case 1:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tF.apply(this,arguments)}function tM(){return tU.apply(this,arguments)}function tU(){tU=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eU.testE2e()];case 1:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tU.apply(this,arguments)}a(function(){var e;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,k.default)((0,C.hideBin)(T.default.argv)).scriptName(ep).usage("$0 <command> [options]").command("lint","Check code for linting issues",tS).command("lint:fix","Fix linting issues automatically",t_).command("lint:inspect","View active ESLint configuration",tI).command("lint-staged","Run lint checks on staged files",tb).command("commitlint","Validate commit message format",tC).command("setup","Initialize project setup and dependencies",tG).command("reset","Reset the project and reinstall dependencies",tA).command("inspect","Analyze installed project dependencies",tR).command("test:unit","Run unit test suite",tD).command("test:e2e","Run end-to-end test suite",tM).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(j.default.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();M.error("Fatal: ".concat(e.message)),T.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,a,i,o){try{var c=e[i](o);var s=c.value}catch(e){n(e);return}if(c.done){t(s)}else{Promise.resolve(s).then(r,a)}}function a(e){return function(){var t=this,n=arguments;return new Promise(function(a,i){var o=e.apply(t,n);function c(e){r(o,a,i,c,s,"next",e)}function s(e){r(o,a,i,c,s,"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 a=true;var i=false;var o,c;try{for(n=n.call(e);!(a=(o=n.next()).done);a=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){i=true;c=e}finally{try{if(!a&&n["return"]!=null)n["return"]()}finally{if(i)throw c}}return r}function s(){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 f(e,n){return t(e)||c(e,n)||h(e,n)||s()}function p(e){return n(e)||o(e)||h(e)||u()}function d(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function h(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 v(e,t){var n,r,a,i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[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 s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,c[0]&&(i=0)),i)try{if(n=1,r&&(a=c[0]&2?r["return"]:c[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;if(r=0,a)c=[c[0]&2,a.value];switch(c[0]){case 0:case 1:a=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(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]<a[3])){i.label=c[1];break}if(c[0]===6&&i.label<a[1]){i.label=a[1];a=c;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(c);break}if(a[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];r=0}finally{n=a=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var y=Object.create;var g=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var S=function(e,t,n,r){var a=true,i=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":d(t))=="object"||typeof t=="function")try{var c=function(){var a=u.value;!I.call(e,a)&&a!==n&&g(e,a,{get:function(){return t[a]},enumerable:!(r=m(t,a))||r.enumerable})};for(var s=b(t)[Symbol.iterator](),u;!(a=(u=s.next()).done);a=true)c()}catch(e){i=true;o=e}finally{try{if(!a&&s.return!=null){s.return()}}finally{if(i){throw o}}}return e};var O=function(e,t,n){return n=e!=null?y(w(e)):{},S(t||!e||!e.__esModule?g(n,"default",{value:e,enumerable:!0}):n,e)},E=function(e){return S(g({},"__esModule",{value:!0}),e)};var _={};module.exports=E(_);var C=O(require("process"),1),T=require("yargs/helpers"),k=O(require("yargs/yargs"),1),j=O(require("../../package-KSSCGX3B.json"),1);var N=require("child_process"),G=O(require("process"),1),P=O(require("util"),1);var A=O(require("process"),1),L=A.default.env.DEBUG==="true";var R=O(require("chalk"),1),x=O(require("consola"),1),D=require("graphql");L||(x.default.level=4);function F(e){var t=R.default[e];return typeof t=="function"?t:R.default.green}var M={silent:x.default.silent,level:x.default.level,fatal:x.default.fatal,error:x.default.error,warn:x.default.warn,log:x.default.log,info:x.default.info,success:x.default.success,ready:x.default.ready,start:x.default.start,box:x.default.box,debug:x.default.debug,trace:x.default.trace,verbose:x.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)){x.default.box(R.default.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,a=e.rule,i=e.message;x.default.log("".concat(R.default.gray("File:")," ").concat(R.default.blue("".concat(t).concat(r?":".concat(r):"")))),a&&x.default.log(" ".concat(F(n)("Rule:")," ").concat(a)),x.default.log(" ".concat(F(n)("Message:")," ").concat(i))}),x.default.box(F(n)("".concat(e," : ").concat(t.length))),x.default.log(R.default.gray("─".repeat(40)))}};var U={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};var q=O(require("node-fetch"),1);var J=O(require("fs"),1);function K(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return J.existsSync(e)})}function W(e,t){var n=J.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var r=JSON.parse(n);if((typeof r==="undefined"?"undefined":d(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(t){throw new Error("Failed to parse JSON from file: ".concat(e))}return n}function B(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,a=r===void 0?!1:r,i=a&&(typeof t==="undefined"?"undefined":d(t))=="object"?JSON.stringify(t,null,4):String(t);J.writeFileSync(e,i,"utf-8")}function H(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,a=r===void 0?!1:r,i=a&&(typeof t==="undefined"?"undefined":d(t))=="object"?JSON.stringify(t,null,4):String(t);J.appendFileSync(e,i,"utf-8")}function Y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}t.forEach(function(e){K(e)&&J.rmSync(e,{recursive:!0,force:!0})})}var $=O(require("process"),1);var V=O(require("path"),1);function z(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).resolve.apply(r,[Q].concat(p(t)))}function X(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=V).join.apply(r,p(t))}var Q=$.default.env.INIT_CWD||$.default.cwd(),Z="@cyberskill/shared",ee=".cyberskill-storage",et="node_modules",en="dist",er="package.json",ea="package-lock.json",ei="tsconfig.json",eo=".gitignore",ec=".simple-git-hooks.json",es="pnpm-lock.yaml",eu=".git/hooks/",el=".git/COMMIT_EDITMSG",ef=X(Q,et,Z,en),ep="cyberskill",ed="src/nodejs/cli/index.ts",eh="eslint",ev="eslint",ey="vitest",eg="playwright",em="vitest",eb="@commitlint/cli",ew="commitlint",eI="lint-staged",eS="lint-staged",eO="typescript",eE="tsc",e_="tsx",eC="git",eT="pnpm",ek="pnpm exec",ej="simple-git-hooks",eN="simple-git-hooks",eG="@eslint/config-inspector",eP="eslint-config-inspector",eA="node-modules-inspector",eL="node-modules-inspector",eR={CYBERSKILL_DIRECTORY:ef,WORKING_DIRECTORY:Q,TS_CONFIG:z(ei),GIT_IGNORE:z(eo),GIT_HOOK:z(eu),GIT_COMMIT_MSG:z(el),SIMPLE_GIT_HOOKS_JSON:z(ec),PACKAGE_JSON:z(er),PACKAGE_LOCK_JSON:z(ea),PNPM_LOCK_YAML:z(es),NODE_MODULES:z(et),LINT_STAGED_CONFIG:z("".concat(ef,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:z("".concat(ef,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:z("".concat(ef,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:z("".concat(ef,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:z("".concat(ef,"/react/vitest/vitest.e2e.js"))};function ex(e){var t=e.isCurrentProject;return l({"pre-commit":eS,"commit-msg":ew},t&&{"pre-push":ti("".concat(eC," pull"))})}function eD(e){return eF.apply(this,arguments)}function eF(){eF=a(function(e){var t,n,r,a,i,o;var c=arguments;return v(this,function(s){switch(s.label){case 0:for(t=c.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=c[r]}a=f(n,2),i=a[0],o=a[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case"CLI":return[3,1];case"RAW":return[3,3]}return[3,4];case 1:return[4,e$(i.split(" "),{update:!0})];case 2:return[2,(s.sent(),tc(ti("".concat(ek," ").concat(o))))];case 3:return[2,tc(ti(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return eF.apply(this,arguments)}function eM(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}return /*#__PURE__*/a(function(){return v(this,function(t){return[2,eD.apply(void 0,[e].concat(p(n)))]})})}var eU={simpleGitHooks:eM("CLI",ej,eN),eslintInspect:eM("CLI",eG,eP),nodeModulesInspect:eM("CLI",eA,eL),eslintCheck:eM("CLI",eh,"".concat(ev," ").concat(eR.WORKING_DIRECTORY)),eslintFix:eM("CLI",eh,"".concat(ev," ").concat(eR.WORKING_DIRECTORY," --fix")),typescriptCheck:eM("CLI",eO,"".concat(eE," -p ").concat(eR.TS_CONFIG," --noEmit")),configureGitHook:eM("RAW","".concat(eC," config core.hooksPath ").concat(eR.GIT_HOOK)),testUnit:eM("CLI",ey,"".concat(em," --config ").concat(eR.UNIT_TEST_CONFIG)),testE2e:eM("CLI","".concat(ey," ").concat(eg),"".concat(em," --config ").concat(eR.E2E_TEST_CONFIG)),commitLint:eM("CLI",eb,"".concat(ew," --edit ").concat(eR.GIT_COMMIT_MSG," --config ").concat(eR.COMMITLINT_CONFIG)),lintStaged:eM("CLI",eI,"".concat(eS," --config ").concat(eR.LINT_STAGED_CONFIG)),stageBuildDirectory:eM("RAW","".concat(eC," add ").concat(en)),build:eM("RAW","".concat(eT," run build")),pnpmInstallStandard:eM("RAW","".concat(eT," install")),pnpmInstallLegacy:eM("RAW","".concat(eT," install --legacy-peer-deps")),pnpmInstallForce:eM("RAW","".concat(eT," install --force"))};function eq(e){var t=X(Q,er);if(!K(t))return!1;try{var n=W(t,{asJson:!0}),r=n.name,a=n.dependencies,i=a===void 0?{}:a,o=n.devDependencies,c=o===void 0?{}:o,s=r===e,u=e in i,l=e in c;return s||u||l?{path:t,file:n,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return M.warn("Failed to read package.json: ".concat(e.message)),!1}}function eJ(e){return eK.apply(this,arguments)}function eK(){eK=a(function(e){var t,n,r,a;return v(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,(0,q.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:a=i.sent();throw M.error('Failed to fetch version for "'.concat(e,'": ').concat(a.message)),a;case 4:return[2]}})});return eK.apply(this,arguments)}function eW(e,t){return eB.apply(this,arguments)}function eB(){eB=a(function(e,t){var n,r,a,i,o,c,s,u,f,p,d,h,y,g,m,b,w,I,S,O,E;return v(this,function(v){switch(v.label){case 0:v.trys.push([0,4,,5]);n=eq(e);if(!n)return[2,l({},U)];s=n.path,u=n.file,f=n.isCurrentProject,p=n.isDepend,d=n.isDevDepend,h=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(a=u.devDependencies)!==null&&a!==void 0?a:{},g=f?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(o=h[e])!==null&&o!==void 0?o:"0.0.0":d?(c=y[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=g;return[3,3];case 1:return[4,eJ(e)];case 2:w=v.sent();v.label=3;case 3:m=w,b=f||g===m;if(!b&&(t===null||t===void 0?void 0:t.update)){;S=p?"dependencies":d?"devDependencies":null;S&&((I=u[S])===null||I===void 0?void 0:I[e])!==m&&(u[S]=(O=u[S])!==null&&O!==void 0?O:{},u[S][e]=m,B(s,u,{isJson:!0}),M.info('Updated "'.concat(e,'" to version ').concat(m)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:b}];case 4:E=v.sent();return[2,(M.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},U))];case 5:return[2]}})});return eB.apply(this,arguments)}function eH(){return eY.apply(this,arguments)}function eY(){eY=a(function(){var e,t,n,r,a,i,o,c,s,u,l,f;return v(this,function(p){switch(p.label){case 0:e=[{command:function(){return eU.pnpmInstallStandard()},message:"Installing dependencies (standard)"},{command:function(){return eU.pnpmInstallLegacy()},message:"Retrying with legacy peer dependencies"},{command:function(){return eU.pnpmInstallForce()},message:"Retrying with force install"}];t=true,n=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);a=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=a.next()).done))return[3,8];o=i.value,c=o.command,s=o.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,tl("".concat(s," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();M.warn("Installation attempt failed: ".concat(s)),M.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=p.sent();n=true;r=f;return[3,11];case 10:try{if(!t&&a.return!=null){a.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return eY.apply(this,arguments)}function e$(e,t){return eV.apply(this,arguments)}function eV(){eV=a(function(e,t){var n,r,a,i,o,c,s,u,f,d,h;return v(this,function(v){switch(v.label){case 0:if(!K(eR.PACKAGE_JSON)){M.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);n=p(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return eW(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=v.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,eH()];case 3:r=v.sent();v.label=4;case 4:r;i=true,o=false,c=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((a=t===null||t===void 0?void 0:t.postInstallActions)!==null&&a!==void 0?a:[])[Symbol.iterator]();v.label=6;case 6:if(!!(i=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:d=v.sent();o=true;c=d;return[3,12];case 11:try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw c}}return[7];case 12:return[3,14];case 13:h=v.sent();throw M.error('Failed to setup "'.concat(e.join(", "),'": ').concat(h.message)),h;case 14:return[2]}})});return eV.apply(this,arguments)}var ez=O(require("node-persist"),1),eX=O(require("os"),1),eQ=O(require("process"),1);function eZ(){return eQ.default.env.CYBERSKILL_STORAGE_DIR||X(eX.default.homedir(),ee)}function e0(){return e1.apply(this,arguments)}function e1(){e1=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=ez.default.defaultInstance;if(e)return[3,2];return[4,ez.default.init({dir:eZ(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return e1.apply(this,arguments)}var e4={get:function e(e){return a(function(){var t,n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e0()];case 1:r.sent();return[4,ez.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(M.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return a(function(){var n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e0()];case 1:r.sent();return[4,ez.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();M.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return a(function(){var t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e0()];case 1:n.sent();return[4,ez.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();M.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return a(function(){var e,t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,e0()];case 1:n.sent();return[4,ez.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(M.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(M.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return a(function(){return v(this,function(t){try{return[2,"".concat(eZ()," (key: ").concat(e,")")]}catch(e){return[2,(M.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var e2=P.promisify(N.exec);function e3(e){return"error_list:".concat(e)}function e5(e){return e6.apply(this,arguments)}function e6(){e6=a(function(e){var t,n,r;return v(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=e3(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,e4.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/a(function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,e4.getLogLink(n)];case 1:e=t.sent();e&&M.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();M.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return e6.apply(this,arguments)}function e8(){return e7.apply(this,arguments)}function e7(){e7=a(function(){var e,t,n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e4.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=a(function(e){var t;return v(this,function(n){switch(n.label){case 0:return[4,e4.get(e)];case 1:return[2,((t=n.sent())===null||t===void 0?void 0:t.errors)||[]]}})});return function(t){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:n=r.sent();return[2,(M.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return e7.apply(this,arguments)}function e9(){return te.apply(this,arguments)}function te(){te=a(function(){var e,t,n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,e4.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(function(e){return e4.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();M.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return te.apply(this,arguments)}function tt(e){var t=[],n=[],r="",a=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c,s,u,l,f;var p=a.exec(e)||[],d=i.exec(e)||[],h=o.exec(e)||[];var v,y,g,m,b,w;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]==="error"?"error":"warning",message:(v=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:"",rule:(y=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&y!==void 0?y:""}):d.length?t.push({file:(g=d===null||d===void 0?void 0:d[1])!==null&&g!==void 0?g:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]==="error"?"error":"warning",message:(m=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&m!==void 0?m:""}):h.length?t.push({file:"commitlint",type:"error",message:(b=h===null||h===void 0?void 0:(l=h[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=h===null||h===void 0?void 0:(f=h[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):n.push(e.trim())}}),t.length&&e5(t),L&&n.length&&(M.warn("Unmatched lines:"),n.forEach(function(e){return M.info(" ".concat(e))}))}function tn(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,a=e.line,i=e.column,o=e.ruleId,c=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(a,":").concat(i),rule:o,message:c})})}),n.length&&e5(n)}catch(t){tt(e)}}function tr(e){return ta.apply(this,arguments)}function ta(){ta=a(function(e){var t,n,r,a,i,o,c,s,u;var l=arguments;return v(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:tn;n=new AbortController;G.default.on("SIGINT",function(){M.warn("Process interrupted. Terminating..."),n.abort(),G.default.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,e2(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),a=r.stdout,i=r.stderr;[a,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:o=f.sent();c=o.stdout,s=o.stderr,u=o.message;[c,s].forEach(function(e){return e&&t(e)}),!s&&!c&&M.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return ta.apply(this,arguments)}function ti(e){return{raw:!0,cmd:e}}function to(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(ek," ").concat(Z," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ek," ").concat(e_," ").concat(ed," ").concat(e):"".concat(ek," ").concat(ep," ").concat(e)}function tc(e,t){return typeof e=="function"?to(e(t),t):(typeof e==="undefined"?"undefined":d(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?to(e,t):e}function ts(e){return tu.apply(this,arguments)}function tu(){tu=a(function(e){var t,n,r,a,i,o,c;var s=arguments;return v(this,function(u){switch(u.label){case 0:t=s.length>1&&s[1]!==void 0?s[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,eW(Z)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:a=c,i={isRemote:r,isCurrentProject:a},o=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=f(e,2),n=t[0],r=t[1];return[n,tc(r,i)]}))]}})});return tu.apply(this,arguments)}function tl(e,t){return tf.apply(this,arguments)}function tf(){tf=a(function(e,t){var n;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);M.start("".concat(e)),L&&M.info("→ ".concat(t));return[4,tr(t)];case 1:r.sent(),M.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw M.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return tf.apply(this,arguments)}function tp(){return td.apply(this,arguments)}function td(){td=a(function(){var e,t;return v(this,function(n){switch(n.label){case 0:if(!K(eR.TS_CONFIG))return[3,3];t=["Performing TypeScript validation"];return[4,eU.typescriptCheck()];case 1:return[4,tl.apply(void 0,t.concat([n.sent()]))];case 2:e=n.sent();return[3,4];case 3:e=M.warn("No TypeScript configuration found. Skipping type check.");n.label=4;case 4:e;return[2]}})});return td.apply(this,arguments)}function th(){return tv.apply(this,arguments)}function tv(){tv=a(function(){var e,t,n,r;var a=arguments;return v(this,function(i){switch(i.label){case 0:e=a.length>0&&a[0]!==void 0?a[0]:!1;if(!e)return[3,3];n=["Running ESLint with auto-fix"];return[4,eU.eslintFix()];case 1:return[4,tl.apply(void 0,n.concat([i.sent()]))];case 2:t=i.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,eU.eslintCheck()];case 4:return[4,tl.apply(void 0,r.concat([i.sent()]))];case 5:t=i.sent();i.label=6;case 6:t;return[2]}})});return tv.apply(this,arguments)}function ty(e,t){if(!t.length)return;var n=e==="Errors"?"red":"yellow";M.printBoxedLog(e==="Errors"?"✖ Errors":"⚠ Warnings",t,n)}function tg(){return tm.apply(this,arguments)}function tm(){tm=a(function(){var e,t,n;return v(this,function(r){switch(r.label){case 0:return[4,e8()];case 1:e=r.sent(),t=e.filter(function(e){return e.type==="error"}),n=e.filter(function(e){return e.type==="warning"});!t.length&&!n.length?M.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(ty("Warnings",n),ty("Errors",t));return[2]}})});return tm.apply(this,arguments)}function tb(){return tw.apply(this,arguments)}function tw(){tw=a(function(){var e,t,n,r,a,i;return v(this,function(o){switch(o.label){case 0:return[4,e9()];case 1:o.sent();return[4,eW(Z)];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(Z)];return[4,eU.build()];case 4:return[4,tl.apply(void 0,n.concat([o.sent()]))];case 5:o.sent();r=["Staging build artifacts"];return[4,eU.stageBuildDirectory()];case 6:return[4,tl.apply(void 0,r.concat([o.sent()]))];case 7:o.sent();return[3,9];case 8:a=o.sent();throw M.error("Error building and staging ".concat(Z,": ").concat(a.message)),a;case 9:i=["Executing lint-staged"];return[4,eU.lintStaged()];case 10:return[4,tl.apply(void 0,i.concat([o.sent()]))];case 11:o.sent(),tg();return[2]}})});return tw.apply(this,arguments)}function tI(){return tS.apply(this,arguments)}function tS(){tS=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=["Inspecting ESLint configuration"];return[4,eU.eslintInspect()];case 1:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tS.apply(this,arguments)}function tO(){return tE.apply(this,arguments)}function tE(){tE=a(function(){return v(this,function(e){switch(e.label){case 0:return[4,e9()];case 1:e.sent();return[4,Promise.all([tp(),th()])];case 2:e.sent(),tg();return[2]}})});return tE.apply(this,arguments)}function t_(){return tC.apply(this,arguments)}function tC(){tC=a(function(){return v(this,function(e){switch(e.label){case 0:return[4,e9()];case 1:e.sent();return[4,Promise.all([tp(),th(!0)])];case 2:e.sent(),tg();return[2]}})});return tC.apply(this,arguments)}function tT(){return tk.apply(this,arguments)}function tk(){tk=a(function(){var e;return v(this,function(t){switch(t.label){case 0:return[4,e9()];case 1:t.sent();e=["Validating commit message"];return[4,eU.commitLint()];case 2:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 3:t.sent(),tg();return[2]}})});return tk.apply(this,arguments)}function tj(){return tN.apply(this,arguments)}function tN(){tN=a(function(){var e,t,n,r;return v(this,function(a){switch(a.label){case 0:e=["Configuring Git hooks"];return[4,eU.configureGitHook()];case 1:return[4,tl.apply(void 0,e.concat([a.sent()]))];case 2:a.sent(),Y(eR.GIT_HOOK);return[4,ts(ex)];case 3:t=a.sent();B(eR.SIMPLE_GIT_HOOKS_JSON,t,{isJson:!0});n="\n".concat(ec,"\n");K(eR.GIT_IGNORE)?W(eR.GIT_IGNORE).split("\n").includes(ec)||H(eR.GIT_IGNORE,n):B(eR.GIT_IGNORE,n);r=["Setting up simple-git-hooks"];return[4,eU.simpleGitHooks()];case 4:return[4,tl.apply(void 0,r.concat([a.sent()]))];case 5:a.sent();return[2]}})});return tN.apply(this,arguments)}function tG(){return tP.apply(this,arguments)}function tP(){tP=a(function(){return v(this,function(e){switch(e.label){case 0:return[4,e$([Z],{update:!0,postInstallActions:[tj]})];case 1:e.sent();return[2]}})});return tP.apply(this,arguments)}function tA(){return tL.apply(this,arguments)}function tL(){tL=a(function(){return v(this,function(e){switch(e.label){case 0:Y(eR.NODE_MODULES,eR.PNPM_LOCK_YAML);return[4,eH()];case 1:e.sent();return[4,tj()];case 2:e.sent();return[2]}})});return tL.apply(this,arguments)}function tR(){return tx.apply(this,arguments)}function tx(){tx=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=["Inspecting project dependencies"];return[4,eU.nodeModulesInspect()];case 1:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tx.apply(this,arguments)}function tD(){return tF.apply(this,arguments)}function tF(){tF=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=["Running unit tests"];return[4,eU.testUnit()];case 1:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tF.apply(this,arguments)}function tM(){return tU.apply(this,arguments)}function tU(){tU=a(function(){var e;return v(this,function(t){switch(t.label){case 0:e=["Running end-to-end tests"];return[4,eU.testE2e()];case 1:return[4,tl.apply(void 0,e.concat([t.sent()]))];case 2:t.sent();return[2]}})});return tU.apply(this,arguments)}a(function(){var e;return v(this,function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);return[4,(0,k.default)((0,T.hideBin)(C.default.argv)).scriptName(ep).usage("$0 <command> [options]").command("lint","Check code for linting issues",tO).command("lint:fix","Fix linting issues automatically",t_).command("lint:inspect","View active ESLint configuration",tI).command("lint-staged","Run lint checks on staged files",tb).command("commitlint","Validate commit message format",tT).command("setup","Initialize project setup and dependencies",tG).command("reset","Reset the project and reinstall dependencies",tA).command("inspect","Analyze installed project dependencies",tR).command("test:unit","Run unit test suite",tD).command("test:e2e","Run end-to-end test suite",tM).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(j.default.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:t.sent();return[3,3];case 2:e=t.sent();M.error("Fatal: ".concat(e.message)),C.default.exit(1);return[3,3];case 3:return[2]}})})();
|
package/dist/nodejs/cli/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,n){if(n==null||n>t.length)n=t.length;for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function n(t){if(Array.isArray(t))return t}function e(n){if(Array.isArray(n))return t(n)}function r(t,n,e,r,i,o,a){try{var c=t[o](a);var s=c.value}catch(t){e(t);return}if(c.done){n(s)}else{Promise.resolve(s).then(r,i)}}function i(t){return function(){var n=this,e=arguments;return new Promise(function(i,o){var a=t.apply(n,e);function c(t){r(a,i,o,c,s,"next",t)}function s(t){r(a,i,o,c,s,"throw",t)}c(undefined)})}}function o(t,n,e){if(n in t){Object.defineProperty(t,n,{value:e,enumerable:true,configurable:true,writable:true})}else{t[n]=e}return t}function a(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,n){var e=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(e==null)return;var r=[];var i=true;var o=false;var a,c;try{for(e=e.call(t);!(i=(a=e.next()).done);i=true){r.push(a.value);if(n&&r.length===n)break}}catch(t){o=true;c=t}finally{try{if(!i&&e["return"]!=null)e["return"]()}finally{if(o)throw c}}return r}function s(){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(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};var r=Object.keys(e);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))}r.forEach(function(n){o(t,n,e[n])})}return t}function f(t,e){return n(t)||c(t,e)||h(t,e)||s()}function p(t){return e(t)||a(t)||h(t)||u()}function d(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function h(n,e){if(!n)return;if(typeof n==="string")return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);if(r==="Object"&&n.constructor)r=n.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 t(n,e)}function v(t,n){var e,r,i,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(n){return s([t,n])}}function s(c){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(o=0)),o)try{if(e=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;r=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(c[0]===6&&o.label<i[1]){o.label=i[1];i=c;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(c);break}if(i[2])o.ops.pop();o.trys.pop();continue}c=n.call(t,o)}catch(t){c=[6,t];r=0}finally{e=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}import y from"node:process";import{hideBin as m}from"yargs/helpers";import g from"yargs/yargs";import b from"../../package-MZ24VJKI.json";import{exec as w}from"node:child_process";import I from"node:process";import*as S from"node:util";import E from"node:process";var O=E.env.DEBUG==="true";import _ from"chalk";import T from"consola";import{GraphQLError as C}from"graphql";O||(T.level=4);function k(t){var n=_[t];return typeof n=="function"?n:_.green}var G={silent:T.silent,level:T.level,fatal:T.fatal,error:T.error,warn:T.warn,log:T.log,info:T.info,success:T.success,ready:T.ready,start:T.start,box:T.box,debug:T.debug,trace:T.trace,verbose:T.verbose,printBoxedLog:function t(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(n===null||n===void 0?void 0:n.length)){T.box(_.green(t));return}n.forEach(function(t){var n=t.file,r=t.position,i=t.rule,o=t.message;T.log("".concat(_.gray("File:")," ").concat(_.blue("".concat(n).concat(r?":".concat(r):"")))),i&&T.log(" ".concat(k(e)("Rule:")," ").concat(i)),T.log(" ".concat(k(e)("Message:")," ").concat(o))}),T.box(k(e)("".concat(t," : ").concat(n.length))),T.log(_.gray("─".repeat(40)))}};var N={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import j from"node-fetch";import*as L from"node:fs";function A(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}return n.every(function(t){return L.existsSync(t)})}function R(t,n){var e=L.readFileSync(t,"utf-8");if(n===null||n===void 0?void 0:n.asJson)try{var r=JSON.parse(e);if((typeof r==="undefined"?"undefined":d(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(n){throw new Error("Failed to parse JSON from file: ".concat(t))}return e}function P(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=e.isJson,i=r===void 0?!1:r,o=i&&(typeof n==="undefined"?"undefined":d(n))=="object"?JSON.stringify(n,null,4):String(n);L.writeFileSync(t,o,"utf-8")}function x(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=e.isJson,i=r===void 0?!1:r,o=i&&(typeof n==="undefined"?"undefined":d(n))=="object"?JSON.stringify(n,null,4):String(n);L.appendFileSync(t,o,"utf-8")}function D(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}n.forEach(function(t){A(t)&&L.rmSync(t,{recursive:!0,force:!0})})}import F from"node:process";import*as M from"node:path";function U(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var r;return(r=M).resolve.apply(r,[K].concat(p(n)))}function J(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var r;return(r=M).join.apply(r,p(n))}var K=F.env.INIT_CWD||F.cwd(),W="@cyberskill/shared",B=".cyberskill-storage",H="node_modules",Y="dist",$="package.json",V="package-lock.json",z="tsconfig.json",q=".gitignore",Q=".simple-git-hooks.json",Z="pnpm-lock.yaml",X=".git/hooks/",tt=".git/COMMIT_EDITMSG",tn=J(K,H,W,Y),te="cyberskill",tr="src/nodejs/cli/index.ts",ti="eslint",to="eslint",ta="vitest",tc="playwright",ts="vitest",tu="@commitlint/cli",tl="commitlint",tf="lint-staged",tp="lint-staged",td="typescript",th="tsc",tv="tsx",ty="git",tm="pnpm",tg="pnpm exec",tb="simple-git-hooks",tw="simple-git-hooks",tI="@eslint/config-inspector",tS="eslint-config-inspector",tE="node-modules-inspector",tO="node-modules-inspector",t_={CYBERSKILL_DIRECTORY:tn,WORKING_DIRECTORY:K,TS_CONFIG:U(z),GIT_IGNORE:U(q),GIT_HOOK:U(X),GIT_COMMIT_MSG:U(tt),SIMPLE_GIT_HOOKS_JSON:U(Q),PACKAGE_JSON:U($),PACKAGE_LOCK_JSON:U(V),PNPM_LOCK_YAML:U(Z),NODE_MODULES:U(H),LINT_STAGED_CONFIG:U("".concat(tn,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:U("".concat(tn,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:U("".concat(tn,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:U("".concat(tn,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:U("".concat(tn,"/react/vitest/vitest.e2e.js"))};function tT(t){var n=t.isCurrentProject;return l({"pre-commit":tp,"commit-msg":tl},n&&{"pre-push":t5("".concat(ty," pull"))})}function tC(t){return tk.apply(this,arguments)}function tk(){tk=i(function(t){var n,e,r,i,o,a;var c=arguments;return v(this,function(s){switch(s.label){case 0:for(n=c.length,e=new Array(n>1?n-1:0),r=1;r<n;r++){e[r-1]=c[r]}i=f(e,2),o=i[0],a=i[1];if(!o)throw new Error("'first' argument is undefined");switch(t){case"CLI":return[3,1];case"RAW":return[3,3]}return[3,4];case 1:return[4,tF(o.split(" "),{update:!0})];case 2:return[2,(s.sent(),t8(t5("".concat(tg," ").concat(a))))];case 3:return[2,t8(t5(o))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tk.apply(this,arguments)}function tG(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++){e[r-1]=arguments[r]}return /*#__PURE__*/i(function(){return v(this,function(n){return[2,tC.apply(void 0,[t].concat(p(e)))]})})}var tN={simpleGitHooks:tG("CLI",tb,tw),eslintInspect:tG("CLI",tI,tS),nodeModulesInspect:tG("CLI",tE,tO),eslintCheck:tG("CLI",ti,"".concat(to," ").concat(t_.WORKING_DIRECTORY)),eslintFix:tG("CLI",ti,"".concat(to," ").concat(t_.WORKING_DIRECTORY," --fix")),typescriptCheck:tG("CLI",td,"".concat(th," -p ").concat(t_.TS_CONFIG," --noEmit")),configureGitHook:tG("RAW","".concat(ty," config core.hooksPath ").concat(t_.GIT_HOOK)),testUnit:tG("CLI",ta,"".concat(ts," --config ").concat(t_.UNIT_TEST_CONFIG)),testE2e:tG("CLI","".concat(ta," ").concat(tc),"".concat(ts," --config ").concat(t_.E2E_TEST_CONFIG)),commitLint:tG("CLI",tu,"".concat(tl," --edit ").concat(t_.GIT_COMMIT_MSG," --config ").concat(t_.COMMITLINT_CONFIG)),lintStaged:tG("CLI",tf,"".concat(tp," --config ").concat(t_.LINT_STAGED_CONFIG)),stageBuildDirectory:tG("RAW","".concat(ty," add ").concat(Y)),build:tG("RAW","".concat(tm," run build")),pnpmInstallStandard:tG("RAW","".concat(tm," install")),pnpmInstallLegacy:tG("RAW","".concat(tm," install --legacy-peer-deps")),pnpmInstallForce:tG("RAW","".concat(tm," install --force"))};function tj(t){var n=J(K,$);if(!A(n))return!1;try{var e=R(n,{asJson:!0}),r=e.name,i=e.dependencies,o=i===void 0?{}:i,a=e.devDependencies,c=a===void 0?{}:a,s=r===t,u=t in o,l=t in c;return s||u||l?{path:n,file:e,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(t){return G.warn("Failed to read package.json: ".concat(t.message)),!1}}function tL(t){return tA.apply(this,arguments)}function tA(){tA=i(function(t){var n,e,r,i;return v(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,j("https://registry.npmjs.org/".concat(t,"/latest"))];case 1:n=o.sent();if(!n.ok)throw new Error("Failed to fetch latest version: ".concat(n.status," ").concat(n.statusText));return[4,n.json()];case 2:e=o.sent(),r=e.version;return[2,r];case 3:i=o.sent();throw G.error('Failed to fetch version for "'.concat(t,'": ').concat(i.message)),i;case 4:return[2]}})});return tA.apply(this,arguments)}function tR(t,n){return tP.apply(this,arguments)}function tP(){tP=i(function(t,n){var e,r,i,o,a,c,s,u,f,p,d,h,y,m,g,b,w,I,S,E,O;return v(this,function(v){switch(v.label){case 0:v.trys.push([0,4,,5]);e=tj(t);if(!e)return[2,l({},N)];s=e.path,u=e.file,f=e.isCurrentProject,p=e.isDepend,d=e.isDevDepend,h=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(i=u.devDependencies)!==null&&i!==void 0?i:{},m=f?(o=u.version)!==null&&o!==void 0?o:"0.0.0":p?(a=h[t])!==null&&a!==void 0?a:"0.0.0":d?(c=y[t])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=m;return[3,3];case 1:return[4,tL(t)];case 2:w=v.sent();v.label=3;case 3:g=w,b=f||m===g;if(!b&&(n===null||n===void 0?void 0:n.update)){;S=p?"dependencies":d?"devDependencies":null;S&&((I=u[S])===null||I===void 0?void 0:I[t])!==g&&(u[S]=(E=u[S])!==null&&E!==void 0?E:{},u[S][t]=g,P(s,u,{isJson:!0}),G.info('Updated "'.concat(t,'" to version ').concat(g)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:b}];case 4:O=v.sent();return[2,(G.error('Error checking package "'.concat(t,'": ').concat(O.message)),l({},N))];case 5:return[2]}})});return tP.apply(this,arguments)}function tx(){return tD.apply(this,arguments)}function tD(){tD=i(function(){var t,n,e,r,i,o,a,c,s,u,l,f;return v(this,function(p){switch(p.label){case 0:t=[{command:function(){return tN.pnpmInstallStandard()},message:"Installing dependencies (standard)"},{command:function(){return tN.pnpmInstallLegacy()},message:"Retrying with legacy peer dependencies"},{command:function(){return tN.pnpmInstallForce()},message:"Retrying with force install"}];n=true,e=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);i=t[Symbol.iterator]();p.label=2;case 2:if(!!(n=(o=i.next()).done))return[3,8];a=o.value,c=a.command,s=a.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,nt("".concat(s," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();G.warn("Installation attempt failed: ".concat(s)),G.error("Details: ".concat(l.message));return[3,7];case 7:n=true;return[3,2];case 8:return[3,11];case 9:f=p.sent();e=true;r=f;return[3,11];case 10:try{if(!n&&i.return!=null){i.return()}}finally{if(e){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return tD.apply(this,arguments)}function tF(t,n){return tM.apply(this,arguments)}function tM(){tM=i(function(t,n){var e,r,i,o,a,c,s,u,f,d,h;return v(this,function(v){switch(v.label){case 0:if(!A(t_.PACKAGE_JSON)){G.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);e=p(new Set(t)).sort();return[4,Promise.all(e.map(function(t){return tR(t,l({},(n===null||n===void 0?void 0:n.update)&&{update:n.update}))}))];case 2:r=v.sent().every(function(t){return t.isUpToDate});if(r)return[3,4];return[4,tx()];case 3:r=v.sent();v.label=4;case 4:r;o=true,a=false,c=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((i=n===null||n===void 0?void 0:n.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();v.label=6;case 6:if(!!(o=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=v.sent();a=true;c=d;return[3,12];case 11:try{if(!o&&s.return!=null){s.return()}}finally{if(a){throw c}}return[7];case 12:return[3,14];case 13:h=v.sent();throw G.error('Failed to setup "'.concat(t.join(", "),'": ').concat(h.message)),h;case 14:return[2]}})});return tM.apply(this,arguments)}import tU from"node-persist";import tJ from"node:os";import tK from"node:process";function tW(){return tK.env.CYBERSKILL_STORAGE_DIR||J(tJ.homedir(),B)}function tB(){return tH.apply(this,arguments)}function tH(){tH=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=tU.defaultInstance;if(t)return[3,2];return[4,tU.init({dir:tW(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:t=n.sent();n.label=2;case 2:t;return[2]}})});return tH.apply(this,arguments)}var tY={get:function t(t){return i(function(){var n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tB()];case 1:r.sent();return[4,tU.getItem(t)];case 2:return[2,(n=r.sent())!==null&&n!==void 0?n:null];case 3:e=r.sent();return[2,(G.error('[Storage:get] Error getting key "'.concat(t,'":'),e),null)];case 4:return[2]}})})()},set:function t(t,n){return i(function(){var e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tB()];case 1:r.sent();return[4,tU.setItem(t,n)];case 2:r.sent();return[3,4];case 3:e=r.sent();G.error('[Storage:set] Error setting key "'.concat(t,'":'),e);return[3,4];case 4:return[2]}})})()},remove:function t(t){return i(function(){var n;return v(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,tB()];case 1:e.sent();return[4,tU.removeItem(t)];case 2:e.sent();return[3,4];case 3:n=e.sent();G.error('[Storage:remove] Error removing key "'.concat(t,'":'),n);return[3,4];case 4:return[2]}})})()},keys:function t(){return i(function(){var t,n;return v(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,tB()];case 1:e.sent();return[4,tU.keys()];case 2:t=e.sent();return[2,Array.isArray(t)?t:(G.warn("[Storage:keys] Invalid keys response:",t),[])];case 3:n=e.sent();return[2,(G.error("[Storage:keys] Error getting keys:",n),[])];case 4:return[2]}})})()},getLogLink:function t(t){return i(function(){return v(this,function(n){try{return[2,"".concat(tW()," (key: ").concat(t,")")]}catch(t){return[2,(G.error("[Storage:getLogLink] Error getting log link:",t),null)]}return[2]})})()}};var t$=S.promisify(w);function tV(t){return"error_list:".concat(t)}function tz(t){return tq.apply(this,arguments)}function tq(){tq=i(function(t){var n,e,r;return v(this,function(o){switch(o.label){case 0:if(t.length===0)return[2];n=Date.now(),e=tV(n);o.label=1;case 1:o.trys.push([1,3,,4]);return[4,tY.set(e,{errors:t,timestamp:n})];case 2:o.sent(),setTimeout(/*#__PURE__*/i(function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,tY.getLogLink(e)];case 1:t=n.sent();t&&G.info("\uD83D\uDCC2 Open the error list manually: ".concat(t));return[2]}})}),10);return[3,4];case 3:r=o.sent();G.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tq.apply(this,arguments)}function tQ(){return tZ.apply(this,arguments)}function tZ(){tZ=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tY.keys()];case 1:t=r.sent(),n=Array.isArray(t)?t.filter(function(t){var n;return t===null||t===void 0?void 0:(n=t.startsWith)===null||n===void 0?void 0:n.call(t,"error_list:")}):[];return[4,Promise.all(n.map(/*#__PURE__*/function(){var t=i(function(t){var n;return v(this,function(e){switch(e.label){case 0:return[4,tY.get(t)];case 1:return[2,((n=e.sent())===null||n===void 0?void 0:n.errors)||[]]}})});return function(n){return t.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:e=r.sent();return[2,(G.error("Failed to retrieve stored errors: ".concat(e.message)),[])];case 4:return[2]}})});return tZ.apply(this,arguments)}function tX(){return t0.apply(this,arguments)}function t0(){t0=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tY.keys()];case 1:t=r.sent(),n=Array.isArray(t)?t.filter(function(t){var n;return t===null||t===void 0?void 0:(n=t.startsWith)===null||n===void 0?void 0:n.call(t,"error_list:")}):[];return[4,Promise.all(n.map(function(t){return tY.remove(t)}))];case 2:r.sent();return[3,4];case 3:e=r.sent();G.error("Failed to clear error lists: ".concat(e.message));return[3,4];case 4:return[2]}})});return t0.apply(this,arguments)}function t1(t){var n=[],e=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;t.split("\n").forEach(function(t){if(t.startsWith("/"))r=t.trim();else{var c,s,u,l,f;var p=i.exec(t)||[],d=o.exec(t)||[],h=a.exec(t)||[];var v,y,m,g,b,w;p.length&&r?n.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]==="error"?"error":"warning",message:(v=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:"",rule:(y=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&y!==void 0?y:""}):d.length?n.push({file:(m=d===null||d===void 0?void 0:d[1])!==null&&m!==void 0?m:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]==="error"?"error":"warning",message:(g=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&g!==void 0?g:""}):h.length?n.push({file:"commitlint",type:"error",message:(b=h===null||h===void 0?void 0:(l=h[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=h===null||h===void 0?void 0:(f=h[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):e.push(t.trim())}}),n.length&&tz(n),O&&e.length&&(G.warn("Unmatched lines:"),e.forEach(function(t){return G.info(" ".concat(t))}))}function t4(t){try{var n=JSON.parse(t),e=[];n.forEach(function(t){var n=t.filePath,r=t.messages;r.forEach(function(t){var r=t.severity,i=t.line,o=t.column,a=t.ruleId,c=t.message;e.push({type:r===2?"error":"warning",file:n,position:"".concat(i,":").concat(o),rule:a,message:c})})}),e.length&&tz(e)}catch(n){t1(t)}}function t2(t){return t3.apply(this,arguments)}function t3(){t3=i(function(t){var n,e,r,i,o,a,c,s,u;var l=arguments;return v(this,function(f){switch(f.label){case 0:n=l.length>1&&l[1]!==void 0?l[1]:t4;e=new AbortController;I.on("SIGINT",function(){G.warn("Process interrupted. Terminating..."),e.abort(),I.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,t$(t,{maxBuffer:0x6400000,signal:e.signal})];case 2:r=f.sent(),i=r.stdout,o=r.stderr;[i,o].forEach(function(t){return t&&n(t)});return[3,4];case 3:a=f.sent();c=a.stdout,s=a.stderr,u=a.message;[c,s].forEach(function(t){return t&&n(t)}),!s&&!c&&G.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return t3.apply(this,arguments)}function t5(t){return{raw:!0,cmd:t}}function t6(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tg," ").concat(W," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tg," ").concat(tv," ").concat(tr," ").concat(t):"".concat(tg," ").concat(te," ").concat(t)}function t8(t,n){return typeof t=="function"?t6(t(n),n):(typeof t==="undefined"?"undefined":d(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?t6(t,n):t}function t7(t){return t9.apply(this,arguments)}function t9(){t9=i(function(t){var n,e,r,i,o,a,c;var s=arguments;return v(this,function(u){switch(u.label){case 0:n=s.length>1&&s[1]!==void 0?s[1]:{};r=(e=n===null||n===void 0?void 0:n.isRemote)!==null&&e!==void 0?e:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,tR(W)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:i=c,o={isRemote:r,isCurrentProject:i},a=typeof t=="function"?t(o):t;return[2,Object.fromEntries(Object.entries(a).map(function(t){var n=f(t,2),e=n[0],r=n[1];return[e,t8(r,o)]}))]}})});return t9.apply(this,arguments)}function nt(t,n){return nn.apply(this,arguments)}function nn(){nn=i(function(t,n){var e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);G.start("".concat(t)),O&&G.info("→ ".concat(n));return[4,t2(n)];case 1:r.sent(),G.success("".concat(t," done."));return[3,3];case 2:e=r.sent();throw G.error("".concat(t," failed: ").concat(e.message)),e;case 3:return[2]}})});return nn.apply(this,arguments)}function ne(){return nr.apply(this,arguments)}function nr(){nr=i(function(){var t,n;return v(this,function(e){switch(e.label){case 0:if(!A(t_.TS_CONFIG))return[3,3];n=["Performing TypeScript validation"];return[4,tN.typescriptCheck()];case 1:return[4,nt.apply(void 0,n.concat([e.sent()]))];case 2:t=e.sent();return[3,4];case 3:t=G.warn("No TypeScript configuration found. Skipping type check.");e.label=4;case 4:t;return[2]}})});return nr.apply(this,arguments)}function ni(){return no.apply(this,arguments)}function no(){no=i(function(){var t,n,e,r;var i=arguments;return v(this,function(o){switch(o.label){case 0:t=i.length>0&&i[0]!==void 0?i[0]:!1;if(!t)return[3,3];e=["Running ESLint with auto-fix"];return[4,tN.eslintFix()];case 1:return[4,nt.apply(void 0,e.concat([o.sent()]))];case 2:n=o.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tN.eslintCheck()];case 4:return[4,nt.apply(void 0,r.concat([o.sent()]))];case 5:n=o.sent();o.label=6;case 6:n;return[2]}})});return no.apply(this,arguments)}function na(t,n){if(!n.length)return;var e=t==="Errors"?"red":"yellow";G.printBoxedLog(t==="Errors"?"✖ Errors":"⚠ Warnings",n,e)}function nc(){return ns.apply(this,arguments)}function ns(){ns=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:return[4,tQ()];case 1:t=r.sent(),n=t.filter(function(t){return t.type==="error"}),e=t.filter(function(t){return t.type==="warning"});!n.length&&!e.length?G.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(na("Warnings",e),na("Errors",n));return[2]}})});return ns.apply(this,arguments)}function nu(){return nl.apply(this,arguments)}function nl(){nl=i(function(){var t,n,e,r,i,o;return v(this,function(a){switch(a.label){case 0:return[4,tX()];case 1:a.sent();return[4,tR(W)];case 2:t=a.sent(),n=t.isCurrentProject;if(!n)return[3,9];a.label=3;case 3:a.trys.push([3,8,,9]);e=["Building package: ".concat(W)];return[4,tN.build()];case 4:return[4,nt.apply(void 0,e.concat([a.sent()]))];case 5:a.sent();r=["Staging build artifacts"];return[4,tN.stageBuildDirectory()];case 6:return[4,nt.apply(void 0,r.concat([a.sent()]))];case 7:a.sent();return[3,9];case 8:i=a.sent();throw G.error("Error building and staging ".concat(W,": ").concat(i.message)),i;case 9:o=["Executing lint-staged"];return[4,tN.lintStaged()];case 10:return[4,nt.apply(void 0,o.concat([a.sent()]))];case 11:a.sent(),nc();return[2]}})});return nl.apply(this,arguments)}function nf(){return np.apply(this,arguments)}function np(){np=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Inspecting ESLint configuration"];return[4,tN.eslintInspect()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return np.apply(this,arguments)}function nd(){return nh.apply(this,arguments)}function nh(){nh=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tX()];case 1:t.sent();return[4,Promise.all([ne(),ni()])];case 2:t.sent(),nc();return[2]}})});return nh.apply(this,arguments)}function nv(){return ny.apply(this,arguments)}function ny(){ny=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tX()];case 1:t.sent();return[4,Promise.all([ne(),ni(!0)])];case 2:t.sent(),nc();return[2]}})});return ny.apply(this,arguments)}function nm(){return ng.apply(this,arguments)}function ng(){ng=i(function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,tX()];case 1:n.sent();t=["Validating commit message"];return[4,tN.commitLint()];case 2:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 3:n.sent(),nc();return[2]}})});return ng.apply(this,arguments)}function nb(){return nw.apply(this,arguments)}function nw(){nw=i(function(){var t,n,e,r;return v(this,function(i){switch(i.label){case 0:t=["Configuring Git hooks"];return[4,tN.configureGitHook()];case 1:return[4,nt.apply(void 0,t.concat([i.sent()]))];case 2:i.sent(),D(t_.GIT_HOOK);return[4,t7(tT)];case 3:n=i.sent();P(t_.SIMPLE_GIT_HOOKS_JSON,n,{isJson:!0});e="\n".concat(Q,"\n");A(t_.GIT_IGNORE)?R(t_.GIT_IGNORE).split("\n").includes(Q)||x(t_.GIT_IGNORE,e):P(t_.GIT_IGNORE,e);r=["Setting up simple-git-hooks"];return[4,tN.simpleGitHooks()];case 4:return[4,nt.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})});return nw.apply(this,arguments)}function nI(){return nS.apply(this,arguments)}function nS(){nS=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tF([W],{update:!0,postInstallActions:[nb]})];case 1:t.sent();return[2]}})});return nS.apply(this,arguments)}function nE(){return nO.apply(this,arguments)}function nO(){nO=i(function(){return v(this,function(t){switch(t.label){case 0:D(t_.NODE_MODULES,t_.PNPM_LOCK_YAML);return[4,tx()];case 1:t.sent();return[4,nb()];case 2:t.sent();return[2]}})});return nO.apply(this,arguments)}function n_(){return nT.apply(this,arguments)}function nT(){nT=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Inspecting project dependencies"];return[4,tN.nodeModulesInspect()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nT.apply(this,arguments)}function nC(){return nk.apply(this,arguments)}function nk(){nk=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Running unit tests"];return[4,tN.testUnit()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nk.apply(this,arguments)}function nG(){return nN.apply(this,arguments)}function nN(){nN=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Running end-to-end tests"];return[4,tN.testE2e()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nN.apply(this,arguments)}i(function(){var t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,g(m(y.argv)).scriptName(te).usage("$0 <command> [options]").command("lint","Check code for linting issues",nd).command("lint:fix","Fix linting issues automatically",nv).command("lint:inspect","View active ESLint configuration",nf).command("lint-staged","Run lint checks on staged files",nu).command("commitlint","Validate commit message format",nm).command("setup","Initialize project setup and dependencies",nI).command("reset","Reset the project and reinstall dependencies",nE).command("inspect","Analyze installed project dependencies",n_).command("test:unit","Run unit test suite",nC).command("test:e2e","Run end-to-end test suite",nG).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:n.sent();return[3,3];case 2:t=n.sent();G.error("Fatal: ".concat(t.message)),y.exit(1);return[3,3];case 3:return[2]}})})();
|
|
1
|
+
function t(t,n){if(n==null||n>t.length)n=t.length;for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function n(t){if(Array.isArray(t))return t}function e(n){if(Array.isArray(n))return t(n)}function r(t,n,e,r,i,o,a){try{var c=t[o](a);var s=c.value}catch(t){e(t);return}if(c.done){n(s)}else{Promise.resolve(s).then(r,i)}}function i(t){return function(){var n=this,e=arguments;return new Promise(function(i,o){var a=t.apply(n,e);function c(t){r(a,i,o,c,s,"next",t)}function s(t){r(a,i,o,c,s,"throw",t)}c(undefined)})}}function o(t,n,e){if(n in t){Object.defineProperty(t,n,{value:e,enumerable:true,configurable:true,writable:true})}else{t[n]=e}return t}function a(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,n){var e=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(e==null)return;var r=[];var i=true;var o=false;var a,c;try{for(e=e.call(t);!(i=(a=e.next()).done);i=true){r.push(a.value);if(n&&r.length===n)break}}catch(t){o=true;c=t}finally{try{if(!i&&e["return"]!=null)e["return"]()}finally{if(o)throw c}}return r}function s(){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(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};var r=Object.keys(e);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))}r.forEach(function(n){o(t,n,e[n])})}return t}function f(t,e){return n(t)||c(t,e)||h(t,e)||s()}function p(t){return e(t)||a(t)||h(t)||u()}function d(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function h(n,e){if(!n)return;if(typeof n==="string")return t(n,e);var r=Object.prototype.toString.call(n).slice(8,-1);if(r==="Object"&&n.constructor)r=n.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 t(n,e)}function v(t,n){var e,r,i,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(t){return function(n){return s([t,n])}}function s(c){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(o=0)),o)try{if(e=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;r=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(c[0]===6&&o.label<i[1]){o.label=i[1];i=c;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(c);break}if(i[2])o.ops.pop();o.trys.pop();continue}c=n.call(t,o)}catch(t){c=[6,t];r=0}finally{e=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}import y from"node:process";import{hideBin as m}from"yargs/helpers";import g from"yargs/yargs";import b from"../../package-KSSCGX3B.json";import{exec as w}from"node:child_process";import I from"node:process";import*as S from"node:util";import E from"node:process";var O=E.env.DEBUG==="true";import _ from"chalk";import C from"consola";import{GraphQLError as T}from"graphql";O||(C.level=4);function k(t){var n=_[t];return typeof n=="function"?n:_.green}var G={silent:C.silent,level:C.level,fatal:C.fatal,error:C.error,warn:C.warn,log:C.log,info:C.info,success:C.success,ready:C.ready,start:C.start,box:C.box,debug:C.debug,trace:C.trace,verbose:C.verbose,printBoxedLog:function t(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(n===null||n===void 0?void 0:n.length)){C.box(_.green(t));return}n.forEach(function(t){var n=t.file,r=t.position,i=t.rule,o=t.message;C.log("".concat(_.gray("File:")," ").concat(_.blue("".concat(n).concat(r?":".concat(r):"")))),i&&C.log(" ".concat(k(e)("Rule:")," ").concat(i)),C.log(" ".concat(k(e)("Message:")," ").concat(o))}),C.box(k(e)("".concat(t," : ").concat(n.length))),C.log(_.gray("─".repeat(40)))}};var N={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import j from"node-fetch";import*as L from"node:fs";function A(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}return n.every(function(t){return L.existsSync(t)})}function R(t,n){var e=L.readFileSync(t,"utf-8");if(n===null||n===void 0?void 0:n.asJson)try{var r=JSON.parse(e);if((typeof r==="undefined"?"undefined":d(r))=="object"&&r!==null)return r;throw new Error("Parsed JSON is not an object or array")}catch(n){throw new Error("Failed to parse JSON from file: ".concat(t))}return e}function P(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=e.isJson,i=r===void 0?!1:r,o=i&&(typeof n==="undefined"?"undefined":d(n))=="object"?JSON.stringify(n,null,4):String(n);L.writeFileSync(t,o,"utf-8")}function x(t,n){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=e.isJson,i=r===void 0?!1:r,o=i&&(typeof n==="undefined"?"undefined":d(n))=="object"?JSON.stringify(n,null,4):String(n);L.appendFileSync(t,o,"utf-8")}function D(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}n.forEach(function(t){A(t)&&L.rmSync(t,{recursive:!0,force:!0})})}import F from"node:process";import*as M from"node:path";function U(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var r;return(r=M).resolve.apply(r,[K].concat(p(n)))}function J(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var r;return(r=M).join.apply(r,p(n))}var K=F.env.INIT_CWD||F.cwd(),W="@cyberskill/shared",B=".cyberskill-storage",H="node_modules",Y="dist",$="package.json",V="package-lock.json",z="tsconfig.json",q=".gitignore",Q=".simple-git-hooks.json",X="pnpm-lock.yaml",Z=".git/hooks/",tt=".git/COMMIT_EDITMSG",tn=J(K,H,W,Y),te="cyberskill",tr="src/nodejs/cli/index.ts",ti="eslint",to="eslint",ta="vitest",tc="playwright",ts="vitest",tu="@commitlint/cli",tl="commitlint",tf="lint-staged",tp="lint-staged",td="typescript",th="tsc",tv="tsx",ty="git",tm="pnpm",tg="pnpm exec",tb="simple-git-hooks",tw="simple-git-hooks",tI="@eslint/config-inspector",tS="eslint-config-inspector",tE="node-modules-inspector",tO="node-modules-inspector",t_={CYBERSKILL_DIRECTORY:tn,WORKING_DIRECTORY:K,TS_CONFIG:U(z),GIT_IGNORE:U(q),GIT_HOOK:U(Z),GIT_COMMIT_MSG:U(tt),SIMPLE_GIT_HOOKS_JSON:U(Q),PACKAGE_JSON:U($),PACKAGE_LOCK_JSON:U(V),PNPM_LOCK_YAML:U(X),NODE_MODULES:U(H),LINT_STAGED_CONFIG:U("".concat(tn,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:U("".concat(tn,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:U("".concat(tn,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:U("".concat(tn,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:U("".concat(tn,"/react/vitest/vitest.e2e.js"))};function tC(t){var n=t.isCurrentProject;return l({"pre-commit":tp,"commit-msg":tl},n&&{"pre-push":t5("".concat(ty," pull"))})}function tT(t){return tk.apply(this,arguments)}function tk(){tk=i(function(t){var n,e,r,i,o,a;var c=arguments;return v(this,function(s){switch(s.label){case 0:for(n=c.length,e=new Array(n>1?n-1:0),r=1;r<n;r++){e[r-1]=c[r]}i=f(e,2),o=i[0],a=i[1];if(!o)throw new Error("'first' argument is undefined");switch(t){case"CLI":return[3,1];case"RAW":return[3,3]}return[3,4];case 1:return[4,tF(o.split(" "),{update:!0})];case 2:return[2,(s.sent(),t8(t5("".concat(tg," ").concat(a))))];case 3:return[2,t8(t5(o))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tk.apply(this,arguments)}function tG(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),r=1;r<n;r++){e[r-1]=arguments[r]}return /*#__PURE__*/i(function(){return v(this,function(n){return[2,tT.apply(void 0,[t].concat(p(e)))]})})}var tN={simpleGitHooks:tG("CLI",tb,tw),eslintInspect:tG("CLI",tI,tS),nodeModulesInspect:tG("CLI",tE,tO),eslintCheck:tG("CLI",ti,"".concat(to," ").concat(t_.WORKING_DIRECTORY)),eslintFix:tG("CLI",ti,"".concat(to," ").concat(t_.WORKING_DIRECTORY," --fix")),typescriptCheck:tG("CLI",td,"".concat(th," -p ").concat(t_.TS_CONFIG," --noEmit")),configureGitHook:tG("RAW","".concat(ty," config core.hooksPath ").concat(t_.GIT_HOOK)),testUnit:tG("CLI",ta,"".concat(ts," --config ").concat(t_.UNIT_TEST_CONFIG)),testE2e:tG("CLI","".concat(ta," ").concat(tc),"".concat(ts," --config ").concat(t_.E2E_TEST_CONFIG)),commitLint:tG("CLI",tu,"".concat(tl," --edit ").concat(t_.GIT_COMMIT_MSG," --config ").concat(t_.COMMITLINT_CONFIG)),lintStaged:tG("CLI",tf,"".concat(tp," --config ").concat(t_.LINT_STAGED_CONFIG)),stageBuildDirectory:tG("RAW","".concat(ty," add ").concat(Y)),build:tG("RAW","".concat(tm," run build")),pnpmInstallStandard:tG("RAW","".concat(tm," install")),pnpmInstallLegacy:tG("RAW","".concat(tm," install --legacy-peer-deps")),pnpmInstallForce:tG("RAW","".concat(tm," install --force"))};function tj(t){var n=J(K,$);if(!A(n))return!1;try{var e=R(n,{asJson:!0}),r=e.name,i=e.dependencies,o=i===void 0?{}:i,a=e.devDependencies,c=a===void 0?{}:a,s=r===t,u=t in o,l=t in c;return s||u||l?{path:n,file:e,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(t){return G.warn("Failed to read package.json: ".concat(t.message)),!1}}function tL(t){return tA.apply(this,arguments)}function tA(){tA=i(function(t){var n,e,r,i;return v(this,function(o){switch(o.label){case 0:o.trys.push([0,3,,4]);return[4,j("https://registry.npmjs.org/".concat(t,"/latest"))];case 1:n=o.sent();if(!n.ok)throw new Error("Failed to fetch latest version: ".concat(n.status," ").concat(n.statusText));return[4,n.json()];case 2:e=o.sent(),r=e.version;return[2,r];case 3:i=o.sent();throw G.error('Failed to fetch version for "'.concat(t,'": ').concat(i.message)),i;case 4:return[2]}})});return tA.apply(this,arguments)}function tR(t,n){return tP.apply(this,arguments)}function tP(){tP=i(function(t,n){var e,r,i,o,a,c,s,u,f,p,d,h,y,m,g,b,w,I,S,E,O;return v(this,function(v){switch(v.label){case 0:v.trys.push([0,4,,5]);e=tj(t);if(!e)return[2,l({},N)];s=e.path,u=e.file,f=e.isCurrentProject,p=e.isDepend,d=e.isDevDepend,h=(r=u.dependencies)!==null&&r!==void 0?r:{},y=(i=u.devDependencies)!==null&&i!==void 0?i:{},m=f?(o=u.version)!==null&&o!==void 0?o:"0.0.0":p?(a=h[t])!==null&&a!==void 0?a:"0.0.0":d?(c=y[t])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=m;return[3,3];case 1:return[4,tL(t)];case 2:w=v.sent();v.label=3;case 3:g=w,b=f||m===g;if(!b&&(n===null||n===void 0?void 0:n.update)){;S=p?"dependencies":d?"devDependencies":null;S&&((I=u[S])===null||I===void 0?void 0:I[t])!==g&&(u[S]=(E=u[S])!==null&&E!==void 0?E:{},u[S][t]=g,P(s,u,{isJson:!0}),G.info('Updated "'.concat(t,'" to version ').concat(g)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:b}];case 4:O=v.sent();return[2,(G.error('Error checking package "'.concat(t,'": ').concat(O.message)),l({},N))];case 5:return[2]}})});return tP.apply(this,arguments)}function tx(){return tD.apply(this,arguments)}function tD(){tD=i(function(){var t,n,e,r,i,o,a,c,s,u,l,f;return v(this,function(p){switch(p.label){case 0:t=[{command:function(){return tN.pnpmInstallStandard()},message:"Installing dependencies (standard)"},{command:function(){return tN.pnpmInstallLegacy()},message:"Retrying with legacy peer dependencies"},{command:function(){return tN.pnpmInstallForce()},message:"Retrying with force install"}];n=true,e=false,r=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);i=t[Symbol.iterator]();p.label=2;case 2:if(!!(n=(o=i.next()).done))return[3,8];a=o.value,c=a.command,s=a.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,nt("".concat(s," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();G.warn("Installation attempt failed: ".concat(s)),G.error("Details: ".concat(l.message));return[3,7];case 7:n=true;return[3,2];case 8:return[3,11];case 9:f=p.sent();e=true;r=f;return[3,11];case 10:try{if(!n&&i.return!=null){i.return()}}finally{if(e){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return tD.apply(this,arguments)}function tF(t,n){return tM.apply(this,arguments)}function tM(){tM=i(function(t,n){var e,r,i,o,a,c,s,u,f,d,h;return v(this,function(v){switch(v.label){case 0:if(!A(t_.PACKAGE_JSON)){G.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);e=p(new Set(t)).sort();return[4,Promise.all(e.map(function(t){return tR(t,l({},(n===null||n===void 0?void 0:n.update)&&{update:n.update}))}))];case 2:r=v.sent().every(function(t){return t.isUpToDate});if(r)return[3,4];return[4,tx()];case 3:r=v.sent();v.label=4;case 4:r;o=true,a=false,c=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((i=n===null||n===void 0?void 0:n.postInstallActions)!==null&&i!==void 0?i:[])[Symbol.iterator]();v.label=6;case 6:if(!!(o=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:o=true;return[3,6];case 9:return[3,12];case 10:d=v.sent();a=true;c=d;return[3,12];case 11:try{if(!o&&s.return!=null){s.return()}}finally{if(a){throw c}}return[7];case 12:return[3,14];case 13:h=v.sent();throw G.error('Failed to setup "'.concat(t.join(", "),'": ').concat(h.message)),h;case 14:return[2]}})});return tM.apply(this,arguments)}import tU from"node-persist";import tJ from"node:os";import tK from"node:process";function tW(){return tK.env.CYBERSKILL_STORAGE_DIR||J(tJ.homedir(),B)}function tB(){return tH.apply(this,arguments)}function tH(){tH=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=tU.defaultInstance;if(t)return[3,2];return[4,tU.init({dir:tW(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:t=n.sent();n.label=2;case 2:t;return[2]}})});return tH.apply(this,arguments)}var tY={get:function t(t){return i(function(){var n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tB()];case 1:r.sent();return[4,tU.getItem(t)];case 2:return[2,(n=r.sent())!==null&&n!==void 0?n:null];case 3:e=r.sent();return[2,(G.error('[Storage:get] Error getting key "'.concat(t,'":'),e),null)];case 4:return[2]}})})()},set:function t(t,n){return i(function(){var e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tB()];case 1:r.sent();return[4,tU.setItem(t,n)];case 2:r.sent();return[3,4];case 3:e=r.sent();G.error('[Storage:set] Error setting key "'.concat(t,'":'),e);return[3,4];case 4:return[2]}})})()},remove:function t(t){return i(function(){var n;return v(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,tB()];case 1:e.sent();return[4,tU.removeItem(t)];case 2:e.sent();return[3,4];case 3:n=e.sent();G.error('[Storage:remove] Error removing key "'.concat(t,'":'),n);return[3,4];case 4:return[2]}})})()},keys:function t(){return i(function(){var t,n;return v(this,function(e){switch(e.label){case 0:e.trys.push([0,3,,4]);return[4,tB()];case 1:e.sent();return[4,tU.keys()];case 2:t=e.sent();return[2,Array.isArray(t)?t:(G.warn("[Storage:keys] Invalid keys response:",t),[])];case 3:n=e.sent();return[2,(G.error("[Storage:keys] Error getting keys:",n),[])];case 4:return[2]}})})()},getLogLink:function t(t){return i(function(){return v(this,function(n){try{return[2,"".concat(tW()," (key: ").concat(t,")")]}catch(t){return[2,(G.error("[Storage:getLogLink] Error getting log link:",t),null)]}return[2]})})()}};var t$=S.promisify(w);function tV(t){return"error_list:".concat(t)}function tz(t){return tq.apply(this,arguments)}function tq(){tq=i(function(t){var n,e,r;return v(this,function(o){switch(o.label){case 0:if(t.length===0)return[2];n=Date.now(),e=tV(n);o.label=1;case 1:o.trys.push([1,3,,4]);return[4,tY.set(e,{errors:t,timestamp:n})];case 2:o.sent(),setTimeout(/*#__PURE__*/i(function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,tY.getLogLink(e)];case 1:t=n.sent();t&&G.info("\uD83D\uDCC2 Open the error list manually: ".concat(t));return[2]}})}),10);return[3,4];case 3:r=o.sent();G.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return tq.apply(this,arguments)}function tQ(){return tX.apply(this,arguments)}function tX(){tX=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tY.keys()];case 1:t=r.sent(),n=Array.isArray(t)?t.filter(function(t){var n;return t===null||t===void 0?void 0:(n=t.startsWith)===null||n===void 0?void 0:n.call(t,"error_list:")}):[];return[4,Promise.all(n.map(/*#__PURE__*/function(){var t=i(function(t){var n;return v(this,function(e){switch(e.label){case 0:return[4,tY.get(t)];case 1:return[2,((n=e.sent())===null||n===void 0?void 0:n.errors)||[]]}})});return function(n){return t.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:e=r.sent();return[2,(G.error("Failed to retrieve stored errors: ".concat(e.message)),[])];case 4:return[2]}})});return tX.apply(this,arguments)}function tZ(){return t0.apply(this,arguments)}function t0(){t0=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,tY.keys()];case 1:t=r.sent(),n=Array.isArray(t)?t.filter(function(t){var n;return t===null||t===void 0?void 0:(n=t.startsWith)===null||n===void 0?void 0:n.call(t,"error_list:")}):[];return[4,Promise.all(n.map(function(t){return tY.remove(t)}))];case 2:r.sent();return[3,4];case 3:e=r.sent();G.error("Failed to clear error lists: ".concat(e.message));return[3,4];case 4:return[2]}})});return t0.apply(this,arguments)}function t1(t){var n=[],e=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,o=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;t.split("\n").forEach(function(t){if(t.startsWith("/"))r=t.trim();else{var c,s,u,l,f;var p=i.exec(t)||[],d=o.exec(t)||[],h=a.exec(t)||[];var v,y,m,g,b,w;p.length&&r?n.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]==="error"?"error":"warning",message:(v=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&v!==void 0?v:"",rule:(y=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&y!==void 0?y:""}):d.length?n.push({file:(m=d===null||d===void 0?void 0:d[1])!==null&&m!==void 0?m:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]==="error"?"error":"warning",message:(g=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&g!==void 0?g:""}):h.length?n.push({file:"commitlint",type:"error",message:(b=h===null||h===void 0?void 0:(l=h[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=h===null||h===void 0?void 0:(f=h[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):e.push(t.trim())}}),n.length&&tz(n),O&&e.length&&(G.warn("Unmatched lines:"),e.forEach(function(t){return G.info(" ".concat(t))}))}function t4(t){try{var n=JSON.parse(t),e=[];n.forEach(function(t){var n=t.filePath,r=t.messages;r.forEach(function(t){var r=t.severity,i=t.line,o=t.column,a=t.ruleId,c=t.message;e.push({type:r===2?"error":"warning",file:n,position:"".concat(i,":").concat(o),rule:a,message:c})})}),e.length&&tz(e)}catch(n){t1(t)}}function t2(t){return t3.apply(this,arguments)}function t3(){t3=i(function(t){var n,e,r,i,o,a,c,s,u;var l=arguments;return v(this,function(f){switch(f.label){case 0:n=l.length>1&&l[1]!==void 0?l[1]:t4;e=new AbortController;I.on("SIGINT",function(){G.warn("Process interrupted. Terminating..."),e.abort(),I.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,t$(t,{maxBuffer:0x6400000,signal:e.signal})];case 2:r=f.sent(),i=r.stdout,o=r.stderr;[i,o].forEach(function(t){return t&&n(t)});return[3,4];case 3:a=f.sent();c=a.stdout,s=a.stderr,u=a.message;[c,s].forEach(function(t){return t&&n(t)}),!s&&!c&&G.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return t3.apply(this,arguments)}function t5(t){return{raw:!0,cmd:t}}function t6(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tg," ").concat(W," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tg," ").concat(tv," ").concat(tr," ").concat(t):"".concat(tg," ").concat(te," ").concat(t)}function t8(t,n){return typeof t=="function"?t6(t(n),n):(typeof t==="undefined"?"undefined":d(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?t6(t,n):t}function t7(t){return t9.apply(this,arguments)}function t9(){t9=i(function(t){var n,e,r,i,o,a,c;var s=arguments;return v(this,function(u){switch(u.label){case 0:n=s.length>1&&s[1]!==void 0?s[1]:{};r=(e=n===null||n===void 0?void 0:n.isRemote)!==null&&e!==void 0?e:!1;if(!r)return[3,1];c=!1;return[3,3];case 1:return[4,tR(W)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:i=c,o={isRemote:r,isCurrentProject:i},a=typeof t=="function"?t(o):t;return[2,Object.fromEntries(Object.entries(a).map(function(t){var n=f(t,2),e=n[0],r=n[1];return[e,t8(r,o)]}))]}})});return t9.apply(this,arguments)}function nt(t,n){return nn.apply(this,arguments)}function nn(){nn=i(function(t,n){var e;return v(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);G.start("".concat(t)),O&&G.info("→ ".concat(n));return[4,t2(n)];case 1:r.sent(),G.success("".concat(t," done."));return[3,3];case 2:e=r.sent();throw G.error("".concat(t," failed: ").concat(e.message)),e;case 3:return[2]}})});return nn.apply(this,arguments)}function ne(){return nr.apply(this,arguments)}function nr(){nr=i(function(){var t,n;return v(this,function(e){switch(e.label){case 0:if(!A(t_.TS_CONFIG))return[3,3];n=["Performing TypeScript validation"];return[4,tN.typescriptCheck()];case 1:return[4,nt.apply(void 0,n.concat([e.sent()]))];case 2:t=e.sent();return[3,4];case 3:t=G.warn("No TypeScript configuration found. Skipping type check.");e.label=4;case 4:t;return[2]}})});return nr.apply(this,arguments)}function ni(){return no.apply(this,arguments)}function no(){no=i(function(){var t,n,e,r;var i=arguments;return v(this,function(o){switch(o.label){case 0:t=i.length>0&&i[0]!==void 0?i[0]:!1;if(!t)return[3,3];e=["Running ESLint with auto-fix"];return[4,tN.eslintFix()];case 1:return[4,nt.apply(void 0,e.concat([o.sent()]))];case 2:n=o.sent();return[3,6];case 3:r=["Running ESLint check"];return[4,tN.eslintCheck()];case 4:return[4,nt.apply(void 0,r.concat([o.sent()]))];case 5:n=o.sent();o.label=6;case 6:n;return[2]}})});return no.apply(this,arguments)}function na(t,n){if(!n.length)return;var e=t==="Errors"?"red":"yellow";G.printBoxedLog(t==="Errors"?"✖ Errors":"⚠ Warnings",n,e)}function nc(){return ns.apply(this,arguments)}function ns(){ns=i(function(){var t,n,e;return v(this,function(r){switch(r.label){case 0:return[4,tQ()];case 1:t=r.sent(),n=t.filter(function(t){return t.type==="error"}),e=t.filter(function(t){return t.type==="warning"});!n.length&&!e.length?G.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(na("Warnings",e),na("Errors",n));return[2]}})});return ns.apply(this,arguments)}function nu(){return nl.apply(this,arguments)}function nl(){nl=i(function(){var t,n,e,r,i,o;return v(this,function(a){switch(a.label){case 0:return[4,tZ()];case 1:a.sent();return[4,tR(W)];case 2:t=a.sent(),n=t.isCurrentProject;if(!n)return[3,9];a.label=3;case 3:a.trys.push([3,8,,9]);e=["Building package: ".concat(W)];return[4,tN.build()];case 4:return[4,nt.apply(void 0,e.concat([a.sent()]))];case 5:a.sent();r=["Staging build artifacts"];return[4,tN.stageBuildDirectory()];case 6:return[4,nt.apply(void 0,r.concat([a.sent()]))];case 7:a.sent();return[3,9];case 8:i=a.sent();throw G.error("Error building and staging ".concat(W,": ").concat(i.message)),i;case 9:o=["Executing lint-staged"];return[4,tN.lintStaged()];case 10:return[4,nt.apply(void 0,o.concat([a.sent()]))];case 11:a.sent(),nc();return[2]}})});return nl.apply(this,arguments)}function nf(){return np.apply(this,arguments)}function np(){np=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Inspecting ESLint configuration"];return[4,tN.eslintInspect()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return np.apply(this,arguments)}function nd(){return nh.apply(this,arguments)}function nh(){nh=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tZ()];case 1:t.sent();return[4,Promise.all([ne(),ni()])];case 2:t.sent(),nc();return[2]}})});return nh.apply(this,arguments)}function nv(){return ny.apply(this,arguments)}function ny(){ny=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tZ()];case 1:t.sent();return[4,Promise.all([ne(),ni(!0)])];case 2:t.sent(),nc();return[2]}})});return ny.apply(this,arguments)}function nm(){return ng.apply(this,arguments)}function ng(){ng=i(function(){var t;return v(this,function(n){switch(n.label){case 0:return[4,tZ()];case 1:n.sent();t=["Validating commit message"];return[4,tN.commitLint()];case 2:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 3:n.sent(),nc();return[2]}})});return ng.apply(this,arguments)}function nb(){return nw.apply(this,arguments)}function nw(){nw=i(function(){var t,n,e,r;return v(this,function(i){switch(i.label){case 0:t=["Configuring Git hooks"];return[4,tN.configureGitHook()];case 1:return[4,nt.apply(void 0,t.concat([i.sent()]))];case 2:i.sent(),D(t_.GIT_HOOK);return[4,t7(tC)];case 3:n=i.sent();P(t_.SIMPLE_GIT_HOOKS_JSON,n,{isJson:!0});e="\n".concat(Q,"\n");A(t_.GIT_IGNORE)?R(t_.GIT_IGNORE).split("\n").includes(Q)||x(t_.GIT_IGNORE,e):P(t_.GIT_IGNORE,e);r=["Setting up simple-git-hooks"];return[4,tN.simpleGitHooks()];case 4:return[4,nt.apply(void 0,r.concat([i.sent()]))];case 5:i.sent();return[2]}})});return nw.apply(this,arguments)}function nI(){return nS.apply(this,arguments)}function nS(){nS=i(function(){return v(this,function(t){switch(t.label){case 0:return[4,tF([W],{update:!0,postInstallActions:[nb]})];case 1:t.sent();return[2]}})});return nS.apply(this,arguments)}function nE(){return nO.apply(this,arguments)}function nO(){nO=i(function(){return v(this,function(t){switch(t.label){case 0:D(t_.NODE_MODULES,t_.PNPM_LOCK_YAML);return[4,tx()];case 1:t.sent();return[4,nb()];case 2:t.sent();return[2]}})});return nO.apply(this,arguments)}function n_(){return nC.apply(this,arguments)}function nC(){nC=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Inspecting project dependencies"];return[4,tN.nodeModulesInspect()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nC.apply(this,arguments)}function nT(){return nk.apply(this,arguments)}function nk(){nk=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Running unit tests"];return[4,tN.testUnit()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nk.apply(this,arguments)}function nG(){return nN.apply(this,arguments)}function nN(){nN=i(function(){var t;return v(this,function(n){switch(n.label){case 0:t=["Running end-to-end tests"];return[4,tN.testE2e()];case 1:return[4,nt.apply(void 0,t.concat([n.sent()]))];case 2:n.sent();return[2]}})});return nN.apply(this,arguments)}i(function(){var t;return v(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);return[4,g(m(y.argv)).scriptName(te).usage("$0 <command> [options]").command("lint","Check code for linting issues",nd).command("lint:fix","Fix linting issues automatically",nv).command("lint:inspect","View active ESLint configuration",nf).command("lint-staged","Run lint checks on staged files",nu).command("commitlint","Validate commit message format",nm).command("setup","Initialize project setup and dependencies",nI).command("reset","Reset the project and reinstall dependencies",nE).command("inspect","Analyze installed project dependencies",n_).command("test:unit","Run unit test suite",nT).command("test:e2e","Run end-to-end test suite",nG).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(b.version).epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse()];case 1:n.sent();return[3,3];case 2:t=n.sent();G.error("Fatal: ".concat(t.message)),y.exit(1);return[3,3];case 3:return[2]}})})();
|