@cyberskill/shared 1.104.0 → 1.106.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/_tsup-dts-rollup.d.cts +0 -1
  2. package/dist/_tsup-dts-rollup.d.ts +0 -1
  3. package/dist/configs/config.util.cjs +1 -1
  4. package/dist/configs/config.util.js +1 -1
  5. package/dist/configs/index.cjs +1 -1
  6. package/dist/configs/index.js +1 -1
  7. package/dist/index.cjs +1 -1
  8. package/dist/index.js +1 -1
  9. package/dist/nodejs/cli/cli.util.cjs +1 -1
  10. package/dist/nodejs/cli/cli.util.js +1 -1
  11. package/dist/nodejs/cli/index.cjs +1 -1
  12. package/dist/nodejs/cli/index.js +1 -1
  13. package/dist/nodejs/command/command.util.cjs +1 -1
  14. package/dist/nodejs/command/command.util.js +1 -1
  15. package/dist/nodejs/command/index.cjs +1 -1
  16. package/dist/nodejs/command/index.js +1 -1
  17. package/dist/nodejs/index.cjs +1 -1
  18. package/dist/nodejs/index.js +1 -1
  19. package/dist/nodejs/mongo/index.cjs +1 -1
  20. package/dist/nodejs/mongo/index.js +1 -1
  21. package/dist/nodejs/mongo/mongo.util.cjs +1 -1
  22. package/dist/nodejs/mongo/mongo.util.js +1 -1
  23. package/dist/nodejs/package/index.cjs +1 -1
  24. package/dist/nodejs/package/index.js +1 -1
  25. package/dist/nodejs/package/package.util.cjs +1 -1
  26. package/dist/nodejs/package/package.util.js +1 -1
  27. package/dist/nodejs/path/index.cjs +1 -1
  28. package/dist/nodejs/path/index.js +1 -1
  29. package/dist/nodejs/path/path.constant.cjs +1 -1
  30. package/dist/nodejs/path/path.constant.js +1 -1
  31. package/dist/react/index.cjs +1 -1
  32. package/dist/react/index.js +1 -1
  33. package/dist/react/vitest/index.cjs +1 -1
  34. package/dist/react/vitest/index.js +1 -1
  35. package/dist/react/vitest/vitest.unit.cjs +1 -1
  36. package/dist/react/vitest/vitest.unit.js +1 -1
  37. package/package.json +1 -1
@@ -1 +1 @@
1
- function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(t){if(Array.isArray(t))return e(t)}function n(e,t,n,r,o,a,c){try{var i=e[a](c);var s=i.value}catch(e){n(e);return}if(i.done){t(s)}else{Promise.resolve(s).then(r,o)}}function r(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var c=e.apply(t,r);function i(e){n(c,o,a,i,s,"next",e)}function s(e){n(c,o,a,i,s,"throw",e)}i(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(){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 i(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 s(e){return t(e)||a(e)||l(e)||c()}function u(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function l(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 f(e,t){var n,r,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=i(0),c["throw"]=i(1),c["return"]=i(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function i(e){return function(t){return s([e,t])}}function s(i){if(n)throw new TypeError("Generator is already executing.");while(c&&(c=0,i[0]&&(a=0)),a)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:a.label++;return{value:i[1],done:false};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}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}}}var p=Object.defineProperty;var d=function(e,t){return p(e,"name",{value:t,configurable:!0})};import m from"@vitejs/plugin-react-swc";import{defineConfig as g}from"vitest/config";var v=".cyberskill-storage";import h from"dotenv";import{bool as y,cleanEnv as I,str as b}from"envalid";import E from"node:os";import C from"node:path";import O from"node:process";h.config();function S(){var e={DEBUG:O.env.DEBUG||!1,CWD:O.env.CWD||O.cwd(),CYBERSKILL_STORAGE_DIRECTORY:O.env.CYBERSKILL_STORAGE_DIRECTORY||C.join(E.homedir(),v)};return I(e,{DEBUG:y(),CWD:b(),CYBERSKILL_STORAGE_DIRECTORY:b()})}d(S,"getEnv");var T=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as _}from"node:child_process";import w from"node:process";import*as G from"node:util";var N=function(e){return e.Error="error",e.Warning="warning",e}({});import L from"chalk";import R from"consola";import{GraphQLError as k}from"graphql";var D=S();D.DEBUG||(R.level=4);function j(e){var t=L[e];return typeof t=="function"?t:L.green}d(j,"chalkKeyword");var A={silent:R.silent,level:R.level,fatal:R.fatal,error:R.error,warn:R.warn,log:R.log,info:R.info,success:R.success,ready:R.ready,start:R.start,box:R.box,debug:R.debug,trace:R.trace,verbose:R.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){R.box(L.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,o=e.rule,a=e.message;R.log("".concat(L.gray("File:")," ").concat(L.blue("".concat(t).concat(r?":".concat(r):"")))),o&&R.log(" ".concat(j(n)("Rule:")," ").concat(o)),R.log(" ".concat(j(n)("Message:")," ").concat(a))}),R.box(j(n)("".concat(e," : ").concat(t.length))),R.log(L.gray("─".repeat(40)))}};var M={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import P from"node-fetch";import F from"fs-extra";var x=F.readFileSync,U=F.writeFileSync,K=F.pathExistsSync,Y=F.appendFileSync,B=F.copySync,W=F.removeSync,J=F.statSync,H=F.readJsonSync,$=F.writeJsonSync;function q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return K(e)})}d(q,"existsSync");var Q=S();function V(e){var t=eG(Q.CWD,ej);if(!q(t))return!1;try{var n=H(t),r=n.name,o=n.dependencies,a=o===void 0?{}:o,c=n.devDependencies,i=c===void 0?{}:c,s=r===e,u=e in a,l=e in i;return s||u||l?{path:t,file:n,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return A.warn("Failed to read package.json: ".concat(e.message)),!1}}d(V,"getPackage");function z(e){return X.apply(this,arguments)}function X(){X=r(function(e){var t,n,r,o;return f(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,P("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=a.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=a.sent(),r=n.version;return[2,r];case 3:o=a.sent();throw A.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})});return X.apply(this,arguments)}d(z,"getLatestPackageVersion");function Z(e,t){return ee.apply(this,arguments)}function ee(){ee=r(function(e,t){var n,r,o,a,c,s,u,l,p,d,m,g,v,h,y,I,b,E,C,O,S;return f(this,function(f){switch(f.label){case 0:f.trys.push([0,4,,5]);n=V(e);if(!n)return[2,i({},M)];u=n.path,l=n.file,p=n.isCurrentProject,d=n.isDepend,m=n.isDevDepend,g=(r=l.dependencies)!==null&&r!==void 0?r:{},v=(o=l.devDependencies)!==null&&o!==void 0?o:{},h=p?(a=l.version)!==null&&a!==void 0?a:"0.0.0":d?(c=g[e])!==null&&c!==void 0?c:"0.0.0":m?(s=v[e])!==null&&s!==void 0?s:"0.0.0":"0.0.0";if(!p)return[3,1];b=h;return[3,3];case 1:return[4,z(e)];case 2:b=f.sent();f.label=3;case 3:y=b,I=p||h===y;if(!I&&(t===null||t===void 0?void 0:t.update)){;C=d?"dependencies":m?"devDependencies":null;C&&((E=l[C])===null||E===void 0?void 0:E[e])!==y&&(l[C]=(O=l[C])!==null&&O!==void 0?O:{},l[C][e]=y,$(u,l),A.info('Updated "'.concat(e,'" to version ').concat(y)))}return[2,{isCurrentProject:p,installedPath:u,file:l,isUpToDate:I}];case 4:S=f.sent();return[2,(A.error('Error checking package "'.concat(e,'": ').concat(S.message)),i({},M))];case 5:return[2]}})});return ee.apply(this,arguments)}d(Z,"checkPackage");function et(){return en.apply(this,arguments)}function en(){en=r(function(){var e,t,n,r,o,a,c,i,s,u,l,p;return f(this,function(f){switch(f.label){case 0:e=[{command:d(function(){return tu.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:d(function(){return tu.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:d(function(){return tu.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);o=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(a=o.next()).done))return[3,8];c=a.value,i=c.command,s=c.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,i()];case 4:u=f.sent();return[4,eC("".concat(s," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();A.warn("Installation attempt failed: ".concat(s)),A.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:p=f.sent();n=true;r=p;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return en.apply(this,arguments)}d(et,"installDependencies");function er(e,t){return eo.apply(this,arguments)}function eo(){eo=r(function(e,t){var n,r,o,a,c,u,l,p,d,m,g;return f(this,function(f){switch(f.label){case 0:if(!q(ta.PACKAGE_JSON)){A.error("package.json not found. Aborting setup.");return[2]}f.label=1;case 1:f.trys.push([1,13,,14]);n=s(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return Z(e,i({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=f.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,et()];case 3:r=f.sent();f.label=4;case 4:r;a=true,c=false,u=undefined;f.label=5;case 5:f.trys.push([5,10,11,12]);l=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();f.label=6;case 6:if(!!(a=(p=l.next()).done))return[3,9];d=p.value;return[4,d()];case 7:f.sent();f.label=8;case 8:a=true;return[3,6];case 9:return[3,12];case 10:m=f.sent();c=true;u=m;return[3,12];case 11:try{if(!a&&l.return!=null){l.return()}}finally{if(c){throw u}}return[7];case 12:return[3,14];case 13:g=f.sent();throw A.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return eo.apply(this,arguments)}d(er,"setupPackages");import ea from"node-persist";var ec=S();function ei(){return es.apply(this,arguments)}function es(){es=r(function(){var e;return f(this,function(t){switch(t.label){case 0:e=ea.defaultInstance;if(e)return[3,2];return[4,ea.init({dir:ec.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return es.apply(this,arguments)}d(ei,"initNodePersist");var eu={get:function e(e){return r(function(){var t,n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ei()];case 1:r.sent();return[4,ea.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(A.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return r(function(){var n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ei()];case 1:r.sent();return[4,ea.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();A.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return r(function(){var t;return f(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ei()];case 1:n.sent();return[4,ea.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();A.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return r(function(){var e,t;return f(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ei()];case 1:n.sent();return[4,ea.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(A.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(A.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return r(function(){return f(this,function(t){try{return[2,"".concat(ec.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(A.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var el=S(),ef=G.promisify(_);function ep(e){return"error_list:".concat(e)}d(ep,"getErrorListKey");function ed(e){return em.apply(this,arguments)}function em(){em=r(function(e){var t,n,o;return f(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),n=ep(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,eu.set(n,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(/*#__PURE__*/r(function(){var e;return f(this,function(t){switch(t.label){case 0:return[4,eu.getLogLink(n)];case 1:e=t.sent();e&&A.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:o=a.sent();A.error("Failed to save errors: ".concat(o.message));return[3,4];case 4:return[2]}})});return em.apply(this,arguments)}d(ed,"saveErrorListToStorage");function eg(e){var t=[],n=[],r="",o=/^\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 i,s,u,l,f;var p=o.exec(e)||[],d=a.exec(e)||[],m=c.exec(e)||[];var g,v,h,y,I,b;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===N.Error?N.Error:N.Warning,message:(g=p===null||p===void 0?void 0:(i=p[4])===null||i===void 0?void 0:i.trim())!==null&&g!==void 0?g:"",rule:(v=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&v!==void 0?v:""}):d.length?t.push({file:(h=d===null||d===void 0?void 0:d[1])!==null&&h!==void 0?h:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]===N.Error?N.Error:N.Warning,message:(y=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):m.length?t.push({file:"commitlint",type:N.Error,message:(I=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&I!==void 0?I:"",rule:(b=m===null||m===void 0?void 0:(f=m[2])===null||f===void 0?void 0:f.trim())!==null&&b!==void 0?b:""}):n.push(e.trim())}}),t.length&&ed(t),el.DEBUG&&n.length&&(A.warn("Unmatched lines:"),n.forEach(function(e){return A.info(" ".concat(e))}))}d(eg,"parseTextErrors");function ev(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,a=e.column,c=e.ruleId,i=e.message;n.push({type:r===2?N.Error:N.Warning,file:t,position:"".concat(o,":").concat(a),rule:c,message:i})})}),n.length&&ed(n)}catch(t){eg(e)}}d(ev,"parseCommandOutput");function eh(e){return ey.apply(this,arguments)}function ey(){ey=r(function(e){var t,n,r,o,a,c,i,s,u;var l=arguments;return f(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ev;n=new AbortController;w.on("SIGINT",function(){A.warn("Process interrupted. Terminating..."),n.abort(),w.exit()});f.label=1;case 1:f.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ef(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),o=r.stdout,a=r.stderr;[o,a].forEach(function(e){return e&&t(e)});f.label=3;case 3:return[3,5];case 4:c=f.sent();i=c.stdout,s=c.stderr,u=c.message;[i,s].forEach(function(e){return e&&t(e)}),!s&&!i&&A.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return ey.apply(this,arguments)}d(eh,"executeCommand");function eI(e){return{raw:!0,cmd:e}}d(eI,"rawCommand");function eb(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e6," ").concat(eR," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e6," ").concat(e3," ").concat(eJ," ").concat(e):"".concat(e6," ").concat(eW," ").concat(e)}d(eb,"formatCLI");function eE(e,t){return typeof e=="function"?eb(e(t),t):(typeof e==="undefined"?"undefined":u(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eb(e,t):e}d(eE,"formatCommand");function eC(e,t){return eO.apply(this,arguments)}function eO(){eO=r(function(e,t){var n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);A.start("".concat(e)),el.DEBUG&&A.info("→ ".concat(t));return[4,eh(t)];case 1:r.sent(),A.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw A.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return eO.apply(this,arguments)}d(eC,"runCommand");import{join as eS,resolve as eT}from"node:path";var e_=S();function ew(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return eT.apply(void 0,[e_.CWD].concat(s(t)))}d(ew,"resolveWorkingPath");function eG(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return eS.apply(void 0,s(t))}d(eG,"join");var eN=S(),eL=eN.CWD,eR="@cyberskill/shared",ek="node_modules",eD="dist",ej="package.json",eA="package-lock.json",eM="tsconfig.json",eP=".gitignore",eF=".simple-git-hooks.json",ex="pnpm-lock.yaml",eU=".git/hooks/",eK=".git/COMMIT_EDITMSG",eY=".migrate-mongo.config.js",eB=eG(eL,ek,eR,eD),eW="cyberskill",eJ="src/nodejs/cli/index.ts",eH="eslint",e$="eslint",eq="vitest",eQ="playwright",eV="vitest",ez="@commitlint/cli",eX="commitlint",eZ="lint-staged",e0="lint-staged",e1="typescript",e2="tsc",e3="tsx",e4="git",e5="pnpm",e6="pnpm exec",e7="simple-git-hooks",e8="simple-git-hooks",e9="@eslint/config-inspector",te="eslint-config-inspector",tt="node-modules-inspector",tn="node-modules-inspector",tr="migrate-mongo",to="./node_modules/migrate-mongo/bin/migrate-mongo",ta={CYBERSKILL_DIRECTORY:eB,WORKING_DIRECTORY:eL,TS_CONFIG:ew(eM),GIT_IGNORE:ew(eP),GIT_HOOK:ew(eU),GIT_COMMIT_MSG:ew(eK),SIMPLE_GIT_HOOKS_JSON:ew(eF),PACKAGE_JSON:ew(ej),PACKAGE_LOCK_JSON:ew(eA),PNPM_LOCK_YAML:ew(ex),NODE_MODULES:ew(ek),MIGRATE_MONGO_CONFIG:ew(eY),LINT_STAGED_CONFIG:ew("".concat(eB,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:ew("".concat(eB,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:ew("".concat(eB,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:ew("".concat(eB,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:ew("".concat(eB,"/react/vitest/vitest.e2e.js"))};function tc(e,t,n){return ti.apply(this,arguments)}function ti(){ti=r(function(e,t,n){return f(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case T.CLI:return[3,1];case T.STRING:return[3,3]}return[3,4];case 1:return[4,er(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),eE(eI("".concat(e6," ").concat(n))))];case 3:return[2,eE(eI(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return ti.apply(this,arguments)}d(tc,"buildCommand");function ts(e,t,n){return /*#__PURE__*/r(function(){return f(this,function(r){return[2,tc(e,t,n)]})})}d(ts,"commandFactory");var tu={simpleGitHooks:ts(T.CLI,e7,e8),eslintInspect:ts(T.CLI,e9,te),nodeModulesInspect:ts(T.CLI,tt,tn),eslintCheck:ts(T.CLI,eH,"".concat(e$," ").concat(ta.WORKING_DIRECTORY)),eslintFix:ts(T.CLI,eH,"".concat(e$," ").concat(ta.WORKING_DIRECTORY," --fix")),typescriptCheck:ts(T.CLI,e1,"".concat(e2," -p ").concat(ta.TS_CONFIG," --noEmit")),configureGitHook:ts(T.STRING,"".concat(e4," config core.hooksPath ").concat(ta.GIT_HOOK)),testUnit:ts(T.CLI,eq,"".concat(eV," --config ").concat(ta.UNIT_TEST_CONFIG)),testE2e:ts(T.CLI,"".concat(eq," ").concat(eQ),"".concat(eV," --config ").concat(ta.E2E_TEST_CONFIG)),mongoMigrateCreate:d(function(e){return ts(T.CLI,tr,"".concat(e3," ").concat(to," create ").concat(e," -f ").concat(ta.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:ts(T.CLI,tr,"".concat(e3," ").concat(to," up -f ").concat(ta.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:ts(T.CLI,tr,"".concat(e3," ").concat(to," down -f ").concat(ta.MIGRATE_MONGO_CONFIG)),mongoMigrateStatus:ts(T.CLI,tr,"".concat(e3," ").concat(to," status -f ").concat(ta.MIGRATE_MONGO_CONFIG)),commitLint:ts(T.CLI,ez,"".concat(eX," --edit ").concat(ta.GIT_COMMIT_MSG," --config ").concat(ta.COMMITLINT_CONFIG)),lintStaged:ts(T.CLI,eZ,"".concat(e0," --config ").concat(ta.LINT_STAGED_CONFIG)),stageBuildDirectory:ts(T.STRING,"".concat(e4," add ").concat(eD)),build:ts(T.STRING,"".concat(e5," run build")),pnpmInstallStandard:ts(T.STRING,"".concat(e5," install")),pnpmInstallLegacy:ts(T.STRING,"".concat(e5," install --legacy-peer-deps")),pnpmInstallForce:ts(T.STRING,"".concat(e5," install --force"))};function tl(e){return g(i({plugins:[m()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[ta.UNIT_TEST_SETUP_CONFIG]}},e))}d(tl,"vitestUnit");export{tl as vitestUnit};
1
+ function e(e,t){if(t==null||t>e.length)t=e.length;for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t(t){if(Array.isArray(t))return e(t)}function n(e,t,n,r,o,a,c){try{var i=e[a](c);var s=i.value}catch(e){n(e);return}if(i.done){t(s)}else{Promise.resolve(s).then(r,o)}}function r(e){return function(){var t=this,r=arguments;return new Promise(function(o,a){var c=e.apply(t,r);function i(e){n(c,o,a,i,s,"next",e)}function s(e){n(c,o,a,i,s,"throw",e)}i(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(){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 i(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 s(e){return t(e)||a(e)||l(e)||c()}function u(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function l(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 f(e,t){var n,r,o,a={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=i(0),c["throw"]=i(1),c["return"]=i(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function i(e){return function(t){return s([e,t])}}function s(i){if(n)throw new TypeError("Generator is already executing.");while(c&&(c=0,i[0]&&(a=0)),a)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:a.label++;return{value:i[1],done:false};case 5:a.label++;r=i[1];i=[0];continue;case 7:i=a.ops.pop();a.trys.pop();continue;default:if(!(o=a.trys,o=o.length>0&&o[o.length-1])&&(i[0]===6||i[0]===2)){a=0;continue}if(i[0]===3&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(i[0]===6&&a.label<o[1]){a.label=o[1];o=i;break}if(o&&a.label<o[2]){a.label=o[2];a.ops.push(i);break}if(o[2])a.ops.pop();a.trys.pop();continue}i=t.call(e,a)}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}}}var p=Object.defineProperty;var d=function(e,t){return p(e,"name",{value:t,configurable:!0})};import m from"@vitejs/plugin-react-swc";import{defineConfig as g}from"vitest/config";var v=".cyberskill-storage";import h from"dotenv";import{bool as y,cleanEnv as I,str as b}from"envalid";import E from"node:os";import C from"node:path";import S from"node:process";h.config();function O(){var e={DEBUG:S.env.DEBUG||!1,CWD:S.env.CWD||S.cwd(),CYBERSKILL_STORAGE_DIRECTORY:S.env.CYBERSKILL_STORAGE_DIRECTORY||C.join(E.homedir(),v)};return I(e,{DEBUG:y(),CWD:b(),CYBERSKILL_STORAGE_DIRECTORY:b()})}d(O,"getEnv");var T=function(e){return e.CLI="CLI",e.STRING="STRING",e.FUNCTION="FUNCTION",e}({});import{exec as w}from"node:child_process";import _ from"node:process";import*as G from"node:util";var N=function(e){return e.Error="error",e.Warning="warning",e}({});import L from"chalk";import R from"consola";import{GraphQLError as k}from"graphql";var D=O();D.DEBUG||(R.level=4);function j(e){var t=L[e];return typeof t=="function"?t:L.green}d(j,"chalkKeyword");var P={silent:R.silent,level:R.level,fatal:R.fatal,error:R.error,warn:R.warn,log:R.log,info:R.info,success:R.success,ready:R.ready,start:R.start,box:R.box,debug:R.debug,trace:R.trace,verbose:R.verbose,printBoxedLog:function e(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){R.box(L.green(e));return}t.forEach(function(e){var t=e.file,r=e.position,o=e.rule,a=e.message;R.log("".concat(L.gray("File:")," ").concat(L.blue("".concat(t).concat(r?":".concat(r):"")))),o&&R.log(" ".concat(j(n)("Rule:")," ").concat(o)),R.log(" ".concat(j(n)("Message:")," ").concat(a))}),R.box(j(n)("".concat(e," : ").concat(t.length))),R.log(L.gray("─".repeat(40)))}};var A={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import F from"node-fetch";import M from"fs-extra";var x=M.readFileSync,U=M.writeFileSync,K=M.pathExistsSync,Y=M.appendFileSync,B=M.copySync,W=M.removeSync,J=M.statSync,H=M.readJsonSync,$=M.writeJsonSync;function q(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return t.every(function(e){return K(e)})}d(q,"existsSync");var Q=O();function V(e){var t=eG(Q.CWD,ej);if(!q(t))return!1;try{var n=H(t),r=n.name,o=n.dependencies,a=o===void 0?{}:o,c=n.devDependencies,i=c===void 0?{}:c,s=r===e,u=e in a,l=e in i;return s||u||l?{path:t,file:n,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return P.warn("Failed to read package.json: ".concat(e.message)),!1}}d(V,"getPackage");function z(e){return X.apply(this,arguments)}function X(){X=r(function(e){var t,n,r,o;return f(this,function(a){switch(a.label){case 0:a.trys.push([0,3,,4]);return[4,F("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=a.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:n=a.sent(),r=n.version;return[2,r];case 3:o=a.sent();throw P.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})});return X.apply(this,arguments)}d(z,"getLatestPackageVersion");function Z(e,t){return ee.apply(this,arguments)}function ee(){ee=r(function(e,t){var n,r,o,a,c,s,u,l,p,d,m,g,v,h,y,I,b,E,C,S,O;return f(this,function(f){switch(f.label){case 0:f.trys.push([0,4,,5]);n=V(e);if(!n)return[2,i({},A)];u=n.path,l=n.file,p=n.isCurrentProject,d=n.isDepend,m=n.isDevDepend,g=(r=l.dependencies)!==null&&r!==void 0?r:{},v=(o=l.devDependencies)!==null&&o!==void 0?o:{},h=p?(a=l.version)!==null&&a!==void 0?a:"0.0.0":d?(c=g[e])!==null&&c!==void 0?c:"0.0.0":m?(s=v[e])!==null&&s!==void 0?s:"0.0.0":"0.0.0";if(!p)return[3,1];b=h;return[3,3];case 1:return[4,z(e)];case 2:b=f.sent();f.label=3;case 3:y=b,I=p||h===y;if(!I&&(t===null||t===void 0?void 0:t.update)){;C=d?"dependencies":m?"devDependencies":null;C&&((E=l[C])===null||E===void 0?void 0:E[e])!==y&&(l[C]=(S=l[C])!==null&&S!==void 0?S:{},l[C][e]=y,$(u,l),P.info('Updated "'.concat(e,'" to version ').concat(y)))}return[2,{isCurrentProject:p,installedPath:u,file:l,isUpToDate:I}];case 4:O=f.sent();return[2,(P.error('Error checking package "'.concat(e,'": ').concat(O.message)),i({},A))];case 5:return[2]}})});return ee.apply(this,arguments)}d(Z,"checkPackage");function et(){return en.apply(this,arguments)}function en(){en=r(function(){var e,t,n,r,o,a,c,i,s,u,l,p;return f(this,function(f){switch(f.label){case 0:e=[{command:d(function(){return tu.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:d(function(){return tu.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:d(function(){return tu.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,n=false,r=undefined;f.label=1;case 1:f.trys.push([1,9,10,11]);o=e[Symbol.iterator]();f.label=2;case 2:if(!!(t=(a=o.next()).done))return[3,8];c=a.value,i=c.command,s=c.message;f.label=3;case 3:f.trys.push([3,6,,7]);return[4,i()];case 4:u=f.sent();return[4,eC("".concat(s," using: ").concat(u),u)];case 5:f.sent();return[2];case 6:l=f.sent();P.warn("Installation attempt failed: ".concat(s)),P.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:p=f.sent();n=true;r=p;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(n){throw r}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return en.apply(this,arguments)}d(et,"installDependencies");function er(e,t){return eo.apply(this,arguments)}function eo(){eo=r(function(e,t){var n,r,o,a,c,u,l,p,d,m,g;return f(this,function(f){switch(f.label){case 0:if(!q(ta.PACKAGE_JSON)){P.error("package.json not found. Aborting setup.");return[2]}f.label=1;case 1:f.trys.push([1,13,,14]);n=s(new Set(e)).sort();return[4,Promise.all(n.map(function(e){return Z(e,i({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:r=f.sent().every(function(e){return e.isUpToDate});if(r)return[3,4];return[4,et()];case 3:r=f.sent();f.label=4;case 4:r;a=true,c=false,u=undefined;f.label=5;case 5:f.trys.push([5,10,11,12]);l=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();f.label=6;case 6:if(!!(a=(p=l.next()).done))return[3,9];d=p.value;return[4,d()];case 7:f.sent();f.label=8;case 8:a=true;return[3,6];case 9:return[3,12];case 10:m=f.sent();c=true;u=m;return[3,12];case 11:try{if(!a&&l.return!=null){l.return()}}finally{if(c){throw u}}return[7];case 12:return[3,14];case 13:g=f.sent();throw P.error('Failed to setup "'.concat(e.join(", "),'": ').concat(g.message)),g;case 14:return[2]}})});return eo.apply(this,arguments)}d(er,"setupPackages");import ea from"node-persist";var ec=O();function ei(){return es.apply(this,arguments)}function es(){es=r(function(){var e;return f(this,function(t){switch(t.label){case 0:e=ea.defaultInstance;if(e)return[3,2];return[4,ea.init({dir:ec.CYBERSKILL_STORAGE_DIRECTORY,stringify:JSON.stringify,parse:JSON.parse,encoding:"utf8",logging:!1,forgiveParseErrors:!0})];case 1:e=t.sent();t.label=2;case 2:e;return[2]}})});return es.apply(this,arguments)}d(ei,"initNodePersist");var eu={get:function e(e){return r(function(){var t,n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ei()];case 1:r.sent();return[4,ea.getItem(e)];case 2:return[2,(t=r.sent())!==null&&t!==void 0?t:null];case 3:n=r.sent();return[2,(P.error('[Storage:get] Error getting key "'.concat(e,'":'),n),null)];case 4:return[2]}})})()},set:function e(e,t){return r(function(){var n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,ei()];case 1:r.sent();return[4,ea.setItem(e,t)];case 2:r.sent();return[3,4];case 3:n=r.sent();P.error('[Storage:set] Error setting key "'.concat(e,'":'),n);return[3,4];case 4:return[2]}})})()},remove:function e(e){return r(function(){var t;return f(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ei()];case 1:n.sent();return[4,ea.removeItem(e)];case 2:n.sent();return[3,4];case 3:t=n.sent();P.error('[Storage:remove] Error removing key "'.concat(e,'":'),t);return[3,4];case 4:return[2]}})})()},keys:function e(){return r(function(){var e,t;return f(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,ei()];case 1:n.sent();return[4,ea.keys()];case 2:e=n.sent();return[2,Array.isArray(e)?e:(P.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=n.sent();return[2,(P.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return r(function(){return f(this,function(t){try{return[2,"".concat(ec.CYBERSKILL_STORAGE_DIRECTORY," (key: ").concat(e,")")]}catch(e){return[2,(P.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var el=O(),ef=G.promisify(w);function ep(e){return"error_list:".concat(e)}d(ep,"getErrorListKey");function ed(e){return em.apply(this,arguments)}function em(){em=r(function(e){var t,n,o;return f(this,function(a){switch(a.label){case 0:if(e.length===0)return[2];t=Date.now(),n=ep(t);a.label=1;case 1:a.trys.push([1,3,,4]);return[4,eu.set(n,{errors:e,timestamp:t})];case 2:a.sent(),setTimeout(/*#__PURE__*/r(function(){var e;return f(this,function(t){switch(t.label){case 0:return[4,eu.getLogLink(n)];case 1:e=t.sent();e&&P.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:o=a.sent();P.error("Failed to save errors: ".concat(o.message));return[3,4];case 4:return[2]}})});return em.apply(this,arguments)}d(ed,"saveErrorListToStorage");function eg(e){var t=[],n=[],r="",o=/^\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 i,s,u,l,f;var p=o.exec(e)||[],d=a.exec(e)||[],m=c.exec(e)||[];var g,v,h,y,I,b;p.length&&r?t.push({file:r,position:"".concat(p[1],":").concat(p[2]),type:p[3]===N.Error?N.Error:N.Warning,message:(g=p===null||p===void 0?void 0:(i=p[4])===null||i===void 0?void 0:i.trim())!==null&&g!==void 0?g:"",rule:(v=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&v!==void 0?v:""}):d.length?t.push({file:(h=d===null||d===void 0?void 0:d[1])!==null&&h!==void 0?h:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]===N.Error?N.Error:N.Warning,message:(y=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&y!==void 0?y:""}):m.length?t.push({file:"commitlint",type:N.Error,message:(I=m===null||m===void 0?void 0:(l=m[1])===null||l===void 0?void 0:l.trim())!==null&&I!==void 0?I:"",rule:(b=m===null||m===void 0?void 0:(f=m[2])===null||f===void 0?void 0:f.trim())!==null&&b!==void 0?b:""}):n.push(e.trim())}}),t.length&&ed(t),el.DEBUG&&n.length&&(P.warn("Unmatched lines:"),n.forEach(function(e){return P.info(" ".concat(e))}))}d(eg,"parseTextErrors");function ev(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,a=e.column,c=e.ruleId,i=e.message;n.push({type:r===2?N.Error:N.Warning,file:t,position:"".concat(o,":").concat(a),rule:c,message:i})})}),n.length&&ed(n)}catch(t){eg(e)}}d(ev,"parseCommandOutput");function eh(e){return ey.apply(this,arguments)}function ey(){ey=r(function(e){var t,n,r,o,a,c,i,s,u;var l=arguments;return f(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ev;n=new AbortController;_.on("SIGINT",function(){P.warn("Process interrupted. Terminating..."),n.abort(),_.exit()});f.label=1;case 1:f.trys.push([1,4,,5]);if(!(typeof e=="string"))return[3,3];return[4,ef(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),o=r.stdout,a=r.stderr;[o,a].forEach(function(e){return e&&t(e)});f.label=3;case 3:return[3,5];case 4:c=f.sent();i=c.stdout,s=c.stderr,u=c.message;[i,s].forEach(function(e){return e&&t(e)}),!s&&!i&&P.error("Command failed: ".concat(u));return[3,5];case 5:return[2]}})});return ey.apply(this,arguments)}d(eh,"executeCommand");function eI(e){return{raw:!0,cmd:e}}d(eI,"rawCommand");function eb(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e6," ").concat(eR," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e6," ").concat(e3," ").concat(eJ," ").concat(e):"".concat(e6," ").concat(eW," ").concat(e)}d(eb,"formatCLI");function eE(e,t){return typeof e=="function"?eb(e(t),t):(typeof e==="undefined"?"undefined":u(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eb(e,t):e}d(eE,"formatCommand");function eC(e,t){return eS.apply(this,arguments)}function eS(){eS=r(function(e,t){var n;return f(this,function(r){switch(r.label){case 0:r.trys.push([0,2,,3]);P.start("".concat(e)),el.DEBUG&&P.info("→ ".concat(t));return[4,eh(t)];case 1:r.sent(),P.success("".concat(e," done."));return[3,3];case 2:n=r.sent();throw P.error("".concat(e," failed: ").concat(n.message)),n;case 3:return[2]}})});return eS.apply(this,arguments)}d(eC,"runCommand");import{join as eO,resolve as eT}from"node:path";var ew=O();function e_(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return eT.apply(void 0,[ew.CWD].concat(s(t)))}d(e_,"resolveWorkingPath");function eG(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}return eO.apply(void 0,s(t))}d(eG,"join");var eN=O(),eL=eN.CWD,eR="@cyberskill/shared",ek="node_modules",eD="dist",ej="package.json",eP="package-lock.json",eA="tsconfig.json",eF=".gitignore",eM=".simple-git-hooks.json",ex="pnpm-lock.yaml",eU=".git/hooks/",eK=".git/COMMIT_EDITMSG",eY=".migrate-mongo.config.js",eB=eG(eL,ek,eR,eD),eW="cyberskill",eJ="src/nodejs/cli/index.ts",eH="eslint",e$="eslint",eq="vitest",eQ="playwright",eV="vitest",ez="@commitlint/cli",eX="commitlint",eZ="lint-staged",e0="lint-staged",e1="typescript",e2="tsc",e3="tsx",e4="git",e5="pnpm",e6="pnpm exec",e7="simple-git-hooks",e8="simple-git-hooks",e9="@eslint/config-inspector",te="eslint-config-inspector",tt="node-modules-inspector",tn="node-modules-inspector",tr="migrate-mongo",to="./node_modules/migrate-mongo/bin/migrate-mongo",ta={CYBERSKILL_DIRECTORY:eB,WORKING_DIRECTORY:eL,TS_CONFIG:e_(eA),GIT_IGNORE:e_(eF),GIT_HOOK:e_(eU),GIT_COMMIT_MSG:e_(eK),SIMPLE_GIT_HOOKS_JSON:e_(eM),PACKAGE_JSON:e_(ej),PACKAGE_LOCK_JSON:e_(eP),PNPM_LOCK_YAML:e_(ex),NODE_MODULES:e_(ek),MIGRATE_MONGO_CONFIG:e_(eY),LINT_STAGED_CONFIG:e_("".concat(eB,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:e_("".concat(eB,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:e_("".concat(eB,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:e_("".concat(eB,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:e_("".concat(eB,"/react/vitest/vitest.e2e.js"))};function tc(e,t,n){return ti.apply(this,arguments)}function ti(){ti=r(function(e,t,n){return f(this,function(r){switch(r.label){case 0:if(!t)throw new Error("'first' argument is undefined");switch(e){case T.CLI:return[3,1];case T.STRING:return[3,3]}return[3,4];case 1:return[4,er(t.split(" "),{update:!0})];case 2:return[2,(r.sent(),eE(eI("".concat(e6," ").concat(n))))];case 3:return[2,eE(eI(t))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return ti.apply(this,arguments)}d(tc,"buildCommand");function ts(e,t,n){return /*#__PURE__*/r(function(){return f(this,function(r){return[2,tc(e,t,n)]})})}d(ts,"commandFactory");var tu={simpleGitHooks:ts(T.CLI,e7,e8),eslintInspect:ts(T.CLI,e9,te),nodeModulesInspect:ts(T.CLI,tt,tn),eslintCheck:ts(T.CLI,eH,"".concat(e$," ").concat(ta.WORKING_DIRECTORY)),eslintFix:ts(T.CLI,eH,"".concat(e$," ").concat(ta.WORKING_DIRECTORY," --fix")),typescriptCheck:ts(T.CLI,e1,"".concat(e2," -p ").concat(ta.TS_CONFIG," --noEmit")),configureGitHook:ts(T.STRING,"".concat(e4," config core.hooksPath ").concat(ta.GIT_HOOK)),testUnit:ts(T.CLI,eq,"".concat(eV," --config ").concat(ta.UNIT_TEST_CONFIG)),testE2e:ts(T.CLI,"".concat(eq," ").concat(eQ),"".concat(eV," --config ").concat(ta.E2E_TEST_CONFIG)),mongoMigrateCreate:d(function(e){return ts(T.CLI,tr,"".concat(e3," ").concat(to," create ").concat(e," -f ").concat(ta.MIGRATE_MONGO_CONFIG))()},"mongoMigrateCreate"),mongoMigrateUp:ts(T.CLI,tr,"".concat(e3," ").concat(to," up -f ").concat(ta.MIGRATE_MONGO_CONFIG)),mongoMigrateDown:ts(T.CLI,tr,"".concat(e3," ").concat(to," down -f ").concat(ta.MIGRATE_MONGO_CONFIG)),commitLint:ts(T.CLI,ez,"".concat(eX," --edit ").concat(ta.GIT_COMMIT_MSG," --config ").concat(ta.COMMITLINT_CONFIG)),lintStaged:ts(T.CLI,eZ,"".concat(e0," --config ").concat(ta.LINT_STAGED_CONFIG)),stageBuildDirectory:ts(T.STRING,"".concat(e4," add ").concat(eD)),build:ts(T.STRING,"".concat(e5," run build")),pnpmInstallStandard:ts(T.STRING,"".concat(e5," install")),pnpmInstallLegacy:ts(T.STRING,"".concat(e5," install --legacy-peer-deps")),pnpmInstallForce:ts(T.STRING,"".concat(e5," install --force"))};function tl(e){return g(i({plugins:[m()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[ta.UNIT_TEST_SETUP_CONFIG]}},e))}d(tl,"vitestUnit");export{tl as vitestUnit};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cyberskill/shared",
3
3
  "type": "module",
4
- "version": "1.104.0",
4
+ "version": "1.106.0",
5
5
  "description": "CyberSkill Shared",
6
6
  "author": "Stephen Cheng",
7
7
  "license": "MIT",