@cyberskill/shared 1.56.0 → 1.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_tsup-dts-rollup.d.cts +10 -6
- package/dist/_tsup-dts-rollup.d.ts +10 -6
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/configs/graphql/graphql-codegen.cjs +1 -1
- package/dist/configs/graphql/graphql-codegen.js +1 -1
- package/dist/configs/graphql/index.cjs +1 -1
- package/dist/configs/graphql/index.js +1 -1
- package/dist/configs/index.cjs +1 -0
- package/dist/configs/index.d.cts +1 -0
- package/dist/configs/index.d.ts +1 -0
- package/dist/configs/index.js +1 -0
- package/dist/configs/vitest/react/unit.cjs +1 -1
- package/dist/configs/vitest/react/unit.js +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.cts +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.js +1 -1
- package/dist/constants/path.cjs +1 -1
- package/dist/constants/path.d.cts +1 -0
- package/dist/constants/path.d.ts +1 -0
- package/dist/constants/path.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/typescript/config.cjs +1 -1
- package/dist/typescript/config.js +1 -1
- package/dist/typescript/index.cjs +1 -1
- package/dist/typescript/index.js +1 -1
- package/dist/utils/command.cjs +1 -1
- package/dist/utils/command.js +1 -1
- package/dist/utils/index-nodejs.cjs +1 -1
- package/dist/utils/index-nodejs.js +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.cts +0 -1
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/package.cjs +1 -1
- package/dist/utils/package.js +1 -1
- package/dist/utils/path.cjs +1 -1
- package/dist/utils/path.js +1 -1
- package/dist/utils/storage-server.cjs +1 -1
- package/dist/utils/storage-server.js +1 -1
- package/package.json +19 -8
- package/dist/utils/config.cjs +0 -1
- package/dist/utils/config.d.cts +0 -1
- package/dist/utils/config.d.ts +0 -1
- package/dist/utils/config.js +0 -1
|
@@ -1390,7 +1390,8 @@ declare enum E_ConfigType {
|
|
|
1390
1390
|
ESLINT = "eslint",
|
|
1391
1391
|
COMMITLINT = "commitlint",
|
|
1392
1392
|
LINT_STAGED = "lint-staged",
|
|
1393
|
-
|
|
1393
|
+
VITEST_REACT_E2E = "vitest-react-e2e",
|
|
1394
|
+
VITEST_REACT_UNIT = "vitest-react-unit"
|
|
1394
1395
|
}
|
|
1395
1396
|
export { E_ConfigType }
|
|
1396
1397
|
export { E_ConfigType as E_ConfigType_alias_1 }
|
|
@@ -1400,7 +1401,8 @@ declare enum E_ConfigType_2 {
|
|
|
1400
1401
|
ESLINT = 'eslint',
|
|
1401
1402
|
COMMITLINT = 'commitlint',
|
|
1402
1403
|
LINT_STAGED = 'lint-staged',
|
|
1403
|
-
|
|
1404
|
+
VITEST_REACT_E2E = 'vitest-react-e2e',
|
|
1405
|
+
VITEST_REACT_UNIT = 'vitest-react-unit',
|
|
1404
1406
|
}
|
|
1405
1407
|
|
|
1406
1408
|
declare enum E_ErrorType {
|
|
@@ -2084,10 +2086,7 @@ export { LoadingProvider }
|
|
|
2084
2086
|
export { LoadingProvider as LoadingProvider_alias_1 }
|
|
2085
2087
|
export { LoadingProvider as LoadingProvider_alias_2 }
|
|
2086
2088
|
|
|
2087
|
-
declare function mergeConfigs(type: T_ConfigType_2, ...configs: T_Object_2[]): T_Object_2;
|
|
2088
|
-
export { mergeConfigs }
|
|
2089
|
-
export { mergeConfigs as mergeConfigs_alias_1 }
|
|
2090
|
-
export { mergeConfigs as mergeConfigs_alias_2 }
|
|
2089
|
+
export declare function mergeConfigs(type: T_ConfigType_2, ...configs: T_Object_2[]): T_Object_2;
|
|
2091
2090
|
|
|
2092
2091
|
declare const mongo: {
|
|
2093
2092
|
getDateTime(now?: Date): string;
|
|
@@ -2269,6 +2268,11 @@ export { PATH }
|
|
|
2269
2268
|
export { PATH as PATH_alias_1 }
|
|
2270
2269
|
export { PATH as PATH_alias_2 }
|
|
2271
2270
|
|
|
2271
|
+
declare const PLAYWRIGHT_PACKAGE_NAME = "playwright";
|
|
2272
|
+
export { PLAYWRIGHT_PACKAGE_NAME }
|
|
2273
|
+
export { PLAYWRIGHT_PACKAGE_NAME as PLAYWRIGHT_PACKAGE_NAME_alias_1 }
|
|
2274
|
+
export { PLAYWRIGHT_PACKAGE_NAME as PLAYWRIGHT_PACKAGE_NAME_alias_2 }
|
|
2275
|
+
|
|
2272
2276
|
declare const PNPM_CLI = "pnpm";
|
|
2273
2277
|
export { PNPM_CLI }
|
|
2274
2278
|
export { PNPM_CLI as PNPM_CLI_alias_1 }
|
|
@@ -1390,7 +1390,8 @@ declare enum E_ConfigType {
|
|
|
1390
1390
|
ESLINT = "eslint",
|
|
1391
1391
|
COMMITLINT = "commitlint",
|
|
1392
1392
|
LINT_STAGED = "lint-staged",
|
|
1393
|
-
|
|
1393
|
+
VITEST_REACT_E2E = "vitest-react-e2e",
|
|
1394
|
+
VITEST_REACT_UNIT = "vitest-react-unit"
|
|
1394
1395
|
}
|
|
1395
1396
|
export { E_ConfigType }
|
|
1396
1397
|
export { E_ConfigType as E_ConfigType_alias_1 }
|
|
@@ -1400,7 +1401,8 @@ declare enum E_ConfigType_2 {
|
|
|
1400
1401
|
ESLINT = 'eslint',
|
|
1401
1402
|
COMMITLINT = 'commitlint',
|
|
1402
1403
|
LINT_STAGED = 'lint-staged',
|
|
1403
|
-
|
|
1404
|
+
VITEST_REACT_E2E = 'vitest-react-e2e',
|
|
1405
|
+
VITEST_REACT_UNIT = 'vitest-react-unit',
|
|
1404
1406
|
}
|
|
1405
1407
|
|
|
1406
1408
|
declare enum E_ErrorType {
|
|
@@ -2084,10 +2086,7 @@ export { LoadingProvider }
|
|
|
2084
2086
|
export { LoadingProvider as LoadingProvider_alias_1 }
|
|
2085
2087
|
export { LoadingProvider as LoadingProvider_alias_2 }
|
|
2086
2088
|
|
|
2087
|
-
declare function mergeConfigs(type: T_ConfigType_2, ...configs: T_Object_2[]): T_Object_2;
|
|
2088
|
-
export { mergeConfigs }
|
|
2089
|
-
export { mergeConfigs as mergeConfigs_alias_1 }
|
|
2090
|
-
export { mergeConfigs as mergeConfigs_alias_2 }
|
|
2089
|
+
export declare function mergeConfigs(type: T_ConfigType_2, ...configs: T_Object_2[]): T_Object_2;
|
|
2091
2090
|
|
|
2092
2091
|
declare const mongo: {
|
|
2093
2092
|
getDateTime(now?: Date): string;
|
|
@@ -2269,6 +2268,11 @@ export { PATH }
|
|
|
2269
2268
|
export { PATH as PATH_alias_1 }
|
|
2270
2269
|
export { PATH as PATH_alias_2 }
|
|
2271
2270
|
|
|
2271
|
+
declare const PLAYWRIGHT_PACKAGE_NAME = "playwright";
|
|
2272
|
+
export { PLAYWRIGHT_PACKAGE_NAME }
|
|
2273
|
+
export { PLAYWRIGHT_PACKAGE_NAME as PLAYWRIGHT_PACKAGE_NAME_alias_1 }
|
|
2274
|
+
export { PLAYWRIGHT_PACKAGE_NAME as PLAYWRIGHT_PACKAGE_NAME_alias_2 }
|
|
2275
|
+
|
|
2272
2276
|
declare const PNPM_CLI = "pnpm";
|
|
2273
2277
|
export { PNPM_CLI }
|
|
2274
2278
|
export { PNPM_CLI as PNPM_CLI_alias_1 }
|
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,c,o){try{var a=e[c](o);var s=a.value}catch(e){n(e);return}if(a.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,c){var o=e.apply(t,n);function a(e){r(o,i,c,a,s,"next",e)}function s(e){r(o,i,c,a,s,"throw",e)}a(undefined)})}}function c(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var c=false;var o,a;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){c=true;a=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(c)throw a}}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){c(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)||a(e,n)||y(e,n)||s()}function h(e){return n(e)||o(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,c,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return c={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function a(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;r=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(c[0]===6&&o.label<i[1]){o.label=i[1];i=c;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(c);break}if(i[2])o.ops.pop();o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var v=Object.create;var _=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var O=function(e,t,n,r){var i=true,c=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":g(t))=="object"||typeof t=="function")try{var a=function(){var i=u.value;!S.call(e,i)&&i!==n&&_(e,i,{get:function(){return t[i]},enumerable:!(r=E(t,i))||r.enumerable})};for(var s=b(t)[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true)a()}catch(e){c=true;o=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(c){throw o}}}return e};var N=function(e,t,n){return n=e!=null?v(I(e)):{},O(t||!e||!e.__esModule?_(n,"default",{value:e,enumerable:!0}):n,e)};var w=N(require("process"),1),T=require("yargs/helpers"),P=N(require("yargs/yargs"),1);var C=process.env.DEBUG==="true";var D=N(require("process"),1);var L=N(require("boxen"),1),A=N(require("chalk"),1),R=require("child_process"),j=N(require("process"),1),G=N(require("util"),1);var M=N(require("node-fetch"),1);var k=N(require("fs"),1),F=function(e){return k.existsSync(e)};function K(e,t){var n=k.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 x(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,c=i&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);k.writeFileSync(e,c,"utf-8")}function U(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,c=i&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);k.appendFileSync(e,c,"utf-8")}function B(e){e.forEach(function(e){F(e)&&k.rmSync(e,{recursive:!0,force:!0})})}var Y=N(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=Y).resolve.apply(r,[eD].concat(h(t)))}function V(){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 W=N(require("node-persist"),1),q=N(require("os"),1),X=N(require("process"),1);function H(){return X.default.env.CYBERSKILL_STORAGE_DIR||V(q.default.homedir(),eA)}function $(){return z.apply(this,arguments)}function z(){z=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 z.apply(this,arguments)}var Q={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,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,$()];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,$()];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,$()];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 Z=24*60*60*1e3;function ee(e){var t=V(eD,eG);if(F(t))try{var n=K(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=V(eD,eR,e,eG);if(F(r))try{var i=K(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 et(e){return en.apply(this,arguments)}function en(){en=i(function(e){var t,n,r,i,c,o,a,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,Q.get(n)];case 1:i=p.sent();return[4,Q.get(r)];case 2:c=p.sent(),o=i&&Date.now()-i.timestamp<Z;if(!t&&o)return[2,i.version];a={};(c===null||c===void 0?void 0:c.etag)&&(a["If-None-Match"]=c.etag),(c===null||c===void 0?void 0:c.lastModified)&&(a["If-Modified-Since"]=c.lastModified);p.label=3;case 3:p.trys.push([3,8,,9]);return[4,(0,M.default)("https://registry.npmjs.org/".concat(e,"/latest"),{headers:a})];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,Q.set(n,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,Q.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 en.apply(this,arguments)}function er(e){return ei.apply(this,arguments)}function ei(){ei=i(function(e){var t,n,r,i,c;return m(this,function(o){switch(o.label){case 0:t={isInstalled:!1,isCurrentProject:!1,installedPath:"",installedVersion:"",latestVersion:"",file:{}};o.label=1;case 1:o.trys.push([1,6,,7]);n=ee(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,et(e,!0)];case 3:i=o.sent();o.label=4;case 4:r=t.latestVersion=i;o.label=5;case 5:return[2,(r,t)];case 6:c=o.sent();return[2,(ed.error('Error checking package "'.concat(e,'": ').concat(c.message)),t)];case 7:return[2]}})});return ei.apply(this,arguments)}var ec=G.promisify(R.exec),eo=A.default,ea=eo.gray,es=eo.blue;function eu(){return ea("[".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,c=n.padding,o=c===void 0?1:c,a=n.margin,s=a===void 0?1:a,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:o,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:o,margin:s,borderStyle:l,borderColor:i})),console.log(ea("─".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(c){switch(c.label){case 0:if(e.length===0)return[2];t=Date.now(),n=eh(t);c.label=1;case 1:c.trys.push([1,3,,4]);return[4,Q.set(n,{errors:e,timestamp:t})];case 2:c.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,Q.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=c.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,Q.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,Q.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 e_(){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,Q.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 Q.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 eb(e){var t=[],n=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,c=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a=i.exec(e)||[],s=c.exec(e)||[],u=o.exec(e)||[];a.length&&r?t.push({file:r,position:"".concat(a[1],":").concat(a[2]),type:a[3]==="error"?"error":"warning",message:a[4].trim(),rule:a[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&&C&&(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,c=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(i,":").concat(c),rule:o,message:a})})}),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,c,o,a,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;j.default.on("SIGINT",function(){ed.warning("Process interrupted. Terminating..."),n.abort(),j.default.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,ec(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),i=r.stdout,c=r.stderr;[i,c].forEach(function(e){return e&&t(e)});return[3,4];case 3:o=f.sent();a=o.stdout,s=o.stderr,u=o.message;[a,s].forEach(function(e){return e&&t(e)}),!s&&!a&&ed.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eO.apply(this,arguments)}function eN(e){return{raw:!0,cmd:e}}function ew(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e3," ").concat(eL," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e3," ").concat(e1," src/cli.ts ").concat(e):"".concat(e3," ").concat(eJ," ").concat(e)}function eT(e,t){return typeof e=="function"?ew(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"?ew(e,t):e}function eP(e){return eC.apply(this,arguments)}function eC(){eC=i(function(e){var t,n,r,i,c,o,a;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];a=!1;return[3,3];case 1:return[4,er(eL)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:i=a,c={isRemote:r,isCurrentProject:i},o=typeof e=="function"?e(c):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,eT(r,c)]}))]}})});return eC.apply(this,arguments)}var eD=D.default.env.INIT_CWD||D.default.cwd(),eL="@cyberskill/shared",eA=".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=V(eD,eR,eL,ej),eJ="cyberskill",eV="eslint",eW="eslint",eq="vitest",eX="vitest",eH="@commitlint/cli",e$="commitlint",ez="lint-staged",eQ="lint-staged",eZ="typescript",e0="tsc",e1="tsx",e2="git",e4="pnpm",e3="pnpm exec",e5="simple-git-hooks",e6="simple-git-hooks",e8="@eslint/config-inspector",e7="eslint-config-inspector",e9="node-modules-inspector",te="node-modules-inspector",tt={CYBERSKILL_DIRECTORY:eY,WORKING_DIRECTORY:eD,TS_CONFIG:J(ek),GIT_IGNORE:J(eF),GIT_HOOK:J(eU),GIT_COMMIT_MSG:J(eB),SIMPLE_GIT_HOOKS_JSON:J(eK),PACKAGE_JSON:J(eG),PACKAGE_LOCK_JSON:J(eM),PNPM_LOCK_YAML:J(ex),NODE_MODULES:J(eR),CYBERSKILL:{LINT_STAGED_CONFIG:J("".concat(eY,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:J("".concat(eY,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:J("".concat(eY,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:J("".concat(eY,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:J("".concat(eY,"/configs/vitest/react/e2e.js"))}};function tn(e){var t=e.isCurrentProject;return l({"pre-commit":eQ,"commit-msg":e$},t&&{"pre-push":eN("".concat(e2," pull"))})}function tr(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),c=i[0],o=i[1];switch(e){case"PNPM_ADD_AND_EXEC":return eT(eN("".concat(e4," add ").concat(c," && ").concat(e3," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return eT(eN("".concat(e4," add -D ").concat(c," && ").concat(e3," ").concat(o)));case"RAW":return eT(eN(c))}}var ti={SIMPLE_GIT_HOOKS:tr("PNPM_ADD_DEV_AND_EXEC",e5,e6),ESLINT_INSPECT:tr("PNPM_ADD_DEV_AND_EXEC",e8,e7),NODE_MODULES_INSPECT:tr("PNPM_ADD_DEV_AND_EXEC",e9,te),ESLINT_CHECK:tr("PNPM_ADD_DEV_AND_EXEC",eV,"".concat(eW," ").concat(tt.WORKING_DIRECTORY)),ESLINT_FIX:tr("PNPM_ADD_DEV_AND_EXEC",eV,"".concat(eW," ").concat(tt.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tr("PNPM_ADD_AND_EXEC",eZ,"".concat(e0," -p ").concat(tt.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tr("RAW","".concat(e2," config core.hooksPath ").concat(tt.GIT_HOOK)),BUILD:tr("RAW","".concat(e4," run build")),STAGE_BUILD_DIRECTORY:tr("RAW","".concat(e2," add ").concat(ej)),PNPM_INSTALL_STANDARD:tr("RAW","".concat(e4," install")),PNPM_INSTALL_LEGACY:tr("RAW","".concat(e4," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tr("RAW","".concat(e4," install --force")),CYBERSKILL:{TEST_UNIT:tr("PNPM_ADD_DEV_AND_EXEC",eq,"".concat(eX," --config ").concat(tt.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tr("PNPM_ADD_DEV_AND_EXEC",eq,"".concat(eX," --config ").concat(tt.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tr("PNPM_ADD_DEV_AND_EXEC",eH,"".concat(e$," --edit ").concat(tt.GIT_COMMIT_MSG," --config ").concat(tt.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tr("PNPM_ADD_DEV_AND_EXEC",ez,"".concat(eQ," --config ").concat(tt.CYBERSKILL.LINT_STAGED_CONFIG))}};function tc(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,"...")),C&&ed.info("Executing command: ".concat(t));return[4,eS(t)];case 1:n.sent(),ed.success("".concat(e," completed successfully."));return[2]}})});return to.apply(this,arguments)}function ta(){return ts.apply(this,arguments)}function ts(){ts=i(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!F(tt.TS_CONFIG))return[3,2];return[4,tc("Performing TypeScript validation",ti.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 ts.apply(this,arguments)}function tu(){return tl.apply(this,arguments)}function tl(){tl=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,tc("Running ESLint with auto-fix",ti.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,tc("Running ESLint check",ti.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tl.apply(this,arguments)}function tf(){return tp.apply(this,arguments)}function tp(){tp=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 tp.apply(this,arguments)}function td(){return th.apply(this,arguments)}function th(){th=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,e_()];case 1:r.sent();return[4,er(eL)];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,tc("Building package: ".concat(eL),ti.BUILD)];case 4:r.sent();return[4,tc("Staging build artifacts",ti.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw ed.error("Error building and staging ".concat(eL,": ").concat(n.message)),n;case 7:return[4,tc("Executing lint-staged",ti.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),tf();return[2]}})});return th.apply(this,arguments)}function tg(){return ty.apply(this,arguments)}function ty(){ty=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tc("Inspecting ESLint configuration",ti.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return ty.apply(this,arguments)}function tm(){return tv.apply(this,arguments)}function tv(){tv=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e_()];case 1:e.sent();return[4,Promise.all([ta(),tu()])];case 2:e.sent(),tf();return[2]}})});return tv.apply(this,arguments)}function t_(){return tE.apply(this,arguments)}function tE(){tE=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e_()];case 1:e.sent();return[4,Promise.all([ta(),tu(!0)])];case 2:e.sent(),tf();return[2]}})});return tE.apply(this,arguments)}function tb(){return tI.apply(this,arguments)}function tI(){tI=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e_()];case 1:e.sent();return[4,tc("Validating commit message",ti.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tf();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,tc("Configuring Git hooks",ti.CONFIGURE_GIT_HOOK)];case 1:n.sent(),B([tt.GIT_HOOK]);return[4,eP(tn)];case 2:e=n.sent();x(tt.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eK,"\n");F(tt.GIT_IGNORE)?K(tt.GIT_IGNORE).split("\n").includes(eK)||U(tt.GIT_IGNORE,t):x(tt.GIT_IGNORE,t);return[4,tc("Installing simple-git-hooks",ti.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tO.apply(this,arguments)}function tN(){return tw.apply(this,arguments)}function tw(){tw=i(function(){var e,t,n,r,i,c,o,a,s,u,l;return m(this,function(f){switch(f.label){case 0:e=[{command:ti.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:ti.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:ti.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=(c=i.next()).done))return[3,7];o=c.value,a=o.command,s=o.message;f.label=3;case 3:f.trys.push([3,5,,6]);return[4,tc("".concat(s," using: ").concat(a),a)];case 4:f.sent();return[2];case 5:u=f.sent();ed.warning("Installation attempt failed: ".concat(a)),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 tT(e){return tP.apply(this,arguments)}function tP(){tP=i(function(e){var t,n,r,i,o;return m(this,function(a){switch(a.label){case 0:a.trys.push([0,4,,5]);return[4,er(e)];case 1:t=a.sent(),n=t.installedPath,r=t.latestVersion,i=t.file;i.dependencies=p(l({},i.dependencies),c({},i.name,r)),x(n,i,{isJson:!0});return[4,tN()];case 2:a.sent();return[4,t_()];case 3:a.sent();return[3,5];case 4:o=a.sent();throw ed.error('Failed to update "'.concat(e,'": ').concat(o.message)),o;case 5:return[2]}})});return tP.apply(this,arguments)}function tC(){return tD.apply(this,arguments)}function tD(){tD=i(function(){var e,t,n,r,i,c,o;return m(this,function(a){switch(a.label){case 0:if(!F(tt.PACKAGE_JSON)){ed.error("package.json not found. Aborting setup.");return[2]}a.label=1;case 1:a.trys.push([1,7,,8]);return[4,er(eL)];case 2:e=a.sent(),t=e.isInstalled,n=e.installedVersion,r=e.latestVersion,i=e.isCurrentProject;if(!(i||t&&n===r))return[3,3];c=ed.success("Cyberskill package is already up to date.");return[3,5];case 3:return[4,tT(eL)];case 4:c=a.sent();a.label=5;case 5:c;return[4,tS()];case 6:a.sent();return[3,8];case 7:o=a.sent();throw ed.error("Project setup failed: ".concat(o.message)),o;case 8:return[2]}})});return tD.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:B([tt.NODE_MODULES,tt.PNPM_LOCK_YAML]);return[4,tN()];case 1:e.sent();return[4,tS()];case 2:e.sent();return[2]}})});return tA.apply(this,arguments)}function tR(){return tj.apply(this,arguments)}function tj(){tj=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tc("Inspecting project dependencies",ti.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tj.apply(this,arguments)}function tG(){return tM.apply(this,arguments)}function tM(){tM=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tc("Running unit tests",ti.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tM.apply(this,arguments)}function tk(){return tF.apply(this,arguments)}function tF(){tF=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,tc("Running end-to-end tests",ti.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tF.apply(this,arguments)}(0,P.default)((0,T.hideBin)(w.default.argv)).scriptName(eJ).usage("$0 <command> [options]").command("lint","Check code for linting issues",tm).command("lint:fix","Fix linting issues automatically",t_).command("lint:inspect","View active ESLint configuration",tg).command("lint-staged","Run lint checks on staged files",td).command("commitlint","Validate commit message format",tb).command("setup","Initialize project setup and dependencies",tC).command("reset","Reset the project and reinstall dependencies",tL).command("inspect","Analyze installed project dependencies",tR).command("test:unit","Run unit test suite",tG).command("test:e2e","Run end-to-end test suite",tk).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,c,o){try{var a=e[c](o);var s=a.value}catch(e){n(e);return}if(a.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,c){var o=e.apply(t,n);function a(e){r(o,i,c,a,s,"next",e)}function s(e){r(o,i,c,a,s,"throw",e)}a(undefined)})}}function c(e,t,n){if(t in e){Object.defineProperty(e,t,{value:n,enumerable:true,configurable:true,writable:true})}else{e[t]=n}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function a(e,t){var n=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n==null)return;var r=[];var i=true;var c=false;var o,a;try{for(n=n.call(e);!(i=(o=n.next()).done);i=true){r.push(o.value);if(t&&r.length===t)break}}catch(e){c=true;a=e}finally{try{if(!i&&n["return"]!=null)n["return"]()}finally{if(c)throw a}}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){c(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)||a(e,n)||y(e,n)||s()}function h(e){return n(e)||o(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,c,o={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]};return c={next:a(0),"throw":a(1),"return":a(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function a(e){return function(t){return s([e,t])}}function s(c){if(n)throw new TypeError("Generator is already executing.");while(o)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;r=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(i=o.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(c[0]===6&&o.label<i[1]){o.label=i[1];i=c;break}if(i&&o.label<i[2]){o.label=i[2];o.ops.push(c);break}if(i[2])o.ops.pop();o.trys.pop();continue}c=t.call(e,o)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var v=Object.create;var _=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var O=function(e,t,n,r){var i=true,c=false,o=undefined;if(t&&(typeof t==="undefined"?"undefined":g(t))=="object"||typeof t=="function")try{var a=function(){var i=u.value;!S.call(e,i)&&i!==n&&_(e,i,{get:function(){return t[i]},enumerable:!(r=E(t,i))||r.enumerable})};for(var s=b(t)[Symbol.iterator](),u;!(i=(u=s.next()).done);i=true)a()}catch(e){c=true;o=e}finally{try{if(!i&&s.return!=null){s.return()}}finally{if(c){throw o}}}return e};var N=function(e,t,n){return n=e!=null?v(I(e)):{},O(t||!e||!e.__esModule?_(n,"default",{value:e,enumerable:!0}):n,e)};var w=N(require("process"),1),T=require("yargs/helpers"),P=N(require("yargs/yargs"),1);var C=process.env.DEBUG==="true";var D=N(require("process"),1);var L=N(require("boxen"),1),A=N(require("chalk"),1),R=require("child_process"),j=N(require("process"),1),G=N(require("util"),1);var M=N(require("node-fetch"),1);var k=N(require("fs"),1),F=function(e){return k.existsSync(e)};function K(e,t){var n=k.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 x(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,c=i&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);k.writeFileSync(e,c,"utf-8")}function U(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var r=n.isJson,i=r===void 0?!1:r,c=i&&(typeof t==="undefined"?"undefined":g(t))=="object"?JSON.stringify(t,null,4):String(t);k.appendFileSync(e,c,"utf-8")}function B(e){e.forEach(function(e){F(e)&&k.rmSync(e,{recursive:!0,force:!0})})}var Y=N(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=Y).resolve.apply(r,[eD].concat(h(t)))}function V(){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 W=N(require("node-persist"),1),q=N(require("os"),1),X=N(require("process"),1);function H(){return X.default.env.CYBERSKILL_STORAGE_DIR||V(q.default.homedir(),eA)}function $(){return z.apply(this,arguments)}function z(){z=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 z.apply(this,arguments)}var Q={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,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,$()];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,$()];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,$()];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 Z=24*60*60*1e3;function ee(e){var t=V(eD,eG);if(F(t))try{var n=K(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=V(eD,eR,e,eG);if(F(r))try{var i=K(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 et(e){return en.apply(this,arguments)}function en(){en=i(function(e){var t,n,r,i,c,o,a,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,Q.get(n)];case 1:i=p.sent();return[4,Q.get(r)];case 2:c=p.sent(),o=i&&Date.now()-i.timestamp<Z;if(!t&&o)return[2,i.version];a={};(c===null||c===void 0?void 0:c.etag)&&(a["If-None-Match"]=c.etag),(c===null||c===void 0?void 0:c.lastModified)&&(a["If-Modified-Since"]=c.lastModified);p.label=3;case 3:p.trys.push([3,8,,9]);return[4,(0,M.default)("https://registry.npmjs.org/".concat(e,"/latest"),{headers:a})];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,Q.set(n,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,Q.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 en.apply(this,arguments)}function er(e){return ei.apply(this,arguments)}function ei(){ei=i(function(e){var t,n,r,i,c;return m(this,function(o){switch(o.label){case 0:t={isInstalled:!1,isCurrentProject:!1,installedPath:"",installedVersion:"",latestVersion:"",file:{}};o.label=1;case 1:o.trys.push([1,6,,7]);n=ee(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,et(e,!0)];case 3:i=o.sent();o.label=4;case 4:r=t.latestVersion=i;o.label=5;case 5:return[2,(r,t)];case 6:c=o.sent();return[2,(ed.error('Error checking package "'.concat(e,'": ').concat(c.message)),t)];case 7:return[2]}})});return ei.apply(this,arguments)}var ec=G.promisify(R.exec),eo=A.default,ea=eo.gray,es=eo.blue;function eu(){return ea("[".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,c=n.padding,o=c===void 0?1:c,a=n.margin,s=a===void 0?1:a,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:o,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:o,margin:s,borderStyle:l,borderColor:i})),console.log(ea("─".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(c){switch(c.label){case 0:if(e.length===0)return[2];t=Date.now(),n=eh(t);c.label=1;case 1:c.trys.push([1,3,,4]);return[4,Q.set(n,{errors:e,timestamp:t})];case 2:c.sent(),setTimeout(/*#__PURE__*/i(function(){var e;return m(this,function(t){switch(t.label){case 0:return[4,Q.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=c.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,Q.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,Q.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 e_(){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,Q.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 Q.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 eb(e){var t=[],n=[],r="",i=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,c=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,o=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))r=e.trim();else{var a=i.exec(e)||[],s=c.exec(e)||[],u=o.exec(e)||[];a.length&&r?t.push({file:r,position:"".concat(a[1],":").concat(a[2]),type:a[3]==="error"?"error":"warning",message:a[4].trim(),rule:a[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&&C&&(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,c=e.column,o=e.ruleId,a=e.message;n.push({type:r===2?"error":"warning",file:t,position:"".concat(i,":").concat(c),rule:o,message:a})})}),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,c,o,a,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;j.default.on("SIGINT",function(){ed.warning("Process interrupted. Terminating..."),n.abort(),j.default.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,ec(e,{maxBuffer:0x6400000,signal:n.signal})];case 2:r=f.sent(),i=r.stdout,c=r.stderr;[i,c].forEach(function(e){return e&&t(e)});return[3,4];case 3:o=f.sent();a=o.stdout,s=o.stderr,u=o.message;[a,s].forEach(function(e){return e&&t(e)}),!s&&!a&&ed.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eO.apply(this,arguments)}function eN(e){return{raw:!0,cmd:e}}function ew(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e5," ").concat(eL," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e5," ").concat(e2," src/cli.ts ").concat(e):"".concat(e5," ").concat(eJ," ").concat(e)}function eT(e,t){return typeof e=="function"?ew(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"?ew(e,t):e}function eP(e){return eC.apply(this,arguments)}function eC(){eC=i(function(e){var t,n,r,i,c,o,a;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];a=!1;return[3,3];case 1:return[4,er(eL)];case 2:a=u.sent().isCurrentProject;u.label=3;case 3:i=a,c={isRemote:r,isCurrentProject:i},o=typeof e=="function"?e(c):e;return[2,Object.fromEntries(Object.entries(o).map(function(e){var t=d(e,2),n=t[0],r=t[1];return[n,eT(r,c)]}))]}})});return eC.apply(this,arguments)}var eD=D.default.env.INIT_CWD||D.default.cwd(),eL="@cyberskill/shared",eA=".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=V(eD,eR,eL,ej),eJ="cyberskill",eV="eslint",eW="eslint",eq="vitest",eX="playwright",eH="vitest",e$="@commitlint/cli",ez="commitlint",eQ="lint-staged",eZ="lint-staged",e0="typescript",e1="tsc",e2="tsx",e4="git",e3="pnpm",e5="pnpm exec",e6="simple-git-hooks",e8="simple-git-hooks",e7="@eslint/config-inspector",e9="eslint-config-inspector",te="node-modules-inspector",tt="node-modules-inspector",tn={CYBERSKILL_DIRECTORY:eY,WORKING_DIRECTORY:eD,TS_CONFIG:J(ek),GIT_IGNORE:J(eF),GIT_HOOK:J(eU),GIT_COMMIT_MSG:J(eB),SIMPLE_GIT_HOOKS_JSON:J(eK),PACKAGE_JSON:J(eG),PACKAGE_LOCK_JSON:J(eM),PNPM_LOCK_YAML:J(ex),NODE_MODULES:J(eR),CYBERSKILL:{LINT_STAGED_CONFIG:J("".concat(eY,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:J("".concat(eY,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:J("".concat(eY,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:J("".concat(eY,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:J("".concat(eY,"/configs/vitest/react/e2e.js"))}};function tr(e){var t=e.isCurrentProject;return l({"pre-commit":eZ,"commit-msg":ez},t&&{"pre-push":eN("".concat(e4," pull"))})}function ti(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),c=i[0],o=i[1];switch(e){case"PNPM_ADD_AND_EXEC":return eT(eN("".concat(e3," add ").concat(c," && ").concat(e5," ").concat(o)));case"PNPM_ADD_DEV_AND_EXEC":return eT(eN("".concat(e3," add -D ").concat(c," && ").concat(e5," ").concat(o)));case"RAW":return eT(eN(c))}}var tc={SIMPLE_GIT_HOOKS:ti("PNPM_ADD_DEV_AND_EXEC",e6,e8),ESLINT_INSPECT:ti("PNPM_ADD_DEV_AND_EXEC",e7,e9),NODE_MODULES_INSPECT:ti("PNPM_ADD_DEV_AND_EXEC",te,tt),ESLINT_CHECK:ti("PNPM_ADD_DEV_AND_EXEC",eV,"".concat(eW," ").concat(tn.WORKING_DIRECTORY)),ESLINT_FIX:ti("PNPM_ADD_DEV_AND_EXEC",eV,"".concat(eW," ").concat(tn.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:ti("PNPM_ADD_AND_EXEC",e0,"".concat(e1," -p ").concat(tn.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:ti("RAW","".concat(e4," config core.hooksPath ").concat(tn.GIT_HOOK)),BUILD:ti("RAW","".concat(e3," run build")),STAGE_BUILD_DIRECTORY:ti("RAW","".concat(e4," add ").concat(ej)),PNPM_INSTALL_STANDARD:ti("RAW","".concat(e3," install")),PNPM_INSTALL_LEGACY:ti("RAW","".concat(e3," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:ti("RAW","".concat(e3," install --force")),CYBERSKILL:{TEST_UNIT:ti("PNPM_ADD_AND_EXEC",eq,"".concat(eH," --config ").concat(tn.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:ti("PNPM_ADD_AND_EXEC","".concat(eq," ").concat(eX),"".concat(eH," --config ").concat(tn.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:ti("PNPM_ADD_DEV_AND_EXEC",e$,"".concat(ez," --edit ").concat(tn.GIT_COMMIT_MSG," --config ").concat(tn.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:ti("PNPM_ADD_DEV_AND_EXEC",eQ,"".concat(eZ," --config ").concat(tn.CYBERSKILL.LINT_STAGED_CONFIG))}};function to(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,"...")),C&&ed.info("Executing command: ".concat(t));return[4,eS(t)];case 1:n.sent(),ed.success("".concat(e," completed successfully."));return[2]}})});return ta.apply(this,arguments)}function ts(){return tu.apply(this,arguments)}function tu(){tu=i(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!F(tn.TS_CONFIG))return[3,2];return[4,to("Performing TypeScript validation",tc.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 tu.apply(this,arguments)}function tl(){return tf.apply(this,arguments)}function tf(){tf=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,to("Running ESLint with auto-fix",tc.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,to("Running ESLint check",tc.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;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,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 td.apply(this,arguments)}function th(){return tg.apply(this,arguments)}function tg(){tg=i(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,e_()];case 1:r.sent();return[4,er(eL)];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,to("Building package: ".concat(eL),tc.BUILD)];case 4:r.sent();return[4,to("Staging build artifacts",tc.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw ed.error("Error building and staging ".concat(eL,": ").concat(n.message)),n;case 7:return[4,to("Executing lint-staged",tc.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),tp();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,to("Inspecting ESLint configuration",tc.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return tm.apply(this,arguments)}function tv(){return t_.apply(this,arguments)}function t_(){t_=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e_()];case 1:e.sent();return[4,Promise.all([ts(),tl()])];case 2:e.sent(),tp();return[2]}})});return t_.apply(this,arguments)}function tE(){return tb.apply(this,arguments)}function tb(){tb=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e_()];case 1:e.sent();return[4,Promise.all([ts(),tl(!0)])];case 2:e.sent(),tp();return[2]}})});return tb.apply(this,arguments)}function tI(){return tS.apply(this,arguments)}function tS(){tS=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,e_()];case 1:e.sent();return[4,to("Validating commit message",tc.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tp();return[2]}})});return tS.apply(this,arguments)}function tO(){return tN.apply(this,arguments)}function tN(){tN=i(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,to("Configuring Git hooks",tc.CONFIGURE_GIT_HOOK)];case 1:n.sent(),B([tn.GIT_HOOK]);return[4,eP(tr)];case 2:e=n.sent();x(tn.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eK,"\n");F(tn.GIT_IGNORE)?K(tn.GIT_IGNORE).split("\n").includes(eK)||U(tn.GIT_IGNORE,t):x(tn.GIT_IGNORE,t);return[4,to("Installing simple-git-hooks",tc.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tN.apply(this,arguments)}function tw(){return tT.apply(this,arguments)}function tT(){tT=i(function(){var e,t,n,r,i,c,o,a,s,u,l;return m(this,function(f){switch(f.label){case 0:e=[{command:tc.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:tc.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:tc.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=(c=i.next()).done))return[3,7];o=c.value,a=o.command,s=o.message;f.label=3;case 3:f.trys.push([3,5,,6]);return[4,to("".concat(s," using: ").concat(a),a)];case 4:f.sent();return[2];case 5:u=f.sent();ed.warning("Installation attempt failed: ".concat(a)),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 tT.apply(this,arguments)}function tP(e){return tC.apply(this,arguments)}function tC(){tC=i(function(e){var t,n,r,i,o;return m(this,function(a){switch(a.label){case 0:a.trys.push([0,4,,5]);return[4,er(e)];case 1:t=a.sent(),n=t.installedPath,r=t.latestVersion,i=t.file;i.dependencies=p(l({},i.dependencies),c({},i.name,r)),x(n,i,{isJson:!0});return[4,tw()];case 2:a.sent();return[4,tE()];case 3:a.sent();return[3,5];case 4:o=a.sent();throw ed.error('Failed to update "'.concat(e,'": ').concat(o.message)),o;case 5:return[2]}})});return tC.apply(this,arguments)}function tD(){return tL.apply(this,arguments)}function tL(){tL=i(function(){var e,t,n,r,i,c,o;return m(this,function(a){switch(a.label){case 0:if(!F(tn.PACKAGE_JSON)){ed.error("package.json not found. Aborting setup.");return[2]}a.label=1;case 1:a.trys.push([1,7,,8]);return[4,er(eL)];case 2:e=a.sent(),t=e.isInstalled,n=e.installedVersion,r=e.latestVersion,i=e.isCurrentProject;if(!(i||t&&n===r))return[3,3];c=ed.success("Cyberskill package is already up to date.");return[3,5];case 3:return[4,tP(eL)];case 4:c=a.sent();a.label=5;case 5:c;return[4,tO()];case 6:a.sent();return[3,8];case 7:o=a.sent();throw ed.error("Project setup failed: ".concat(o.message)),o;case 8:return[2]}})});return tL.apply(this,arguments)}function tA(){return tR.apply(this,arguments)}function tR(){tR=i(function(){return m(this,function(e){switch(e.label){case 0:B([tn.NODE_MODULES,tn.PNPM_LOCK_YAML]);return[4,tw()];case 1:e.sent();return[4,tO()];case 2: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,to("Inspecting project dependencies",tc.NODE_MODULES_INSPECT)];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,to("Running unit tests",tc.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tk.apply(this,arguments)}function tF(){return tK.apply(this,arguments)}function tK(){tK=i(function(){return m(this,function(e){switch(e.label){case 0:return[4,to("Running end-to-end tests",tc.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tK.apply(this,arguments)}(0,P.default)((0,T.hideBin)(w.default.argv)).scriptName(eJ).usage("$0 <command> [options]").command("lint","Check code for linting issues",tv).command("lint:fix","Fix linting issues automatically",tE).command("lint:inspect","View active ESLint configuration",ty).command("lint-staged","Run lint checks on staged files",th).command("commitlint","Validate commit message format",tI).command("setup","Initialize project setup and dependencies",tD).command("reset","Reset the project and reinstall dependencies",tA).command("inspect","Analyze installed project dependencies",tj).command("test:unit","Run unit test suite",tM).command("test:e2e","Run end-to-end test suite",tF).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,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)||m(e,n)||a()}function h(e){return n(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(t,n){if(!t)return;if(typeof t==="string")return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor)r=t.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}function y(e,t){var n,r,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";var b=process.env.DEBUG==="true";import I from"node:process";import S from"boxen";import O from"chalk";import{exec as N}from"node:child_process";import T from"node:process";import*as w from"node:util";import C from"node-fetch";import*as P from"node:fs";var D=function(e){return P.existsSync(e)};function L(e,t){var n=P.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);P.writeFileSync(e,i,"utf-8")}function R(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);P.appendFileSync(e,i,"utf-8")}function j(e){e.forEach(function(e){D(e)&&P.rmSync(e,{recursive:!0,force:!0})})}import*as G from"node:path";function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=G).resolve.apply(r,[eb].concat(h(t)))}function k(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=G).join.apply(r,h(t))}import F from"node-persist";import K from"node:os";import x from"node:process";function U(){return x.env.CYBERSKILL_STORAGE_DIR||k(K.homedir(),eS)}function B(){return Y.apply(this,arguments)}function Y(){Y=o(function(){var e;return y(this,function(t){switch(t.label){case 0:e=F.defaultInstance;if(e)return[3,2];return[4,F.init({dir:U(),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 Y.apply(this,arguments)}var J={get:function e(e){return o(function(){var t,n;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,F.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 y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,B()];case 1:r.sent();return[4,F.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 y(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,B()];case 1:n.sent();return[4,F.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 y(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,B()];case 1:n.sent();return[4,F.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 y(this,function(t){try{return[2,"".concat(U()," (key: ").concat(e,")")]}catch(e){return[2,(console.error("❌ [Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var V=24*60*60*1e3;function W(e){var t=k(eb,eT);if(D(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=k(eb,eO,e,eT);if(D(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 y(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,J.get(n)];case 1:o=p.sent();return[4,J.get(r)];case 2:i=p.sent(),c=o&&Date.now()-o.timestamp<V;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,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,J.set(n,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,J.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 $(e){return z.apply(this,arguments)}function z(){z=o(function(e){var t,n,r,o,i;return y(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 z.apply(this,arguments)}var q=w.promisify(N),Q=O.gray,Z=O.blue;function ee(){return Q("[".concat(new Date().toLocaleTimeString(),"]"))}function et(e){var t=O[e];return typeof t=="function"?t:O.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(S(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(S(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 y(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,J.set(n,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return y(this,function(t){switch(t.label){case 0:return[4,J.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 y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,J.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 y(this,function(n){switch(n.label){case 0:return[4,J.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 y(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,J.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 J.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&&b&&(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 y(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ed;n=new AbortController;T.on("SIGINT",function(){eo.warning("Process interrupted. Terminating..."),n.abort(),T.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 em(e){return{raw:!0,cmd:e}}function ey(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e$," ").concat(eI," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e$," ").concat(eW," src/cli.ts ").concat(e):"".concat(e$," ").concat(eG," ").concat(e)}function ev(e,t){return typeof e=="function"?ey(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"?ey(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 y(this,function(u){switch(u.label){case 0:t=a.length>1&&a[1]!==void 0?a[1]:{};r=(n=t===null||t===void 0?void 0:t.isRemote)!==null&&n!==void 0?n:!1;if(!r)return[3,1];s=!1;return[3,3];case 1:return[4,$(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=I.env.INIT_CWD||I.cwd(),eI="@cyberskill/shared",eS=".cyberskill-storage",eO="node_modules",eN="dist",eT="package.json",ew="package-lock.json",eC="tsconfig.json",eP=".gitignore",eD=".simple-git-hooks.json",eL="pnpm-lock.yaml",eA=".git/hooks/",eR=".git/COMMIT_EDITMSG",ej=k(eb,eO,eI,eN),eG="cyberskill",eM="eslint",ek="eslint",eF="vitest",eK="vitest",ex="@commitlint/cli",eU="commitlint",eB="lint-staged",eY="lint-staged",eJ="typescript",eV="tsc",eW="tsx",eX="git",eH="pnpm",e$="pnpm exec",ez="simple-git-hooks",eq="simple-git-hooks",eQ="@eslint/config-inspector",eZ="eslint-config-inspector",e0="node-modules-inspector",e2="node-modules-inspector",e4={CYBERSKILL_DIRECTORY:ej,WORKING_DIRECTORY:eb,TS_CONFIG:M(eC),GIT_IGNORE:M(eP),GIT_HOOK:M(eA),GIT_COMMIT_MSG:M(eR),SIMPLE_GIT_HOOKS_JSON:M(eD),PACKAGE_JSON:M(eT),PACKAGE_LOCK_JSON:M(ew),PNPM_LOCK_YAML:M(eL),NODE_MODULES:M(eO),CYBERSKILL:{LINT_STAGED_CONFIG:M("".concat(ej,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:M("".concat(ej,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:M("".concat(ej,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:M("".concat(ej,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:M("".concat(ej,"/configs/vitest/react/e2e.js"))}};function e1(e){var t=e.isCurrentProject;return l({"pre-commit":eY,"commit-msg":eU},t&&{"pre-push":em("".concat(eX," pull"))})}function e3(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(em("".concat(eH," add ").concat(i," && ").concat(e$," ").concat(c)));case"PNPM_ADD_DEV_AND_EXEC":return ev(em("".concat(eH," add -D ").concat(i," && ").concat(e$," ").concat(c)));case"RAW":return ev(em(i))}}var e5={SIMPLE_GIT_HOOKS:e3("PNPM_ADD_DEV_AND_EXEC",ez,eq),ESLINT_INSPECT:e3("PNPM_ADD_DEV_AND_EXEC",eQ,eZ),NODE_MODULES_INSPECT:e3("PNPM_ADD_DEV_AND_EXEC",e0,e2),ESLINT_CHECK:e3("PNPM_ADD_DEV_AND_EXEC",eM,"".concat(ek," ").concat(e4.WORKING_DIRECTORY)),ESLINT_FIX:e3("PNPM_ADD_DEV_AND_EXEC",eM,"".concat(ek," ").concat(e4.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:e3("PNPM_ADD_AND_EXEC",eJ,"".concat(eV," -p ").concat(e4.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:e3("RAW","".concat(eX," config core.hooksPath ").concat(e4.GIT_HOOK)),BUILD:e3("RAW","".concat(eH," run build")),STAGE_BUILD_DIRECTORY:e3("RAW","".concat(eX," add ").concat(eN)),PNPM_INSTALL_STANDARD:e3("RAW","".concat(eH," install")),PNPM_INSTALL_LEGACY:e3("RAW","".concat(eH," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:e3("RAW","".concat(eH," install --force")),CYBERSKILL:{TEST_UNIT:e3("PNPM_ADD_DEV_AND_EXEC",eF,"".concat(eK," --config ").concat(e4.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:e3("PNPM_ADD_DEV_AND_EXEC",eF,"".concat(eK," --config ").concat(e4.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:e3("PNPM_ADD_DEV_AND_EXEC",ex,"".concat(eU," --edit ").concat(e4.GIT_COMMIT_MSG," --config ").concat(e4.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:e3("PNPM_ADD_DEV_AND_EXEC",eB,"".concat(eY," --config ").concat(e4.CYBERSKILL.LINT_STAGED_CONFIG))}};function e6(e,t){return e8.apply(this,arguments)}function e8(){e8=o(function(e,t){return y(this,function(n){switch(n.label){case 0:eo.info("".concat(e,"...")),b&&eo.info("Executing command: ".concat(t));return[4,eh(t)];case 1:n.sent(),eo.success("".concat(e," completed successfully."));return[2]}})});return e8.apply(this,arguments)}function e7(){return e9.apply(this,arguments)}function e9(){e9=o(function(){var e;return y(this,function(t){switch(t.label){case 0:if(!D(e4.TS_CONFIG))return[3,2];return[4,e6("Performing TypeScript validation",e5.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 e9.apply(this,arguments)}function te(){return tt.apply(this,arguments)}function tt(){tt=o(function(){var e,t;var n=arguments;return y(this,function(r){switch(r.label){case 0:e=n.length>0&&n[0]!==void 0?n[0]:!1;if(!e)return[3,2];return[4,e6("Running ESLint with auto-fix",e5.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,e6("Running ESLint check",e5.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;return[2]}})});return tt.apply(this,arguments)}function tn(){return tr.apply(this,arguments)}function tr(){tr=o(function(){var e,t,n;return y(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 tr.apply(this,arguments)}function to(){return ti.apply(this,arguments)}function ti(){ti=o(function(){var e,t,n;return y(this,function(r){switch(r.label){case 0:return[4,el()];case 1:r.sent();return[4,$(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,e6("Building package: ".concat(eI),e5.BUILD)];case 4:r.sent();return[4,e6("Staging build artifacts",e5.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,e6("Executing lint-staged",e5.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),tn();return[2]}})});return ti.apply(this,arguments)}function tc(){return ts.apply(this,arguments)}function ts(){ts=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,e6("Inspecting ESLint configuration",e5.ESLINT_INSPECT)];case 1:e.sent();return[2]}})});return ts.apply(this,arguments)}function ta(){return tu.apply(this,arguments)}function tu(){tu=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,Promise.all([e7(),te()])];case 2:e.sent(),tn();return[2]}})});return tu.apply(this,arguments)}function tl(){return tf.apply(this,arguments)}function tf(){tf=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,Promise.all([e7(),te(!0)])];case 2:e.sent(),tn();return[2]}})});return tf.apply(this,arguments)}function tp(){return td.apply(this,arguments)}function td(){td=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,e6("Validating commit message",e5.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tn();return[2]}})});return td.apply(this,arguments)}function th(){return tg.apply(this,arguments)}function tg(){tg=o(function(){var e,t;return y(this,function(n){switch(n.label){case 0:return[4,e6("Configuring Git hooks",e5.CONFIGURE_GIT_HOOK)];case 1:n.sent(),j([e4.GIT_HOOK]);return[4,eE(e1)];case 2:e=n.sent();A(e4.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eD,"\n");D(e4.GIT_IGNORE)?L(e4.GIT_IGNORE).split("\n").includes(eD)||R(e4.GIT_IGNORE,t):A(e4.GIT_IGNORE,t);return[4,e6("Installing simple-git-hooks",e5.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tg.apply(this,arguments)}function tm(){return ty.apply(this,arguments)}function ty(){ty=o(function(){var e,t,n,r,o,i,c,s,a,u,l;return y(this,function(f){switch(f.label){case 0:e=[{command:e5.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:e5.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:e5.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,e6("".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 tv(e){return tE.apply(this,arguments)}function tE(){tE=o(function(e){var t,n,r,o,c;return y(this,function(s){switch(s.label){case 0:s.trys.push([0,4,,5]);return[4,$(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,tm()];case 2:s.sent();return[4,tl()];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 tE.apply(this,arguments)}function t_(){return tb.apply(this,arguments)}function tb(){tb=o(function(){var e,t,n,r,o,i,c;return y(this,function(s){switch(s.label){case 0:if(!D(e4.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,$(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,tv(eI)];case 4:i=s.sent();s.label=5;case 5:i;return[4,th()];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 tb.apply(this,arguments)}function tI(){return tS.apply(this,arguments)}function tS(){tS=o(function(){return y(this,function(e){switch(e.label){case 0:j([e4.NODE_MODULES,e4.PNPM_LOCK_YAML]);return[4,tm()];case 1:e.sent();return[4,th()];case 2:e.sent();return[2]}})});return tS.apply(this,arguments)}function tO(){return tN.apply(this,arguments)}function tN(){tN=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,e6("Inspecting project dependencies",e5.NODE_MODULES_INSPECT)];case 1:e.sent();return[2]}})});return tN.apply(this,arguments)}function tT(){return tw.apply(this,arguments)}function tw(){tw=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,e6("Running unit tests",e5.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tw.apply(this,arguments)}function tC(){return tP.apply(this,arguments)}function tP(){tP=o(function(){return y(this,function(e){switch(e.label){case 0:return[4,e6("Running end-to-end tests",e5.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tP.apply(this,arguments)}_(E(v.argv)).scriptName(eG).usage("$0 <command> [options]").command("lint","Check code for linting issues",ta).command("lint:fix","Fix linting issues automatically",tl).command("lint:inspect","View active ESLint configuration",tc).command("lint-staged","Run lint checks on staged files",to).command("commitlint","Validate commit message format",tp).command("setup","Initialize project setup and dependencies",t_).command("reset","Reset the project and reinstall dependencies",tI).command("inspect","Analyze installed project dependencies",tO).command("test:unit","Run unit test suite",tT).command("test:e2e","Run end-to-end test suite",tC).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";var b=process.env.DEBUG==="true";import I from"node:process";import S from"boxen";import O from"chalk";import{exec as N}from"node:child_process";import T from"node:process";import*as w from"node:util";import C from"node-fetch";import*as P from"node:fs";var D=function(e){return P.existsSync(e)};function L(e,t){var n=P.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);P.writeFileSync(e,i,"utf-8")}function R(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);P.appendFileSync(e,i,"utf-8")}function j(e){e.forEach(function(e){D(e)&&P.rmSync(e,{recursive:!0,force:!0})})}import*as G from"node:path";function M(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=G).resolve.apply(r,[eb].concat(h(t)))}function k(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=G).join.apply(r,h(t))}import F from"node-persist";import K from"node:os";import x from"node:process";function U(){return x.env.CYBERSKILL_STORAGE_DIR||k(K.homedir(),eS)}function B(){return Y.apply(this,arguments)}function Y(){Y=o(function(){var e;return m(this,function(t){switch(t.label){case 0:e=F.defaultInstance;if(e)return[3,2];return[4,F.init({dir:U(),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 Y.apply(this,arguments)}var J={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,B()];case 1:r.sent();return[4,F.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,B()];case 1:r.sent();return[4,F.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,B()];case 1:n.sent();return[4,F.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,B()];case 1:n.sent();return[4,F.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(U()," (key: ").concat(e,")")]}catch(e){return[2,(console.error("❌ [Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var V=24*60*60*1e3;function W(e){var t=k(eb,eT);if(D(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=k(eb,eO,e,eT);if(D(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,J.get(n)];case 1:o=p.sent();return[4,J.get(r)];case 2:i=p.sent(),c=o&&Date.now()-o.timestamp<V;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,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,J.set(n,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,J.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 $(e){return z.apply(this,arguments)}function z(){z=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 z.apply(this,arguments)}var q=w.promisify(N),Q=O.gray,Z=O.blue;function ee(){return Q("[".concat(new Date().toLocaleTimeString(),"]"))}function et(e){var t=O[e];return typeof t=="function"?t:O.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(S(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(S(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,J.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,J.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,J.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,J.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,J.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 J.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&&b&&(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;T.on("SIGINT",function(){eo.warning("Process interrupted. Terminating..."),n.abort(),T.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(ez," ").concat(eI," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(ez," ").concat(eX," src/cli.ts ").concat(e):"".concat(ez," ").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,$(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=I.env.INIT_CWD||I.cwd(),eI="@cyberskill/shared",eS=".cyberskill-storage",eO="node_modules",eN="dist",eT="package.json",ew="package-lock.json",eC="tsconfig.json",eP=".gitignore",eD=".simple-git-hooks.json",eL="pnpm-lock.yaml",eA=".git/hooks/",eR=".git/COMMIT_EDITMSG",ej=k(eb,eO,eI,eN),eG="cyberskill",eM="eslint",ek="eslint",eF="vitest",eK="playwright",ex="vitest",eU="@commitlint/cli",eB="commitlint",eY="lint-staged",eJ="lint-staged",eV="typescript",eW="tsc",eX="tsx",eH="git",e$="pnpm",ez="pnpm exec",eq="simple-git-hooks",eQ="simple-git-hooks",eZ="@eslint/config-inspector",e0="eslint-config-inspector",e2="node-modules-inspector",e4="node-modules-inspector",e1={CYBERSKILL_DIRECTORY:ej,WORKING_DIRECTORY:eb,TS_CONFIG:M(eC),GIT_IGNORE:M(eP),GIT_HOOK:M(eA),GIT_COMMIT_MSG:M(eR),SIMPLE_GIT_HOOKS_JSON:M(eD),PACKAGE_JSON:M(eT),PACKAGE_LOCK_JSON:M(ew),PNPM_LOCK_YAML:M(eL),NODE_MODULES:M(eO),CYBERSKILL:{LINT_STAGED_CONFIG:M("".concat(ej,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:M("".concat(ej,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:M("".concat(ej,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:M("".concat(ej,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:M("".concat(ej,"/configs/vitest/react/e2e.js"))}};function e3(e){var t=e.isCurrentProject;return l({"pre-commit":eJ,"commit-msg":eB},t&&{"pre-push":ey("".concat(eH," pull"))})}function e5(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(e$," add ").concat(i," && ").concat(ez," ").concat(c)));case"PNPM_ADD_DEV_AND_EXEC":return ev(ey("".concat(e$," add -D ").concat(i," && ").concat(ez," ").concat(c)));case"RAW":return ev(ey(i))}}var e6={SIMPLE_GIT_HOOKS:e5("PNPM_ADD_DEV_AND_EXEC",eq,eQ),ESLINT_INSPECT:e5("PNPM_ADD_DEV_AND_EXEC",eZ,e0),NODE_MODULES_INSPECT:e5("PNPM_ADD_DEV_AND_EXEC",e2,e4),ESLINT_CHECK:e5("PNPM_ADD_DEV_AND_EXEC",eM,"".concat(ek," ").concat(e1.WORKING_DIRECTORY)),ESLINT_FIX:e5("PNPM_ADD_DEV_AND_EXEC",eM,"".concat(ek," ").concat(e1.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:e5("PNPM_ADD_AND_EXEC",eV,"".concat(eW," -p ").concat(e1.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:e5("RAW","".concat(eH," config core.hooksPath ").concat(e1.GIT_HOOK)),BUILD:e5("RAW","".concat(e$," run build")),STAGE_BUILD_DIRECTORY:e5("RAW","".concat(eH," add ").concat(eN)),PNPM_INSTALL_STANDARD:e5("RAW","".concat(e$," install")),PNPM_INSTALL_LEGACY:e5("RAW","".concat(e$," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:e5("RAW","".concat(e$," install --force")),CYBERSKILL:{TEST_UNIT:e5("PNPM_ADD_AND_EXEC",eF,"".concat(ex," --config ").concat(e1.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:e5("PNPM_ADD_AND_EXEC","".concat(eF," ").concat(eK),"".concat(ex," --config ").concat(e1.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:e5("PNPM_ADD_DEV_AND_EXEC",eU,"".concat(eB," --edit ").concat(e1.GIT_COMMIT_MSG," --config ").concat(e1.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:e5("PNPM_ADD_DEV_AND_EXEC",eY,"".concat(eJ," --config ").concat(e1.CYBERSKILL.LINT_STAGED_CONFIG))}};function e8(e,t){return e7.apply(this,arguments)}function e7(){e7=o(function(e,t){return m(this,function(n){switch(n.label){case 0:eo.info("".concat(e,"...")),b&&eo.info("Executing command: ".concat(t));return[4,eh(t)];case 1:n.sent(),eo.success("".concat(e," completed successfully."));return[2]}})});return e7.apply(this,arguments)}function e9(){return te.apply(this,arguments)}function te(){te=o(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!D(e1.TS_CONFIG))return[3,2];return[4,e8("Performing TypeScript validation",e6.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 te.apply(this,arguments)}function tt(){return tn.apply(this,arguments)}function tn(){tn=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,e8("Running ESLint with auto-fix",e6.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,e8("Running ESLint check",e6.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;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,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 to.apply(this,arguments)}function ti(){return tc.apply(this,arguments)}function tc(){tc=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,$(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,e8("Building package: ".concat(eI),e6.BUILD)];case 4:r.sent();return[4,e8("Staging build artifacts",e6.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,e8("Executing lint-staged",e6.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),tr();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,e8("Inspecting ESLint configuration",e6.ESLINT_INSPECT)];case 1:e.sent();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([e9(),tt()])];case 2:e.sent(),tr();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,Promise.all([e9(),tt(!0)])];case 2:e.sent(),tr();return[2]}})});return tp.apply(this,arguments)}function td(){return th.apply(this,arguments)}function th(){th=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,el()];case 1:e.sent();return[4,e8("Validating commit message",e6.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),tr();return[2]}})});return th.apply(this,arguments)}function tg(){return ty.apply(this,arguments)}function ty(){ty=o(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,e8("Configuring Git hooks",e6.CONFIGURE_GIT_HOOK)];case 1:n.sent(),j([e1.GIT_HOOK]);return[4,eE(e3)];case 2:e=n.sent();A(e1.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eD,"\n");D(e1.GIT_IGNORE)?L(e1.GIT_IGNORE).split("\n").includes(eD)||R(e1.GIT_IGNORE,t):A(e1.GIT_IGNORE,t);return[4,e8("Installing simple-git-hooks",e6.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return ty.apply(this,arguments)}function tm(){return tv.apply(this,arguments)}function tv(){tv=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:e6.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:e6.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:e6.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,e8("".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 tv.apply(this,arguments)}function tE(e){return t_.apply(this,arguments)}function t_(){t_=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,$(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,tm()];case 2:s.sent();return[4,tf()];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 t_.apply(this,arguments)}function tb(){return tI.apply(this,arguments)}function tI(){tI=o(function(){var e,t,n,r,o,i,c;return m(this,function(s){switch(s.label){case 0:if(!D(e1.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,$(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,tE(eI)];case 4:i=s.sent();s.label=5;case 5:i;return[4,tg()];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 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:j([e1.NODE_MODULES,e1.PNPM_LOCK_YAML]);return[4,tm()];case 1:e.sent();return[4,tg()];case 2: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,e8("Inspecting project dependencies",e6.NODE_MODULES_INSPECT)];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,e8("Running unit tests",e6.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tC.apply(this,arguments)}function tP(){return tD.apply(this,arguments)}function tD(){tD=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,e8("Running end-to-end tests",e6.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tD.apply(this,arguments)}_(E(v.argv)).scriptName(eG).usage("$0 <command> [options]").command("lint","Check code for linting issues",tu).command("lint:fix","Fix linting issues automatically",tf).command("lint:inspect","View active ESLint configuration",ts).command("lint-staged","Run lint checks on staged files",ti).command("commitlint","Validate commit message format",td).command("setup","Initialize project setup and dependencies",tb).command("reset","Reset the project and reinstall dependencies",tS).command("inspect","Analyze installed project dependencies",tN).command("test:unit","Run unit test suite",tw).command("test:e2e","Run end-to-end test suite",tP).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 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 a,i;try{for(r=r.call(t);!(o=(a=r.next()).done);o=true){n.push(a.value);if(e&&n.length===e)break}}catch(t){c=true;i=t}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(c)throw i}}return n}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(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)||a()}function s(t){return r(t)||o(t)||_(t)||i()}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 E=Object.create;var p=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var O=function(t,e){for(var r in e)p(t,r,{get:e[r],enumerable:!0})},C=function(t,e,r,n){var o=true,c=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":f(e))=="object"||typeof e=="function")try{var i=function(){var o=l.value;!N.call(t,o)&&o!==r&&p(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)i()}catch(t){c=true;a=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}}return t};var
|
|
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 a,i;try{for(r=r.call(t);!(o=(a=r.next()).done);o=true){n.push(a.value);if(e&&n.length===e)break}}catch(t){c=true;i=t}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(c)throw i}}return n}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(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)||a()}function s(t){return r(t)||o(t)||_(t)||i()}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 E=Object.create;var p=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var O=function(t,e){for(var r in e)p(t,r,{get:e[r],enumerable:!0})},C=function(t,e,r,n){var o=true,c=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":f(e))=="object"||typeof e=="function")try{var i=function(){var o=l.value;!N.call(t,o)&&o!==r&&p(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)i()}catch(t){c=true;a=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}}return t};var v=function(t,e,r){return r=t!=null?E(y(t)):{},C(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)},D=function(t){return C(p({},"__esModule",{value:!0}),t)};var T={};O(T,{createGraphqlCodegenConfig:function(){return tM}});module.exports=D(T);var g=v(require("process"),1);var A=v(require("boxen"),1),m=v(require("chalk"),1),S=require("child_process"),b=v(require("process"),1),h=v(require("util"),1);var P=process.env.DEBUG==="true";var M=v(require("node-fetch"),1);var L=v(require("fs"),1);var G=v(require("path"),1);function R(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=G).resolve.apply(n,[x].concat(s(e)))}function w(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=G).join.apply(n,s(e))}var j=v(require("node-persist"),1),K=v(require("os"),1),F=v(require("process"),1);var k=24*60*60*1e3;var q=h.promisify(S.exec),Y=m.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(tv," ").concat(V," ").concat(t):(e===null||e===void 0?void 0:e.isCurrentProject)?"".concat(tv," ").concat(tN," src/cli.ts ").concat(t):"".concat(tv," ").concat(ta," ").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(),V="@cyberskill/shared";var J="node_modules",$="dist",z="package.json",Q="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=w(x,J,V,$),ta="cyberskill",ti="eslint",tu="eslint",tl="vitest",ts="playwright",tf="vitest",t_="@commitlint/cli",tE="commitlint",tp="lint-staged",tI="lint-staged",td="typescript",ty="tsc",tN="tsx",tO="git",tC="pnpm",tv="pnpm exec",tD="simple-git-hooks",tT="simple-git-hooks",tg="@eslint/config-inspector",tA="eslint-config-inspector",tm="node-modules-inspector",tS="node-modules-inspector",tb={CYBERSKILL_DIRECTORY:tc,WORKING_DIRECTORY:x,TS_CONFIG:R(Z),GIT_IGNORE:R(tt),GIT_HOOK:R(tn),GIT_COMMIT_MSG:R(to),SIMPLE_GIT_HOOKS_JSON:R(te),PACKAGE_JSON:R(z),PACKAGE_LOCK_JSON:R(Q),PNPM_LOCK_YAML:R(tr),NODE_MODULES:R(J),CYBERSKILL:{LINT_STAGED_CONFIG:R("".concat(tc,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:R("".concat(tc,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:R("".concat(tc,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:R("".concat(tc,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:R("".concat(tc,"/configs/vitest/react/e2e.js"))}};function th(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],a=o[1];switch(t){case"PNPM_ADD_AND_EXEC":return B(W("".concat(tC," add ").concat(c," && ").concat(tv," ").concat(a)));case"PNPM_ADD_DEV_AND_EXEC":return B(W("".concat(tC," add -D ").concat(c," && ").concat(tv," ").concat(a)));case"RAW":return B(W(c))}}var tP={SIMPLE_GIT_HOOKS:th("PNPM_ADD_DEV_AND_EXEC",tD,tT),ESLINT_INSPECT:th("PNPM_ADD_DEV_AND_EXEC",tg,tA),NODE_MODULES_INSPECT:th("PNPM_ADD_DEV_AND_EXEC",tm,tS),ESLINT_CHECK:th("PNPM_ADD_DEV_AND_EXEC",ti,"".concat(tu," ").concat(tb.WORKING_DIRECTORY)),ESLINT_FIX:th("PNPM_ADD_DEV_AND_EXEC",ti,"".concat(tu," ").concat(tb.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:th("PNPM_ADD_AND_EXEC",td,"".concat(ty," -p ").concat(tb.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:th("RAW","".concat(tO," config core.hooksPath ").concat(tb.GIT_HOOK)),BUILD:th("RAW","".concat(tC," run build")),STAGE_BUILD_DIRECTORY:th("RAW","".concat(tO," add ").concat($)),PNPM_INSTALL_STANDARD:th("RAW","".concat(tC," install")),PNPM_INSTALL_LEGACY:th("RAW","".concat(tC," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:th("RAW","".concat(tC," install --force")),CYBERSKILL:{TEST_UNIT:th("PNPM_ADD_AND_EXEC",tl,"".concat(tf," --config ").concat(tb.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:th("PNPM_ADD_AND_EXEC","".concat(tl," ").concat(ts),"".concat(tf," --config ").concat(tb.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:th("PNPM_ADD_DEV_AND_EXEC",t_,"".concat(tE," --edit ").concat(tb.GIT_COMMIT_MSG," --config ").concat(tb.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:th("PNPM_ADD_DEV_AND_EXEC",tp,"".concat(tI," --config ").concat(tb.CYBERSKILL.LINT_STAGED_CONFIG))}};function tM(t){var e=t.uri,r=t.from,o=t.to,c=t.withComponent,a=t.withHOC,i=t.withHooks,l=t.withMutationFn,s=t.withRefetchFn;var f=u({},c&&{withComponent:c},a&&{withHOC:a},i&&{withHooks:i},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 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)||f(t,o)||i()}function _(t){return o(t)||r(t)||f(t)||a()}function u(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function f(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 N}from"node:child_process";import*as
|
|
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)||f(t,o)||i()}function _(t){return o(t)||r(t)||f(t)||a()}function u(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function f(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 N}from"node:child_process";import*as m from"node:util";var T=process.env.DEBUG==="true";import D from"node-fetch";import*as C 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=C).resolve.apply(e,[L].concat(_(n)))}function O(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=C).join.apply(e,_(n))}import d from"node-persist";var A=24*60*60*1e3;var S=m.promisify(N),g=I.gray,h=I.blue;function P(t){return{raw:!0,cmd:t}}function v(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tc," ").concat(M," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tc," ").concat(to," src/cli.ts ").concat(t):"".concat(tc," ").concat(H," ").concat(t)}function b(t,n){return typeof t=="function"?v(t(n),n):(typeof t==="undefined"?"undefined":u(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?v(t,n):t}var L=E.env.INIT_CWD||E.cwd(),M="@cyberskill/shared";var G="node_modules",R="dist",w="package.json",j="package-lock.json",K="tsconfig.json",F=".gitignore",k=".simple-git-hooks.json",Y="pnpm-lock.yaml",X=".git/hooks/",U=".git/COMMIT_EDITMSG",W=O(L,G,M,R),H="cyberskill",B="eslint",V="eslint",x="vitest",J="playwright",q="vitest",$="@commitlint/cli",z="commitlint",Q="lint-staged",Z="lint-staged",tt="typescript",tn="tsc",to="tsx",te="git",tr="pnpm",tc="pnpm exec",ti="simple-git-hooks",ta="simple-git-hooks",ts="@eslint/config-inspector",tl="eslint-config-inspector",t_="node-modules-inspector",tu="node-modules-inspector",tf={CYBERSKILL_DIRECTORY:W,WORKING_DIRECTORY:L,TS_CONFIG:y(K),GIT_IGNORE:y(F),GIT_HOOK:y(X),GIT_COMMIT_MSG:y(U),SIMPLE_GIT_HOOKS_JSON:y(k),PACKAGE_JSON:y(w),PACKAGE_LOCK_JSON:y(j),PNPM_LOCK_YAML:y(Y),NODE_MODULES:y(G),CYBERSKILL:{LINT_STAGED_CONFIG:y("".concat(W,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:y("".concat(W,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:y("".concat(W,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:y("".concat(W,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:y("".concat(W,"/configs/vitest/react/e2e.js"))}};function tE(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 b(P("".concat(tr," add ").concat(c," && ").concat(tc," ").concat(i)));case"PNPM_ADD_DEV_AND_EXEC":return b(P("".concat(tr," add -D ").concat(c," && ").concat(tc," ").concat(i)));case"RAW":return b(P(c))}}var tp={SIMPLE_GIT_HOOKS:tE("PNPM_ADD_DEV_AND_EXEC",ti,ta),ESLINT_INSPECT:tE("PNPM_ADD_DEV_AND_EXEC",ts,tl),NODE_MODULES_INSPECT:tE("PNPM_ADD_DEV_AND_EXEC",t_,tu),ESLINT_CHECK:tE("PNPM_ADD_DEV_AND_EXEC",B,"".concat(V," ").concat(tf.WORKING_DIRECTORY)),ESLINT_FIX:tE("PNPM_ADD_DEV_AND_EXEC",B,"".concat(V," ").concat(tf.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tE("PNPM_ADD_AND_EXEC",tt,"".concat(tn," -p ").concat(tf.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tE("RAW","".concat(te," config core.hooksPath ").concat(tf.GIT_HOOK)),BUILD:tE("RAW","".concat(tr," run build")),STAGE_BUILD_DIRECTORY:tE("RAW","".concat(te," add ").concat(R)),PNPM_INSTALL_STANDARD:tE("RAW","".concat(tr," install")),PNPM_INSTALL_LEGACY:tE("RAW","".concat(tr," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tE("RAW","".concat(tr," install --force")),CYBERSKILL:{TEST_UNIT:tE("PNPM_ADD_AND_EXEC",x,"".concat(q," --config ").concat(tf.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tE("PNPM_ADD_AND_EXEC","".concat(x," ").concat(J),"".concat(q," --config ").concat(tf.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tE("PNPM_ADD_DEV_AND_EXEC",$,"".concat(z," --edit ").concat(tf.GIT_COMMIT_MSG," --config ").concat(tf.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tE("PNPM_ADD_DEV_AND_EXEC",Q,"".concat(Z," --config ").concat(tf.CYBERSKILL.LINT_STAGED_CONFIG))}};function tI(t){var n=t.uri,o=t.from,r=t.to,c=t.withComponent,i=t.withHOC,a=t.withHooks,l=t.withMutationFn,_=t.withRefetchFn;var u=s({},c&&{withComponent:c},i&&{withHOC:i},a&&{withHooks:a},l&&{withMutationFn:l},_&&{withRefetchFn:_});return{schema:n,documents:[o],generates:e({},r,s({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(u).length>0&&{config:u})),hooks:{afterAllFileWrite:[tp.ESLINT_FIX]}}}export{tI as createGraphqlCodegenConfig};
|
|
@@ -1 +1 @@
|
|
|
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 a,i;try{for(r=r.call(t);!(o=(a=r.next()).done);o=true){n.push(a.value);if(e&&n.length===e)break}}catch(t){c=true;i=t}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(c)throw i}}return n}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(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)||a()}function s(t){return r(t)||o(t)||_(t)||i()}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 E=Object.create;var p=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var O=function(t,e){for(var r in e)p(t,r,{get:e[r],enumerable:!0})},C=function(t,e,r,n){var o=true,c=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":f(e))=="object"||typeof e=="function")try{var i=function(){var o=l.value;!N.call(t,o)&&o!==r&&p(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)i()}catch(t){c=true;a=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}}return t};var
|
|
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 a,i;try{for(r=r.call(t);!(o=(a=r.next()).done);o=true){n.push(a.value);if(e&&n.length===e)break}}catch(t){c=true;i=t}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(c)throw i}}return n}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(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)||a()}function s(t){return r(t)||o(t)||_(t)||i()}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 E=Object.create;var p=Object.defineProperty;var I=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var O=function(t,e){for(var r in e)p(t,r,{get:e[r],enumerable:!0})},C=function(t,e,r,n){var o=true,c=false,a=undefined;if(e&&(typeof e==="undefined"?"undefined":f(e))=="object"||typeof e=="function")try{var i=function(){var o=l.value;!N.call(t,o)&&o!==r&&p(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)i()}catch(t){c=true;a=t}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(c){throw a}}}return t};var v=function(t,e,r){return r=t!=null?E(y(t)):{},C(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)},D=function(t){return C(p({},"__esModule",{value:!0}),t)};var T={};O(T,{createGraphqlCodegenConfig:function(){return tM}});module.exports=D(T);var g=v(require("process"),1);var A=v(require("boxen"),1),m=v(require("chalk"),1),S=require("child_process"),b=v(require("process"),1),h=v(require("util"),1);var P=process.env.DEBUG==="true";var M=v(require("node-fetch"),1);var L=v(require("fs"),1);var G=v(require("path"),1);function R(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=G).resolve.apply(n,[x].concat(s(e)))}function w(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=G).join.apply(n,s(e))}var j=v(require("node-persist"),1),K=v(require("os"),1),F=v(require("process"),1);var k=24*60*60*1e3;var q=h.promisify(S.exec),Y=m.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(tv," ").concat(V," ").concat(t):(e===null||e===void 0?void 0:e.isCurrentProject)?"".concat(tv," ").concat(tN," src/cli.ts ").concat(t):"".concat(tv," ").concat(ta," ").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(),V="@cyberskill/shared";var J="node_modules",$="dist",z="package.json",Q="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=w(x,J,V,$),ta="cyberskill",ti="eslint",tu="eslint",tl="vitest",ts="playwright",tf="vitest",t_="@commitlint/cli",tE="commitlint",tp="lint-staged",tI="lint-staged",td="typescript",ty="tsc",tN="tsx",tO="git",tC="pnpm",tv="pnpm exec",tD="simple-git-hooks",tT="simple-git-hooks",tg="@eslint/config-inspector",tA="eslint-config-inspector",tm="node-modules-inspector",tS="node-modules-inspector",tb={CYBERSKILL_DIRECTORY:tc,WORKING_DIRECTORY:x,TS_CONFIG:R(Z),GIT_IGNORE:R(tt),GIT_HOOK:R(tn),GIT_COMMIT_MSG:R(to),SIMPLE_GIT_HOOKS_JSON:R(te),PACKAGE_JSON:R(z),PACKAGE_LOCK_JSON:R(Q),PNPM_LOCK_YAML:R(tr),NODE_MODULES:R(J),CYBERSKILL:{LINT_STAGED_CONFIG:R("".concat(tc,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:R("".concat(tc,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:R("".concat(tc,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:R("".concat(tc,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:R("".concat(tc,"/configs/vitest/react/e2e.js"))}};function th(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],a=o[1];switch(t){case"PNPM_ADD_AND_EXEC":return B(W("".concat(tC," add ").concat(c," && ").concat(tv," ").concat(a)));case"PNPM_ADD_DEV_AND_EXEC":return B(W("".concat(tC," add -D ").concat(c," && ").concat(tv," ").concat(a)));case"RAW":return B(W(c))}}var tP={SIMPLE_GIT_HOOKS:th("PNPM_ADD_DEV_AND_EXEC",tD,tT),ESLINT_INSPECT:th("PNPM_ADD_DEV_AND_EXEC",tg,tA),NODE_MODULES_INSPECT:th("PNPM_ADD_DEV_AND_EXEC",tm,tS),ESLINT_CHECK:th("PNPM_ADD_DEV_AND_EXEC",ti,"".concat(tu," ").concat(tb.WORKING_DIRECTORY)),ESLINT_FIX:th("PNPM_ADD_DEV_AND_EXEC",ti,"".concat(tu," ").concat(tb.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:th("PNPM_ADD_AND_EXEC",td,"".concat(ty," -p ").concat(tb.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:th("RAW","".concat(tO," config core.hooksPath ").concat(tb.GIT_HOOK)),BUILD:th("RAW","".concat(tC," run build")),STAGE_BUILD_DIRECTORY:th("RAW","".concat(tO," add ").concat($)),PNPM_INSTALL_STANDARD:th("RAW","".concat(tC," install")),PNPM_INSTALL_LEGACY:th("RAW","".concat(tC," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:th("RAW","".concat(tC," install --force")),CYBERSKILL:{TEST_UNIT:th("PNPM_ADD_AND_EXEC",tl,"".concat(tf," --config ").concat(tb.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:th("PNPM_ADD_AND_EXEC","".concat(tl," ").concat(ts),"".concat(tf," --config ").concat(tb.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:th("PNPM_ADD_DEV_AND_EXEC",t_,"".concat(tE," --edit ").concat(tb.GIT_COMMIT_MSG," --config ").concat(tb.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:th("PNPM_ADD_DEV_AND_EXEC",tp,"".concat(tI," --config ").concat(tb.CYBERSKILL.LINT_STAGED_CONFIG))}};function tM(t){var e=t.uri,r=t.from,o=t.to,c=t.withComponent,a=t.withHOC,i=t.withHooks,l=t.withMutationFn,s=t.withRefetchFn;var f=u({},c&&{withComponent:c},a&&{withHOC:a},i&&{withHooks:i},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 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)||f(t,o)||i()}function _(t){return o(t)||r(t)||f(t)||a()}function u(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function f(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 N}from"node:child_process";import*as
|
|
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)||f(t,o)||i()}function _(t){return o(t)||r(t)||f(t)||a()}function u(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function f(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 N}from"node:child_process";import*as m from"node:util";var T=process.env.DEBUG==="true";import D from"node-fetch";import*as C 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=C).resolve.apply(e,[L].concat(_(n)))}function O(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=C).join.apply(e,_(n))}import d from"node-persist";var A=24*60*60*1e3;var S=m.promisify(N),g=I.gray,h=I.blue;function P(t){return{raw:!0,cmd:t}}function v(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tc," ").concat(M," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tc," ").concat(to," src/cli.ts ").concat(t):"".concat(tc," ").concat(H," ").concat(t)}function b(t,n){return typeof t=="function"?v(t(n),n):(typeof t==="undefined"?"undefined":u(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?v(t,n):t}var L=E.env.INIT_CWD||E.cwd(),M="@cyberskill/shared";var G="node_modules",R="dist",w="package.json",j="package-lock.json",K="tsconfig.json",F=".gitignore",k=".simple-git-hooks.json",Y="pnpm-lock.yaml",X=".git/hooks/",U=".git/COMMIT_EDITMSG",W=O(L,G,M,R),H="cyberskill",B="eslint",V="eslint",x="vitest",J="playwright",q="vitest",$="@commitlint/cli",z="commitlint",Q="lint-staged",Z="lint-staged",tt="typescript",tn="tsc",to="tsx",te="git",tr="pnpm",tc="pnpm exec",ti="simple-git-hooks",ta="simple-git-hooks",ts="@eslint/config-inspector",tl="eslint-config-inspector",t_="node-modules-inspector",tu="node-modules-inspector",tf={CYBERSKILL_DIRECTORY:W,WORKING_DIRECTORY:L,TS_CONFIG:y(K),GIT_IGNORE:y(F),GIT_HOOK:y(X),GIT_COMMIT_MSG:y(U),SIMPLE_GIT_HOOKS_JSON:y(k),PACKAGE_JSON:y(w),PACKAGE_LOCK_JSON:y(j),PNPM_LOCK_YAML:y(Y),NODE_MODULES:y(G),CYBERSKILL:{LINT_STAGED_CONFIG:y("".concat(W,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:y("".concat(W,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:y("".concat(W,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:y("".concat(W,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:y("".concat(W,"/configs/vitest/react/e2e.js"))}};function tE(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 b(P("".concat(tr," add ").concat(c," && ").concat(tc," ").concat(i)));case"PNPM_ADD_DEV_AND_EXEC":return b(P("".concat(tr," add -D ").concat(c," && ").concat(tc," ").concat(i)));case"RAW":return b(P(c))}}var tp={SIMPLE_GIT_HOOKS:tE("PNPM_ADD_DEV_AND_EXEC",ti,ta),ESLINT_INSPECT:tE("PNPM_ADD_DEV_AND_EXEC",ts,tl),NODE_MODULES_INSPECT:tE("PNPM_ADD_DEV_AND_EXEC",t_,tu),ESLINT_CHECK:tE("PNPM_ADD_DEV_AND_EXEC",B,"".concat(V," ").concat(tf.WORKING_DIRECTORY)),ESLINT_FIX:tE("PNPM_ADD_DEV_AND_EXEC",B,"".concat(V," ").concat(tf.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tE("PNPM_ADD_AND_EXEC",tt,"".concat(tn," -p ").concat(tf.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tE("RAW","".concat(te," config core.hooksPath ").concat(tf.GIT_HOOK)),BUILD:tE("RAW","".concat(tr," run build")),STAGE_BUILD_DIRECTORY:tE("RAW","".concat(te," add ").concat(R)),PNPM_INSTALL_STANDARD:tE("RAW","".concat(tr," install")),PNPM_INSTALL_LEGACY:tE("RAW","".concat(tr," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tE("RAW","".concat(tr," install --force")),CYBERSKILL:{TEST_UNIT:tE("PNPM_ADD_AND_EXEC",x,"".concat(q," --config ").concat(tf.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tE("PNPM_ADD_AND_EXEC","".concat(x," ").concat(J),"".concat(q," --config ").concat(tf.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tE("PNPM_ADD_DEV_AND_EXEC",$,"".concat(z," --edit ").concat(tf.GIT_COMMIT_MSG," --config ").concat(tf.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tE("PNPM_ADD_DEV_AND_EXEC",Q,"".concat(Z," --config ").concat(tf.CYBERSKILL.LINT_STAGED_CONFIG))}};function tI(t){var n=t.uri,o=t.from,r=t.to,c=t.withComponent,i=t.withHOC,a=t.withHooks,l=t.withMutationFn,_=t.withRefetchFn;var u=s({},c&&{withComponent:c},i&&{withHOC:i},a&&{withHooks:a},l&&{withMutationFn:l},_&&{withRefetchFn:_});return{schema:n,documents:[o],generates:e({},r,s({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(u).length>0&&{config:u})),hooks:{afterAllFileWrite:[tp.ESLINT_FIX]}}}export{tI as createGraphqlCodegenConfig};
|