@cyberskill/shared 1.52.0 → 1.54.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.
@@ -5997,9 +5997,9 @@ export declare const default_alias_8: (options: UserConfig) => UserConfig;
5997
5997
  export declare const default_alias_9: (options: UserConfig) => UserConfig;
5998
5998
 
5999
5999
  declare enum E_CommandType {
6000
- PNPM_ADD_AND_EXEC = "pnpmAddAndExec",
6001
- PNPM_EXEC = "pnpmExec",
6002
- RAW = "raw"
6000
+ PNPM_ADD_AND_EXEC = "PNPM_ADD_AND_EXEC",
6001
+ PNPM_EXEC = "PNPM_EXEC",
6002
+ RAW = "RAW"
6003
6003
  }
6004
6004
  export { E_CommandType }
6005
6005
  export { E_CommandType as E_CommandType_alias_1 }
@@ -6870,6 +6870,7 @@ declare const PATH: {
6870
6870
  LINT_STAGED_CONFIG: string;
6871
6871
  COMMITLINT_CONFIG: string;
6872
6872
  UNIT_TEST_CONFIG: string;
6873
+ UNIT_TEST_SETUP_CONFIG: string;
6873
6874
  E2E_TEST_CONFIG: string;
6874
6875
  };
6875
6876
  };
@@ -7565,7 +7566,7 @@ export { TSC_CLI }
7565
7566
  export { TSC_CLI as TSC_CLI_alias_1 }
7566
7567
  export { TSC_CLI as TSC_CLI_alias_2 }
7567
7568
 
7568
- declare const TSC_PACKAGE_NAME = "tsc";
7569
+ declare const TSC_PACKAGE_NAME = "typescript";
7569
7570
  export { TSC_PACKAGE_NAME }
7570
7571
  export { TSC_PACKAGE_NAME as TSC_PACKAGE_NAME_alias_1 }
7571
7572
  export { TSC_PACKAGE_NAME as TSC_PACKAGE_NAME_alias_2 }
@@ -5997,9 +5997,9 @@ export declare const default_alias_8: (options: UserConfig) => UserConfig;
5997
5997
  export declare const default_alias_9: (options: UserConfig) => UserConfig;
5998
5998
 
5999
5999
  declare enum E_CommandType {
6000
- PNPM_ADD_AND_EXEC = "pnpmAddAndExec",
6001
- PNPM_EXEC = "pnpmExec",
6002
- RAW = "raw"
6000
+ PNPM_ADD_AND_EXEC = "PNPM_ADD_AND_EXEC",
6001
+ PNPM_EXEC = "PNPM_EXEC",
6002
+ RAW = "RAW"
6003
6003
  }
6004
6004
  export { E_CommandType }
6005
6005
  export { E_CommandType as E_CommandType_alias_1 }
@@ -6870,6 +6870,7 @@ declare const PATH: {
6870
6870
  LINT_STAGED_CONFIG: string;
6871
6871
  COMMITLINT_CONFIG: string;
6872
6872
  UNIT_TEST_CONFIG: string;
6873
+ UNIT_TEST_SETUP_CONFIG: string;
6873
6874
  E2E_TEST_CONFIG: string;
6874
6875
  };
6875
6876
  };
@@ -7565,7 +7566,7 @@ export { TSC_CLI }
7565
7566
  export { TSC_CLI as TSC_CLI_alias_1 }
7566
7567
  export { TSC_CLI as TSC_CLI_alias_2 }
7567
7568
 
7568
- declare const TSC_PACKAGE_NAME = "tsc";
7569
+ declare const TSC_PACKAGE_NAME = "typescript";
7569
7570
  export { TSC_PACKAGE_NAME }
7570
7571
  export { TSC_PACKAGE_NAME as TSC_PACKAGE_NAME_alias_1 }
7571
7572
  export { TSC_PACKAGE_NAME as TSC_PACKAGE_NAME_alias_2 }
package/dist/cli.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,i,a,c){try{var o=e[a](c);var s=o.value}catch(e){n(e);return}if(o.done){t(s)}else{Promise.resolve(s).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){var c=e.apply(t,n);function o(e){r(c,i,a,o,s,"next",e)}function s(e){r(c,i,a,o,s,"throw",e)}o(undefined)})}}function a(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 c(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function o(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var a=false;var c,o;try{for(n=n.call(e);!(i=(c=n.next()).done);i=true){r.push(c.value);if(t&&r.length===t)break}}catch(e){a=true;o=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(a)throw o}}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){a(e,t,n[t])})}return e}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{f(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function d(e,n){return t(e)||o(e,n)||y(e,n)||s()}function h(e){return n(e)||c(e)||y(e)||u()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,i,a,c={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return a={next:o(0),"throw":o(1),"return":o(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function o(e){return function(t){return s([e,t])}}function s(a){if(n)throw new TypeError("Generator is already executing.");while(c)try{if(n=1,r&&(i=a[0]&2?r["return"]:a[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;if(r=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:c.label++;return{value:a[1],done:false};case 5:c.label++;r=a[1];a=[0];continue;case 7:a=c.ops.pop();c.trys.pop();continue;default:if(!(i=c.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){c=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){c.label=a[1];break}if(a[0]===6&&c.label<i[1]){c.label=i[1];i=a;break}if(i&&c.label<i[2]){c.label=i[2];c.ops.push(a);break}if(i[2])c.ops.pop();c.trys.pop();continue}a=t.call(e,c)}catch(e){a=[6,e];r=0}finally{n=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}var v=Object.create;var b=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var w=function(e,t,n,r){var i=true,a=false,c=undefined;if(t&&(typeof t==="undefined"?"undefined":g(t))=="object"||typeof t=="function")try{var o=function(){var i=u.value;!O.call(e,i)&&i!==n&&b(e,i,{get:function(){return t[i]},enumerable:!(r=E(t,i))||r.enumerable})};for(var s=I(t)[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true)o()}catch(e){a=true;c=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(a){throw c}}}return e};var _=function(e,t,n){return n=e!=null?v(S(e)):{},w(t||!e||!e.__esModule?b(n,"default",{value:e,enumerable:!0}):n,e)};var T=_(require("process"),1),C=require("yargs/helpers"),N=_(require("yargs/yargs"),1);var L=_(require("process"),1);var P=_(require("boxen"),1),A=_(require("chalk"),1),j=require("child_process"),R=_(require("process"),1),G=_(require("util"),1);var k=_(require("node-fetch"),1);var M=_(require("fs"),1),D=function(e){return M.existsSync(e)};function x(e,t){var n=M.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":g(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 K(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,a=i&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);M.writeFileSync(e,a,"utf-8")}function F(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,a=i&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);M.appendFileSync(e,a,"utf-8")}function B(e){e.forEach(function(e){D(e)&&M.rmSync(e,{recursive:!0,force:!0})})}var Y=_(require("path"),1);function U(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=Y).resolve.apply(r,[eP].concat(h(t)))}function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=Y).join.apply(r,h(t))}var q=_(require("node-persist"),1),H=_(require("os"),1),V=_(require("process"),1);function W(){return V.default.env.CYBERSKILL_STORAGE_DIR||J(H.default.homedir(),ej)}function $(){return z.apply(this,arguments)}function z(){z=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=q.default.defaultInstance;if(e)return[3,2];return[4,q.default.init({dir:W(),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 z.apply(this,arguments)}var X={get:function e(e){return i(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,$()];case 1:r.sent();return[4,q.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,$()];case 1:r.sent();return[4,q.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,$()];case 1:n.sent();return[4,q.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,$()];case 1:n.sent();return[4,q.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(console.warn("⚠️ [Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return m(this,function(t){try{return[2,"".concat(W()," (key: ").concat(e,")")]}catch(e){return[2,(console.error("❌ [Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var Q=24*60*60*1e3;function Z(e){var t=J(eP,ek);if(D(t))try{var n=x(t,{asJson:!0});if(n.name===e)return{path:t,file:n,isCurrentProject:!0}}catch(e){ed.warning("Failed to read local package.json: ".concat(e.message))}var r=J(eP,eR,e,ek);if(D(r))try{var i=x(r,{asJson:!0});if(i.name===e)return{path:r,file:i,isCurrentProject:!1}}catch(t){ed.warning("Failed to read node_modules package.json for ".concat(e,": ").concat(t.message))}return!1}function ee(e){return et.apply(this,arguments)}function et(){et=i(function(e){var t,n,r,i,a,c,o,s,u,l;var f=arguments;return m(this,function(p){switch(p.label){case 0:t=f.length>1&&f[1]!==void 0?f[1]:!1;n="npm_version:".concat(e),r="npm_metadata:".concat(e);return[4,X.get(n)];case 1:i=p.sent();return[4,X.get(r)];case 2:a=p.sent(),c=i&&Date.now()-i.timestamp<Q;if(!t&&c)return[2,i.version];o={};(a===null||a===void 0?void 0:a.etag)&&(o["If-None-Match"]=a.etag),(a===null||a===void 0?void 0:a.lastModified)&&(o["If-Modified-Since"]=a.lastModified);p.label=3;case 3:p.trys.push([3,8,,9]);return[4,(0,k.default)("https://registry.npmjs.org/".concat(e,"/latest"),{headers:o})];case 4:s=p.sent();if(s.status===304&&i)return[2,i.version];if(!s.ok)throw new Error("Failed to fetch latest version: ".concat(s.statusText));return[4,s.json()];case 5:u=p.sent().version;return[4,X.set(n,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,X.set(r,{etag:s.headers.get("ETag")||void 0,lastModified:s.headers.get("Last-Modified")||void 0})];case 7:return[2,(p.sent(),u)];case 8:l=p.sent();if(ed.error("Error fetching latest version for ".concat(e,": ").concat(l.message)),i)return[2,(ed.warning("Falling back to cached version for ".concat(e,": ").concat(i.version)),i.version)];throw l;case 9:return[2]}})});return et.apply(this,arguments)}function en(e){return er.apply(this,arguments)}function er(){er=i(function(e){var t,n,r,i,a;return m(this,function(c){switch(c.label){case 0:t={isInstalled:!1,isCurrentProject:!1,installedPath:"",installedVersion:"",latestVersion:"",file:{}};c.label=1;case 1:c.trys.push([1,6,,7]);n=Z(e);r=n;if(!r)return[3,5];t.file=n.file,t.isInstalled=!0,t.installedPath=n.path,t.installedVersion=n.file.version,t.isCurrentProject=n.isCurrentProject;if(!n.isCurrentProject)return[3,2];i=n.file.version;return[3,4];case 2:return[4,ee(e,!0)];case 3:i=c.sent();c.label=4;case 4:r=t.latestVersion=i;c.label=5;case 5:return[2,(r,t)];case 6:a=c.sent();return[2,(ed.error('Error checking package "'.concat(e,'": ').concat(a.message)),t)];case 7:return[2]}})});return er.apply(this,arguments)}var ei=R.default.env.DEBUG==="true",ea=G.promisify(j.exec),ec=A.default,eo=ec.gray,es=ec.blue;function eu(){return eo("[".concat(new Date().toLocaleTimeString(),"]"))}function el(e){var t=A.default[e];return typeof t=="function"?t:A.default.green}function ef(e,t,n,r){var i=el(t);console.log("".concat(eu()," ").concat(i("".concat(n," ").concat(e))," ").concat(r))}function ep(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.color,i=r===void 0?"green":r,a=n.padding,c=a===void 0?1:a,o=n.margin,s=o===void 0?1:o,u=n.borderStyle,l=u===void 0?"round":u,f=n.titleColor,p=f===void 0?"bold":f;var d=el(i),h=el(p);if(typeof t=="string"){console.log((0,P.default)(h(d("".concat(e,"\n").concat(t))),{padding:c,margin:s,borderStyle:l,borderColor:i}));return}Array.isArray(t)&&t.length&&(t.forEach(function(e){var t=e.file,n=e.position,r=e.rule,i=e.message;console.log("".concat(eu()," ").concat(d("File:")," ").concat(es("".concat(t).concat(n?":".concat(n):"")))),r&&console.log(" ".concat(d("Rule:")," ").concat(d(r))),console.log(" ".concat(d("Message:")," ").concat(d(i)))}),console.log((0,P.default)(h(d("".concat(e,": ").concat(t.length))),{padding:c,margin:s,borderStyle:l,borderColor:i})),console.log(eo("─".repeat(40))))}var ed={success:function(e){return ef("SUCCESS","green","✔",e)},error:function(e){return ef("ERROR","red","✖",e)},warning:function(e){return ef("WARNING","yellow","⚠",e)},info:function(e){return ef("INFO","blue","ℹ",e)},printBoxedLog:ep};function eh(e){return"error_list:".concat(e)}function eg(e){return ey.apply(this,arguments)}function ey(){ey=i(function(e){var t,n,r;return m(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),n=eh(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,X.set(n,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,X.getLogLink(n)];case 1:e=t.sent();e&&ed.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=a.sent();ed.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return ey.apply(this,arguments)}function em(){return ev.apply(this,arguments)}function ev(){ev=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,X.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=i(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,X.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,(ed.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return ev.apply(this,arguments)}function eb(){return eE.apply(this,arguments)}function eE(){eE=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,X.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 X.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();ed.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return eE.apply(this,arguments)}function eI(e){var t=[],n=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,a=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,c=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var o=i.exec(e)||[],s=a.exec(e)||[],u=c.exec(e)||[];o.length&&r?t.push({file:r,position:"".concat(o[1],":").concat(o[2]),type:o[3]==="error"?"error":"warning",message:o[4].trim(),rule:o[5].trim()}):s.length?t.push({file:s[1],position:"".concat(s[2],":").concat(s[3]),type:s[4]==="error"?"error":"warning",message:s[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&eg(t),n.length&&ei&&(ed.warning("Unmatched lines:"),n.forEach(function(e){return console.log(" ".concat(e))}))}function eS(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,i=e.line,a=e.column,c=e.ruleId,o=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(i,":").concat(a),rule:c,message:o})})}),n.length&&eg(n)}catch(t){eI(e)}}function eO(e){return ew.apply(this,arguments)}function ew(){ew=i(function(e){var t,n,r,i,a,c,o,s,u;var l=arguments;return m(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eS;n=new AbortController;R.default.on("SIGINT",function(){ed.warning("Process interrupted. Terminating..."),n.abort(),R.default.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,ea(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),i=r.stdout,a=r.stderr;[i,a].forEach(function(e){return e&&t(e)});return[3,4];case 3:c=f.sent();o=c.stdout,s=c.stderr,u=c.message;[o,s].forEach(function(e){return e&&t(e)}),!s&&!o&&ed.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return ew.apply(this,arguments)}function e_(e){return{raw:!0,cmd:e}}function eT(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e4," ").concat(eA," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e4," ").concat(e0," src/cli.ts ").concat(e):"".concat(e4," ").concat(eJ," ").concat(e)}function eC(e,t){return typeof e=="function"?eT(e(t),t):(typeof e==="undefined"?"undefined":g(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eT(e,t):e}function eN(e){return eL.apply(this,arguments)}function eL(){eL=i(function(e){var t,n,r,i,a,c,o;var s=arguments;return m(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];o=!1;return[3,3];case 1:return[4,en(eA)];case 2:o=u.sent().isCurrentProject;u.label=3;case 3:i=o,a={isRemote:r,isCurrentProject:i},c=typeof e=="function"?e(a):e;return[2,Object.fromEntries(Object.entries(c).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,eC(r,a)]}))]}})});return eL.apply(this,arguments)}var eP=L.default.env.INIT_CWD||L.default.cwd(),eA="@cyberskill/shared",ej=".cyberskill-storage",eR="node_modules",eG="dist",ek="package.json",eM="package-lock.json",eD="tsconfig.json",ex=".gitignore",eK=".simple-git-hooks.json",eF="pnpm-lock.yaml",eB=".git/hooks/",eY=".git/COMMIT_EDITMSG",eU=J(eP,eR,eA,eG),eJ="cyberskill",eq="eslint",eH="vitest",eV="vitest",eW="@commitlint/cli",e$="commitlint",ez="lint-staged",eX="lint-staged",eQ="tsc",eZ="tsc",e0="tsx",e1="git",e2="pnpm",e4="pnpm exec",e3="simple-git-hooks",e5="simple-git-hooks",e6="@eslint/config-inspector",e8="eslint-config-inspector",e7="node-modules-inspector",e9="node-modules-inspector",te={CYBERSKILL_DIRECTORY:eU,WORKING_DIRECTORY:eP,TS_CONFIG:U(eD),GIT_IGNORE:U(ex),GIT_HOOK:U(eB),GIT_COMMIT_MSG:U(eY),SIMPLE_GIT_HOOKS_JSON:U(eK),PACKAGE_JSON:U(ek),PACKAGE_LOCK_JSON:U(eM),PNPM_LOCK_YAML:U(eF),NODE_MODULES:U(eR),CYBERSKILL:{LINT_STAGED_CONFIG:U("".concat(eU,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:U("".concat(eU,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:U("".concat(eU,"/configs/vitest/react/unit.js")),E2E_TEST_CONFIG:U("".concat(eU,"/configs/vitest/react/e2e.js"))}};function tt(e){var t=e.isCurrentProject;return l({"pre-commit":eX,"commit-msg":e$},t&&{"pre-push":e_("".concat(e1," pull"))})}function tn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var i=d(n,2),a=i[0],c=i[1];switch(e){case"pnpmAddAndExec":return eC(e_("".concat(e2," add -D ").concat(a," && ").concat(e4," ").concat(c)));case"pnpmExec":return eC(e_("".concat(e4," ").concat(a," ").concat(c||"").trim()));case"raw":return eC(e_(a))}}var tr={SIMPLE_GIT_HOOKS:tn("pnpmAddAndExec",e3,e5),ESLINT_INSPECT:tn("pnpmAddAndExec",e6,e8),NODE_MODULES_INSPECT:tn("pnpmAddAndExec",e7,e9),ESLINT_CHECK:tn("pnpmExec",eq,te.WORKING_DIRECTORY),ESLINT_FIX:tn("pnpmExec",eq,"".concat(te.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tn("pnpmAddAndExec",eQ,"".concat(eZ," -p ").concat(te.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tn("raw","".concat(e1," config core.hooksPath ").concat(te.GIT_HOOK)),BUILD:tn("raw","".concat(e2," run build")),STAGE_BUILD_DIRECTORY:tn("raw","".concat(e1," add ").concat(eG)),PNPM_INSTALL_STANDARD:tn("raw","".concat(e2," install")),PNPM_INSTALL_LEGACY:tn("raw","".concat(e2," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tn("raw","".concat(e2," install --force")),CYBERSKILL:{TEST_UNIT:tn("pnpmAddAndExec",eH,"".concat(eV," --config ").concat(te.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tn("pnpmAddAndExec",eH,"".concat(eV," --config ").concat(te.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tn("pnpmAddAndExec",eW,"".concat(e$," --edit ").concat(te.GIT_COMMIT_MSG," --config ").concat(te.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tn("pnpmAddAndExec",ez,"".concat(eX," --config ").concat(te.CYBERSKILL.LINT_STAGED_CONFIG))}};function ti(e,t){return ta.apply(this,arguments)}function ta(){ta=i(function(e,t){return m(this,function(n){switch(n.label){case 0:ed.info("".concat(e,"..."));return[4,eO(t)];case 1:n.sent(),ed.success("".concat(e," completed successfully."));return[2]}})});return ta.apply(this,arguments)}function tc(){return to.apply(this,arguments)}function to(){to=i(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!D(te.TS_CONFIG))return[3,2];return[4,ti("Performing TypeScript validation",tr.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=ed.warning("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return to.apply(this,arguments)}function ts(){return tu.apply(this,arguments)}function tu(){tu=i(function(){var e,t;var n=arguments;return m(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,ti("Running ESLint with auto-fix",tr.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,ti("Running ESLint check",tr.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tu.apply(this,arguments)}function tl(){return tf.apply(this,arguments)}function tf(){tf=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,em()];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?ed.printBoxedLog("✔ NO ISSUES FOUND","",{color:"green"}):(ed.printBoxedLog("⚠ Warnings",n,{color:"yellow"}),ed.printBoxedLog("✖ Errors",t,{color:"red"}));return[2]}})});return tf.apply(this,arguments)}function tp(){return td.apply(this,arguments)}function td(){td=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,eb()];case 1:r.sent();return[4,en(eA)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,ti("Building package: ".concat(eA),tr.BUILD)];case 4:r.sent();return[4,ti("Staging build artifacts",tr.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw ed.error("Error building and staging ".concat(eA,": ").concat(n.message)),n;case 7:return[4,ti("Executing lint-staged",tr.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),tl();return[2]}})});return td.apply(this,arguments)}function th(){return tg.apply(this,arguments)}function tg(){tg=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti("Inspecting ESLint configuration",tr.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tg.apply(this,arguments)}function ty(){return tm.apply(this,arguments)}function tm(){tm=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,eb()];case 1:e.sent();return[4,Promise.all([tc(),ts()])];case 2:e.sent(),tl();return[2]}})});return tm.apply(this,arguments)}function tv(){return tb.apply(this,arguments)}function tb(){tb=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,eb()];case 1:e.sent();return[4,Promise.all([tc(),ts(!0)])];case 2:e.sent(),tl();return[2]}})});return tb.apply(this,arguments)}function tE(){return tI.apply(this,arguments)}function tI(){tI=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,eb()];case 1:e.sent();return[4,ti("Validating commit message",tr.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tl();return[2]}})});return tI.apply(this,arguments)}function tS(){return tO.apply(this,arguments)}function tO(){tO=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,ti("Configuring Git hooks",tr.CONFIGURE_GIT_HOOK)];case 1:n.sent(),B([te.GIT_HOOK]);return[4,eN(tt)];case 2:e=n.sent();K(te.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eK,"\n");D(te.GIT_IGNORE)?x(te.GIT_IGNORE).split("\n").includes(eK)||F(te.GIT_IGNORE,t):K(te.GIT_IGNORE,t);return[4,ti("Installing simple-git-hooks",tr.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tO.apply(this,arguments)}function tw(){return t_.apply(this,arguments)}function t_(){t_=i(function(){var e,t,n,r,i,a,c,o,s,u,l;return m(this,function(f){switch(f.label){case 0:e=[{command:tr.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:tr.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:tr.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,8,9,10]);i=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(a=i.next()).done))return[3,7];c=a.value,o=c.command,s=c.message;f.label=3;case 3:f.trys.push([3,5,,6]);return[4,ti("".concat(s," using: ").concat(o),o)];case 4:f.sent();return[2];case 5:u=f.sent();ed.warning("Installation attempt failed: ".concat(o)),ed.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=f.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return t_.apply(this,arguments)}function tT(e){return tC.apply(this,arguments)}function tC(){tC=i(function(e){var t,n,r,i,c;return m(this,function(o){switch(o.label){case 0:o.trys.push([0,4,,5]);return[4,en(e)];case 1:t=o.sent(),n=t.installedPath,r=t.latestVersion,i=t.file;i.dependencies=p(l({},i.dependencies),a({},i.name,r)),K(n,i,{isJson:!0});return[4,tw()];case 2:o.sent();return[4,tv()];case 3:o.sent();return[3,5];case 4:c=o.sent();throw ed.error('Failed to update "'.concat(e,'": ').concat(c.message)),c;case 5:return[2]}})});return tC.apply(this,arguments)}function tN(){return tL.apply(this,arguments)}function tL(){tL=i(function(){var e,t,n,r,i,a,c;return m(this,function(o){switch(o.label){case 0:if(!D(te.PACKAGE_JSON)){ed.error("package.json not found. Aborting setup.");return[2]}o.label=1;case 1:o.trys.push([1,7,,8]);return[4,en(eA)];case 2:e=o.sent(),t=e.isInstalled,n=e.installedVersion,r=e.latestVersion,i=e.isCurrentProject;if(!(i||t&&n===r))return[3,3];a=ed.success("Cyberskill package is already up to date.");return[3,5];case 3:return[4,tT(eA)];case 4:a=o.sent();o.label=5;case 5:a;return[4,tS()];case 6:o.sent();return[3,8];case 7:c=o.sent();throw ed.error("Project setup failed: ".concat(c.message)),c;case 8:return[2]}})});return tL.apply(this,arguments)}function tP(){return tA.apply(this,arguments)}function tA(){tA=i(function(){return m(this,function(e){switch(e.label){case 0:B([te.NODE_MODULES,te.PNPM_LOCK_YAML]);return[4,tw()];case 1:e.sent();return[4,tS()];case 2:e.sent();return[2]}})});return tA.apply(this,arguments)}function tj(){return tR.apply(this,arguments)}function tR(){tR=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti("Inspecting project dependencies",tr.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tR.apply(this,arguments)}function tG(){return tk.apply(this,arguments)}function tk(){tk=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti("Running unit tests",tr.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tk.apply(this,arguments)}function tM(){return tD.apply(this,arguments)}function tD(){tD=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti("Running end-to-end tests",tr.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tD.apply(this,arguments)}(0,N.default)((0,C.hideBin)(T.default.argv)).scriptName(eJ).usage("$0 <command> [options]").command("lint","Check code for linting issues",ty).command("lint:fix","Fix linting issues automatically",tv).command("lint:inspect","View active ESLint configuration",th).command("lint-staged","Run lint checks on staged files",tp).command("commitlint","Validate commit message format",tE).command("setup","Initialize project setup and dependencies",tN).command("reset","Reset the project and reinstall dependencies",tP).command("inspect","Analyze installed project dependencies",tj).command("test:unit","Run unit test suite",tG).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").epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse();
2
+ "use strict";function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,i,o,a){try{var c=e[o](a);var s=c.value}catch(e){n(e);return}if(c.done){t(s)}else{Promise.resolve(s).then(r,i)}}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var a=e.apply(t,n);function c(e){r(a,i,o,c,s,"next",e)}function s(e){r(a,i,o,c,s,"throw",e)}c(undefined)})}}function o(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 a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var o=false;var a,c;try{for(n=n.call(e);!(i=(a=n.next()).done);i=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){o=true;c=e}finally{try{if(!i&&n["return"]!=null)n["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(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){o(e,t,n[t])})}return e}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{f(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function d(e,n){return t(e)||c(e,n)||y(e,n)||s()}function h(e){return n(e)||a(e)||y(e)||u()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,i,o,a={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),"throw":c(1),"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(o){if(n)throw new TypeError("Generator is already executing.");while(a)try{if(n=1,r&&(i=o[0]&2?r["return"]:o[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;if(r=0,i)o=[o[0]&2,i.value];switch(o[0]){case 0:case 1:i=o;break;case 4:a.label++;return{value:o[1],done:false};case 5:a.label++;r=o[1];o=[0];continue;case 7:o=a.ops.pop();a.trys.pop();continue;default:if(!(i=a.trys,i=i.length>0&&i[i.length-1])&&(o[0]===6||o[0]===2)){a=0;continue}if(o[0]===3&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(o[0]===6&&a.label<i[1]){a.label=i[1];i=o;break}if(i&&a.label<i[2]){a.label=i[2];a.ops.push(o);break}if(i[2])a.ops.pop();a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e];r=0}finally{n=i=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}}var v=Object.create;var E=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var O=function(e,t,n,r){var i=true,o=false,a=undefined;if(t&&(typeof t==="undefined"?"undefined":g(t))=="object"||typeof t=="function")try{var c=function(){var i=u.value;!S.call(e,i)&&i!==n&&E(e,i,{get:function(){return t[i]},enumerable:!(r=_(t,i))||r.enumerable})};for(var s=b(t)[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true)c()}catch(e){o=true;a=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(o){throw a}}}return e};var w=function(e,t,n){return n=e!=null?v(I(e)):{},O(t||!e||!e.__esModule?E(n,"default",{value:e,enumerable:!0}):n,e)};var N=w(require("process"),1),T=require("yargs/helpers"),P=w(require("yargs/yargs"),1);var C=w(require("process"),1);var L=w(require("boxen"),1),A=w(require("chalk"),1),D=require("child_process"),R=w(require("process"),1),j=w(require("util"),1);var G=w(require("node-fetch"),1);var M=w(require("fs"),1),k=function(e){return M.existsSync(e)};function F(e,t){var n=M.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":g(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 K(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,o=i&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);M.writeFileSync(e,o,"utf-8")}function x(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,o=i&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);M.appendFileSync(e,o,"utf-8")}function U(e){e.forEach(function(e){k(e)&&M.rmSync(e,{recursive:!0,force:!0})})}var B=w(require("path"),1);function Y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=B).resolve.apply(r,[eL].concat(h(t)))}function J(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=B).join.apply(r,h(t))}var W=w(require("node-persist"),1),q=w(require("os"),1),X=w(require("process"),1);function H(){return X.default.env.CYBERSKILL_STORAGE_DIR||J(q.default.homedir(),eD)}function V(){return $.apply(this,arguments)}function $(){$=i(function(){var e;return m(this,function(t){switch(t.label){case 0:e=W.default.defaultInstance;if(e)return[3,2];return[4,W.default.init({dir:H(),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 $.apply(this,arguments)}var z={get:function e(e){return i(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,V()];case 1:r.sent();return[4,W.default.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return i(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,V()];case 1:r.sent();return[4,W.default.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return i(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,V()];case 1:n.sent();return[4,W.default.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,V()];case 1:n.sent();return[4,W.default.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(console.warn("⚠️ [Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return i(function(){return m(this,function(t){try{return[2,"".concat(H()," (key: ").concat(e,")")]}catch(e){return[2,(console.error("❌ [Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var Q=24*60*60*1e3;function Z(e){var t=J(eL,eG);if(k(t))try{var n=F(t,{asJson:!0});if(n.name===e)return{path:t,file:n,isCurrentProject:!0}}catch(e){ed.warning("Failed to read local package.json: ".concat(e.message))}var r=J(eL,eR,e,eG);if(k(r))try{var i=F(r,{asJson:!0});if(i.name===e)return{path:r,file:i,isCurrentProject:!1}}catch(t){ed.warning("Failed to read node_modules package.json for ".concat(e,": ").concat(t.message))}return!1}function ee(e){return et.apply(this,arguments)}function et(){et=i(function(e){var t,n,r,i,o,a,c,s,u,l;var f=arguments;return m(this,function(p){switch(p.label){case 0:t=f.length>1&&f[1]!==void 0?f[1]:!1;n="npm_version:".concat(e),r="npm_metadata:".concat(e);return[4,z.get(n)];case 1:i=p.sent();return[4,z.get(r)];case 2:o=p.sent(),a=i&&Date.now()-i.timestamp<Q;if(!t&&a)return[2,i.version];c={};(o===null||o===void 0?void 0:o.etag)&&(c["If-None-Match"]=o.etag),(o===null||o===void 0?void 0:o.lastModified)&&(c["If-Modified-Since"]=o.lastModified);p.label=3;case 3:p.trys.push([3,8,,9]);return[4,(0,G.default)("https://registry.npmjs.org/".concat(e,"/latest"),{headers:c})];case 4:s=p.sent();if(s.status===304&&i)return[2,i.version];if(!s.ok)throw new Error("Failed to fetch latest version: ".concat(s.statusText));return[4,s.json()];case 5:u=p.sent().version;return[4,z.set(n,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,z.set(r,{etag:s.headers.get("ETag")||void 0,lastModified:s.headers.get("Last-Modified")||void 0})];case 7:return[2,(p.sent(),u)];case 8:l=p.sent();if(ed.error("Error fetching latest version for ".concat(e,": ").concat(l.message)),i)return[2,(ed.warning("Falling back to cached version for ".concat(e,": ").concat(i.version)),i.version)];throw l;case 9:return[2]}})});return et.apply(this,arguments)}function en(e){return er.apply(this,arguments)}function er(){er=i(function(e){var t,n,r,i,o;return m(this,function(a){switch(a.label){case 0:t={isInstalled:!1,isCurrentProject:!1,installedPath:"",installedVersion:"",latestVersion:"",file:{}};a.label=1;case 1:a.trys.push([1,6,,7]);n=Z(e);r=n;if(!r)return[3,5];t.file=n.file,t.isInstalled=!0,t.installedPath=n.path,t.installedVersion=n.file.version,t.isCurrentProject=n.isCurrentProject;if(!n.isCurrentProject)return[3,2];i=n.file.version;return[3,4];case 2:return[4,ee(e,!0)];case 3:i=a.sent();a.label=4;case 4:r=t.latestVersion=i;a.label=5;case 5:return[2,(r,t)];case 6:o=a.sent();return[2,(ed.error('Error checking package "'.concat(e,'": ').concat(o.message)),t)];case 7:return[2]}})});return er.apply(this,arguments)}var ei=R.default.env.DEBUG==="true",eo=j.promisify(D.exec),ea=A.default,ec=ea.gray,es=ea.blue;function eu(){return ec("[".concat(new Date().toLocaleTimeString(),"]"))}function el(e){var t=A.default[e];return typeof t=="function"?t:A.default.green}function ef(e,t,n,r){var i=el(t);console.log("".concat(eu()," ").concat(i("".concat(n," ").concat(e))," ").concat(r))}function ep(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.color,i=r===void 0?"green":r,o=n.padding,a=o===void 0?1:o,c=n.margin,s=c===void 0?1:c,u=n.borderStyle,l=u===void 0?"round":u,f=n.titleColor,p=f===void 0?"bold":f;var d=el(i),h=el(p);if(typeof t=="string"){console.log((0,L.default)(h(d("".concat(e,"\n").concat(t))),{padding:a,margin:s,borderStyle:l,borderColor:i}));return}Array.isArray(t)&&t.length&&(t.forEach(function(e){var t=e.file,n=e.position,r=e.rule,i=e.message;console.log("".concat(eu()," ").concat(d("File:")," ").concat(es("".concat(t).concat(n?":".concat(n):"")))),r&&console.log(" ".concat(d("Rule:")," ").concat(d(r))),console.log(" ".concat(d("Message:")," ").concat(d(i)))}),console.log((0,L.default)(h(d("".concat(e,": ").concat(t.length))),{padding:a,margin:s,borderStyle:l,borderColor:i})),console.log(ec("─".repeat(40))))}var ed={success:function(e){return ef("SUCCESS","green","✔",e)},error:function(e){return ef("ERROR","red","✖",e)},warning:function(e){return ef("WARNING","yellow","⚠",e)},info:function(e){return ef("INFO","blue","ℹ",e)},printBoxedLog:ep};function eh(e){return"error_list:".concat(e)}function eg(e){return ey.apply(this,arguments)}function ey(){ey=i(function(e){var t,n,r;return m(this,function(o){switch(o.label){case 0:if(e.length===0)return[2];t=Date.now(),n=eh(t);o.label=1;case 1:o.trys.push([1,3,,4]);return[4,z.set(n,{errors:e,timestamp:t})];case 2:o.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,z.getLogLink(n)];case 1:e=t.sent();e&&ed.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=o.sent();ed.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return ey.apply(this,arguments)}function em(){return ev.apply(this,arguments)}function ev(){ev=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,z.keys()];case 1:e=r.sent(),t=Array.isArray(e)?e.filter(function(e){var t;return e===null||e===void 0?void 0:(t=e.startsWith)===null||t===void 0?void 0:t.call(e,"error_list:")}):[];return[4,Promise.all(t.map(/*#__PURE__*/function(){var e=i(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,z.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,(ed.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return ev.apply(this,arguments)}function eE(){return e_.apply(this,arguments)}function e_(){e_=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,z.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 z.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();ed.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return e_.apply(this,arguments)}function eb(e){var t=[],n=[],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+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var c=i.exec(e)||[],s=o.exec(e)||[],u=a.exec(e)||[];c.length&&r?t.push({file:r,position:"".concat(c[1],":").concat(c[2]),type:c[3]==="error"?"error":"warning",message:c[4].trim(),rule:c[5].trim()}):s.length?t.push({file:s[1],position:"".concat(s[2],":").concat(s[3]),type:s[4]==="error"?"error":"warning",message:s[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&eg(t),n.length&&ei&&(ed.warning("Unmatched lines:"),n.forEach(function(e){return console.log(" ".concat(e))}))}function eI(e){try{var t=JSON.parse(e),n=[];t.forEach(function(e){var t=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,i=e.line,o=e.column,a=e.ruleId,c=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(i,":").concat(o),rule:a,message:c})})}),n.length&&eg(n)}catch(t){eb(e)}}function eS(e){return eO.apply(this,arguments)}function eO(){eO=i(function(e){var t,n,r,i,o,a,c,s,u;var l=arguments;return m(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:eI;n=new AbortController;R.default.on("SIGINT",function(){ed.warning("Process interrupted. Terminating..."),n.abort(),R.default.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,eo(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),i=r.stdout,o=r.stderr;[i,o].forEach(function(e){return e&&t(e)});return[3,4];case 3:a=f.sent();c=a.stdout,s=a.stderr,u=a.message;[c,s].forEach(function(e){return e&&t(e)}),!s&&!c&&ed.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eO.apply(this,arguments)}function ew(e){return{raw:!0,cmd:e}}function eN(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e4," ").concat(eA," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e4," ").concat(e0," src/cli.ts ").concat(e):"".concat(e4," ").concat(eJ," ").concat(e)}function eT(e,t){return typeof e=="function"?eN(e(t),t):(typeof e==="undefined"?"undefined":g(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eN(e,t):e}function eP(e){return eC.apply(this,arguments)}function eC(){eC=i(function(e){var t,n,r,i,o,a,c;var s=arguments;return m(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,en(eA)];case 2:c=u.sent().isCurrentProject;u.label=3;case 3:i=c,o={isRemote:r,isCurrentProject:i},a=typeof e=="function"?e(o):e;return[2,Object.fromEntries(Object.entries(a).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,eT(r,o)]}))]}})});return eC.apply(this,arguments)}var eL=C.default.env.INIT_CWD||C.default.cwd(),eA="@cyberskill/shared",eD=".cyberskill-storage",eR="node_modules",ej="dist",eG="package.json",eM="package-lock.json",ek="tsconfig.json",eF=".gitignore",eK=".simple-git-hooks.json",ex="pnpm-lock.yaml",eU=".git/hooks/",eB=".git/COMMIT_EDITMSG",eY=J(eL,eR,eA,ej),eJ="cyberskill",eW="eslint",eq="vitest",eX="vitest",eH="@commitlint/cli",eV="commitlint",e$="lint-staged",ez="lint-staged",eQ="typescript",eZ="tsc",e0="tsx",e1="git",e2="pnpm",e4="pnpm exec",e3="simple-git-hooks",e5="simple-git-hooks",e6="@eslint/config-inspector",e8="eslint-config-inspector",e7="node-modules-inspector",e9="node-modules-inspector",te={CYBERSKILL_DIRECTORY:eY,WORKING_DIRECTORY:eL,TS_CONFIG:Y(ek),GIT_IGNORE:Y(eF),GIT_HOOK:Y(eU),GIT_COMMIT_MSG:Y(eB),SIMPLE_GIT_HOOKS_JSON:Y(eK),PACKAGE_JSON:Y(eG),PACKAGE_LOCK_JSON:Y(eM),PNPM_LOCK_YAML:Y(ex),NODE_MODULES:Y(eR),CYBERSKILL:{LINT_STAGED_CONFIG:Y("".concat(eY,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:Y("".concat(eY,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:Y("".concat(eY,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:Y("".concat(eY,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:Y("".concat(eY,"/configs/vitest/react/e2e.js"))}};function tt(e){var t=e.isCurrentProject;return l({"pre-commit":ez,"commit-msg":eV},t&&{"pre-push":ew("".concat(e1," pull"))})}function tn(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var i=d(n,2),o=i[0],a=i[1];switch(e){case"PNPM_ADD_AND_EXEC":return eT(ew("".concat(e2," add -D ").concat(o," && ").concat(e4," ").concat(a)));case"PNPM_EXEC":return eT(ew("".concat(e4," ").concat(o," ").concat(a||"").trim()));case"RAW":return eT(ew(o))}}var tr={SIMPLE_GIT_HOOKS:tn("PNPM_ADD_AND_EXEC",e3,e5),ESLINT_INSPECT:tn("PNPM_ADD_AND_EXEC",e6,e8),NODE_MODULES_INSPECT:tn("PNPM_ADD_AND_EXEC",e7,e9),ESLINT_CHECK:tn("PNPM_EXEC",eW,te.WORKING_DIRECTORY),ESLINT_FIX:tn("PNPM_EXEC",eW,"".concat(te.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tn("PNPM_ADD_AND_EXEC",eQ,"".concat(eZ," -p ").concat(te.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tn("RAW","".concat(e1," config core.hooksPath ").concat(te.GIT_HOOK)),BUILD:tn("RAW","".concat(e2," run build")),STAGE_BUILD_DIRECTORY:tn("RAW","".concat(e1," add ").concat(ej)),PNPM_INSTALL_STANDARD:tn("RAW","".concat(e2," install")),PNPM_INSTALL_LEGACY:tn("RAW","".concat(e2," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tn("RAW","".concat(e2," install --force")),CYBERSKILL:{TEST_UNIT:tn("PNPM_ADD_AND_EXEC",eq,"".concat(eX," --config ").concat(te.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tn("PNPM_ADD_AND_EXEC",eq,"".concat(eX," --config ").concat(te.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tn("PNPM_ADD_AND_EXEC",eH,"".concat(eV," --edit ").concat(te.GIT_COMMIT_MSG," --config ").concat(te.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tn("PNPM_ADD_AND_EXEC",e$,"".concat(ez," --config ").concat(te.CYBERSKILL.LINT_STAGED_CONFIG))}};function ti(e,t){return to.apply(this,arguments)}function to(){to=i(function(e,t){return m(this,function(n){switch(n.label){case 0:ed.info("".concat(e,"..."));return[4,eS(t)];case 1:n.sent(),ed.success("".concat(e," completed successfully."));return[2]}})});return to.apply(this,arguments)}function ta(){return tc.apply(this,arguments)}function tc(){tc=i(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!k(te.TS_CONFIG))return[3,2];return[4,ti("Performing TypeScript validation",tr.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=ed.warning("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tc.apply(this,arguments)}function ts(){return tu.apply(this,arguments)}function tu(){tu=i(function(){var e,t;var n=arguments;return m(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,ti("Running ESLint with auto-fix",tr.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,ti("Running ESLint check",tr.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tu.apply(this,arguments)}function tl(){return tf.apply(this,arguments)}function tf(){tf=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,em()];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?ed.printBoxedLog("✔ NO ISSUES FOUND","",{color:"green"}):(ed.printBoxedLog("⚠ Warnings",n,{color:"yellow"}),ed.printBoxedLog("✖ Errors",t,{color:"red"}));return[2]}})});return tf.apply(this,arguments)}function tp(){return td.apply(this,arguments)}function td(){td=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,eE()];case 1:r.sent();return[4,en(eA)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,ti("Building package: ".concat(eA),tr.BUILD)];case 4:r.sent();return[4,ti("Staging build artifacts",tr.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw ed.error("Error building and staging ".concat(eA,": ").concat(n.message)),n;case 7:return[4,ti("Executing lint-staged",tr.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),tl();return[2]}})});return td.apply(this,arguments)}function th(){return tg.apply(this,arguments)}function tg(){tg=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti("Inspecting ESLint configuration",tr.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tg.apply(this,arguments)}function ty(){return tm.apply(this,arguments)}function tm(){tm=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,eE()];case 1:e.sent();return[4,Promise.all([ta(),ts()])];case 2:e.sent(),tl();return[2]}})});return tm.apply(this,arguments)}function tv(){return tE.apply(this,arguments)}function tE(){tE=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,eE()];case 1:e.sent();return[4,Promise.all([ta(),ts(!0)])];case 2:e.sent(),tl();return[2]}})});return tE.apply(this,arguments)}function t_(){return tb.apply(this,arguments)}function tb(){tb=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,eE()];case 1:e.sent();return[4,ti("Validating commit message",tr.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tl();return[2]}})});return tb.apply(this,arguments)}function tI(){return tS.apply(this,arguments)}function tS(){tS=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,ti("Configuring Git hooks",tr.CONFIGURE_GIT_HOOK)];case 1:n.sent(),U([te.GIT_HOOK]);return[4,eP(tt)];case 2:e=n.sent();K(te.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eK,"\n");k(te.GIT_IGNORE)?F(te.GIT_IGNORE).split("\n").includes(eK)||x(te.GIT_IGNORE,t):K(te.GIT_IGNORE,t);return[4,ti("Installing simple-git-hooks",tr.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tS.apply(this,arguments)}function tO(){return tw.apply(this,arguments)}function tw(){tw=i(function(){var e,t,n,r,i,o,a,c,s,u,l;return m(this,function(f){switch(f.label){case 0:e=[{command:tr.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:tr.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:tr.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,8,9,10]);i=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(o=i.next()).done))return[3,7];a=o.value,c=a.command,s=a.message;f.label=3;case 3:f.trys.push([3,5,,6]);return[4,ti("".concat(s," using: ").concat(c),c)];case 4:f.sent();return[2];case 5:u=f.sent();ed.warning("Installation attempt failed: ".concat(c)),ed.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=f.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return tw.apply(this,arguments)}function tN(e){return tT.apply(this,arguments)}function tT(){tT=i(function(e){var t,n,r,i,a;return m(this,function(c){switch(c.label){case 0:c.trys.push([0,4,,5]);return[4,en(e)];case 1:t=c.sent(),n=t.installedPath,r=t.latestVersion,i=t.file;i.dependencies=p(l({},i.dependencies),o({},i.name,r)),K(n,i,{isJson:!0});return[4,tO()];case 2:c.sent();return[4,tv()];case 3:c.sent();return[3,5];case 4:a=c.sent();throw ed.error('Failed to update "'.concat(e,'": ').concat(a.message)),a;case 5:return[2]}})});return tT.apply(this,arguments)}function tP(){return tC.apply(this,arguments)}function tC(){tC=i(function(){var e,t,n,r,i,o,a;return m(this,function(c){switch(c.label){case 0:if(!k(te.PACKAGE_JSON)){ed.error("package.json not found. Aborting setup.");return[2]}c.label=1;case 1:c.trys.push([1,7,,8]);return[4,en(eA)];case 2:e=c.sent(),t=e.isInstalled,n=e.installedVersion,r=e.latestVersion,i=e.isCurrentProject;if(!(i||t&&n===r))return[3,3];o=ed.success("Cyberskill package is already up to date.");return[3,5];case 3:return[4,tN(eA)];case 4:o=c.sent();c.label=5;case 5:o;return[4,tI()];case 6:c.sent();return[3,8];case 7:a=c.sent();throw ed.error("Project setup failed: ".concat(a.message)),a;case 8:return[2]}})});return tC.apply(this,arguments)}function tL(){return tA.apply(this,arguments)}function tA(){tA=i(function(){return m(this,function(e){switch(e.label){case 0:U([te.NODE_MODULES,te.PNPM_LOCK_YAML]);return[4,tO()];case 1:e.sent();return[4,tI()];case 2:e.sent();return[2]}})});return tA.apply(this,arguments)}function tD(){return tR.apply(this,arguments)}function tR(){tR=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti("Inspecting project dependencies",tr.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tR.apply(this,arguments)}function tj(){return tG.apply(this,arguments)}function tG(){tG=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti("Running unit tests",tr.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tG.apply(this,arguments)}function tM(){return tk.apply(this,arguments)}function tk(){tk=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,ti("Running end-to-end tests",tr.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tk.apply(this,arguments)}(0,P.default)((0,T.hideBin)(N.default.argv)).scriptName(eJ).usage("$0 <command> [options]").command("lint","Check code for linting issues",ty).command("lint:fix","Fix linting issues automatically",tv).command("lint:inspect","View active ESLint configuration",th).command("lint-staged","Run lint checks on staged files",tp).command("commitlint","Validate commit message format",t_).command("setup","Initialize project setup and dependencies",tP).command("reset","Reset the project and reinstall dependencies",tL).command("inspect","Analyze installed project dependencies",tD).command("test:unit","Run unit test suite",tj).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").epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse();
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function e(e,n){if(n==null||n>e.length)n=e.length;for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function n(e){if(Array.isArray(e))return e}function t(n){if(Array.isArray(n))return e(n)}function r(e,n,t,r,o,i,c){try{var s=e[i](c);var a=s.value}catch(e){t(e);return}if(s.done){n(a)}else{Promise.resolve(a).then(r,o)}}function o(e){return function(){var n=this,t=arguments;return new Promise(function(o,i){var c=e.apply(n,t);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(undefined)})}}function i(e,n,t){if(n in e){Object.defineProperty(e,n,{value:t,enumerable:true,configurable:true,writable:true})}else{e[n]=t}return e}function c(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function s(e,n){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var r=[];var o=true;var i=false;var c,s;try{for(t=t.call(e);!(o=(c=t.next()).done);o=true){r.push(c.value);if(n&&r.length===n)break}}catch(e){i=true;s=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw s}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var n=1;n<arguments.length;n++){var t=arguments[n]!=null?arguments[n]:{};var r=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}r.forEach(function(n){i(e,n,t[n])})}return e}function f(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(n){r=r.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})}t.push.apply(t,r)}return t}function p(e,n){n=n!=null?n:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(n))}else{f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function d(e,t){return n(e)||s(e,t)||m(e,t)||a()}function h(e){return t(e)||c(e)||m(e)||u()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function m(n,t){if(!n)return;if(typeof n==="string")return e(n,t);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 e(n,t)}function y(e,n){var t,r,o,i,c={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(n){return a([e,n])}}function a(i){if(t)throw new TypeError("Generator is already executing.");while(c)try{if(t=1,r&&(o=i[0]&2?r["return"]:i[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;if(r=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:c.label++;return{value:i[1],done:false};case 5:c.label++;r=i[1];i=[0];continue;case 7:i=c.ops.pop();c.trys.pop();continue;default:if(!(o=c.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){c=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(i[0]===6&&c.label<o[1]){c.label=o[1];o=i;break}if(o&&c.label<o[2]){c.label=o[2];c.ops.push(i);break}if(o[2])c.ops.pop();c.trys.pop();continue}i=n.call(e,c)}catch(e){i=[6,e];r=0}finally{t=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}import v from"node:process";import{hideBin as E}from"yargs/helpers";import b from"yargs/yargs";import I from"node:process";import S from"boxen";import w from"chalk";import{exec as _}from"node:child_process";import O from"node:process";import*as T from"node:util";import C from"node-fetch";import*as N from"node:fs";var L=function(e){return N.existsSync(e)};function P(e,n){var t=N.readFileSync(e,"utf-8");if(n===null||n===void 0?void 0:n.asJson)try{var r=JSON.parse(t);if((typeof r==="undefined"?"undefined":g(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(e))}return t}function A(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=t.isJson,o=r===void 0?!1:r,i=o&&(typeof n==="undefined"?"undefined":g(n))=="object"?JSON.stringify(n,null,4):String(n);N.writeFileSync(e,i,"utf-8")}function R(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=t.isJson,o=r===void 0?!1:r,i=o&&(typeof n==="undefined"?"undefined":g(n))=="object"?JSON.stringify(n,null,4):String(n);N.appendFileSync(e,i,"utf-8")}function j(e){e.forEach(function(e){L(e)&&N.rmSync(e,{recursive:!0,force:!0})})}import*as G from"node:path";function k(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}var r;return(r=G).resolve.apply(r,[eI].concat(h(n)))}function M(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++){n[t]=arguments[t]}var r;return(r=G).join.apply(r,h(n))}import D from"node-persist";import x from"node:os";import K from"node:process";function F(){return K.env.CYBERSKILL_STORAGE_DIR||M(x.homedir(),ew)}function B(){return Y.apply(this,arguments)}function Y(){Y=o(function(){var e;return y(this,function(n){switch(n.label){case 0:e=D.defaultInstance;if(e)return[3,2];return[4,D.init({dir:F(),stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=n.sent();n.label=2;case 2:e;return[2]}})});return Y.apply(this,arguments)}var U={get:function e(e){return o(function(){var n,t;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,B()];case 1:r.sent();return[4,D.getItem(e)];case 2:return[2,(n=r.sent())!==null&&n!==void 0?n:null];case 3:t=r.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),t),null)];case 4:return[2]}})})()},set:function e(e,n){return o(function(){var t;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,B()];case 1:r.sent();return[4,D.setItem(e,n)];case 2:r.sent();return[3,4];case 3:t=r.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var n;return y(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,B()];case 1:t.sent();return[4,D.removeItem(e)];case 2:t.sent();return[3,4];case 3:n=t.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,n;return y(this,function(t){switch(t.label){case 0:t.trys.push([0,3,,4]);return[4,B()];case 1:t.sent();return[4,D.keys()];case 2:e=t.sent();return[2,Array.isArray(e)?e:(console.warn("⚠️ [Storage:keys] Invalid keys response:",e),[])];case 3:n=t.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",n),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return y(this,function(n){try{return[2,"".concat(F()," (key: ").concat(e,")")]}catch(e){return[2,(console.error("❌ [Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var J=24*60*60*1e3;function H(e){var n=M(eI,eT);if(L(n))try{var t=P(n,{asJson:!0});if(t.name===e)return{path:n,file:t,isCurrentProject:!0}}catch(e){eo.warning("Failed to read local package.json: ".concat(e.message))}var r=M(eI,e_,e,eT);if(L(r))try{var o=P(r,{asJson:!0});if(o.name===e)return{path:r,file:o,isCurrentProject:!1}}catch(n){eo.warning("Failed to read node_modules package.json for ".concat(e,": ").concat(n.message))}return!1}function V(e){return W.apply(this,arguments)}function W(){W=o(function(e){var n,t,r,o,i,c,s,a,u,l;var f=arguments;return y(this,function(p){switch(p.label){case 0:n=f.length>1&&f[1]!==void 0?f[1]:!1;t="npm_version:".concat(e),r="npm_metadata:".concat(e);return[4,U.get(t)];case 1:o=p.sent();return[4,U.get(r)];case 2:i=p.sent(),c=o&&Date.now()-o.timestamp<J;if(!n&&c)return[2,o.version];s={};(i===null||i===void 0?void 0:i.etag)&&(s["If-None-Match"]=i.etag),(i===null||i===void 0?void 0:i.lastModified)&&(s["If-Modified-Since"]=i.lastModified);p.label=3;case 3:p.trys.push([3,8,,9]);return[4,C("https://registry.npmjs.org/".concat(e,"/latest"),{headers:s})];case 4:a=p.sent();if(a.status===304&&o)return[2,o.version];if(!a.ok)throw new Error("Failed to fetch latest version: ".concat(a.statusText));return[4,a.json()];case 5:u=p.sent().version;return[4,U.set(t,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,U.set(r,{etag:a.headers.get("ETag")||void 0,lastModified:a.headers.get("Last-Modified")||void 0})];case 7:return[2,(p.sent(),u)];case 8:l=p.sent();if(eo.error("Error fetching latest version for ".concat(e,": ").concat(l.message)),o)return[2,(eo.warning("Falling back to cached version for ".concat(e,": ").concat(o.version)),o.version)];throw l;case 9:return[2]}})});return W.apply(this,arguments)}function $(e){return z.apply(this,arguments)}function z(){z=o(function(e){var n,t,r,o,i;return y(this,function(c){switch(c.label){case 0:n={isInstalled:!1,isCurrentProject:!1,installedPath:"",installedVersion:"",latestVersion:"",file:{}};c.label=1;case 1:c.trys.push([1,6,,7]);t=H(e);r=t;if(!r)return[3,5];n.file=t.file,n.isInstalled=!0,n.installedPath=t.path,n.installedVersion=t.file.version,n.isCurrentProject=t.isCurrentProject;if(!t.isCurrentProject)return[3,2];o=t.file.version;return[3,4];case 2:return[4,V(e,!0)];case 3:o=c.sent();c.label=4;case 4:r=n.latestVersion=o;c.label=5;case 5:return[2,(r,n)];case 6:i=c.sent();return[2,(eo.error('Error checking package "'.concat(e,'": ').concat(i.message)),n)];case 7:return[2]}})});return z.apply(this,arguments)}var X=O.env.DEBUG==="true",q=T.promisify(_),Q=w.gray,Z=w.blue;function ee(){return Q("[".concat(new Date().toLocaleTimeString(),"]"))}function en(e){var n=w[e];return typeof n=="function"?n:w.green}function et(e,n,t,r){var o=en(n);console.log("".concat(ee()," ").concat(o("".concat(t," ").concat(e))," ").concat(r))}function er(e,n){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=t.color,o=r===void 0?"green":r,i=t.padding,c=i===void 0?1:i,s=t.margin,a=s===void 0?1:s,u=t.borderStyle,l=u===void 0?"round":u,f=t.titleColor,p=f===void 0?"bold":f;var d=en(o),h=en(p);if(typeof n=="string"){console.log(S(h(d("".concat(e,"\n").concat(n))),{padding:c,margin:a,borderStyle:l,borderColor:o}));return}Array.isArray(n)&&n.length&&(n.forEach(function(e){var n=e.file,t=e.position,r=e.rule,o=e.message;console.log("".concat(ee()," ").concat(d("File:")," ").concat(Z("".concat(n).concat(t?":".concat(t):"")))),r&&console.log(" ".concat(d("Rule:")," ").concat(d(r))),console.log(" ".concat(d("Message:")," ").concat(d(o)))}),console.log(S(h(d("".concat(e,": ").concat(n.length))),{padding:c,margin:a,borderStyle:l,borderColor:o})),console.log(Q("─".repeat(40))))}var eo={success:function(e){return et("SUCCESS","green","✔",e)},error:function(e){return et("ERROR","red","✖",e)},warning:function(e){return et("WARNING","yellow","⚠",e)},info:function(e){return et("INFO","blue","ℹ",e)},printBoxedLog:er};function ei(e){return"error_list:".concat(e)}function ec(e){return es.apply(this,arguments)}function es(){es=o(function(e){var n,t,r;return y(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];n=Date.now(),t=ei(n);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,U.set(t,{errors:e,timestamp:n})];case 2:i.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return y(this,function(n){switch(n.label){case 0:return[4,U.getLogLink(t)];case 1:e=n.sent();e&&eo.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();eo.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return es.apply(this,arguments)}function ea(){return eu.apply(this,arguments)}function eu(){eu=o(function(){var e,n,t;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,U.keys()];case 1:e=r.sent(),n=Array.isArray(e)?e.filter(function(e){var n;return e===null||e===void 0?void 0:(n=e.startsWith)===null||n===void 0?void 0:n.call(e,"error_list:")}):[];return[4,Promise.all(n.map(/*#__PURE__*/function(){var e=o(function(e){var n;return y(this,function(t){switch(t.label){case 0:return[4,U.get(e)];case 1:return[2,((n=t.sent())===null||n===void 0?void 0:n.errors)||[]]}})});return function(n){return e.apply(this,arguments)}}()))];case 2:return[2,r.sent().flat()];case 3:t=r.sent();return[2,(eo.error("Failed to retrieve stored errors: ".concat(t.message)),[])];case 4:return[2]}})});return eu.apply(this,arguments)}function el(){return ef.apply(this,arguments)}function ef(){ef=o(function(){var e,n,t;return y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,U.keys()];case 1:e=r.sent(),n=Array.isArray(e)?e.filter(function(e){var n;return e===null||e===void 0?void 0:(n=e.startsWith)===null||n===void 0?void 0:n.call(e,"error_list:")}):[];return[4,Promise.all(n.map(function(e){return U.remove(e)}))];case 2:r.sent();return[3,4];case 3:t=r.sent();eo.error("Failed to clear error lists: ".concat(t.message));return[3,4];case 4:return[2]}})});return ef.apply(this,arguments)}function ep(e){var n=[],t=[],r="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,c=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var s=o.exec(e)||[],a=i.exec(e)||[],u=c.exec(e)||[];s.length&&r?n.push({file:r,position:"".concat(s[1],":").concat(s[2]),type:s[3]==="error"?"error":"warning",message:s[4].trim(),rule:s[5].trim()}):a.length?n.push({file:a[1],position:"".concat(a[2],":").concat(a[3]),type:a[4]==="error"?"error":"warning",message:a[5].trim()}):u.length?n.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):t.push(e.trim())}}),n.length&&ec(n),t.length&&X&&(eo.warning("Unmatched lines:"),t.forEach(function(e){return console.log(" ".concat(e))}))}function ed(e){try{var n=JSON.parse(e),t=[];n.forEach(function(e){var n=e.filePath,r=e.messages;r.forEach(function(e){var r=e.severity,o=e.line,i=e.column,c=e.ruleId,s=e.message;t.push({type:r===2?"error":"warning",file:n,position:"".concat(o,":").concat(i),rule:c,message:s})})}),t.length&&ec(t)}catch(n){ep(e)}}function eh(e){return eg.apply(this,arguments)}function eg(){eg=o(function(e){var n,t,r,o,i,c,s,a,u;var l=arguments;return y(this,function(f){switch(f.label){case 0:n=l.length>1&&l[1]!==void 0?l[1]:ed;t=new AbortController;O.on("SIGINT",function(){eo.warning("Process interrupted. Terminating..."),t.abort(),O.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,q(e,{maxBuffer:0x6400000,signal:t.signal})];case 2:r=f.sent(),o=r.stdout,i=r.stderr;[o,i].forEach(function(e){return e&&n(e)});return[3,4];case 3:c=f.sent();s=c.stdout,a=c.stderr,u=c.message;[s,a].forEach(function(e){return e&&n(e)}),!a&&!s&&eo.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eg.apply(this,arguments)}function em(e){return{raw:!0,cmd:e}}function ey(e,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(e$," ").concat(eS," ").concat(e):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(e$," ").concat(eH," src/cli.ts ").concat(e):"".concat(e$," ").concat(ek," ").concat(e)}function ev(e,n){return typeof e=="function"?ey(e(n),n):(typeof e==="undefined"?"undefined":g(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ey(e,n):e}function eE(e){return eb.apply(this,arguments)}function eb(){eb=o(function(e){var n,t,r,o,i,c,s;var a=arguments;return y(this,function(u){switch(u.label){case 0:n=a.length>1&&a[1]!==void 0?a[1]:{};r=(t=n===null||n===void 0?void 0:n.isRemote)!==null&&t!==void 0?t:!1;if(!r)return[3,1];s=!1;return[3,3];case 1:return[4,$(eS)];case 2:s=u.sent().isCurrentProject;u.label=3;case 3:o=s,i={isRemote:r,isCurrentProject:o},c=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(c).map(function(e){var n=d(e,2),t=n[0],r=n[1];return[t,ev(r,i)]}))]}})});return eb.apply(this,arguments)}var eI=I.env.INIT_CWD||I.cwd(),eS="@cyberskill/shared",ew=".cyberskill-storage",e_="node_modules",eO="dist",eT="package.json",eC="package-lock.json",eN="tsconfig.json",eL=".gitignore",eP=".simple-git-hooks.json",eA="pnpm-lock.yaml",eR=".git/hooks/",ej=".git/COMMIT_EDITMSG",eG=M(eI,e_,eS,eO),ek="cyberskill",eM="eslint",eD="vitest",ex="vitest",eK="@commitlint/cli",eF="commitlint",eB="lint-staged",eY="lint-staged",eU="tsc",eJ="tsc",eH="tsx",eV="git",eW="pnpm",e$="pnpm exec",ez="simple-git-hooks",eX="simple-git-hooks",eq="@eslint/config-inspector",eQ="eslint-config-inspector",eZ="node-modules-inspector",e0="node-modules-inspector",e2={CYBERSKILL_DIRECTORY:eG,WORKING_DIRECTORY:eI,TS_CONFIG:k(eN),GIT_IGNORE:k(eL),GIT_HOOK:k(eR),GIT_COMMIT_MSG:k(ej),SIMPLE_GIT_HOOKS_JSON:k(eP),PACKAGE_JSON:k(eT),PACKAGE_LOCK_JSON:k(eC),PNPM_LOCK_YAML:k(eA),NODE_MODULES:k(e_),CYBERSKILL:{LINT_STAGED_CONFIG:k("".concat(eG,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:k("".concat(eG,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:k("".concat(eG,"/configs/vitest/react/unit.js")),E2E_TEST_CONFIG:k("".concat(eG,"/configs/vitest/react/e2e.js"))}};function e4(e){var n=e.isCurrentProject;return l({"pre-commit":eY,"commit-msg":eF},n&&{"pre-push":em("".concat(eV," pull"))})}function e1(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++){t[r-1]=arguments[r]}var o=d(t,2),i=o[0],c=o[1];switch(e){case"pnpmAddAndExec":return ev(em("".concat(eW," add -D ").concat(i," && ").concat(e$," ").concat(c)));case"pnpmExec":return ev(em("".concat(e$," ").concat(i," ").concat(c||"").trim()));case"raw":return ev(em(i))}}var e3={SIMPLE_GIT_HOOKS:e1("pnpmAddAndExec",ez,eX),ESLINT_INSPECT:e1("pnpmAddAndExec",eq,eQ),NODE_MODULES_INSPECT:e1("pnpmAddAndExec",eZ,e0),ESLINT_CHECK:e1("pnpmExec",eM,e2.WORKING_DIRECTORY),ESLINT_FIX:e1("pnpmExec",eM,"".concat(e2.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:e1("pnpmAddAndExec",eU,"".concat(eJ," -p ").concat(e2.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:e1("raw","".concat(eV," config core.hooksPath ").concat(e2.GIT_HOOK)),BUILD:e1("raw","".concat(eW," run build")),STAGE_BUILD_DIRECTORY:e1("raw","".concat(eV," add ").concat(eO)),PNPM_INSTALL_STANDARD:e1("raw","".concat(eW," install")),PNPM_INSTALL_LEGACY:e1("raw","".concat(eW," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:e1("raw","".concat(eW," install --force")),CYBERSKILL:{TEST_UNIT:e1("pnpmAddAndExec",eD,"".concat(ex," --config ").concat(e2.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:e1("pnpmAddAndExec",eD,"".concat(ex," --config ").concat(e2.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:e1("pnpmAddAndExec",eK,"".concat(eF," --edit ").concat(e2.GIT_COMMIT_MSG," --config ").concat(e2.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:e1("pnpmAddAndExec",eB,"".concat(eY," --config ").concat(e2.CYBERSKILL.LINT_STAGED_CONFIG))}};function e5(e,n){return e6.apply(this,arguments)}function e6(){e6=o(function(e,n){return y(this,function(t){switch(t.label){case 0:eo.info("".concat(e,"..."));return[4,eh(n)];case 1:t.sent(),eo.success("".concat(e," completed successfully."));return[2]}})});return e6.apply(this,arguments)}function e8(){return e7.apply(this,arguments)}function e7(){e7=o(function(){var e;return y(this,function(n){switch(n.label){case 0:if(!L(e2.TS_CONFIG))return[3,2];return[4,e5("Performing TypeScript validation",e3.TYPESCRIPT_CHECK)];case 1:e=n.sent();return[3,3];case 2:e=eo.warning("No TypeScript configuration found. Skipping type check.");n.label=3;case 3:e;return[2]}})});return e7.apply(this,arguments)}function e9(){return ne.apply(this,arguments)}function ne(){ne=o(function(){var e,n;var t=arguments;return y(this,function(r){switch(r.label){case 0:e=t.length>0&&t[0]!==void 0?t[0]:!1;if(!e)return[3,2];return[4,e5("Running ESLint with auto-fix",e3.ESLINT_FIX)];case 1:n=r.sent();return[3,4];case 2:return[4,e5("Running ESLint check",e3.ESLINT_CHECK)];case 3:n=r.sent();r.label=4;case 4:n;return[2]}})});return ne.apply(this,arguments)}function nn(){return nt.apply(this,arguments)}function nt(){nt=o(function(){var e,n,t;return y(this,function(r){switch(r.label){case 0:return[4,ea()];case 1:e=r.sent(),n=e.filter(function(e){return e.type==="error"}),t=e.filter(function(e){return e.type==="warning"});!n.length&&!t.length?eo.printBoxedLog("✔ NO ISSUES FOUND","",{color:"green"}):(eo.printBoxedLog("⚠ Warnings",t,{color:"yellow"}),eo.printBoxedLog("✖ Errors",n,{color:"red"}));return[2]}})});return nt.apply(this,arguments)}function nr(){return no.apply(this,arguments)}function no(){no=o(function(){var e,n,t;return y(this,function(r){switch(r.label){case 0:return[4,el()];case 1:r.sent();return[4,$(eS)];case 2:e=r.sent(),n=e.isCurrentProject;if(!n)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,e5("Building package: ".concat(eS),e3.BUILD)];case 4:r.sent();return[4,e5("Staging build artifacts",e3.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:t=r.sent();throw eo.error("Error building and staging ".concat(eS,": ").concat(t.message)),t;case 7:return[4,e5("Executing lint-staged",e3.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),nn();return[2]}})});return no.apply(this,arguments)}function ni(){return nc.apply(this,arguments)}function nc(){nc=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,e5("Inspecting ESLint configuration",e3.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return nc.apply(this,arguments)}function ns(){return na.apply(this,arguments)}function na(){na=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,Promise.all([e8(),e9()])];case 2:e.sent(),nn();return[2]}})});return na.apply(this,arguments)}function nu(){return nl.apply(this,arguments)}function nl(){nl=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,Promise.all([e8(),e9(!0)])];case 2:e.sent(),nn();return[2]}})});return nl.apply(this,arguments)}function nf(){return np.apply(this,arguments)}function np(){np=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,e5("Validating commit message",e3.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),nn();return[2]}})});return np.apply(this,arguments)}function nd(){return nh.apply(this,arguments)}function nh(){nh=o(function(){var e,n;return y(this,function(t){switch(t.label){case 0:return[4,e5("Configuring Git hooks",e3.CONFIGURE_GIT_HOOK)];case 1:t.sent(),j([e2.GIT_HOOK]);return[4,eE(e4)];case 2:e=t.sent();A(e2.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});n="\n".concat(eP,"\n");L(e2.GIT_IGNORE)?P(e2.GIT_IGNORE).split("\n").includes(eP)||R(e2.GIT_IGNORE,n):A(e2.GIT_IGNORE,n);return[4,e5("Installing simple-git-hooks",e3.SIMPLE_GIT_HOOKS)];case 3:t.sent();return[2]}})});return nh.apply(this,arguments)}function ng(){return nm.apply(this,arguments)}function nm(){nm=o(function(){var e,n,t,r,o,i,c,s,a,u,l;return y(this,function(f){switch(f.label){case 0:e=[{command:e3.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:e3.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:e3.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];n=true,t=false,r=undefined;f.label=1;case 1:f.trys.push([1,8,9,10]);o=e[Symbol.iterator]();f.label=2;case 2:if(!!(n=(i=o.next()).done))return[3,7];c=i.value,s=c.command,a=c.message;f.label=3;case 3:f.trys.push([3,5,,6]);return[4,e5("".concat(a," using: ").concat(s),s)];case 4:f.sent();return[2];case 5:u=f.sent();eo.warning("Installation attempt failed: ".concat(s)),eo.error("Details: ".concat(u.message));return[3,6];case 6:n=true;return[3,2];case 7:return[3,10];case 8:l=f.sent();t=true;r=l;return[3,10];case 9:try{if(!n&&o.return!=null){o.return()}}finally{if(t){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return nm.apply(this,arguments)}function ny(e){return nv.apply(this,arguments)}function nv(){nv=o(function(e){var n,t,r,o,c;return y(this,function(s){switch(s.label){case 0:s.trys.push([0,4,,5]);return[4,$(e)];case 1:n=s.sent(),t=n.installedPath,r=n.latestVersion,o=n.file;o.dependencies=p(l({},o.dependencies),i({},o.name,r)),A(t,o,{isJson:!0});return[4,ng()];case 2:s.sent();return[4,nu()];case 3:s.sent();return[3,5];case 4:c=s.sent();throw eo.error('Failed to update "'.concat(e,'": ').concat(c.message)),c;case 5:return[2]}})});return nv.apply(this,arguments)}function nE(){return nb.apply(this,arguments)}function nb(){nb=o(function(){var e,n,t,r,o,i,c;return y(this,function(s){switch(s.label){case 0:if(!L(e2.PACKAGE_JSON)){eo.error("package.json not found. Aborting setup.");return[2]}s.label=1;case 1:s.trys.push([1,7,,8]);return[4,$(eS)];case 2:e=s.sent(),n=e.isInstalled,t=e.installedVersion,r=e.latestVersion,o=e.isCurrentProject;if(!(o||n&&t===r))return[3,3];i=eo.success("Cyberskill package is already up to date.");return[3,5];case 3:return[4,ny(eS)];case 4:i=s.sent();s.label=5;case 5:i;return[4,nd()];case 6:s.sent();return[3,8];case 7:c=s.sent();throw eo.error("Project setup failed: ".concat(c.message)),c;case 8:return[2]}})});return nb.apply(this,arguments)}function nI(){return nS.apply(this,arguments)}function nS(){nS=o(function(){return y(this,function(e){switch(e.label){case 0:j([e2.NODE_MODULES,e2.PNPM_LOCK_YAML]);return[4,ng()];case 1:e.sent();return[4,nd()];case 2:e.sent();return[2]}})});return nS.apply(this,arguments)}function nw(){return n_.apply(this,arguments)}function n_(){n_=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,e5("Inspecting project dependencies",e3.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return n_.apply(this,arguments)}function nO(){return nT.apply(this,arguments)}function nT(){nT=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,e5("Running unit tests",e3.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return nT.apply(this,arguments)}function nC(){return nN.apply(this,arguments)}function nN(){nN=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,e5("Running end-to-end tests",e3.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return nN.apply(this,arguments)}b(E(v.argv)).scriptName(ek).usage("$0 <command> [options]").command("lint","Check code for linting issues",ns).command("lint:fix","Fix linting issues automatically",nu).command("lint:inspect","View active ESLint configuration",ni).command("lint-staged","Run lint checks on staged files",nr).command("commitlint","Validate commit message format",nf).command("setup","Initialize project setup and dependencies",nE).command("reset","Reset the project and reinstall dependencies",nI).command("inspect","Analyze installed project dependencies",nw).command("test:unit","Run unit test suite",nO).command("test:e2e","Run end-to-end test suite",nC).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse();
2
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(e){if(Array.isArray(e))return e}function n(t){if(Array.isArray(t))return e(t)}function r(e,t,n,r,o,i,c){try{var s=e[i](c);var a=s.value}catch(e){n(e);return}if(s.done){t(a)}else{Promise.resolve(a).then(r,o)}}function o(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var c=e.apply(t,n);function s(e){r(c,o,i,s,a,"next",e)}function a(e){r(c,o,i,s,a,"throw",e)}s(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 c(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function s(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var o=true;var i=false;var c,s;try{for(n=n.call(e);!(o=(c=n.next()).done);o=true){r.push(c.value);if(t&&r.length===t)break}}catch(e){i=true;s=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(i)throw s}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var r=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}r.forEach(function(t){i(e,t,n[t])})}return e}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);if(t){r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}n.push.apply(n,r)}return n}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{f(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function d(e,n){return t(e)||s(e,n)||y(e,n)||a()}function h(e){return n(e)||c(e)||y(e)||u()}function g(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function y(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function m(e,t){var n,r,o,i,c={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),"throw":s(1),"return":s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(t){return a([e,t])}}function a(i){if(n)throw new TypeError("Generator is already executing.");while(c)try{if(n=1,r&&(o=i[0]&2?r["return"]:i[0]?r["throw"]||((o=r["return"])&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;if(r=0,o)i=[i[0]&2,o.value];switch(i[0]){case 0:case 1:o=i;break;case 4:c.label++;return{value:i[1],done:false};case 5:c.label++;r=i[1];i=[0];continue;case 7:i=c.ops.pop();c.trys.pop();continue;default:if(!(o=c.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){c=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){c.label=i[1];break}if(i[0]===6&&c.label<o[1]){c.label=o[1];o=i;break}if(o&&c.label<o[2]){c.label=o[2];c.ops.push(i);break}if(o[2])c.ops.pop();c.trys.pop();continue}i=t.call(e,c)}catch(e){i=[6,e];r=0}finally{n=o=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}}import v from"node:process";import{hideBin as E}from"yargs/helpers";import _ from"yargs/yargs";import b from"node:process";import I from"boxen";import S from"chalk";import{exec as O}from"node:child_process";import N from"node:process";import*as T from"node:util";import w from"node-fetch";import*as C from"node:fs";var P=function(e){return C.existsSync(e)};function L(e,t){var n=C.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":g(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 A(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,o=r===void 0?!1:r,i=o&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);C.writeFileSync(e,i,"utf-8")}function D(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,o=r===void 0?!1:r,i=o&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);C.appendFileSync(e,i,"utf-8")}function R(e){e.forEach(function(e){P(e)&&C.rmSync(e,{recursive:!0,force:!0})})}import*as j from"node:path";function G(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=j).resolve.apply(r,[eb].concat(h(t)))}function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=j).join.apply(r,h(t))}import k from"node-persist";import F from"node:os";import K from"node:process";function x(){return K.env.CYBERSKILL_STORAGE_DIR||M(F.homedir(),eS)}function U(){return B.apply(this,arguments)}function B(){B=o(function(){var e;return m(this,function(t){switch(t.label){case 0:e=k.defaultInstance;if(e)return[3,2];return[4,k.init({dir:x(),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 B.apply(this,arguments)}var Y={get:function e(e){return o(function(){var t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,U()];case 1:r.sent();return[4,k.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(console.error('❌ [Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,U()];case 1:r.sent();return[4,k.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();console.error('❌ [Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,U()];case 1:n.sent();return[4,k.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();console.error('❌ [Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return o(function(){var e,t;return m(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,U()];case 1:n.sent();return[4,k.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(console.warn("⚠️ [Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(console.error("❌ [Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return m(this,function(t){try{return[2,"".concat(x()," (key: ").concat(e,")")]}catch(e){return[2,(console.error("❌ [Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var J=24*60*60*1e3;function W(e){var t=M(eb,eT);if(P(t))try{var n=L(t,{asJson:!0});if(n.name===e)return{path:t,file:n,isCurrentProject:!0}}catch(e){eo.warning("Failed to read local package.json: ".concat(e.message))}var r=M(eb,eO,e,eT);if(P(r))try{var o=L(r,{asJson:!0});if(o.name===e)return{path:r,file:o,isCurrentProject:!1}}catch(t){eo.warning("Failed to read node_modules package.json for ".concat(e,": ").concat(t.message))}return!1}function X(e){return H.apply(this,arguments)}function H(){H=o(function(e){var t,n,r,o,i,c,s,a,u,l;var f=arguments;return m(this,function(p){switch(p.label){case 0:t=f.length>1&&f[1]!==void 0?f[1]:!1;n="npm_version:".concat(e),r="npm_metadata:".concat(e);return[4,Y.get(n)];case 1:o=p.sent();return[4,Y.get(r)];case 2:i=p.sent(),c=o&&Date.now()-o.timestamp<J;if(!t&&c)return[2,o.version];s={};(i===null||i===void 0?void 0:i.etag)&&(s["If-None-Match"]=i.etag),(i===null||i===void 0?void 0:i.lastModified)&&(s["If-Modified-Since"]=i.lastModified);p.label=3;case 3:p.trys.push([3,8,,9]);return[4,w("https://registry.npmjs.org/".concat(e,"/latest"),{headers:s})];case 4:a=p.sent();if(a.status===304&&o)return[2,o.version];if(!a.ok)throw new Error("Failed to fetch latest version: ".concat(a.statusText));return[4,a.json()];case 5:u=p.sent().version;return[4,Y.set(n,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,Y.set(r,{etag:a.headers.get("ETag")||void 0,lastModified:a.headers.get("Last-Modified")||void 0})];case 7:return[2,(p.sent(),u)];case 8:l=p.sent();if(eo.error("Error fetching latest version for ".concat(e,": ").concat(l.message)),o)return[2,(eo.warning("Falling back to cached version for ".concat(e,": ").concat(o.version)),o.version)];throw l;case 9:return[2]}})});return H.apply(this,arguments)}function V(e){return $.apply(this,arguments)}function $(){$=o(function(e){var t,n,r,o,i;return m(this,function(c){switch(c.label){case 0:t={isInstalled:!1,isCurrentProject:!1,installedPath:"",installedVersion:"",latestVersion:"",file:{}};c.label=1;case 1:c.trys.push([1,6,,7]);n=W(e);r=n;if(!r)return[3,5];t.file=n.file,t.isInstalled=!0,t.installedPath=n.path,t.installedVersion=n.file.version,t.isCurrentProject=n.isCurrentProject;if(!n.isCurrentProject)return[3,2];o=n.file.version;return[3,4];case 2:return[4,X(e,!0)];case 3:o=c.sent();c.label=4;case 4:r=t.latestVersion=o;c.label=5;case 5:return[2,(r,t)];case 6:i=c.sent();return[2,(eo.error('Error checking package "'.concat(e,'": ').concat(i.message)),t)];case 7:return[2]}})});return $.apply(this,arguments)}var z=N.env.DEBUG==="true",q=T.promisify(O),Q=S.gray,Z=S.blue;function ee(){return Q("[".concat(new Date().toLocaleTimeString(),"]"))}function et(e){var t=S[e];return typeof t=="function"?t:S.green}function en(e,t,n,r){var o=et(t);console.log("".concat(ee()," ").concat(o("".concat(n," ").concat(e))," ").concat(r))}function er(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.color,o=r===void 0?"green":r,i=n.padding,c=i===void 0?1:i,s=n.margin,a=s===void 0?1:s,u=n.borderStyle,l=u===void 0?"round":u,f=n.titleColor,p=f===void 0?"bold":f;var d=et(o),h=et(p);if(typeof t=="string"){console.log(I(h(d("".concat(e,"\n").concat(t))),{padding:c,margin:a,borderStyle:l,borderColor:o}));return}Array.isArray(t)&&t.length&&(t.forEach(function(e){var t=e.file,n=e.position,r=e.rule,o=e.message;console.log("".concat(ee()," ").concat(d("File:")," ").concat(Z("".concat(t).concat(n?":".concat(n):"")))),r&&console.log(" ".concat(d("Rule:")," ").concat(d(r))),console.log(" ".concat(d("Message:")," ").concat(d(o)))}),console.log(I(h(d("".concat(e,": ").concat(t.length))),{padding:c,margin:a,borderStyle:l,borderColor:o})),console.log(Q("─".repeat(40))))}var eo={success:function(e){return en("SUCCESS","green","✔",e)},error:function(e){return en("ERROR","red","✖",e)},warning:function(e){return en("WARNING","yellow","⚠",e)},info:function(e){return en("INFO","blue","ℹ",e)},printBoxedLog:er};function ei(e){return"error_list:".concat(e)}function ec(e){return es.apply(this,arguments)}function es(){es=o(function(e){var t,n,r;return m(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),n=ei(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,Y.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,Y.getLogLink(n)];case 1:e=t.sent();e&&eo.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();eo.error("Failed to save errors: ".concat(r.message));return[3,4];case 4:return[2]}})});return es.apply(this,arguments)}function ea(){return eu.apply(this,arguments)}function eu(){eu=o(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,Y.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=o(function(e){var t;return m(this,function(n){switch(n.label){case 0:return[4,Y.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,(eo.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return eu.apply(this,arguments)}function el(){return ef.apply(this,arguments)}function ef(){ef=o(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,Y.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 Y.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();eo.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return ef.apply(this,arguments)}function ep(e){var t=[],n=[],r="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,c=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var s=o.exec(e)||[],a=i.exec(e)||[],u=c.exec(e)||[];s.length&&r?t.push({file:r,position:"".concat(s[1],":").concat(s[2]),type:s[3]==="error"?"error":"warning",message:s[4].trim(),rule:s[5].trim()}):a.length?t.push({file:a[1],position:"".concat(a[2],":").concat(a[3]),type:a[4]==="error"?"error":"warning",message:a[5].trim()}):u.length?t.push({file:"commitlint",type:"error",message:u[1].trim(),rule:u[2].trim()}):n.push(e.trim())}}),t.length&&ec(t),n.length&&z&&(eo.warning("Unmatched lines:"),n.forEach(function(e){return console.log(" ".concat(e))}))}function ed(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,o=e.line,i=e.column,c=e.ruleId,s=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(o,":").concat(i),rule:c,message:s})})}),n.length&&ec(n)}catch(t){ep(e)}}function eh(e){return eg.apply(this,arguments)}function eg(){eg=o(function(e){var t,n,r,o,i,c,s,a,u;var l=arguments;return m(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ed;n=new AbortController;N.on("SIGINT",function(){eo.warning("Process interrupted. Terminating..."),n.abort(),N.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,q(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),o=r.stdout,i=r.stderr;[o,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:c=f.sent();s=c.stdout,a=c.stderr,u=c.message;[s,a].forEach(function(e){return e&&t(e)}),!a&&!s&&eo.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eg.apply(this,arguments)}function ey(e){return{raw:!0,cmd:e}}function em(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eV," ").concat(eI," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eV," ").concat(eW," src/cli.ts ").concat(e):"".concat(eV," ").concat(eG," ").concat(e)}function ev(e,t){return typeof e=="function"?em(e(t),t):(typeof e==="undefined"?"undefined":g(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?em(e,t):e}function eE(e){return e_.apply(this,arguments)}function e_(){e_=o(function(e){var t,n,r,o,i,c,s;var a=arguments;return m(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];s=!1;return[3,3];case 1:return[4,V(eI)];case 2:s=u.sent().isCurrentProject;u.label=3;case 3:o=s,i={isRemote:r,isCurrentProject:o},c=typeof e=="function"?e(i):e;return[2,Object.fromEntries(Object.entries(c).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,ev(r,i)]}))]}})});return e_.apply(this,arguments)}var eb=b.env.INIT_CWD||b.cwd(),eI="@cyberskill/shared",eS=".cyberskill-storage",eO="node_modules",eN="dist",eT="package.json",ew="package-lock.json",eC="tsconfig.json",eP=".gitignore",eL=".simple-git-hooks.json",eA="pnpm-lock.yaml",eD=".git/hooks/",eR=".git/COMMIT_EDITMSG",ej=M(eb,eO,eI,eN),eG="cyberskill",eM="eslint",ek="vitest",eF="vitest",eK="@commitlint/cli",ex="commitlint",eU="lint-staged",eB="lint-staged",eY="typescript",eJ="tsc",eW="tsx",eX="git",eH="pnpm",eV="pnpm exec",e$="simple-git-hooks",ez="simple-git-hooks",eq="@eslint/config-inspector",eQ="eslint-config-inspector",eZ="node-modules-inspector",e0="node-modules-inspector",e2={CYBERSKILL_DIRECTORY:ej,WORKING_DIRECTORY:eb,TS_CONFIG:G(eC),GIT_IGNORE:G(eP),GIT_HOOK:G(eD),GIT_COMMIT_MSG:G(eR),SIMPLE_GIT_HOOKS_JSON:G(eL),PACKAGE_JSON:G(eT),PACKAGE_LOCK_JSON:G(ew),PNPM_LOCK_YAML:G(eA),NODE_MODULES:G(eO),CYBERSKILL:{LINT_STAGED_CONFIG:G("".concat(ej,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:G("".concat(ej,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:G("".concat(ej,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:G("".concat(ej,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:G("".concat(ej,"/configs/vitest/react/e2e.js"))}};function e4(e){var t=e.isCurrentProject;return l({"pre-commit":eB,"commit-msg":ex},t&&{"pre-push":ey("".concat(eX," pull"))})}function e1(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var o=d(n,2),i=o[0],c=o[1];switch(e){case"PNPM_ADD_AND_EXEC":return ev(ey("".concat(eH," add -D ").concat(i," && ").concat(eV," ").concat(c)));case"PNPM_EXEC":return ev(ey("".concat(eV," ").concat(i," ").concat(c||"").trim()));case"RAW":return ev(ey(i))}}var e3={SIMPLE_GIT_HOOKS:e1("PNPM_ADD_AND_EXEC",e$,ez),ESLINT_INSPECT:e1("PNPM_ADD_AND_EXEC",eq,eQ),NODE_MODULES_INSPECT:e1("PNPM_ADD_AND_EXEC",eZ,e0),ESLINT_CHECK:e1("PNPM_EXEC",eM,e2.WORKING_DIRECTORY),ESLINT_FIX:e1("PNPM_EXEC",eM,"".concat(e2.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:e1("PNPM_ADD_AND_EXEC",eY,"".concat(eJ," -p ").concat(e2.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:e1("RAW","".concat(eX," config core.hooksPath ").concat(e2.GIT_HOOK)),BUILD:e1("RAW","".concat(eH," run build")),STAGE_BUILD_DIRECTORY:e1("RAW","".concat(eX," add ").concat(eN)),PNPM_INSTALL_STANDARD:e1("RAW","".concat(eH," install")),PNPM_INSTALL_LEGACY:e1("RAW","".concat(eH," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:e1("RAW","".concat(eH," install --force")),CYBERSKILL:{TEST_UNIT:e1("PNPM_ADD_AND_EXEC",ek,"".concat(eF," --config ").concat(e2.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:e1("PNPM_ADD_AND_EXEC",ek,"".concat(eF," --config ").concat(e2.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:e1("PNPM_ADD_AND_EXEC",eK,"".concat(ex," --edit ").concat(e2.GIT_COMMIT_MSG," --config ").concat(e2.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:e1("PNPM_ADD_AND_EXEC",eU,"".concat(eB," --config ").concat(e2.CYBERSKILL.LINT_STAGED_CONFIG))}};function e5(e,t){return e6.apply(this,arguments)}function e6(){e6=o(function(e,t){return m(this,function(n){switch(n.label){case 0:eo.info("".concat(e,"..."));return[4,eh(t)];case 1:n.sent(),eo.success("".concat(e," completed successfully."));return[2]}})});return e6.apply(this,arguments)}function e8(){return e7.apply(this,arguments)}function e7(){e7=o(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!P(e2.TS_CONFIG))return[3,2];return[4,e5("Performing TypeScript validation",e3.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=eo.warning("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return e7.apply(this,arguments)}function e9(){return te.apply(this,arguments)}function te(){te=o(function(){var e,t;var n=arguments;return m(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,e5("Running ESLint with auto-fix",e3.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,e5("Running ESLint check",e3.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return te.apply(this,arguments)}function tt(){return tn.apply(this,arguments)}function tn(){tn=o(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,ea()];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?eo.printBoxedLog("✔ NO ISSUES FOUND","",{color:"green"}):(eo.printBoxedLog("⚠ Warnings",n,{color:"yellow"}),eo.printBoxedLog("✖ Errors",t,{color:"red"}));return[2]}})});return tn.apply(this,arguments)}function tr(){return to.apply(this,arguments)}function to(){to=o(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,el()];case 1:r.sent();return[4,V(eI)];case 2:e=r.sent(),t=e.isCurrentProject;if(!t)return[3,7];r.label=3;case 3:r.trys.push([3,6,,7]);return[4,e5("Building package: ".concat(eI),e3.BUILD)];case 4:r.sent();return[4,e5("Staging build artifacts",e3.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw eo.error("Error building and staging ".concat(eI,": ").concat(n.message)),n;case 7:return[4,e5("Executing lint-staged",e3.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),tt();return[2]}})});return to.apply(this,arguments)}function ti(){return tc.apply(this,arguments)}function tc(){tc=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5("Inspecting ESLint configuration",e3.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tc.apply(this,arguments)}function ts(){return ta.apply(this,arguments)}function ta(){ta=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,Promise.all([e8(),e9()])];case 2:e.sent(),tt();return[2]}})});return ta.apply(this,arguments)}function tu(){return tl.apply(this,arguments)}function tl(){tl=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,Promise.all([e8(),e9(!0)])];case 2:e.sent(),tt();return[2]}})});return tl.apply(this,arguments)}function tf(){return tp.apply(this,arguments)}function tp(){tp=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,e5("Validating commit message",e3.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tt();return[2]}})});return tp.apply(this,arguments)}function td(){return th.apply(this,arguments)}function th(){th=o(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,e5("Configuring Git hooks",e3.CONFIGURE_GIT_HOOK)];case 1:n.sent(),R([e2.GIT_HOOK]);return[4,eE(e4)];case 2:e=n.sent();A(e2.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eL,"\n");P(e2.GIT_IGNORE)?L(e2.GIT_IGNORE).split("\n").includes(eL)||D(e2.GIT_IGNORE,t):A(e2.GIT_IGNORE,t);return[4,e5("Installing simple-git-hooks",e3.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return th.apply(this,arguments)}function tg(){return ty.apply(this,arguments)}function ty(){ty=o(function(){var e,t,n,r,o,i,c,s,a,u,l;return m(this,function(f){switch(f.label){case 0:e=[{command:e3.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:e3.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:e3.PNPM_INSTALL_FORCE,message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,8,9,10]);o=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(i=o.next()).done))return[3,7];c=i.value,s=c.command,a=c.message;f.label=3;case 3:f.trys.push([3,5,,6]);return[4,e5("".concat(a," using: ").concat(s),s)];case 4:f.sent();return[2];case 5:u=f.sent();eo.warning("Installation attempt failed: ".concat(s)),eo.error("Details: ".concat(u.message));return[3,6];case 6:t=true;return[3,2];case 7:return[3,10];case 8:l=f.sent();n=true;r=l;return[3,10];case 9:try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}return[7];case 10:throw new Error("All dependency installation strategies failed.")}})});return ty.apply(this,arguments)}function tm(e){return tv.apply(this,arguments)}function tv(){tv=o(function(e){var t,n,r,o,c;return m(this,function(s){switch(s.label){case 0:s.trys.push([0,4,,5]);return[4,V(e)];case 1:t=s.sent(),n=t.installedPath,r=t.latestVersion,o=t.file;o.dependencies=p(l({},o.dependencies),i({},o.name,r)),A(n,o,{isJson:!0});return[4,tg()];case 2:s.sent();return[4,tu()];case 3:s.sent();return[3,5];case 4:c=s.sent();throw eo.error('Failed to update "'.concat(e,'": ').concat(c.message)),c;case 5:return[2]}})});return tv.apply(this,arguments)}function tE(){return t_.apply(this,arguments)}function t_(){t_=o(function(){var e,t,n,r,o,i,c;return m(this,function(s){switch(s.label){case 0:if(!P(e2.PACKAGE_JSON)){eo.error("package.json not found. Aborting setup.");return[2]}s.label=1;case 1:s.trys.push([1,7,,8]);return[4,V(eI)];case 2:e=s.sent(),t=e.isInstalled,n=e.installedVersion,r=e.latestVersion,o=e.isCurrentProject;if(!(o||t&&n===r))return[3,3];i=eo.success("Cyberskill package is already up to date.");return[3,5];case 3:return[4,tm(eI)];case 4:i=s.sent();s.label=5;case 5:i;return[4,td()];case 6:s.sent();return[3,8];case 7:c=s.sent();throw eo.error("Project setup failed: ".concat(c.message)),c;case 8:return[2]}})});return t_.apply(this,arguments)}function tb(){return tI.apply(this,arguments)}function tI(){tI=o(function(){return m(this,function(e){switch(e.label){case 0:R([e2.NODE_MODULES,e2.PNPM_LOCK_YAML]);return[4,tg()];case 1:e.sent();return[4,td()];case 2:e.sent();return[2]}})});return tI.apply(this,arguments)}function tS(){return tO.apply(this,arguments)}function tO(){tO=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5("Inspecting project dependencies",e3.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tO.apply(this,arguments)}function tN(){return tT.apply(this,arguments)}function tT(){tT=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5("Running unit tests",e3.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tT.apply(this,arguments)}function tw(){return tC.apply(this,arguments)}function tC(){tC=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,e5("Running end-to-end tests",e3.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tC.apply(this,arguments)}_(E(v.argv)).scriptName(eG).usage("$0 <command> [options]").command("lint","Check code for linting issues",ts).command("lint:fix","Fix linting issues automatically",tu).command("lint:inspect","View active ESLint configuration",ti).command("lint-staged","Run lint checks on staged files",tr).command("commitlint","Validate commit message format",tf).command("setup","Initialize project setup and dependencies",tE).command("reset","Reset the project and reinstall dependencies",tb).command("inspect","Analyze installed project dependencies",tS).command("test:unit","Run unit test suite",tN).command("test:e2e","Run end-to-end test suite",tw).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").epilog('\uD83D\uDCA1 Tip: Use "--help" with any command to see options\n').parse();
@@ -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){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 o=true;var c=false;var a,i;try{for(n=n.call(e);!(o=(a=n.next()).done);o=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){c=true;i=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(c)throw i}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var o=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}o.forEach(function(t){r(e,t,n[t])})}return e}function l(e,n){return t(e)||c(e,n)||p(e,n)||a()}function s(e){return n(e)||o(e)||p(e)||i()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function p(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)}var d=Object.create;var I=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var _=function(e,t){for(var n in t)I(e,n,{get:t[n],enumerable:!0})},v=function(e,t,n,r){var o=true,c=false,a=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var i=function(){var o=l.value;!E.call(e,o)&&o!==n&&I(e,o,{get:function(){return t[o]},enumerable:!(r=m(t,o))||r.enumerable})};for(var u=y(t)[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true)i()}catch(e){c=true;a=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}}return e};var T=function(e,t,n){return n=e!=null?d(O(e)):{},v(t||!e||!e.__esModule?I(n,"default",{value:e,enumerable:!0}):n,e)},g=function(e){return v(I({},"__esModule",{value:!0}),e)};var C={};_(C,{createGraphqlCodegenConfig:function(){return eL}});module.exports=g(C);var S=T(require("process"),1);var b=T(require("boxen"),1),h=T(require("chalk"),1),A=require("child_process"),N=T(require("process"),1),L=T(require("util"),1);var w=T(require("node-fetch"),1);var G=T(require("fs"),1);var M=T(require("path"),1);function j(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=M).resolve.apply(r,[J].concat(s(t)))}function R(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=M).join.apply(r,s(t))}var P=T(require("node-persist"),1),D=T(require("os"),1),x=T(require("process"),1);var K=24*60*60*1e3;var F=N.default.env.DEBUG==="true",k=L.promisify(A.exec),q=h.default,Y=q.gray,H=q.blue;function B(e){return{raw:!0,cmd:e}}function U(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e_," ").concat(X," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e_," ").concat(ey," src/cli.ts ").concat(e):"".concat(e_," ").concat(ea," ").concat(e)}function W(e,t){return typeof e=="function"?U(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?U(e,t):e}var J=S.default.env.INIT_CWD||S.default.cwd(),X="@cyberskill/shared";var $="node_modules",z="dist",Q="package.json",V="package-lock.json",Z="tsconfig.json",ee=".gitignore",et=".simple-git-hooks.json",en="pnpm-lock.yaml",er=".git/hooks/",eo=".git/COMMIT_EDITMSG",ec=R(J,$,X,z),ea="cyberskill",ei="eslint",eu="vitest",el="vitest",es="@commitlint/cli",ef="commitlint",ep="lint-staged",ed="lint-staged",eI="tsc",em="tsc",ey="tsx",eO="git",eE="pnpm",e_="pnpm exec",ev="simple-git-hooks",eT="simple-git-hooks",eg="@eslint/config-inspector",eC="eslint-config-inspector",eS="node-modules-inspector",eb="node-modules-inspector",eh={CYBERSKILL_DIRECTORY:ec,WORKING_DIRECTORY:J,TS_CONFIG:j(Z),GIT_IGNORE:j(ee),GIT_HOOK:j(er),GIT_COMMIT_MSG:j(eo),SIMPLE_GIT_HOOKS_JSON:j(et),PACKAGE_JSON:j(Q),PACKAGE_LOCK_JSON:j(V),PNPM_LOCK_YAML:j(en),NODE_MODULES:j($),CYBERSKILL:{LINT_STAGED_CONFIG:j("".concat(ec,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:j("".concat(ec,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:j("".concat(ec,"/configs/vitest/react/unit.js")),E2E_TEST_CONFIG:j("".concat(ec,"/configs/vitest/react/e2e.js"))}};function eA(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var o=l(n,2),c=o[0],a=o[1];switch(e){case"pnpmAddAndExec":return W(B("".concat(eE," add -D ").concat(c," && ").concat(e_," ").concat(a)));case"pnpmExec":return W(B("".concat(e_," ").concat(c," ").concat(a||"").trim()));case"raw":return W(B(c))}}var eN={SIMPLE_GIT_HOOKS:eA("pnpmAddAndExec",ev,eT),ESLINT_INSPECT:eA("pnpmAddAndExec",eg,eC),NODE_MODULES_INSPECT:eA("pnpmAddAndExec",eS,eb),ESLINT_CHECK:eA("pnpmExec",ei,eh.WORKING_DIRECTORY),ESLINT_FIX:eA("pnpmExec",ei,"".concat(eh.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eA("pnpmAddAndExec",eI,"".concat(em," -p ").concat(eh.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eA("raw","".concat(eO," config core.hooksPath ").concat(eh.GIT_HOOK)),BUILD:eA("raw","".concat(eE," run build")),STAGE_BUILD_DIRECTORY:eA("raw","".concat(eO," add ").concat(z)),PNPM_INSTALL_STANDARD:eA("raw","".concat(eE," install")),PNPM_INSTALL_LEGACY:eA("raw","".concat(eE," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eA("raw","".concat(eE," install --force")),CYBERSKILL:{TEST_UNIT:eA("pnpmAddAndExec",eu,"".concat(el," --config ").concat(eh.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eA("pnpmAddAndExec",eu,"".concat(el," --config ").concat(eh.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eA("pnpmAddAndExec",es,"".concat(ef," --edit ").concat(eh.GIT_COMMIT_MSG," --config ").concat(eh.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eA("pnpmAddAndExec",ep,"".concat(ed," --config ").concat(eh.CYBERSKILL.LINT_STAGED_CONFIG))}};function eL(e){var t=e.uri,n=e.from,o=e.to,c=e.withComponent,a=e.withHOC,i=e.withHooks,l=e.withMutationFn,s=e.withRefetchFn;var f=u({},c&&{withComponent:c},a&&{withHOC:a},i&&{withHooks:i},l&&{withMutationFn:l},s&&{withRefetchFn:s});return{schema:t,documents:[n],generates:r({},o,u({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[eN.ESLINT_FIX]}}}0&&(module.exports={createGraphqlCodegenConfig:createGraphqlCodegenConfig});
1
+ "use strict";function t(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function e(t){if(Array.isArray(t))return t}function r(e){if(Array.isArray(e))return t(e)}function n(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function o(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,e){var r=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(r==null)return;var n=[];var o=true;var c=false;var i,a;try{for(r=r.call(t);!(o=(i=r.next()).done);o=true){n.push(i.value);if(e&&n.length===e)break}}catch(t){c=true;a=t}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(c)throw a}}return n}function i(){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 a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};var o=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))}o.forEach(function(e){n(t,e,r[e])})}return t}function l(t,r){return e(t)||c(t,r)||_(t,r)||i()}function s(t){return r(t)||o(t)||_(t)||a()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function _(e,r){if(!e)return;if(typeof e==="string")return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(e,r)}var p=Object.create;var E=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var C=function(t,e){for(var r in e)E(t,r,{get:e[r],enumerable:!0})},N=function(t,e,r,n){var o=true,c=false,i=undefined;if(e&&(typeof e==="undefined"?"undefined":f(e))=="object"||typeof e=="function")try{var a=function(){var o=l.value;!O.call(t,o)&&o!==r&&E(t,o,{get:function(){return e[o]},enumerable:!(n=I(e,o))||n.enumerable})};for(var u=d(e)[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true)a()}catch(t){c=true;i=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw i}}}return t};var T=function(t,e,r){return r=t!=null?p(y(t)):{},N(e||!t||!t.__esModule?E(r,"default",{value:t,enumerable:!0}):r,t)},v=function(t){return N(E({},"__esModule",{value:!0}),t)};var m={};C(m,{createGraphqlCodegenConfig:function(){return th}});module.exports=v(m);var g=T(require("process"),1);var S=T(require("boxen"),1),A=T(require("chalk"),1),b=require("child_process"),P=T(require("process"),1),h=T(require("util"),1);var D=T(require("node-fetch"),1);var M=T(require("fs"),1);var L=T(require("path"),1);function G(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=L).resolve.apply(n,[x].concat(s(e)))}function R(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=L).join.apply(n,s(e))}var w=T(require("node-persist"),1),j=T(require("os"),1),K=T(require("process"),1);var F=24*60*60*1e3;var k=P.default.env.DEBUG==="true",q=h.promisify(b.exec),Y=A.default,X=Y.gray,U=Y.blue;function W(t){return{raw:!0,cmd:t}}function H(t,e){return(e===null||e===void 0?void 0:e.isRemote)?"".concat(tC," ").concat(J," ").concat(t):(e===null||e===void 0?void 0:e.isCurrentProject)?"".concat(tC," ").concat(td," src/cli.ts ").concat(t):"".concat(tC," ").concat(ti," ").concat(t)}function B(t,e){return typeof t=="function"?H(t(e),e):(typeof t==="undefined"?"undefined":f(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?H(t,e):t}var x=g.default.env.INIT_CWD||g.default.cwd(),J="@cyberskill/shared";var $="node_modules",z="dist",Q="package.json",V="package-lock.json",Z="tsconfig.json",tt=".gitignore",te=".simple-git-hooks.json",tr="pnpm-lock.yaml",tn=".git/hooks/",to=".git/COMMIT_EDITMSG",tc=R(x,$,J,z),ti="cyberskill",ta="eslint",tu="vitest",tl="vitest",ts="@commitlint/cli",tf="commitlint",t_="lint-staged",tp="lint-staged",tE="typescript",tI="tsc",td="tsx",ty="git",tO="pnpm",tC="pnpm exec",tN="simple-git-hooks",tT="simple-git-hooks",tv="@eslint/config-inspector",tm="eslint-config-inspector",tg="node-modules-inspector",tS="node-modules-inspector",tA={CYBERSKILL_DIRECTORY:tc,WORKING_DIRECTORY:x,TS_CONFIG:G(Z),GIT_IGNORE:G(tt),GIT_HOOK:G(tn),GIT_COMMIT_MSG:G(to),SIMPLE_GIT_HOOKS_JSON:G(te),PACKAGE_JSON:G(Q),PACKAGE_LOCK_JSON:G(V),PNPM_LOCK_YAML:G(tr),NODE_MODULES:G($),CYBERSKILL:{LINT_STAGED_CONFIG:G("".concat(tc,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:G("".concat(tc,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:G("".concat(tc,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:G("".concat(tc,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:G("".concat(tc,"/configs/vitest/react/e2e.js"))}};function tb(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++){r[n-1]=arguments[n]}var o=l(r,2),c=o[0],i=o[1];switch(t){case"PNPM_ADD_AND_EXEC":return B(W("".concat(tO," add -D ").concat(c," && ").concat(tC," ").concat(i)));case"PNPM_EXEC":return B(W("".concat(tC," ").concat(c," ").concat(i||"").trim()));case"RAW":return B(W(c))}}var tP={SIMPLE_GIT_HOOKS:tb("PNPM_ADD_AND_EXEC",tN,tT),ESLINT_INSPECT:tb("PNPM_ADD_AND_EXEC",tv,tm),NODE_MODULES_INSPECT:tb("PNPM_ADD_AND_EXEC",tg,tS),ESLINT_CHECK:tb("PNPM_EXEC",ta,tA.WORKING_DIRECTORY),ESLINT_FIX:tb("PNPM_EXEC",ta,"".concat(tA.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tb("PNPM_ADD_AND_EXEC",tE,"".concat(tI," -p ").concat(tA.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tb("RAW","".concat(ty," config core.hooksPath ").concat(tA.GIT_HOOK)),BUILD:tb("RAW","".concat(tO," run build")),STAGE_BUILD_DIRECTORY:tb("RAW","".concat(ty," add ").concat(z)),PNPM_INSTALL_STANDARD:tb("RAW","".concat(tO," install")),PNPM_INSTALL_LEGACY:tb("RAW","".concat(tO," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tb("RAW","".concat(tO," install --force")),CYBERSKILL:{TEST_UNIT:tb("PNPM_ADD_AND_EXEC",tu,"".concat(tl," --config ").concat(tA.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tb("PNPM_ADD_AND_EXEC",tu,"".concat(tl," --config ").concat(tA.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tb("PNPM_ADD_AND_EXEC",ts,"".concat(tf," --edit ").concat(tA.GIT_COMMIT_MSG," --config ").concat(tA.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tb("PNPM_ADD_AND_EXEC",t_,"".concat(tp," --config ").concat(tA.CYBERSKILL.LINT_STAGED_CONFIG))}};function th(t){var e=t.uri,r=t.from,o=t.to,c=t.withComponent,i=t.withHOC,a=t.withHooks,l=t.withMutationFn,s=t.withRefetchFn;var f=u({},c&&{withComponent:c},i&&{withHOC:i},a&&{withHooks:a},l&&{withMutationFn:l},s&&{withRefetchFn:s});return{schema:e,documents:[r],generates:n({},o,u({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[tP.ESLINT_FIX]}}}0&&(module.exports={createGraphqlCodegenConfig:createGraphqlCodegenConfig});
@@ -1 +1 @@
1
- function t(t,n){if(n==null||n>t.length)n=t.length;for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function n(t){if(Array.isArray(t))return t}function e(n){if(Array.isArray(n))return t(n)}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 r(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 o=[];var r=true;var c=false;var i,a;try{for(e=e.call(t);!(r=(i=e.next()).done);r=true){o.push(i.value);if(n&&o.length===n)break}}catch(t){c=true;a=t}finally{try{if(!r&&e["return"]!=null)e["return"]()}finally{if(c)throw a}}return o}function i(){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 a(){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 s(t,e){return n(t)||c(t,e)||p(t,e)||i()}function u(t){return e(t)||r(t)||p(t)||a()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function p(n,e){if(!n)return;if(typeof n==="string")return t(n,e);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor)o=n.constructor.name;if(o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return t(n,e)}import d from"node:process";import m from"boxen";import I from"chalk";import{exec as E}from"node:child_process";import _ from"node:process";import*as T from"node:util";import O from"node-fetch";import*as y from"node:path";function S(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var o;return(o=y).resolve.apply(o,[R].concat(u(n)))}function C(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var o;return(o=y).join.apply(o,u(n))}import g from"node-persist";var h=24*60*60*1e3;var A=_.env.DEBUG==="true",N=T.promisify(E),v=I.gray,b=I.blue;function L(t){return{raw:!0,cmd:t}}function w(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tr," ").concat(M," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tr," ").concat(tn," src/cli.ts ").concat(t):"".concat(tr," ").concat(W," ").concat(t)}function G(t,n){return typeof t=="function"?w(t(n),n):(typeof t==="undefined"?"undefined":f(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?w(t,n):t}var R=d.env.INIT_CWD||d.cwd(),M="@cyberskill/shared";var P="node_modules",j="dist",D="package.json",K="package-lock.json",x="tsconfig.json",F=".gitignore",k=".simple-git-hooks.json",Y="pnpm-lock.yaml",H=".git/hooks/",B=".git/COMMIT_EDITMSG",U=C(R,P,M,j),W="cyberskill",J="eslint",X="vitest",q="vitest",$="@commitlint/cli",z="commitlint",Q="lint-staged",V="lint-staged",Z="tsc",tt="tsc",tn="tsx",te="git",to="pnpm",tr="pnpm exec",tc="simple-git-hooks",ti="simple-git-hooks",ta="@eslint/config-inspector",tl="eslint-config-inspector",ts="node-modules-inspector",tu="node-modules-inspector",tf={CYBERSKILL_DIRECTORY:U,WORKING_DIRECTORY:R,TS_CONFIG:S(x),GIT_IGNORE:S(F),GIT_HOOK:S(H),GIT_COMMIT_MSG:S(B),SIMPLE_GIT_HOOKS_JSON:S(k),PACKAGE_JSON:S(D),PACKAGE_LOCK_JSON:S(K),PNPM_LOCK_YAML:S(Y),NODE_MODULES:S(P),CYBERSKILL:{LINT_STAGED_CONFIG:S("".concat(U,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:S("".concat(U,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:S("".concat(U,"/configs/vitest/react/unit.js")),E2E_TEST_CONFIG:S("".concat(U,"/configs/vitest/react/e2e.js"))}};function tp(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++){e[o-1]=arguments[o]}var r=s(e,2),c=r[0],i=r[1];switch(t){case"pnpmAddAndExec":return G(L("".concat(to," add -D ").concat(c," && ").concat(tr," ").concat(i)));case"pnpmExec":return G(L("".concat(tr," ").concat(c," ").concat(i||"").trim()));case"raw":return G(L(c))}}var td={SIMPLE_GIT_HOOKS:tp("pnpmAddAndExec",tc,ti),ESLINT_INSPECT:tp("pnpmAddAndExec",ta,tl),NODE_MODULES_INSPECT:tp("pnpmAddAndExec",ts,tu),ESLINT_CHECK:tp("pnpmExec",J,tf.WORKING_DIRECTORY),ESLINT_FIX:tp("pnpmExec",J,"".concat(tf.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tp("pnpmAddAndExec",Z,"".concat(tt," -p ").concat(tf.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tp("raw","".concat(te," config core.hooksPath ").concat(tf.GIT_HOOK)),BUILD:tp("raw","".concat(to," run build")),STAGE_BUILD_DIRECTORY:tp("raw","".concat(te," add ").concat(j)),PNPM_INSTALL_STANDARD:tp("raw","".concat(to," install")),PNPM_INSTALL_LEGACY:tp("raw","".concat(to," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tp("raw","".concat(to," install --force")),CYBERSKILL:{TEST_UNIT:tp("pnpmAddAndExec",X,"".concat(q," --config ").concat(tf.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tp("pnpmAddAndExec",X,"".concat(q," --config ").concat(tf.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tp("pnpmAddAndExec",$,"".concat(z," --edit ").concat(tf.GIT_COMMIT_MSG," --config ").concat(tf.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tp("pnpmAddAndExec",Q,"".concat(V," --config ").concat(tf.CYBERSKILL.LINT_STAGED_CONFIG))}};function tm(t){var n=t.uri,e=t.from,r=t.to,c=t.withComponent,i=t.withHOC,a=t.withHooks,s=t.withMutationFn,u=t.withRefetchFn;var f=l({},c&&{withComponent:c},i&&{withHOC:i},a&&{withHooks:a},s&&{withMutationFn:s},u&&{withRefetchFn:u});return{schema:n,documents:[e],generates:o({},r,l({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[td.ESLINT_FIX]}}}export{tm as createGraphqlCodegenConfig};
1
+ function t(t,n){if(n==null||n>t.length)n=t.length;for(var o=0,e=new Array(n);o<n;o++)e[o]=t[o];return e}function n(t){if(Array.isArray(t))return t}function o(n){if(Array.isArray(n))return t(n)}function e(t,n,o){if(n in t){Object.defineProperty(t,n,{value:o,enumerable:true,configurable:true,writable:true})}else{t[n]=o}return t}function r(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,n){var o=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(o==null)return;var e=[];var r=true;var c=false;var i,a;try{for(o=o.call(t);!(r=(i=o.next()).done);r=true){e.push(i.value);if(n&&e.length===n)break}}catch(t){c=true;a=t}finally{try{if(!r&&o["return"]!=null)o["return"]()}finally{if(c)throw a}}return e}function i(){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 a(){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 s(t){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{};var r=Object.keys(o);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))}r.forEach(function(n){e(t,n,o[n])})}return t}function l(t,o){return n(t)||c(t,o)||_(t,o)||i()}function u(t){return o(t)||r(t)||_(t)||a()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function _(n,o){if(!n)return;if(typeof n==="string")return t(n,o);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor)e=n.constructor.name;if(e==="Map"||e==="Set")return Array.from(e);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return t(n,o)}import E from"node:process";import p from"boxen";import I from"chalk";import{exec as m}from"node:child_process";import N from"node:process";import*as T from"node:util";import C from"node-fetch";import*as O from"node:path";function y(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=O).resolve.apply(e,[M].concat(u(n)))}function d(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=O).join.apply(e,u(n))}import S from"node-persist";var A=24*60*60*1e3;var g=N.env.DEBUG==="true",D=T.promisify(m),P=I.gray,h=I.blue;function v(t){return{raw:!0,cmd:t}}function b(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tr," ").concat(G," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tr," ").concat(tn," src/cli.ts ").concat(t):"".concat(tr," ").concat(B," ").concat(t)}function L(t,n){return typeof t=="function"?b(t(n),n):(typeof t==="undefined"?"undefined":f(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?b(t,n):t}var M=E.env.INIT_CWD||E.cwd(),G="@cyberskill/shared";var R="node_modules",w="dist",j="package.json",K="package-lock.json",F="tsconfig.json",k=".gitignore",Y=".simple-git-hooks.json",X="pnpm-lock.yaml",U=".git/hooks/",W=".git/COMMIT_EDITMSG",H=d(M,R,G,w),B="cyberskill",x="eslint",J="vitest",q="vitest",$="@commitlint/cli",z="commitlint",Q="lint-staged",V="lint-staged",Z="typescript",tt="tsc",tn="tsx",to="git",te="pnpm",tr="pnpm exec",tc="simple-git-hooks",ti="simple-git-hooks",ta="@eslint/config-inspector",ts="eslint-config-inspector",tl="node-modules-inspector",tu="node-modules-inspector",tf={CYBERSKILL_DIRECTORY:H,WORKING_DIRECTORY:M,TS_CONFIG:y(F),GIT_IGNORE:y(k),GIT_HOOK:y(U),GIT_COMMIT_MSG:y(W),SIMPLE_GIT_HOOKS_JSON:y(Y),PACKAGE_JSON:y(j),PACKAGE_LOCK_JSON:y(K),PNPM_LOCK_YAML:y(X),NODE_MODULES:y(R),CYBERSKILL:{LINT_STAGED_CONFIG:y("".concat(H,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:y("".concat(H,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:y("".concat(H,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:y("".concat(H,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:y("".concat(H,"/configs/vitest/react/e2e.js"))}};function t_(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),e=1;e<n;e++){o[e-1]=arguments[e]}var r=l(o,2),c=r[0],i=r[1];switch(t){case"PNPM_ADD_AND_EXEC":return L(v("".concat(te," add -D ").concat(c," && ").concat(tr," ").concat(i)));case"PNPM_EXEC":return L(v("".concat(tr," ").concat(c," ").concat(i||"").trim()));case"RAW":return L(v(c))}}var tE={SIMPLE_GIT_HOOKS:t_("PNPM_ADD_AND_EXEC",tc,ti),ESLINT_INSPECT:t_("PNPM_ADD_AND_EXEC",ta,ts),NODE_MODULES_INSPECT:t_("PNPM_ADD_AND_EXEC",tl,tu),ESLINT_CHECK:t_("PNPM_EXEC",x,tf.WORKING_DIRECTORY),ESLINT_FIX:t_("PNPM_EXEC",x,"".concat(tf.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:t_("PNPM_ADD_AND_EXEC",Z,"".concat(tt," -p ").concat(tf.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:t_("RAW","".concat(to," config core.hooksPath ").concat(tf.GIT_HOOK)),BUILD:t_("RAW","".concat(te," run build")),STAGE_BUILD_DIRECTORY:t_("RAW","".concat(to," add ").concat(w)),PNPM_INSTALL_STANDARD:t_("RAW","".concat(te," install")),PNPM_INSTALL_LEGACY:t_("RAW","".concat(te," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:t_("RAW","".concat(te," install --force")),CYBERSKILL:{TEST_UNIT:t_("PNPM_ADD_AND_EXEC",J,"".concat(q," --config ").concat(tf.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:t_("PNPM_ADD_AND_EXEC",J,"".concat(q," --config ").concat(tf.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:t_("PNPM_ADD_AND_EXEC",$,"".concat(z," --edit ").concat(tf.GIT_COMMIT_MSG," --config ").concat(tf.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:t_("PNPM_ADD_AND_EXEC",Q,"".concat(V," --config ").concat(tf.CYBERSKILL.LINT_STAGED_CONFIG))}};function tp(t){var n=t.uri,o=t.from,r=t.to,c=t.withComponent,i=t.withHOC,a=t.withHooks,l=t.withMutationFn,u=t.withRefetchFn;var f=s({},c&&{withComponent:c},i&&{withHOC:i},a&&{withHooks:a},l&&{withMutationFn:l},u&&{withRefetchFn:u});return{schema:n,documents:[o],generates:e({},r,s({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[tE.ESLINT_FIX]}}}export{tp as createGraphqlCodegenConfig};
@@ -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){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 o=true;var c=false;var a,i;try{for(n=n.call(e);!(o=(a=n.next()).done);o=true){r.push(a.value);if(t&&r.length===t)break}}catch(e){c=true;i=e}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(c)throw i}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};var o=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))}o.forEach(function(t){r(e,t,n[t])})}return e}function l(e,n){return t(e)||c(e,n)||p(e,n)||a()}function s(e){return n(e)||o(e)||p(e)||i()}function f(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function p(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)}var d=Object.create;var I=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var O=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var _=function(e,t){for(var n in t)I(e,n,{get:t[n],enumerable:!0})},v=function(e,t,n,r){var o=true,c=false,a=undefined;if(t&&(typeof t==="undefined"?"undefined":f(t))=="object"||typeof t=="function")try{var i=function(){var o=l.value;!E.call(e,o)&&o!==n&&I(e,o,{get:function(){return t[o]},enumerable:!(r=m(t,o))||r.enumerable})};for(var u=y(t)[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true)i()}catch(e){c=true;a=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}}return e};var T=function(e,t,n){return n=e!=null?d(O(e)):{},v(t||!e||!e.__esModule?I(n,"default",{value:e,enumerable:!0}):n,e)},g=function(e){return v(I({},"__esModule",{value:!0}),e)};var C={};_(C,{createGraphqlCodegenConfig:function(){return eL}});module.exports=g(C);var S=T(require("process"),1);var b=T(require("boxen"),1),h=T(require("chalk"),1),A=require("child_process"),N=T(require("process"),1),L=T(require("util"),1);var w=T(require("node-fetch"),1);var G=T(require("fs"),1);var M=T(require("path"),1);function j(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=M).resolve.apply(r,[J].concat(s(t)))}function R(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=M).join.apply(r,s(t))}var P=T(require("node-persist"),1),D=T(require("os"),1),x=T(require("process"),1);var K=24*60*60*1e3;var F=N.default.env.DEBUG==="true",k=L.promisify(A.exec),q=h.default,Y=q.gray,H=q.blue;function B(e){return{raw:!0,cmd:e}}function U(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e_," ").concat(X," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e_," ").concat(ey," src/cli.ts ").concat(e):"".concat(e_," ").concat(ea," ").concat(e)}function W(e,t){return typeof e=="function"?U(e(t),t):(typeof e==="undefined"?"undefined":f(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?U(e,t):e}var J=S.default.env.INIT_CWD||S.default.cwd(),X="@cyberskill/shared";var $="node_modules",z="dist",Q="package.json",V="package-lock.json",Z="tsconfig.json",ee=".gitignore",et=".simple-git-hooks.json",en="pnpm-lock.yaml",er=".git/hooks/",eo=".git/COMMIT_EDITMSG",ec=R(J,$,X,z),ea="cyberskill",ei="eslint",eu="vitest",el="vitest",es="@commitlint/cli",ef="commitlint",ep="lint-staged",ed="lint-staged",eI="tsc",em="tsc",ey="tsx",eO="git",eE="pnpm",e_="pnpm exec",ev="simple-git-hooks",eT="simple-git-hooks",eg="@eslint/config-inspector",eC="eslint-config-inspector",eS="node-modules-inspector",eb="node-modules-inspector",eh={CYBERSKILL_DIRECTORY:ec,WORKING_DIRECTORY:J,TS_CONFIG:j(Z),GIT_IGNORE:j(ee),GIT_HOOK:j(er),GIT_COMMIT_MSG:j(eo),SIMPLE_GIT_HOOKS_JSON:j(et),PACKAGE_JSON:j(Q),PACKAGE_LOCK_JSON:j(V),PNPM_LOCK_YAML:j(en),NODE_MODULES:j($),CYBERSKILL:{LINT_STAGED_CONFIG:j("".concat(ec,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:j("".concat(ec,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:j("".concat(ec,"/configs/vitest/react/unit.js")),E2E_TEST_CONFIG:j("".concat(ec,"/configs/vitest/react/e2e.js"))}};function eA(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++){n[r-1]=arguments[r]}var o=l(n,2),c=o[0],a=o[1];switch(e){case"pnpmAddAndExec":return W(B("".concat(eE," add -D ").concat(c," && ").concat(e_," ").concat(a)));case"pnpmExec":return W(B("".concat(e_," ").concat(c," ").concat(a||"").trim()));case"raw":return W(B(c))}}var eN={SIMPLE_GIT_HOOKS:eA("pnpmAddAndExec",ev,eT),ESLINT_INSPECT:eA("pnpmAddAndExec",eg,eC),NODE_MODULES_INSPECT:eA("pnpmAddAndExec",eS,eb),ESLINT_CHECK:eA("pnpmExec",ei,eh.WORKING_DIRECTORY),ESLINT_FIX:eA("pnpmExec",ei,"".concat(eh.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eA("pnpmAddAndExec",eI,"".concat(em," -p ").concat(eh.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eA("raw","".concat(eO," config core.hooksPath ").concat(eh.GIT_HOOK)),BUILD:eA("raw","".concat(eE," run build")),STAGE_BUILD_DIRECTORY:eA("raw","".concat(eO," add ").concat(z)),PNPM_INSTALL_STANDARD:eA("raw","".concat(eE," install")),PNPM_INSTALL_LEGACY:eA("raw","".concat(eE," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eA("raw","".concat(eE," install --force")),CYBERSKILL:{TEST_UNIT:eA("pnpmAddAndExec",eu,"".concat(el," --config ").concat(eh.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eA("pnpmAddAndExec",eu,"".concat(el," --config ").concat(eh.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eA("pnpmAddAndExec",es,"".concat(ef," --edit ").concat(eh.GIT_COMMIT_MSG," --config ").concat(eh.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eA("pnpmAddAndExec",ep,"".concat(ed," --config ").concat(eh.CYBERSKILL.LINT_STAGED_CONFIG))}};function eL(e){var t=e.uri,n=e.from,o=e.to,c=e.withComponent,a=e.withHOC,i=e.withHooks,l=e.withMutationFn,s=e.withRefetchFn;var f=u({},c&&{withComponent:c},a&&{withHOC:a},i&&{withHooks:i},l&&{withMutationFn:l},s&&{withRefetchFn:s});return{schema:t,documents:[n],generates:r({},o,u({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[eN.ESLINT_FIX]}}}0&&(module.exports={createGraphqlCodegenConfig:createGraphqlCodegenConfig});
1
+ "use strict";function t(t,e){if(e==null||e>t.length)e=t.length;for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function e(t){if(Array.isArray(t))return t}function r(e){if(Array.isArray(e))return t(e)}function n(t,e,r){if(e in t){Object.defineProperty(t,e,{value:r,enumerable:true,configurable:true,writable:true})}else{t[e]=r}return t}function o(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,e){var r=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(r==null)return;var n=[];var o=true;var c=false;var i,a;try{for(r=r.call(t);!(o=(i=r.next()).done);o=true){n.push(i.value);if(e&&n.length===e)break}}catch(t){c=true;a=t}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(c)throw a}}return n}function i(){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 a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};var o=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))}o.forEach(function(e){n(t,e,r[e])})}return t}function l(t,r){return e(t)||c(t,r)||_(t,r)||i()}function s(t){return r(t)||o(t)||_(t)||a()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function _(e,r){if(!e)return;if(typeof e==="string")return t(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor)n=e.constructor.name;if(n==="Map"||n==="Set")return Array.from(n);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return t(e,r)}var p=Object.create;var E=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var C=function(t,e){for(var r in e)E(t,r,{get:e[r],enumerable:!0})},N=function(t,e,r,n){var o=true,c=false,i=undefined;if(e&&(typeof e==="undefined"?"undefined":f(e))=="object"||typeof e=="function")try{var a=function(){var o=l.value;!O.call(t,o)&&o!==r&&E(t,o,{get:function(){return e[o]},enumerable:!(n=I(e,o))||n.enumerable})};for(var u=d(e)[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true)a()}catch(t){c=true;i=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw i}}}return t};var T=function(t,e,r){return r=t!=null?p(y(t)):{},N(e||!t||!t.__esModule?E(r,"default",{value:t,enumerable:!0}):r,t)},v=function(t){return N(E({},"__esModule",{value:!0}),t)};var m={};C(m,{createGraphqlCodegenConfig:function(){return th}});module.exports=v(m);var g=T(require("process"),1);var S=T(require("boxen"),1),A=T(require("chalk"),1),b=require("child_process"),P=T(require("process"),1),h=T(require("util"),1);var D=T(require("node-fetch"),1);var M=T(require("fs"),1);var L=T(require("path"),1);function G(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=L).resolve.apply(n,[x].concat(s(e)))}function R(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=L).join.apply(n,s(e))}var w=T(require("node-persist"),1),j=T(require("os"),1),K=T(require("process"),1);var F=24*60*60*1e3;var k=P.default.env.DEBUG==="true",q=h.promisify(b.exec),Y=A.default,X=Y.gray,U=Y.blue;function W(t){return{raw:!0,cmd:t}}function H(t,e){return(e===null||e===void 0?void 0:e.isRemote)?"".concat(tC," ").concat(J," ").concat(t):(e===null||e===void 0?void 0:e.isCurrentProject)?"".concat(tC," ").concat(td," src/cli.ts ").concat(t):"".concat(tC," ").concat(ti," ").concat(t)}function B(t,e){return typeof t=="function"?H(t(e),e):(typeof t==="undefined"?"undefined":f(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?H(t,e):t}var x=g.default.env.INIT_CWD||g.default.cwd(),J="@cyberskill/shared";var $="node_modules",z="dist",Q="package.json",V="package-lock.json",Z="tsconfig.json",tt=".gitignore",te=".simple-git-hooks.json",tr="pnpm-lock.yaml",tn=".git/hooks/",to=".git/COMMIT_EDITMSG",tc=R(x,$,J,z),ti="cyberskill",ta="eslint",tu="vitest",tl="vitest",ts="@commitlint/cli",tf="commitlint",t_="lint-staged",tp="lint-staged",tE="typescript",tI="tsc",td="tsx",ty="git",tO="pnpm",tC="pnpm exec",tN="simple-git-hooks",tT="simple-git-hooks",tv="@eslint/config-inspector",tm="eslint-config-inspector",tg="node-modules-inspector",tS="node-modules-inspector",tA={CYBERSKILL_DIRECTORY:tc,WORKING_DIRECTORY:x,TS_CONFIG:G(Z),GIT_IGNORE:G(tt),GIT_HOOK:G(tn),GIT_COMMIT_MSG:G(to),SIMPLE_GIT_HOOKS_JSON:G(te),PACKAGE_JSON:G(Q),PACKAGE_LOCK_JSON:G(V),PNPM_LOCK_YAML:G(tr),NODE_MODULES:G($),CYBERSKILL:{LINT_STAGED_CONFIG:G("".concat(tc,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:G("".concat(tc,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:G("".concat(tc,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:G("".concat(tc,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:G("".concat(tc,"/configs/vitest/react/e2e.js"))}};function tb(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++){r[n-1]=arguments[n]}var o=l(r,2),c=o[0],i=o[1];switch(t){case"PNPM_ADD_AND_EXEC":return B(W("".concat(tO," add -D ").concat(c," && ").concat(tC," ").concat(i)));case"PNPM_EXEC":return B(W("".concat(tC," ").concat(c," ").concat(i||"").trim()));case"RAW":return B(W(c))}}var tP={SIMPLE_GIT_HOOKS:tb("PNPM_ADD_AND_EXEC",tN,tT),ESLINT_INSPECT:tb("PNPM_ADD_AND_EXEC",tv,tm),NODE_MODULES_INSPECT:tb("PNPM_ADD_AND_EXEC",tg,tS),ESLINT_CHECK:tb("PNPM_EXEC",ta,tA.WORKING_DIRECTORY),ESLINT_FIX:tb("PNPM_EXEC",ta,"".concat(tA.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tb("PNPM_ADD_AND_EXEC",tE,"".concat(tI," -p ").concat(tA.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tb("RAW","".concat(ty," config core.hooksPath ").concat(tA.GIT_HOOK)),BUILD:tb("RAW","".concat(tO," run build")),STAGE_BUILD_DIRECTORY:tb("RAW","".concat(ty," add ").concat(z)),PNPM_INSTALL_STANDARD:tb("RAW","".concat(tO," install")),PNPM_INSTALL_LEGACY:tb("RAW","".concat(tO," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tb("RAW","".concat(tO," install --force")),CYBERSKILL:{TEST_UNIT:tb("PNPM_ADD_AND_EXEC",tu,"".concat(tl," --config ").concat(tA.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tb("PNPM_ADD_AND_EXEC",tu,"".concat(tl," --config ").concat(tA.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tb("PNPM_ADD_AND_EXEC",ts,"".concat(tf," --edit ").concat(tA.GIT_COMMIT_MSG," --config ").concat(tA.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tb("PNPM_ADD_AND_EXEC",t_,"".concat(tp," --config ").concat(tA.CYBERSKILL.LINT_STAGED_CONFIG))}};function th(t){var e=t.uri,r=t.from,o=t.to,c=t.withComponent,i=t.withHOC,a=t.withHooks,l=t.withMutationFn,s=t.withRefetchFn;var f=u({},c&&{withComponent:c},i&&{withHOC:i},a&&{withHooks:a},l&&{withMutationFn:l},s&&{withRefetchFn:s});return{schema:e,documents:[r],generates:n({},o,u({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[tP.ESLINT_FIX]}}}0&&(module.exports={createGraphqlCodegenConfig:createGraphqlCodegenConfig});
@@ -1 +1 @@
1
- function t(t,n){if(n==null||n>t.length)n=t.length;for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function n(t){if(Array.isArray(t))return t}function e(n){if(Array.isArray(n))return t(n)}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 r(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 o=[];var r=true;var c=false;var i,a;try{for(e=e.call(t);!(r=(i=e.next()).done);r=true){o.push(i.value);if(n&&o.length===n)break}}catch(t){c=true;a=t}finally{try{if(!r&&e["return"]!=null)e["return"]()}finally{if(c)throw a}}return o}function i(){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 a(){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 s(t,e){return n(t)||c(t,e)||p(t,e)||i()}function u(t){return e(t)||r(t)||p(t)||a()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function p(n,e){if(!n)return;if(typeof n==="string")return t(n,e);var o=Object.prototype.toString.call(n).slice(8,-1);if(o==="Object"&&n.constructor)o=n.constructor.name;if(o==="Map"||o==="Set")return Array.from(o);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return t(n,e)}import d from"node:process";import m from"boxen";import I from"chalk";import{exec as E}from"node:child_process";import _ from"node:process";import*as T from"node:util";import O from"node-fetch";import*as y from"node:path";function S(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var o;return(o=y).resolve.apply(o,[R].concat(u(n)))}function C(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++){n[e]=arguments[e]}var o;return(o=y).join.apply(o,u(n))}import g from"node-persist";var h=24*60*60*1e3;var A=_.env.DEBUG==="true",N=T.promisify(E),v=I.gray,b=I.blue;function L(t){return{raw:!0,cmd:t}}function w(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tr," ").concat(M," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tr," ").concat(tn," src/cli.ts ").concat(t):"".concat(tr," ").concat(W," ").concat(t)}function G(t,n){return typeof t=="function"?w(t(n),n):(typeof t==="undefined"?"undefined":f(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?w(t,n):t}var R=d.env.INIT_CWD||d.cwd(),M="@cyberskill/shared";var P="node_modules",j="dist",D="package.json",K="package-lock.json",x="tsconfig.json",F=".gitignore",k=".simple-git-hooks.json",Y="pnpm-lock.yaml",H=".git/hooks/",B=".git/COMMIT_EDITMSG",U=C(R,P,M,j),W="cyberskill",J="eslint",X="vitest",q="vitest",$="@commitlint/cli",z="commitlint",Q="lint-staged",V="lint-staged",Z="tsc",tt="tsc",tn="tsx",te="git",to="pnpm",tr="pnpm exec",tc="simple-git-hooks",ti="simple-git-hooks",ta="@eslint/config-inspector",tl="eslint-config-inspector",ts="node-modules-inspector",tu="node-modules-inspector",tf={CYBERSKILL_DIRECTORY:U,WORKING_DIRECTORY:R,TS_CONFIG:S(x),GIT_IGNORE:S(F),GIT_HOOK:S(H),GIT_COMMIT_MSG:S(B),SIMPLE_GIT_HOOKS_JSON:S(k),PACKAGE_JSON:S(D),PACKAGE_LOCK_JSON:S(K),PNPM_LOCK_YAML:S(Y),NODE_MODULES:S(P),CYBERSKILL:{LINT_STAGED_CONFIG:S("".concat(U,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:S("".concat(U,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:S("".concat(U,"/configs/vitest/react/unit.js")),E2E_TEST_CONFIG:S("".concat(U,"/configs/vitest/react/e2e.js"))}};function tp(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),o=1;o<n;o++){e[o-1]=arguments[o]}var r=s(e,2),c=r[0],i=r[1];switch(t){case"pnpmAddAndExec":return G(L("".concat(to," add -D ").concat(c," && ").concat(tr," ").concat(i)));case"pnpmExec":return G(L("".concat(tr," ").concat(c," ").concat(i||"").trim()));case"raw":return G(L(c))}}var td={SIMPLE_GIT_HOOKS:tp("pnpmAddAndExec",tc,ti),ESLINT_INSPECT:tp("pnpmAddAndExec",ta,tl),NODE_MODULES_INSPECT:tp("pnpmAddAndExec",ts,tu),ESLINT_CHECK:tp("pnpmExec",J,tf.WORKING_DIRECTORY),ESLINT_FIX:tp("pnpmExec",J,"".concat(tf.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tp("pnpmAddAndExec",Z,"".concat(tt," -p ").concat(tf.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tp("raw","".concat(te," config core.hooksPath ").concat(tf.GIT_HOOK)),BUILD:tp("raw","".concat(to," run build")),STAGE_BUILD_DIRECTORY:tp("raw","".concat(te," add ").concat(j)),PNPM_INSTALL_STANDARD:tp("raw","".concat(to," install")),PNPM_INSTALL_LEGACY:tp("raw","".concat(to," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tp("raw","".concat(to," install --force")),CYBERSKILL:{TEST_UNIT:tp("pnpmAddAndExec",X,"".concat(q," --config ").concat(tf.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tp("pnpmAddAndExec",X,"".concat(q," --config ").concat(tf.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tp("pnpmAddAndExec",$,"".concat(z," --edit ").concat(tf.GIT_COMMIT_MSG," --config ").concat(tf.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tp("pnpmAddAndExec",Q,"".concat(V," --config ").concat(tf.CYBERSKILL.LINT_STAGED_CONFIG))}};function tm(t){var n=t.uri,e=t.from,r=t.to,c=t.withComponent,i=t.withHOC,a=t.withHooks,s=t.withMutationFn,u=t.withRefetchFn;var f=l({},c&&{withComponent:c},i&&{withHOC:i},a&&{withHooks:a},s&&{withMutationFn:s},u&&{withRefetchFn:u});return{schema:n,documents:[e],generates:o({},r,l({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[td.ESLINT_FIX]}}}export{tm as createGraphqlCodegenConfig};
1
+ function t(t,n){if(n==null||n>t.length)n=t.length;for(var o=0,e=new Array(n);o<n;o++)e[o]=t[o];return e}function n(t){if(Array.isArray(t))return t}function o(n){if(Array.isArray(n))return t(n)}function e(t,n,o){if(n in t){Object.defineProperty(t,n,{value:o,enumerable:true,configurable:true,writable:true})}else{t[n]=o}return t}function r(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,n){var o=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(o==null)return;var e=[];var r=true;var c=false;var i,a;try{for(o=o.call(t);!(r=(i=o.next()).done);r=true){e.push(i.value);if(n&&e.length===n)break}}catch(t){c=true;a=t}finally{try{if(!r&&o["return"]!=null)o["return"]()}finally{if(c)throw a}}return e}function i(){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 a(){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 s(t){for(var n=1;n<arguments.length;n++){var o=arguments[n]!=null?arguments[n]:{};var r=Object.keys(o);if(typeof Object.getOwnPropertySymbols==="function"){r=r.concat(Object.getOwnPropertySymbols(o).filter(function(t){return Object.getOwnPropertyDescriptor(o,t).enumerable}))}r.forEach(function(n){e(t,n,o[n])})}return t}function l(t,o){return n(t)||c(t,o)||_(t,o)||i()}function u(t){return o(t)||r(t)||_(t)||a()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function _(n,o){if(!n)return;if(typeof n==="string")return t(n,o);var e=Object.prototype.toString.call(n).slice(8,-1);if(e==="Object"&&n.constructor)e=n.constructor.name;if(e==="Map"||e==="Set")return Array.from(e);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return t(n,o)}import E from"node:process";import p from"boxen";import I from"chalk";import{exec as m}from"node:child_process";import N from"node:process";import*as T from"node:util";import C from"node-fetch";import*as O from"node:path";function y(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=O).resolve.apply(e,[M].concat(u(n)))}function d(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=O).join.apply(e,u(n))}import S from"node-persist";var A=24*60*60*1e3;var g=N.env.DEBUG==="true",D=T.promisify(m),P=I.gray,h=I.blue;function v(t){return{raw:!0,cmd:t}}function b(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tr," ").concat(G," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tr," ").concat(tn," src/cli.ts ").concat(t):"".concat(tr," ").concat(B," ").concat(t)}function L(t,n){return typeof t=="function"?b(t(n),n):(typeof t==="undefined"?"undefined":f(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?b(t,n):t}var M=E.env.INIT_CWD||E.cwd(),G="@cyberskill/shared";var R="node_modules",w="dist",j="package.json",K="package-lock.json",F="tsconfig.json",k=".gitignore",Y=".simple-git-hooks.json",X="pnpm-lock.yaml",U=".git/hooks/",W=".git/COMMIT_EDITMSG",H=d(M,R,G,w),B="cyberskill",x="eslint",J="vitest",q="vitest",$="@commitlint/cli",z="commitlint",Q="lint-staged",V="lint-staged",Z="typescript",tt="tsc",tn="tsx",to="git",te="pnpm",tr="pnpm exec",tc="simple-git-hooks",ti="simple-git-hooks",ta="@eslint/config-inspector",ts="eslint-config-inspector",tl="node-modules-inspector",tu="node-modules-inspector",tf={CYBERSKILL_DIRECTORY:H,WORKING_DIRECTORY:M,TS_CONFIG:y(F),GIT_IGNORE:y(k),GIT_HOOK:y(U),GIT_COMMIT_MSG:y(W),SIMPLE_GIT_HOOKS_JSON:y(Y),PACKAGE_JSON:y(j),PACKAGE_LOCK_JSON:y(K),PNPM_LOCK_YAML:y(X),NODE_MODULES:y(R),CYBERSKILL:{LINT_STAGED_CONFIG:y("".concat(H,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:y("".concat(H,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:y("".concat(H,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:y("".concat(H,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:y("".concat(H,"/configs/vitest/react/e2e.js"))}};function t_(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),e=1;e<n;e++){o[e-1]=arguments[e]}var r=l(o,2),c=r[0],i=r[1];switch(t){case"PNPM_ADD_AND_EXEC":return L(v("".concat(te," add -D ").concat(c," && ").concat(tr," ").concat(i)));case"PNPM_EXEC":return L(v("".concat(tr," ").concat(c," ").concat(i||"").trim()));case"RAW":return L(v(c))}}var tE={SIMPLE_GIT_HOOKS:t_("PNPM_ADD_AND_EXEC",tc,ti),ESLINT_INSPECT:t_("PNPM_ADD_AND_EXEC",ta,ts),NODE_MODULES_INSPECT:t_("PNPM_ADD_AND_EXEC",tl,tu),ESLINT_CHECK:t_("PNPM_EXEC",x,tf.WORKING_DIRECTORY),ESLINT_FIX:t_("PNPM_EXEC",x,"".concat(tf.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:t_("PNPM_ADD_AND_EXEC",Z,"".concat(tt," -p ").concat(tf.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:t_("RAW","".concat(to," config core.hooksPath ").concat(tf.GIT_HOOK)),BUILD:t_("RAW","".concat(te," run build")),STAGE_BUILD_DIRECTORY:t_("RAW","".concat(to," add ").concat(w)),PNPM_INSTALL_STANDARD:t_("RAW","".concat(te," install")),PNPM_INSTALL_LEGACY:t_("RAW","".concat(te," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:t_("RAW","".concat(te," install --force")),CYBERSKILL:{TEST_UNIT:t_("PNPM_ADD_AND_EXEC",J,"".concat(q," --config ").concat(tf.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:t_("PNPM_ADD_AND_EXEC",J,"".concat(q," --config ").concat(tf.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:t_("PNPM_ADD_AND_EXEC",$,"".concat(z," --edit ").concat(tf.GIT_COMMIT_MSG," --config ").concat(tf.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:t_("PNPM_ADD_AND_EXEC",Q,"".concat(V," --config ").concat(tf.CYBERSKILL.LINT_STAGED_CONFIG))}};function tp(t){var n=t.uri,o=t.from,r=t.to,c=t.withComponent,i=t.withHOC,a=t.withHooks,l=t.withMutationFn,u=t.withRefetchFn;var f=s({},c&&{withComponent:c},i&&{withHOC:i},a&&{withHooks:a},l&&{withMutationFn:l},u&&{withRefetchFn:u});return{schema:n,documents:[o],generates:e({},r,s({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[tE.ESLINT_FIX]}}}export{tp as createGraphqlCodegenConfig};