@cyberskill/shared 1.58.0 → 1.59.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 +87 -11
- package/dist/_tsup-dts-rollup.d.ts +87 -11
- 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 -1
- package/dist/configs/index.js +1 -1
- package/dist/configs/vitest/react/unit.cjs +1 -1
- package/dist/configs/vitest/react/unit.js +1 -1
- package/dist/constants/common.cjs +1 -1
- package/dist/constants/common.d.cts +3 -0
- package/dist/constants/common.d.ts +3 -0
- package/dist/constants/common.js +1 -1
- package/dist/constants/index.cjs +1 -1
- package/dist/constants/index.d.cts +3 -0
- package/dist/constants/index.d.ts +3 -0
- package/dist/constants/index.js +1 -1
- package/dist/constants/path.cjs +1 -1
- package/dist/constants/path.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/react/apollo-client.cjs +1 -1
- package/dist/react/apollo-client.js +1 -1
- package/dist/react/apollo-error.cjs +1 -0
- package/dist/react/apollo-error.d.cts +6 -0
- package/dist/react/apollo-error.d.ts +6 -0
- package/dist/react/apollo-error.js +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.cts +6 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.js +1 -1
- package/dist/typescript/apollo-error.cjs +1 -0
- package/dist/typescript/apollo-error.d.cts +2 -0
- package/dist/typescript/apollo-error.d.ts +2 -0
- package/dist/typescript/apollo-error.js +0 -0
- 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/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 +8 -5
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)||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();
|
|
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",I=process.env.NODE_ENV!=="production",S=process.env.GRAPHQL_URI_DEFAULT||"/graphql";import O from"node:process";import N from"boxen";import T from"chalk";import{exec as w}from"node:child_process";import C from"node:process";import*as P from"node:util";import D from"node-fetch";import*as L from"node:fs";var A=function(e){return L.existsSync(e)};function R(e,t){var n=L.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 G(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);L.writeFileSync(e,i,"utf-8")}function j(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);L.appendFileSync(e,i,"utf-8")}function M(e){e.forEach(function(e){A(e)&&L.rmSync(e,{recursive:!0,force:!0})})}import*as k from"node:path";function F(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++){t[n]=arguments[n]}var r;return(r=k).resolve.apply(r,[eS].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=k).join.apply(r,h(t))}import x from"node-persist";import U from"node:os";import B from"node:process";function Y(){return B.env.CYBERSKILL_STORAGE_DIR||K(U.homedir(),eN)}function J(){return V.apply(this,arguments)}function V(){V=o(function(){var e;return m(this,function(t){switch(t.label){case 0:e=x.defaultInstance;if(e)return[3,2];return[4,x.init({dir:Y(),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 V.apply(this,arguments)}var W={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,J()];case 1:r.sent();return[4,x.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,J()];case 1:r.sent();return[4,x.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,J()];case 1:n.sent();return[4,x.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,J()];case 1:n.sent();return[4,x.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(Y()," (key: ").concat(e,")")]}catch(e){return[2,(console.error("❌ [Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var H=24*60*60*1e3;function X(e){var t=K(eS,eC);if(A(t))try{var n=R(t,{asJson:!0});if(n.name===e)return{path:t,file:n,isCurrentProject:!0}}catch(e){ec.warning("Failed to read local package.json: ".concat(e.message))}var r=K(eS,eT,e,eC);if(A(r))try{var o=R(r,{asJson:!0});if(o.name===e)return{path:r,file:o,isCurrentProject:!1}}catch(t){ec.warning("Failed to read node_modules package.json for ".concat(e,": ").concat(t.message))}return!1}function $(e){return z.apply(this,arguments)}function z(){z=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,W.get(n)];case 1:o=p.sent();return[4,W.get(r)];case 2:i=p.sent(),c=o&&Date.now()-o.timestamp<H;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,D("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,W.set(n,{version:u,timestamp:Date.now()})];case 6:p.sent();return[4,W.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(ec.error("Error fetching latest version for ".concat(e,": ").concat(l.message)),o)return[2,(ec.warning("Falling back to cached version for ".concat(e,": ").concat(o.version)),o.version)];throw l;case 9:return[2]}})});return z.apply(this,arguments)}function q(e){return Q.apply(this,arguments)}function Q(){Q=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=X(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,$(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,(ec.error('Error checking package "'.concat(e,'": ').concat(i.message)),t)];case 7:return[2]}})});return Q.apply(this,arguments)}var Z=P.promisify(w),ee=T.gray,et=T.blue;function en(){return ee("[".concat(new Date().toLocaleTimeString(),"]"))}function er(e){var t=T[e];return typeof t=="function"?t:T.green}function eo(e,t,n,r){var o=er(t);console.log("".concat(en()," ").concat(o("".concat(n," ").concat(e))," ").concat(r))}function ei(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=er(o),h=er(p);if(typeof t=="string"){console.log(N(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(en()," ").concat(d("File:")," ").concat(et("".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(N(h(d("".concat(e,": ").concat(t.length))),{padding:c,margin:a,borderStyle:l,borderColor:o})),console.log(ee("─".repeat(40))))}var ec={success:function(e){return eo("SUCCESS","green","✔",e)},error:function(e){return eo("ERROR","red","✖",e)},warning:function(e){return eo("WARNING","yellow","⚠",e)},info:function(e){return eo("INFO","blue","ℹ",e)},printBoxedLog:ei};function es(e){return"error_list:".concat(e)}function ea(e){return eu.apply(this,arguments)}function eu(){eu=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=es(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,W.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,W.getLogLink(n)];case 1:e=t.sent();e&&ec.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:r=i.sent();ec.error("Failed to save errors: ".concat(r.message));return[3,4];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,W.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,W.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,(ec.error("Failed to retrieve stored errors: ".concat(n.message)),[])];case 4:return[2]}})});return ef.apply(this,arguments)}function ep(){return ed.apply(this,arguments)}function ed(){ed=o(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,W.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 W.remove(e)}))];case 2:r.sent();return[3,4];case 3:n=r.sent();ec.error("Failed to clear error lists: ".concat(n.message));return[3,4];case 4:return[2]}})});return ed.apply(this,arguments)}function eh(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&&ea(t),n.length&&b&&(ec.warning("Unmatched lines:"),n.forEach(function(e){return console.log(" ".concat(e))}))}function eg(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&&ea(n)}catch(t){eh(e)}}function ey(e){return em.apply(this,arguments)}function em(){em=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]:eg;n=new AbortController;C.on("SIGINT",function(){ec.warning("Process interrupted. Terminating..."),n.abort(),C.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,Z(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&&ec.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return em.apply(this,arguments)}function ev(e){return{raw:!0,cmd:e}}function eE(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eQ," ").concat(eO," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eQ," ").concat(e$," src/cli.ts ").concat(e):"".concat(eQ," ").concat(ek," ").concat(e)}function e_(e,t){return typeof e=="function"?eE(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"?eE(e,t):e}function eb(e){return eI.apply(this,arguments)}function eI(){eI=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,q(eO)];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,e_(r,i)]}))]}})});return eI.apply(this,arguments)}var eS=O.env.INIT_CWD||O.cwd(),eO="@cyberskill/shared",eN=".cyberskill-storage",eT="node_modules",ew="dist",eC="package.json",eP="package-lock.json",eD="tsconfig.json",eL=".gitignore",eA=".simple-git-hooks.json",eR="pnpm-lock.yaml",eG=".git/hooks/",ej=".git/COMMIT_EDITMSG",eM=K(eS,eT,eO,ew),ek="cyberskill",eF="eslint",eK="eslint",ex="vitest",eU="playwright",eB="vitest",eY="@commitlint/cli",eJ="commitlint",eV="lint-staged",eW="lint-staged",eH="typescript",eX="tsc",e$="tsx",ez="git",eq="pnpm",eQ="pnpm exec",eZ="simple-git-hooks",e0="simple-git-hooks",e2="@eslint/config-inspector",e4="eslint-config-inspector",e1="node-modules-inspector",e3="node-modules-inspector",e5={CYBERSKILL_DIRECTORY:eM,WORKING_DIRECTORY:eS,TS_CONFIG:F(eD),GIT_IGNORE:F(eL),GIT_HOOK:F(eG),GIT_COMMIT_MSG:F(ej),SIMPLE_GIT_HOOKS_JSON:F(eA),PACKAGE_JSON:F(eC),PACKAGE_LOCK_JSON:F(eP),PNPM_LOCK_YAML:F(eR),NODE_MODULES:F(eT),CYBERSKILL:{LINT_STAGED_CONFIG:F("".concat(eM,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:F("".concat(eM,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:F("".concat(eM,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:F("".concat(eM,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:F("".concat(eM,"/configs/vitest/react/e2e.js"))}};function e6(e){var t=e.isCurrentProject;return l({"pre-commit":eW,"commit-msg":eJ},t&&{"pre-push":ev("".concat(ez," pull"))})}function e8(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],s=e==="RAW"?!0:A(K(e5.NODE_MODULES,i));switch(e){case"PNPM_ADD_AND_EXEC":return e_(ev("".concat(s?"":"".concat(eq," add ").concat(i," && ")).concat(eQ," ").concat(c)));case"PNPM_ADD_DEV_AND_EXEC":return e_(ev("".concat(s?"":"".concat(eq," add -D ").concat(i," && ")).concat(eQ," ").concat(c)));case"RAW":return e_(ev(i))}}var e7={SIMPLE_GIT_HOOKS:e8("PNPM_ADD_DEV_AND_EXEC",eZ,e0),ESLINT_INSPECT:e8("PNPM_ADD_DEV_AND_EXEC",e2,e4),NODE_MODULES_INSPECT:e8("PNPM_ADD_DEV_AND_EXEC",e1,e3),ESLINT_CHECK:e8("PNPM_ADD_DEV_AND_EXEC",eF,"".concat(eK," ").concat(e5.WORKING_DIRECTORY)),ESLINT_FIX:e8("PNPM_ADD_DEV_AND_EXEC",eF,"".concat(eK," ").concat(e5.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:e8("PNPM_ADD_AND_EXEC",eH,"".concat(eX," -p ").concat(e5.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:e8("RAW","".concat(ez," config core.hooksPath ").concat(e5.GIT_HOOK)),BUILD:e8("RAW","".concat(eq," run build")),STAGE_BUILD_DIRECTORY:e8("RAW","".concat(ez," add ").concat(ew)),PNPM_INSTALL_STANDARD:e8("RAW","".concat(eq," install")),PNPM_INSTALL_LEGACY:e8("RAW","".concat(eq," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:e8("RAW","".concat(eq," install --force")),CYBERSKILL:{TEST_UNIT:e8("PNPM_ADD_AND_EXEC",ex,"".concat(eB," --config ").concat(e5.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:e8("PNPM_ADD_AND_EXEC","".concat(ex," ").concat(eU),"".concat(eB," --config ").concat(e5.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:e8("PNPM_ADD_DEV_AND_EXEC",eY,"".concat(eJ," --edit ").concat(e5.GIT_COMMIT_MSG," --config ").concat(e5.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:e8("PNPM_ADD_DEV_AND_EXEC",eV,"".concat(eW," --config ").concat(e5.CYBERSKILL.LINT_STAGED_CONFIG))}};function e9(e,t){return te.apply(this,arguments)}function te(){te=o(function(e,t){return m(this,function(n){switch(n.label){case 0:ec.info("".concat(e,"...")),b&&ec.info("Executing command: ".concat(t));return[4,ey(t)];case 1:n.sent(),ec.success("".concat(e," completed successfully."));return[2]}})});return te.apply(this,arguments)}function tt(){return tn.apply(this,arguments)}function tn(){tn=o(function(){var e;return m(this,function(t){switch(t.label){case 0:if(!A(e5.TS_CONFIG))return[3,2];return[4,e9("Performing TypeScript validation",e7.TYPESCRIPT_CHECK)];case 1:e=t.sent();return[3,3];case 2:e=ec.warning("No TypeScript configuration found. Skipping type check.");t.label=3;case 3:e;return[2]}})});return tn.apply(this,arguments)}function tr(){return to.apply(this,arguments)}function to(){to=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,e9("Running ESLint with auto-fix",e7.ESLINT_FIX)];case 1:t=r.sent();return[3,4];case 2:return[4,e9("Running ESLint check",e7.ESLINT_CHECK)];case 3:t=r.sent();r.label=4;case 4:t;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: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?ec.printBoxedLog("✔ NO ISSUES FOUND","",{color:"green"}):(ec.printBoxedLog("⚠ Warnings",n,{color:"yellow"}),ec.printBoxedLog("✖ Errors",t,{color:"red"}));return[2]}})});return tc.apply(this,arguments)}function ts(){return ta.apply(this,arguments)}function ta(){ta=o(function(){var e,t,n;return m(this,function(r){switch(r.label){case 0:return[4,ep()];case 1:r.sent();return[4,q(eO)];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,e9("Building package: ".concat(eO),e7.BUILD)];case 4:r.sent();return[4,e9("Staging build artifacts",e7.STAGE_BUILD_DIRECTORY)];case 5:r.sent();return[3,7];case 6:n=r.sent();throw ec.error("Error building and staging ".concat(eO,": ").concat(n.message)),n;case 7:return[4,e9("Executing lint-staged",e7.CYBERSKILL.LINT_STAGED)];case 8:r.sent(),ti();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,e9("Inspecting ESLint configuration",e7.ESLINT_INSPECT)];case 1:e.sent();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,ep()];case 1:e.sent();return[4,Promise.all([tt(),tr()])];case 2:e.sent(),ti();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,ep()];case 1:e.sent();return[4,Promise.all([tt(),tr(!0)])];case 2:e.sent(),ti();return[2]}})});return th.apply(this,arguments)}function tg(){return ty.apply(this,arguments)}function ty(){ty=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,ep()];case 1:e.sent();return[4,e9("Validating commit message",e7.CYBERSKILL.COMMIT_LINT)];case 2:e.sent(),ti();return[2]}})});return ty.apply(this,arguments)}function tm(){return tv.apply(this,arguments)}function tv(){tv=o(function(){var e,t;return m(this,function(n){switch(n.label){case 0:return[4,e9("Configuring Git hooks",e7.CONFIGURE_GIT_HOOK)];case 1:n.sent(),M([e5.GIT_HOOK]);return[4,eb(e6)];case 2:e=n.sent();G(e5.SIMPLE_GIT_HOOKS_JSON,e,{isJson:!0});t="\n".concat(eA,"\n");A(e5.GIT_IGNORE)?R(e5.GIT_IGNORE).split("\n").includes(eA)||j(e5.GIT_IGNORE,t):G(e5.GIT_IGNORE,t);return[4,e9("Installing simple-git-hooks",e7.SIMPLE_GIT_HOOKS)];case 3:n.sent();return[2]}})});return tv.apply(this,arguments)}function tE(){return t_.apply(this,arguments)}function t_(){t_=o(function(){var e,t,n,r,o,i,c,s,a,u,l;return m(this,function(f){switch(f.label){case 0:e=[{command:e7.PNPM_INSTALL_STANDARD,message:"Installing dependencies (standard)"},{command:e7.PNPM_INSTALL_LEGACY,message:"Retrying with legacy peer dependencies"},{command:e7.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,e9("".concat(a," using: ").concat(s),s)];case 4:f.sent();return[2];case 5:u=f.sent();ec.warning("Installation attempt failed: ".concat(s)),ec.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 t_.apply(this,arguments)}function tb(e){return tI.apply(this,arguments)}function tI(){tI=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,q(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)),G(n,o,{isJson:!0});return[4,tE()];case 2:s.sent();return[4,td()];case 3:s.sent();return[3,5];case 4:c=s.sent();throw ec.error('Failed to update "'.concat(e,'": ').concat(c.message)),c;case 5:return[2]}})});return tI.apply(this,arguments)}function tS(){return tO.apply(this,arguments)}function tO(){tO=o(function(){var e,t,n,r,o,i,c;return m(this,function(s){switch(s.label){case 0:if(!A(e5.PACKAGE_JSON)){ec.error("package.json not found. Aborting setup.");return[2]}s.label=1;case 1:s.trys.push([1,7,,8]);return[4,q(eO)];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=ec.success("Cyberskill package is already up to date.");return[3,5];case 3:return[4,tb(eO)];case 4:i=s.sent();s.label=5;case 5:i;return[4,tm()];case 6:s.sent();return[3,8];case 7:c=s.sent();throw ec.error("Project setup failed: ".concat(c.message)),c;case 8: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:M([e5.NODE_MODULES,e5.PNPM_LOCK_YAML]);return[4,tE()];case 1:e.sent();return[4,tm()];case 2: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,e9("Inspecting project dependencies",e7.NODE_MODULES_INSPECT)];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,e9("Running unit tests",e7.CYBERSKILL.TEST_UNIT)];case 1:e.sent();return[2]}})});return tD.apply(this,arguments)}function tL(){return tA.apply(this,arguments)}function tA(){tA=o(function(){return m(this,function(e){switch(e.label){case 0:return[4,e9("Running end-to-end tests",e7.CYBERSKILL.TEST_E2E)];case 1:e.sent();return[2]}})});return tA.apply(this,arguments)}_(E(v.argv)).scriptName(ek).usage("$0 <command> [options]").command("lint","Check code for linting issues",tf).command("lint:fix","Fix linting issues automatically",td).command("lint:inspect","View active ESLint configuration",tu).command("lint-staged","Run lint checks on staged files",ts).command("commitlint","Validate commit message format",tg).command("setup","Initialize project setup and dependencies",tS).command("reset","Reset the project and reinstall dependencies",tN).command("inspect","Analyze installed project dependencies",tw).command("test:unit","Run unit test suite",tP).command("test:e2e","Run end-to-end test suite",tL).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
|
|
1
|
+
"use strict";function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function r(t,e,n){if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}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 n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var r=[];var o=true;var c=false;var a,i;try{for(n=n.call(t);!(o=(a=n.next()).done);o=true){r.push(a.value);if(e&&r.length===e)break}}catch(t){c=true;i=t}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(c)throw i}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var o=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}o.forEach(function(e){r(t,e,n[e])})}return t}function l(t,n){return e(t)||c(t,n)||_(t,n)||a()}function s(t){return n(t)||o(t)||_(t)||i()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function _(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}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 n in e)p(t,n,{get:e[n],enumerable:!0})},D=function(t,e,n,r){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!==n&&p(t,o,{get:function(){return e[o]},enumerable:!(r=I(e,o))||r.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,n){return n=t!=null?E(y(t)):{},D(e||!t||!t.__esModule?p(n,"default",{value:t,enumerable:!0}):n,t)},C=function(t){return D(p({},"__esModule",{value:!0}),t)};var T={};O(T,{createGraphqlCodegenConfig:function(){return tR}});module.exports=C(T);var A=v(require("process"),1);var g=v(require("boxen"),1),S=v(require("chalk"),1),m=require("child_process"),h=v(require("process"),1),P=v(require("util"),1);var b=process.env.DEBUG==="true",L=process.env.NODE_ENV!=="production",M=process.env.GRAPHQL_URI_DEFAULT||"/graphql";var G=v(require("node-fetch"),1);var R=v(require("fs"),1),w=function(t){return R.existsSync(t)};var j=v(require("path"),1);function F(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var r;return(r=j).resolve.apply(r,[Q].concat(s(e)))}function K(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var r;return(r=j).join.apply(r,s(e))}var k=v(require("node-persist"),1),q=v(require("os"),1),U=v(require("process"),1);var Y=24*60*60*1e3;var X=P.promisify(m.exec),W=S.default,H=W.gray,x=W.blue;function B(t){return{raw:!0,cmd:t}}function V(t,e){return(e===null||e===void 0?void 0:e.isRemote)?"".concat(tA," ").concat($," ").concat(t):(e===null||e===void 0?void 0:e.isCurrentProject)?"".concat(tA," ").concat(tv," src/cli.ts ").concat(t):"".concat(tA," ").concat(tl," ").concat(t)}function J(t,e){return typeof t=="function"?V(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"?V(t,e):t}var Q=A.default.env.INIT_CWD||A.default.cwd(),$="@cyberskill/shared";var z="node_modules",Z="dist",tt="package.json",te="package-lock.json",tn="tsconfig.json",tr=".gitignore",to=".simple-git-hooks.json",tc="pnpm-lock.yaml",ta=".git/hooks/",ti=".git/COMMIT_EDITMSG",tu=K(Q,z,$,Z),tl="cyberskill",ts="eslint",tf="eslint",t_="vitest",tE="playwright",tp="vitest",tI="@commitlint/cli",td="commitlint",ty="lint-staged",tN="lint-staged",tO="typescript",tD="tsc",tv="tsx",tC="git",tT="pnpm",tA="pnpm exec",tg="simple-git-hooks",tS="simple-git-hooks",tm="@eslint/config-inspector",th="eslint-config-inspector",tP="node-modules-inspector",tb="node-modules-inspector",tL={CYBERSKILL_DIRECTORY:tu,WORKING_DIRECTORY:Q,TS_CONFIG:F(tn),GIT_IGNORE:F(tr),GIT_HOOK:F(ta),GIT_COMMIT_MSG:F(ti),SIMPLE_GIT_HOOKS_JSON:F(to),PACKAGE_JSON:F(tt),PACKAGE_LOCK_JSON:F(te),PNPM_LOCK_YAML:F(tc),NODE_MODULES:F(z),CYBERSKILL:{LINT_STAGED_CONFIG:F("".concat(tu,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:F("".concat(tu,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:F("".concat(tu,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:F("".concat(tu,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:F("".concat(tu,"/configs/vitest/react/e2e.js"))}};function tM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}var o=l(n,2),c=o[0],a=o[1],i=t==="RAW"?!0:w(K(tL.NODE_MODULES,c));switch(t){case"PNPM_ADD_AND_EXEC":return J(B("".concat(i?"":"".concat(tT," add ").concat(c," && ")).concat(tA," ").concat(a)));case"PNPM_ADD_DEV_AND_EXEC":return J(B("".concat(i?"":"".concat(tT," add -D ").concat(c," && ")).concat(tA," ").concat(a)));case"RAW":return J(B(c))}}var tG={SIMPLE_GIT_HOOKS:tM("PNPM_ADD_DEV_AND_EXEC",tg,tS),ESLINT_INSPECT:tM("PNPM_ADD_DEV_AND_EXEC",tm,th),NODE_MODULES_INSPECT:tM("PNPM_ADD_DEV_AND_EXEC",tP,tb),ESLINT_CHECK:tM("PNPM_ADD_DEV_AND_EXEC",ts,"".concat(tf," ").concat(tL.WORKING_DIRECTORY)),ESLINT_FIX:tM("PNPM_ADD_DEV_AND_EXEC",ts,"".concat(tf," ").concat(tL.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tM("PNPM_ADD_AND_EXEC",tO,"".concat(tD," -p ").concat(tL.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tM("RAW","".concat(tC," config core.hooksPath ").concat(tL.GIT_HOOK)),BUILD:tM("RAW","".concat(tT," run build")),STAGE_BUILD_DIRECTORY:tM("RAW","".concat(tC," add ").concat(Z)),PNPM_INSTALL_STANDARD:tM("RAW","".concat(tT," install")),PNPM_INSTALL_LEGACY:tM("RAW","".concat(tT," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tM("RAW","".concat(tT," install --force")),CYBERSKILL:{TEST_UNIT:tM("PNPM_ADD_AND_EXEC",t_,"".concat(tp," --config ").concat(tL.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tM("PNPM_ADD_AND_EXEC","".concat(t_," ").concat(tE),"".concat(tp," --config ").concat(tL.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tM("PNPM_ADD_DEV_AND_EXEC",tI,"".concat(td," --edit ").concat(tL.GIT_COMMIT_MSG," --config ").concat(tL.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tM("PNPM_ADD_DEV_AND_EXEC",ty,"".concat(tN," --config ").concat(tL.CYBERSKILL.LINT_STAGED_CONFIG))}};function tR(t){var e=t.uri,n=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:[n],generates:r({},o,u({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[tG.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 D from"node:util";var m=process.env.DEBUG==="true",T=process.env.NODE_ENV!=="production",C=process.env.GRAPHQL_URI_DEFAULT||"/graphql";import O from"node-fetch";import*as A from"node:fs";var d=function(t){return A.existsSync(t)};import*as y from"node:path";function S(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=y).resolve.apply(e,[w].concat(_(n)))}function g(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=y).join.apply(e,_(n))}import h from"node-persist";var P=24*60*60*1e3;var v=D.promisify(N),L=I.gray,b=I.blue;function M(t){return{raw:!0,cmd:t}}function R(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tl," ").concat(j," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tl," ").concat(ti," src/cli.ts ").concat(t):"".concat(tl," ").concat(J," ").concat(t)}function G(t,n){return typeof t=="function"?R(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"?R(t,n):t}var w=E.env.INIT_CWD||E.cwd(),j="@cyberskill/shared";var F="node_modules",K="dist",k="package.json",U="package-lock.json",Y="tsconfig.json",X=".gitignore",W=".simple-git-hooks.json",H="pnpm-lock.yaml",B=".git/hooks/",V=".git/COMMIT_EDITMSG",x=g(w,F,j,K),J="cyberskill",q="eslint",Q="eslint",$="vitest",z="playwright",Z="vitest",tt="@commitlint/cli",tn="commitlint",to="lint-staged",te="lint-staged",tr="typescript",tc="tsc",ti="tsx",ta="git",ts="pnpm",tl="pnpm exec",t_="simple-git-hooks",tu="simple-git-hooks",tf="@eslint/config-inspector",tE="eslint-config-inspector",tp="node-modules-inspector",tI="node-modules-inspector",tN={CYBERSKILL_DIRECTORY:x,WORKING_DIRECTORY:w,TS_CONFIG:S(Y),GIT_IGNORE:S(X),GIT_HOOK:S(B),GIT_COMMIT_MSG:S(V),SIMPLE_GIT_HOOKS_JSON:S(W),PACKAGE_JSON:S(k),PACKAGE_LOCK_JSON:S(U),PNPM_LOCK_YAML:S(H),NODE_MODULES:S(F),CYBERSKILL:{LINT_STAGED_CONFIG:S("".concat(x,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:S("".concat(x,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:S("".concat(x,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:S("".concat(x,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:S("".concat(x,"/configs/vitest/react/e2e.js"))}};function tD(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],a=t==="RAW"?!0:d(g(tN.NODE_MODULES,c));switch(t){case"PNPM_ADD_AND_EXEC":return G(M("".concat(a?"":"".concat(ts," add ").concat(c," && ")).concat(tl," ").concat(i)));case"PNPM_ADD_DEV_AND_EXEC":return G(M("".concat(a?"":"".concat(ts," add -D ").concat(c," && ")).concat(tl," ").concat(i)));case"RAW":return G(M(c))}}var tm={SIMPLE_GIT_HOOKS:tD("PNPM_ADD_DEV_AND_EXEC",t_,tu),ESLINT_INSPECT:tD("PNPM_ADD_DEV_AND_EXEC",tf,tE),NODE_MODULES_INSPECT:tD("PNPM_ADD_DEV_AND_EXEC",tp,tI),ESLINT_CHECK:tD("PNPM_ADD_DEV_AND_EXEC",q,"".concat(Q," ").concat(tN.WORKING_DIRECTORY)),ESLINT_FIX:tD("PNPM_ADD_DEV_AND_EXEC",q,"".concat(Q," ").concat(tN.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tD("PNPM_ADD_AND_EXEC",tr,"".concat(tc," -p ").concat(tN.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tD("RAW","".concat(ta," config core.hooksPath ").concat(tN.GIT_HOOK)),BUILD:tD("RAW","".concat(ts," run build")),STAGE_BUILD_DIRECTORY:tD("RAW","".concat(ta," add ").concat(K)),PNPM_INSTALL_STANDARD:tD("RAW","".concat(ts," install")),PNPM_INSTALL_LEGACY:tD("RAW","".concat(ts," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tD("RAW","".concat(ts," install --force")),CYBERSKILL:{TEST_UNIT:tD("PNPM_ADD_AND_EXEC",$,"".concat(Z," --config ").concat(tN.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tD("PNPM_ADD_AND_EXEC","".concat($," ").concat(z),"".concat(Z," --config ").concat(tN.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tD("PNPM_ADD_DEV_AND_EXEC",tt,"".concat(tn," --edit ").concat(tN.GIT_COMMIT_MSG," --config ").concat(tN.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tD("PNPM_ADD_DEV_AND_EXEC",to,"".concat(te," --config ").concat(tN.CYBERSKILL.LINT_STAGED_CONFIG))}};function tT(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:[tm.ESLINT_FIX]}}}export{tT as createGraphqlCodegenConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function t(t,e){if(e==null||e>t.length)e=t.length;for(var
|
|
1
|
+
"use strict";function t(t,e){if(e==null||e>t.length)e=t.length;for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function e(t){if(Array.isArray(t))return t}function n(e){if(Array.isArray(e))return t(e)}function r(t,e,n){if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}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 n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var r=[];var o=true;var c=false;var a,i;try{for(n=n.call(t);!(o=(a=n.next()).done);o=true){r.push(a.value);if(e&&r.length===e)break}}catch(t){c=true;i=t}finally{try{if(!o&&n["return"]!=null)n["return"]()}finally{if(c)throw i}}return r}function a(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};var o=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}o.forEach(function(e){r(t,e,n[e])})}return t}function l(t,n){return e(t)||c(t,n)||_(t,n)||a()}function s(t){return n(t)||o(t)||_(t)||i()}function f(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function _(e,n){if(!e)return;if(typeof e==="string")return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(r);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}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 n in e)p(t,n,{get:e[n],enumerable:!0})},D=function(t,e,n,r){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!==n&&p(t,o,{get:function(){return e[o]},enumerable:!(r=I(e,o))||r.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,n){return n=t!=null?E(y(t)):{},D(e||!t||!t.__esModule?p(n,"default",{value:t,enumerable:!0}):n,t)},C=function(t){return D(p({},"__esModule",{value:!0}),t)};var T={};O(T,{createGraphqlCodegenConfig:function(){return tR}});module.exports=C(T);var A=v(require("process"),1);var g=v(require("boxen"),1),S=v(require("chalk"),1),m=require("child_process"),h=v(require("process"),1),P=v(require("util"),1);var b=process.env.DEBUG==="true",L=process.env.NODE_ENV!=="production",M=process.env.GRAPHQL_URI_DEFAULT||"/graphql";var G=v(require("node-fetch"),1);var R=v(require("fs"),1),w=function(t){return R.existsSync(t)};var j=v(require("path"),1);function F(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var r;return(r=j).resolve.apply(r,[Q].concat(s(e)))}function K(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++){e[n]=arguments[n]}var r;return(r=j).join.apply(r,s(e))}var k=v(require("node-persist"),1),q=v(require("os"),1),U=v(require("process"),1);var Y=24*60*60*1e3;var X=P.promisify(m.exec),W=S.default,H=W.gray,x=W.blue;function B(t){return{raw:!0,cmd:t}}function V(t,e){return(e===null||e===void 0?void 0:e.isRemote)?"".concat(tA," ").concat($," ").concat(t):(e===null||e===void 0?void 0:e.isCurrentProject)?"".concat(tA," ").concat(tv," src/cli.ts ").concat(t):"".concat(tA," ").concat(tl," ").concat(t)}function J(t,e){return typeof t=="function"?V(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"?V(t,e):t}var Q=A.default.env.INIT_CWD||A.default.cwd(),$="@cyberskill/shared";var z="node_modules",Z="dist",tt="package.json",te="package-lock.json",tn="tsconfig.json",tr=".gitignore",to=".simple-git-hooks.json",tc="pnpm-lock.yaml",ta=".git/hooks/",ti=".git/COMMIT_EDITMSG",tu=K(Q,z,$,Z),tl="cyberskill",ts="eslint",tf="eslint",t_="vitest",tE="playwright",tp="vitest",tI="@commitlint/cli",td="commitlint",ty="lint-staged",tN="lint-staged",tO="typescript",tD="tsc",tv="tsx",tC="git",tT="pnpm",tA="pnpm exec",tg="simple-git-hooks",tS="simple-git-hooks",tm="@eslint/config-inspector",th="eslint-config-inspector",tP="node-modules-inspector",tb="node-modules-inspector",tL={CYBERSKILL_DIRECTORY:tu,WORKING_DIRECTORY:Q,TS_CONFIG:F(tn),GIT_IGNORE:F(tr),GIT_HOOK:F(ta),GIT_COMMIT_MSG:F(ti),SIMPLE_GIT_HOOKS_JSON:F(to),PACKAGE_JSON:F(tt),PACKAGE_LOCK_JSON:F(te),PNPM_LOCK_YAML:F(tc),NODE_MODULES:F(z),CYBERSKILL:{LINT_STAGED_CONFIG:F("".concat(tu,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:F("".concat(tu,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:F("".concat(tu,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:F("".concat(tu,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:F("".concat(tu,"/configs/vitest/react/e2e.js"))}};function tM(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++){n[r-1]=arguments[r]}var o=l(n,2),c=o[0],a=o[1],i=t==="RAW"?!0:w(K(tL.NODE_MODULES,c));switch(t){case"PNPM_ADD_AND_EXEC":return J(B("".concat(i?"":"".concat(tT," add ").concat(c," && ")).concat(tA," ").concat(a)));case"PNPM_ADD_DEV_AND_EXEC":return J(B("".concat(i?"":"".concat(tT," add -D ").concat(c," && ")).concat(tA," ").concat(a)));case"RAW":return J(B(c))}}var tG={SIMPLE_GIT_HOOKS:tM("PNPM_ADD_DEV_AND_EXEC",tg,tS),ESLINT_INSPECT:tM("PNPM_ADD_DEV_AND_EXEC",tm,th),NODE_MODULES_INSPECT:tM("PNPM_ADD_DEV_AND_EXEC",tP,tb),ESLINT_CHECK:tM("PNPM_ADD_DEV_AND_EXEC",ts,"".concat(tf," ").concat(tL.WORKING_DIRECTORY)),ESLINT_FIX:tM("PNPM_ADD_DEV_AND_EXEC",ts,"".concat(tf," ").concat(tL.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tM("PNPM_ADD_AND_EXEC",tO,"".concat(tD," -p ").concat(tL.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tM("RAW","".concat(tC," config core.hooksPath ").concat(tL.GIT_HOOK)),BUILD:tM("RAW","".concat(tT," run build")),STAGE_BUILD_DIRECTORY:tM("RAW","".concat(tC," add ").concat(Z)),PNPM_INSTALL_STANDARD:tM("RAW","".concat(tT," install")),PNPM_INSTALL_LEGACY:tM("RAW","".concat(tT," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tM("RAW","".concat(tT," install --force")),CYBERSKILL:{TEST_UNIT:tM("PNPM_ADD_AND_EXEC",t_,"".concat(tp," --config ").concat(tL.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tM("PNPM_ADD_AND_EXEC","".concat(t_," ").concat(tE),"".concat(tp," --config ").concat(tL.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tM("PNPM_ADD_DEV_AND_EXEC",tI,"".concat(td," --edit ").concat(tL.GIT_COMMIT_MSG," --config ").concat(tL.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tM("PNPM_ADD_DEV_AND_EXEC",ty,"".concat(tN," --config ").concat(tL.CYBERSKILL.LINT_STAGED_CONFIG))}};function tR(t){var e=t.uri,n=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:[n],generates:r({},o,u({plugins:["typescript","typescript-operations","typescript-react-apollo"]},Object.keys(f).length>0&&{config:f})),hooks:{afterAllFileWrite:[tG.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 D from"node:util";var m=process.env.DEBUG==="true",T=process.env.NODE_ENV!=="production",C=process.env.GRAPHQL_URI_DEFAULT||"/graphql";import O from"node-fetch";import*as A from"node:fs";var d=function(t){return A.existsSync(t)};import*as y from"node:path";function S(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=y).resolve.apply(e,[w].concat(_(n)))}function g(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++){n[o]=arguments[o]}var e;return(e=y).join.apply(e,_(n))}import h from"node-persist";var P=24*60*60*1e3;var v=D.promisify(N),L=I.gray,b=I.blue;function M(t){return{raw:!0,cmd:t}}function R(t,n){return(n===null||n===void 0?void 0:n.isRemote)?"".concat(tl," ").concat(j," ").concat(t):(n===null||n===void 0?void 0:n.isCurrentProject)?"".concat(tl," ").concat(ti," src/cli.ts ").concat(t):"".concat(tl," ").concat(J," ").concat(t)}function G(t,n){return typeof t=="function"?R(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"?R(t,n):t}var w=E.env.INIT_CWD||E.cwd(),j="@cyberskill/shared";var F="node_modules",K="dist",k="package.json",U="package-lock.json",Y="tsconfig.json",X=".gitignore",W=".simple-git-hooks.json",H="pnpm-lock.yaml",B=".git/hooks/",V=".git/COMMIT_EDITMSG",x=g(w,F,j,K),J="cyberskill",q="eslint",Q="eslint",$="vitest",z="playwright",Z="vitest",tt="@commitlint/cli",tn="commitlint",to="lint-staged",te="lint-staged",tr="typescript",tc="tsc",ti="tsx",ta="git",ts="pnpm",tl="pnpm exec",t_="simple-git-hooks",tu="simple-git-hooks",tf="@eslint/config-inspector",tE="eslint-config-inspector",tp="node-modules-inspector",tI="node-modules-inspector",tN={CYBERSKILL_DIRECTORY:x,WORKING_DIRECTORY:w,TS_CONFIG:S(Y),GIT_IGNORE:S(X),GIT_HOOK:S(B),GIT_COMMIT_MSG:S(V),SIMPLE_GIT_HOOKS_JSON:S(W),PACKAGE_JSON:S(k),PACKAGE_LOCK_JSON:S(U),PNPM_LOCK_YAML:S(H),NODE_MODULES:S(F),CYBERSKILL:{LINT_STAGED_CONFIG:S("".concat(x,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:S("".concat(x,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:S("".concat(x,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:S("".concat(x,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:S("".concat(x,"/configs/vitest/react/e2e.js"))}};function tD(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],a=t==="RAW"?!0:d(g(tN.NODE_MODULES,c));switch(t){case"PNPM_ADD_AND_EXEC":return G(M("".concat(a?"":"".concat(ts," add ").concat(c," && ")).concat(tl," ").concat(i)));case"PNPM_ADD_DEV_AND_EXEC":return G(M("".concat(a?"":"".concat(ts," add -D ").concat(c," && ")).concat(tl," ").concat(i)));case"RAW":return G(M(c))}}var tm={SIMPLE_GIT_HOOKS:tD("PNPM_ADD_DEV_AND_EXEC",t_,tu),ESLINT_INSPECT:tD("PNPM_ADD_DEV_AND_EXEC",tf,tE),NODE_MODULES_INSPECT:tD("PNPM_ADD_DEV_AND_EXEC",tp,tI),ESLINT_CHECK:tD("PNPM_ADD_DEV_AND_EXEC",q,"".concat(Q," ").concat(tN.WORKING_DIRECTORY)),ESLINT_FIX:tD("PNPM_ADD_DEV_AND_EXEC",q,"".concat(Q," ").concat(tN.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tD("PNPM_ADD_AND_EXEC",tr,"".concat(tc," -p ").concat(tN.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tD("RAW","".concat(ta," config core.hooksPath ").concat(tN.GIT_HOOK)),BUILD:tD("RAW","".concat(ts," run build")),STAGE_BUILD_DIRECTORY:tD("RAW","".concat(ta," add ").concat(K)),PNPM_INSTALL_STANDARD:tD("RAW","".concat(ts," install")),PNPM_INSTALL_LEGACY:tD("RAW","".concat(ts," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tD("RAW","".concat(ts," install --force")),CYBERSKILL:{TEST_UNIT:tD("PNPM_ADD_AND_EXEC",$,"".concat(Z," --config ").concat(tN.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tD("PNPM_ADD_AND_EXEC","".concat($," ").concat(z),"".concat(Z," --config ").concat(tN.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tD("PNPM_ADD_DEV_AND_EXEC",tt,"".concat(tn," --edit ").concat(tN.GIT_COMMIT_MSG," --config ").concat(tN.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tD("PNPM_ADD_DEV_AND_EXEC",to,"".concat(te," --config ").concat(tN.CYBERSKILL.LINT_STAGED_CONFIG))}};function tT(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:[tm.ESLINT_FIX]}}}export{tT as createGraphqlCodegenConfig};
|
package/dist/configs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var a,c;try{for(t=t.call(e);!(o=(a=t.next()).done);o=true){n.push(a.value);if(r&&n.length===r)break}}catch(e){i=true;c=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw c}}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 c(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var o=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}o.forEach(function(r){n(e,r,t[r])})}return e}function l(e,r){if(e==null)return{};var t=s(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function s(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function f(e,t){return r(e)||i(e,t)||v(e,t)||a()}function _(e){return t(e)||o(e)||v(e)||c()}function p(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function v(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.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 e(r,t)}var y=void 0;var d=Object.create;var E=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var b=function(e,r){for(var t in r)E(e,t,{get:r[t],enumerable:!0})},A=function(e,r,t,n){var o=true,i=false,a=undefined;if(r&&(typeof r==="undefined"?"undefined":p(r))=="object"||typeof r=="function")try{var c=function(){var o=l.value;!I.call(e,o)&&o!==t&&E(e,o,{get:function(){return r[o]},enumerable:!(n=g(r,o))||n.enumerable})};for(var u=O(r)[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true)c()}catch(e){i=true;a=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(i){throw a}}}return e};var N=function(e,r,t){return t=e!=null?d(m(e)):{},A(r||!e||!e.__esModule?E(t,"default",{value:e,enumerable:!0}):t,e)},T=function(e){return A(E({},"__esModule",{value:!0}),e)};var C={};b(C,{mergeConfigs:function(){return eZ}});module.exports=T(C);var D=N(require("@antfu/eslint-config"),1);var S=N(require("globals"),1),P=[{languageOptions:{globals:u({},S.node,S.browser)},rules:{"no-console":"warn","no-debugger":"warn","no-alert":"warn","perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var h=N(require("@vitejs/plugin-react-swc"),1),w=require("vitest/config"),L=function(e){return(0,w.defineConfig)(u({plugins:[(0,h.default)()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))};var j=N(require("@vitejs/plugin-react-swc"),1),M=require("vitest/config");var G=N(require("process"),1);var R=N(require("boxen"),1),K=N(require("chalk"),1),q=require("child_process"),k=N(require("process"),1),U=N(require("util"),1);var F=process.env.DEBUG==="true";var Y=N(require("node-fetch"),1);var x=N(require("fs"),1);var X=N(require("path"),1);function B(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n;return(n=X).resolve.apply(n,[eo].concat(_(r)))}function W(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n;return(n=X).join.apply(n,_(r))}var V=N(require("node-persist"),1),H=N(require("os"),1),J=N(require("process"),1);var $=24*60*60*1e3;var z=U.promisify(q.exec),Q=K.default,Z=Q.gray,ee=Q.blue;function er(e){return{raw:!0,cmd:e}}function et(e,r){return(r===null||r===void 0?void 0:r.isRemote)?"".concat(eL," ").concat(ei," ").concat(e):(r===null||r===void 0?void 0:r.isCurrentProject)?"".concat(eL," ").concat(eP," src/cli.ts ").concat(e):"".concat(eL," ").concat(eE," ").concat(e)}function en(e,r){return typeof e=="function"?et(e(r),r):(typeof e==="undefined"?"undefined":p(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?et(e,r):e}var eo=G.default.env.INIT_CWD||G.default.cwd(),ei="@cyberskill/shared";var ea="node_modules",ec="dist",eu="package.json",el="package-lock.json",es="tsconfig.json",ef=".gitignore",e_=".simple-git-hooks.json",ep="pnpm-lock.yaml",ev=".git/hooks/",ey=".git/COMMIT_EDITMSG",ed=W(eo,ea,ei,ec),eE="cyberskill",eg="eslint",eO="eslint",em="vitest",eI="playwright",eb="vitest",eA="@commitlint/cli",eN="commitlint",eT="lint-staged",eC="lint-staged",eD="typescript",eS="tsc",eP="tsx",eh="git",ew="pnpm",eL="pnpm exec",ej="simple-git-hooks",eM="simple-git-hooks",eG="@eslint/config-inspector",eR="eslint-config-inspector",eK="node-modules-inspector",eq="node-modules-inspector",ek={CYBERSKILL_DIRECTORY:ed,WORKING_DIRECTORY:eo,TS_CONFIG:B(es),GIT_IGNORE:B(ef),GIT_HOOK:B(ev),GIT_COMMIT_MSG:B(ey),SIMPLE_GIT_HOOKS_JSON:B(e_),PACKAGE_JSON:B(eu),PACKAGE_LOCK_JSON:B(el),PNPM_LOCK_YAML:B(ep),NODE_MODULES:B(ea),CYBERSKILL:{LINT_STAGED_CONFIG:B("".concat(ed,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:B("".concat(ed,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:B("".concat(ed,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:B("".concat(ed,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:B("".concat(ed,"/configs/vitest/react/e2e.js"))}};function eU(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=f(t,2),i=o[0],a=o[1];switch(e){case"PNPM_ADD_AND_EXEC":return en(er("".concat(ew," add ").concat(i," && ").concat(eL," ").concat(a)));case"PNPM_ADD_DEV_AND_EXEC":return en(er("".concat(ew," add -D ").concat(i," && ").concat(eL," ").concat(a)));case"RAW":return en(er(i))}}var eF={SIMPLE_GIT_HOOKS:eU("PNPM_ADD_DEV_AND_EXEC",ej,eM),ESLINT_INSPECT:eU("PNPM_ADD_DEV_AND_EXEC",eG,eR),NODE_MODULES_INSPECT:eU("PNPM_ADD_DEV_AND_EXEC",eK,eq),ESLINT_CHECK:eU("PNPM_ADD_DEV_AND_EXEC",eg,"".concat(eO," ").concat(ek.WORKING_DIRECTORY)),ESLINT_FIX:eU("PNPM_ADD_DEV_AND_EXEC",eg,"".concat(eO," ").concat(ek.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eU("PNPM_ADD_AND_EXEC",eD,"".concat(eS," -p ").concat(ek.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eU("RAW","".concat(eh," config core.hooksPath ").concat(ek.GIT_HOOK)),BUILD:eU("RAW","".concat(ew," run build")),STAGE_BUILD_DIRECTORY:eU("RAW","".concat(eh," add ").concat(ec)),PNPM_INSTALL_STANDARD:eU("RAW","".concat(ew," install")),PNPM_INSTALL_LEGACY:eU("RAW","".concat(ew," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eU("RAW","".concat(ew," install --force")),CYBERSKILL:{TEST_UNIT:eU("PNPM_ADD_AND_EXEC",em,"".concat(eb," --config ").concat(ek.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eU("PNPM_ADD_AND_EXEC","".concat(em," ").concat(eI),"".concat(eb," --config ").concat(ek.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eU("PNPM_ADD_DEV_AND_EXEC",eA,"".concat(eN," --edit ").concat(ek.GIT_COMMIT_MSG," --config ").concat(ek.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eU("PNPM_ADD_DEV_AND_EXEC",eT,"".concat(eC," --config ").concat(ek.CYBERSKILL.LINT_STAGED_CONFIG))}};var eY=function(e){return(0,M.defineConfig)(u({plugins:[(0,j.default)()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[ek.CYBERSKILL.UNIT_TEST_SETUP_CONFIG]}},e))};var ex=N(require("unorm"),1);function eX(e){return!!e&&(typeof e==="undefined"?"undefined":p(e))=="object"&&!Array.isArray(e)}function eB(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return r.flat().reduce(function(e,r){var t=true,n=false,o=undefined;try{for(var i=Object.entries(r)[Symbol.iterator](),a;!(t=(a=i.next()).done);t=true){var c=f(a.value,2),u=c[0],l=c[1];var s=e[u];Array.isArray(l)?e[u]=Array.from(new Set(_(Array.isArray(s)?s:[]).concat(_(l)))):eX(l)?e[u]=eB(eX(s)?s:{},l):e[u]=l}}catch(e){n=true;o=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw o}}}return e},{})}var eW={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},eV=Object.entries(eW).reduce(function(e,r){var t=f(r,2),n=t[0],o=t[1];return e[n.toUpperCase()]=o.map(function(e){return e.toUpperCase()}),e},{});var eH=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return eB.apply(void 0,_(r))},eJ=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n=eB.apply(void 0,[P].concat(_(r))),o=n.ignores,i=l(n,["ignores"]),a=Array.isArray(o)&&o.every(function(e){return typeof e=="string"})?{ignores:o}:void 0,c=[i].concat(_(a?[a]:[]));return(0,D.default).apply(y,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(_(c)))},e$=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return L.apply(void 0,_(r))},ez=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return eY.apply(void 0,_(r))},eQ={eslint:eJ,commitlint:eH,"lint-staged":eH,"vitest-react-e2e":e$,"vitest-react-unit":ez};function eZ(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=eQ[e];if(!o)throw new Error("Unknown config type: ".concat(e));return o.apply(void 0,_(t))}0&&(module.exports={mergeConfigs:mergeConfigs});
|
|
1
|
+
"use strict";function e(e,r){if(r==null||r>e.length)r=e.length;for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function r(e){if(Array.isArray(e))return e}function t(r){if(Array.isArray(r))return e(r)}function n(e,r,t){if(r in e){Object.defineProperty(e,r,{value:t,enumerable:true,configurable:true,writable:true})}else{e[r]=t}return e}function o(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function i(e,r){var t=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(t==null)return;var n=[];var o=true;var i=false;var c,a;try{for(t=t.call(e);!(o=(c=t.next()).done);o=true){n.push(c.value);if(r&&n.length===r)break}}catch(e){i=true;a=e}finally{try{if(!o&&t["return"]!=null)t["return"]()}finally{if(i)throw a}}return n}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};var o=Object.keys(t);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(t).filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))}o.forEach(function(r){n(e,r,t[r])})}return e}function l(e,r){if(e==null)return{};var t=s(e,r);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(r.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;t[n]=e[n]}}return t}function s(e,r){if(e==null)return{};var t={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(r.indexOf(o)>=0)continue;t[o]=e[o]}return t}function f(e,t){return r(e)||i(e,t)||v(e,t)||c()}function _(e){return t(e)||o(e)||v(e)||a()}function p(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function v(r,t){if(!r)return;if(typeof r==="string")return e(r,t);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor)n=r.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 e(r,t)}var y=void 0;var d=Object.create;var E=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var A=function(e,r){for(var t in r)E(e,t,{get:r[t],enumerable:!0})},N=function(e,r,t,n){var o=true,i=false,c=undefined;if(r&&(typeof r==="undefined"?"undefined":p(r))=="object"||typeof r=="function")try{var a=function(){var o=l.value;!m.call(e,o)&&o!==t&&E(e,o,{get:function(){return r[o]},enumerable:!(n=g(r,o))||n.enumerable})};for(var u=O(r)[Symbol.iterator](),l;!(o=(l=u.next()).done);o=true)a()}catch(e){i=true;c=e}finally{try{if(!o&&u.return!=null){u.return()}}finally{if(i){throw c}}}return e};var b=function(e,r,t){return t=e!=null?d(I(e)):{},N(r||!e||!e.__esModule?E(t,"default",{value:e,enumerable:!0}):t,e)},T=function(e){return N(E({},"__esModule",{value:!0}),e)};var D={};A(D,{mergeConfigs:function(){return e2}});module.exports=T(D);var C=b(require("@antfu/eslint-config"),1);var S=b(require("globals"),1),P=[{languageOptions:{globals:u({},S.node,S.browser)},rules:{"no-console":"warn","no-debugger":"warn","no-alert":"warn","perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var h=b(require("@vitejs/plugin-react-swc"),1),w=require("vitest/config"),L=function(e){return(0,w.defineConfig)(u({plugins:[(0,h.default)()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))};var j=b(require("@vitejs/plugin-react-swc"),1),M=require("vitest/config");var G=b(require("process"),1);var R=b(require("boxen"),1),K=b(require("chalk"),1),q=require("child_process"),U=b(require("process"),1),k=b(require("util"),1);var F=process.env.DEBUG==="true",x=process.env.NODE_ENV!=="production",Y=process.env.GRAPHQL_URI_DEFAULT||"/graphql";var X=b(require("node-fetch"),1);var W=b(require("fs"),1),B=function(e){return W.existsSync(e)};var V=b(require("path"),1);function H(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n;return(n=V).resolve.apply(n,[ea].concat(_(r)))}function J(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n;return(n=V).join.apply(n,_(r))}var Q=b(require("node-persist"),1),$=b(require("os"),1),z=b(require("process"),1);var Z=24*60*60*1e3;var ee=k.promisify(q.exec),er=K.default,et=er.gray,en=er.blue;function eo(e){return{raw:!0,cmd:e}}function ei(e,r){return(r===null||r===void 0?void 0:r.isRemote)?"".concat(eG," ").concat(eu," ").concat(e):(r===null||r===void 0?void 0:r.isCurrentProject)?"".concat(eG," ").concat(eL," src/cli.ts ").concat(e):"".concat(eG," ").concat(eI," ").concat(e)}function ec(e,r){return typeof e=="function"?ei(e(r),r):(typeof e==="undefined"?"undefined":p(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ei(e,r):e}var ea=G.default.env.INIT_CWD||G.default.cwd(),eu="@cyberskill/shared";var el="node_modules",es="dist",ef="package.json",e_="package-lock.json",ep="tsconfig.json",ev=".gitignore",ey=".simple-git-hooks.json",ed="pnpm-lock.yaml",eE=".git/hooks/",eg=".git/COMMIT_EDITMSG",eO=J(ea,el,eu,es),eI="cyberskill",em="eslint",eA="eslint",eN="vitest",eb="playwright",eT="vitest",eD="@commitlint/cli",eC="commitlint",eS="lint-staged",eP="lint-staged",eh="typescript",ew="tsc",eL="tsx",ej="git",eM="pnpm",eG="pnpm exec",eR="simple-git-hooks",eK="simple-git-hooks",eq="@eslint/config-inspector",eU="eslint-config-inspector",ek="node-modules-inspector",eF="node-modules-inspector",ex={CYBERSKILL_DIRECTORY:eO,WORKING_DIRECTORY:ea,TS_CONFIG:H(ep),GIT_IGNORE:H(ev),GIT_HOOK:H(eE),GIT_COMMIT_MSG:H(eg),SIMPLE_GIT_HOOKS_JSON:H(ey),PACKAGE_JSON:H(ef),PACKAGE_LOCK_JSON:H(e_),PNPM_LOCK_YAML:H(ed),NODE_MODULES:H(el),CYBERSKILL:{LINT_STAGED_CONFIG:H("".concat(eO,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:H("".concat(eO,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:H("".concat(eO,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:H("".concat(eO,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:H("".concat(eO,"/configs/vitest/react/e2e.js"))}};function eY(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=f(t,2),i=o[0],c=o[1],a=e==="RAW"?!0:B(J(ex.NODE_MODULES,i));switch(e){case"PNPM_ADD_AND_EXEC":return ec(eo("".concat(a?"":"".concat(eM," add ").concat(i," && ")).concat(eG," ").concat(c)));case"PNPM_ADD_DEV_AND_EXEC":return ec(eo("".concat(a?"":"".concat(eM," add -D ").concat(i," && ")).concat(eG," ").concat(c)));case"RAW":return ec(eo(i))}}var eX={SIMPLE_GIT_HOOKS:eY("PNPM_ADD_DEV_AND_EXEC",eR,eK),ESLINT_INSPECT:eY("PNPM_ADD_DEV_AND_EXEC",eq,eU),NODE_MODULES_INSPECT:eY("PNPM_ADD_DEV_AND_EXEC",ek,eF),ESLINT_CHECK:eY("PNPM_ADD_DEV_AND_EXEC",em,"".concat(eA," ").concat(ex.WORKING_DIRECTORY)),ESLINT_FIX:eY("PNPM_ADD_DEV_AND_EXEC",em,"".concat(eA," ").concat(ex.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:eY("PNPM_ADD_AND_EXEC",eh,"".concat(ew," -p ").concat(ex.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:eY("RAW","".concat(ej," config core.hooksPath ").concat(ex.GIT_HOOK)),BUILD:eY("RAW","".concat(eM," run build")),STAGE_BUILD_DIRECTORY:eY("RAW","".concat(ej," add ").concat(es)),PNPM_INSTALL_STANDARD:eY("RAW","".concat(eM," install")),PNPM_INSTALL_LEGACY:eY("RAW","".concat(eM," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:eY("RAW","".concat(eM," install --force")),CYBERSKILL:{TEST_UNIT:eY("PNPM_ADD_AND_EXEC",eN,"".concat(eT," --config ").concat(ex.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:eY("PNPM_ADD_AND_EXEC","".concat(eN," ").concat(eb),"".concat(eT," --config ").concat(ex.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:eY("PNPM_ADD_DEV_AND_EXEC",eD,"".concat(eC," --edit ").concat(ex.GIT_COMMIT_MSG," --config ").concat(ex.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:eY("PNPM_ADD_DEV_AND_EXEC",eS,"".concat(eP," --config ").concat(ex.CYBERSKILL.LINT_STAGED_CONFIG))}};var eW=function(e){return(0,M.defineConfig)(u({plugins:[(0,j.default)()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[ex.CYBERSKILL.UNIT_TEST_SETUP_CONFIG]}},e))};var eB=b(require("unorm"),1);function eV(e){return!!e&&(typeof e==="undefined"?"undefined":p(e))=="object"&&!Array.isArray(e)}function eH(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return r.flat().reduce(function(e,r){var t=true,n=false,o=undefined;try{for(var i=Object.entries(r)[Symbol.iterator](),c;!(t=(c=i.next()).done);t=true){var a=f(c.value,2),u=a[0],l=a[1];var s=e[u];Array.isArray(l)?e[u]=Array.from(new Set(_(Array.isArray(s)?s:[]).concat(_(l)))):eV(l)?e[u]=eH(eV(s)?s:{},l):e[u]=l}}catch(e){n=true;o=e}finally{try{if(!t&&i.return!=null){i.return()}}finally{if(n){throw o}}}return e},{})}var eJ={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},eQ=Object.entries(eJ).reduce(function(e,r){var t=f(r,2),n=t[0],o=t[1];return e[n.toUpperCase()]=o.map(function(e){return e.toUpperCase()}),e},{});var e$=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return eH.apply(void 0,_(r))},ez=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}var n=eH.apply(void 0,[P].concat(_(r))),o=n.ignores,i=l(n,["ignores"]),c=Array.isArray(o)&&o.every(function(e){return typeof e=="string"})?{ignores:o}:void 0,a=[i].concat(_(c?[c]:[]));return(0,C.default).apply(y,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(_(a)))},eZ=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return L.apply(void 0,_(r))},e0=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++){r[t]=arguments[t]}return eW.apply(void 0,_(r))},e1={eslint:ez,commitlint:e$,"lint-staged":e$,"vitest-react-e2e":eZ,"vitest-react-unit":e0};function e2(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++){t[n-1]=arguments[n]}var o=e1[e];if(!o)throw new Error("Unknown config type: ".concat(e));return o.apply(void 0,_(t))}0&&(module.exports={mergeConfigs:mergeConfigs});
|
package/dist/configs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function t(t,r){if(r==null||r>t.length)r=t.length;for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function r(t){if(Array.isArray(t))return t}function n(r){if(Array.isArray(r))return t(r)}function e(t,r,n){if(r in t){Object.defineProperty(t,r,{value:n,enumerable:true,configurable:true,writable:true})}else{t[r]=n}return t}function o(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function
|
|
1
|
+
function t(t,r){if(r==null||r>t.length)r=t.length;for(var n=0,e=new Array(r);n<r;n++)e[n]=t[n];return e}function r(t){if(Array.isArray(t))return t}function n(r){if(Array.isArray(r))return t(r)}function e(t,r,n){if(r in t){Object.defineProperty(t,r,{value:n,enumerable:true,configurable:true,writable:true})}else{t[r]=n}return t}function o(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,r){var n=t==null?null:typeof Symbol!=="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n==null)return;var e=[];var o=true;var c=false;var i,a;try{for(n=n.call(t);!(o=(i=n.next()).done);o=true){e.push(i.value);if(r&&e.length===r)break}}catch(t){c=true;a=t}finally{try{if(!o&&n["return"]!=null)n["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 r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};var o=Object.keys(n);if(typeof Object.getOwnPropertySymbols==="function"){o=o.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))}o.forEach(function(r){e(t,r,n[r])})}return t}function l(t,r){if(t==null)return{};var n=u(t,r);var e,o;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(t);for(o=0;o<c.length;o++){e=c[o];if(r.indexOf(e)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(t,e))continue;n[e]=t[e]}}return n}function u(t,r){if(t==null)return{};var n={};var e=Object.keys(t);var o,c;for(c=0;c<e.length;c++){o=e[c];if(r.indexOf(o)>=0)continue;n[o]=t[o]}return n}function f(t,n){return r(t)||c(t,n)||m(t,n)||i()}function p(t){return n(t)||o(t)||m(t)||a()}function _(t){"@swc/helpers - typeof";return t&&typeof Symbol!=="undefined"&&t.constructor===Symbol?"symbol":typeof t}function m(r,n){if(!r)return;if(typeof r==="string")return t(r,n);var e=Object.prototype.toString.call(r).slice(8,-1);if(e==="Object"&&r.constructor)e=r.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(r,n)}import y from"@antfu/eslint-config";import*as E from"globals";var d=[{languageOptions:{globals:s({},E.node,E.browser)},rules:{"no-console":"warn","no-debugger":"warn","no-alert":"warn","perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];import v from"@vitejs/plugin-react-swc";import{defineConfig as g}from"vitest/config";var I=function(t){return g(s({plugins:[v()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},t))};import A from"@vitejs/plugin-react-swc";import{defineConfig as N}from"vitest/config";import O from"node:process";import T from"boxen";import D from"chalk";import{exec as C}from"node:child_process";import*as S from"node:util";var b=process.env.DEBUG==="true",P=process.env.NODE_ENV!=="production",h=process.env.GRAPHQL_URI_DEFAULT||"/graphql";import w from"node-fetch";import*as L from"node:fs";var M=function(t){return L.existsSync(t)};import*as G from"node:path";function R(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}var e;return(e=G).resolve.apply(e,[B].concat(p(r)))}function j(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}var e;return(e=G).join.apply(e,p(r))}import K from"node-persist";var U=24*60*60*1e3;var k=S.promisify(C),F=D.gray,Y=D.blue;function x(t){return{raw:!0,cmd:t}}function X(t,r){return(r===null||r===void 0?void 0:r.isRemote)?"".concat(tg," ").concat(H," ").concat(t):(r===null||r===void 0?void 0:r.isCurrentProject)?"".concat(tg," ").concat(tE," src/cli.ts ").concat(t):"".concat(tg," ").concat(to," ").concat(t)}function W(t,r){return typeof t=="function"?X(t(r),r):(typeof t==="undefined"?"undefined":_(t))=="object"&&(t===null||t===void 0?void 0:t.raw)===!0?t.cmd:typeof t=="string"?X(t,r):t}var B=O.env.INIT_CWD||O.cwd(),H="@cyberskill/shared";var V="node_modules",J="dist",q="package.json",Q="package-lock.json",$="tsconfig.json",z=".gitignore",Z=".simple-git-hooks.json",tt="pnpm-lock.yaml",tr=".git/hooks/",tn=".git/COMMIT_EDITMSG",te=j(B,V,H,J),to="cyberskill",tc="eslint",ti="eslint",ta="vitest",ts="playwright",tl="vitest",tu="@commitlint/cli",tf="commitlint",tp="lint-staged",t_="lint-staged",tm="typescript",ty="tsc",tE="tsx",td="git",tv="pnpm",tg="pnpm exec",tI="simple-git-hooks",tA="simple-git-hooks",tN="@eslint/config-inspector",tO="eslint-config-inspector",tT="node-modules-inspector",tD="node-modules-inspector",tC={CYBERSKILL_DIRECTORY:te,WORKING_DIRECTORY:B,TS_CONFIG:R($),GIT_IGNORE:R(z),GIT_HOOK:R(tr),GIT_COMMIT_MSG:R(tn),SIMPLE_GIT_HOOKS_JSON:R(Z),PACKAGE_JSON:R(q),PACKAGE_LOCK_JSON:R(Q),PNPM_LOCK_YAML:R(tt),NODE_MODULES:R(V),CYBERSKILL:{LINT_STAGED_CONFIG:R("".concat(te,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:R("".concat(te,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:R("".concat(te,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:R("".concat(te,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:R("".concat(te,"/configs/vitest/react/e2e.js"))}};function tS(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),e=1;e<r;e++){n[e-1]=arguments[e]}var o=f(n,2),c=o[0],i=o[1],a=t==="RAW"?!0:M(j(tC.NODE_MODULES,c));switch(t){case"PNPM_ADD_AND_EXEC":return W(x("".concat(a?"":"".concat(tv," add ").concat(c," && ")).concat(tg," ").concat(i)));case"PNPM_ADD_DEV_AND_EXEC":return W(x("".concat(a?"":"".concat(tv," add -D ").concat(c," && ")).concat(tg," ").concat(i)));case"RAW":return W(x(c))}}var tb={SIMPLE_GIT_HOOKS:tS("PNPM_ADD_DEV_AND_EXEC",tI,tA),ESLINT_INSPECT:tS("PNPM_ADD_DEV_AND_EXEC",tN,tO),NODE_MODULES_INSPECT:tS("PNPM_ADD_DEV_AND_EXEC",tT,tD),ESLINT_CHECK:tS("PNPM_ADD_DEV_AND_EXEC",tc,"".concat(ti," ").concat(tC.WORKING_DIRECTORY)),ESLINT_FIX:tS("PNPM_ADD_DEV_AND_EXEC",tc,"".concat(ti," ").concat(tC.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:tS("PNPM_ADD_AND_EXEC",tm,"".concat(ty," -p ").concat(tC.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:tS("RAW","".concat(td," config core.hooksPath ").concat(tC.GIT_HOOK)),BUILD:tS("RAW","".concat(tv," run build")),STAGE_BUILD_DIRECTORY:tS("RAW","".concat(td," add ").concat(J)),PNPM_INSTALL_STANDARD:tS("RAW","".concat(tv," install")),PNPM_INSTALL_LEGACY:tS("RAW","".concat(tv," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:tS("RAW","".concat(tv," install --force")),CYBERSKILL:{TEST_UNIT:tS("PNPM_ADD_AND_EXEC",ta,"".concat(tl," --config ").concat(tC.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:tS("PNPM_ADD_AND_EXEC","".concat(ta," ").concat(ts),"".concat(tl," --config ").concat(tC.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:tS("PNPM_ADD_DEV_AND_EXEC",tu,"".concat(tf," --edit ").concat(tC.GIT_COMMIT_MSG," --config ").concat(tC.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:tS("PNPM_ADD_DEV_AND_EXEC",tp,"".concat(t_," --config ").concat(tC.CYBERSKILL.LINT_STAGED_CONFIG))}};var tP=function(t){return N(s({plugins:[A()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tC.CYBERSKILL.UNIT_TEST_SETUP_CONFIG]}},t))};import th from"unorm";function tw(t){return!!t&&(typeof t==="undefined"?"undefined":_(t))=="object"&&!Array.isArray(t)}function tL(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}return r.flat().reduce(function(t,r){var n=true,e=false,o=undefined;try{for(var c=Object.entries(r)[Symbol.iterator](),i;!(n=(i=c.next()).done);n=true){var a=f(i.value,2),s=a[0],l=a[1];var u=t[s];Array.isArray(l)?t[s]=Array.from(new Set(p(Array.isArray(u)?u:[]).concat(p(l)))):tw(l)?t[s]=tL(tw(u)?u:{},l):t[s]=l}}catch(t){e=true;o=t}finally{try{if(!n&&c.return!=null){c.return()}}finally{if(e){throw o}}}return t},{})}var tM={a:["\xe0","\xe1","ạ","ả","\xe3","\xe2","ầ","ấ","ậ","ẩ","ẫ","ă","ằ","ắ","ặ","ẳ","ẵ"],e:["\xe8","\xe9","ẹ","ẻ","ẽ","\xea","ề","ế","ệ","ể","ễ"],i:["\xec","\xed","ị","ỉ","ĩ"],o:["\xf2","\xf3","ọ","ỏ","\xf5","\xf4","ồ","ố","ộ","ổ","ỗ","ơ","ờ","ớ","ợ","ở","ỡ"],u:["\xf9","\xfa","ụ","ủ","ũ","ư","ừ","ứ","ự","ử","ữ"],y:["ỳ","\xfd","ỵ","ỷ","ỹ"],d:["đ"]},tG=Object.entries(tM).reduce(function(t,r){var n=f(r,2),e=n[0],o=n[1];return t[e.toUpperCase()]=o.map(function(t){return t.toUpperCase()}),t},{});var tR=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}return tL.apply(void 0,p(r))},tj=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}var e=tL.apply(void 0,[d].concat(p(r))),o=e.ignores,c=l(e,["ignores"]),i=Array.isArray(o)&&o.every(function(t){return typeof t=="string"})?{ignores:o}:void 0,a=[c].concat(p(i?[i]:[]));return y.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(p(a)))},tK=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}return I.apply(void 0,p(r))},tU=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++){r[n]=arguments[n]}return tP.apply(void 0,p(r))},tk={eslint:tj,commitlint:tR,"lint-staged":tR,"vitest-react-e2e":tK,"vitest-react-unit":tU};function tF(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),e=1;e<r;e++){n[e-1]=arguments[e]}var o=tk[t];if(!o)throw new Error("Unknown config type: ".concat(t));return o.apply(void 0,p(n))}export{tF as mergeConfigs};
|
|
@@ -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
|
|
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 N=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var O=function(t,e){for(var r in e)p(t,r,{get:e[r],enumerable:!0})},T=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;!v.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 y=function(t,e,r){return r=t!=null?E(N(t)):{},T(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)},D=function(t){return T(p({},"__esModule",{value:!0}),t)};var A={};O(A,{default:function(){return tw}});module.exports=D(A);var C=y(require("@vitejs/plugin-react-swc"),1),S=require("vitest/config");var m=y(require("process"),1);var g=y(require("boxen"),1),P=y(require("chalk"),1),b=require("child_process"),L=y(require("process"),1),M=y(require("util"),1);var G=process.env.DEBUG==="true",R=process.env.NODE_ENV!=="production",h=process.env.GRAPHQL_URI_DEFAULT||"/graphql";var j=y(require("node-fetch"),1);var w=y(require("fs"),1),K=function(t){return w.existsSync(t)};var F=y(require("path"),1);function U(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=F).resolve.apply(n,[z].concat(s(e)))}function Y(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++){e[r]=arguments[r]}var n;return(n=F).join.apply(n,s(e))}var q=y(require("node-persist"),1),k=y(require("os"),1),X=y(require("process"),1);var W=24*60*60*1e3;var B=M.promisify(b.exec),x=P.default,V=x.gray,H=x.blue;function J(t){return{raw:!0,cmd:t}}function Q(t,e){return(e===null||e===void 0?void 0:e.isRemote)?"".concat(tm," ").concat(Z," ").concat(t):(e===null||e===void 0?void 0:e.isCurrentProject)?"".concat(tm," ").concat(tA," src/cli.ts ").concat(t):"".concat(tm," ").concat(tf," ").concat(t)}function $(t,e){return typeof t=="function"?Q(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"?Q(t,e):t}var z=m.default.env.INIT_CWD||m.default.cwd(),Z="@cyberskill/shared";var tt="node_modules",te="dist",tr="package.json",tn="package-lock.json",to="tsconfig.json",tc=".gitignore",ta=".simple-git-hooks.json",ti="pnpm-lock.yaml",tu=".git/hooks/",tl=".git/COMMIT_EDITMSG",ts=Y(z,tt,Z,te),tf="cyberskill",t_="eslint",tE="eslint",tp="vitest",tI="playwright",td="vitest",tN="@commitlint/cli",tv="commitlint",tO="lint-staged",tT="lint-staged",ty="typescript",tD="tsc",tA="tsx",tC="git",tS="pnpm",tm="pnpm exec",tg="simple-git-hooks",tP="simple-git-hooks",tb="@eslint/config-inspector",tL="eslint-config-inspector",tM="node-modules-inspector",tG="node-modules-inspector",tR={CYBERSKILL_DIRECTORY:ts,WORKING_DIRECTORY:z,TS_CONFIG:U(to),GIT_IGNORE:U(tc),GIT_HOOK:U(tu),GIT_COMMIT_MSG:U(tl),SIMPLE_GIT_HOOKS_JSON:U(ta),PACKAGE_JSON:U(tr),PACKAGE_LOCK_JSON:U(tn),PNPM_LOCK_YAML:U(ti),NODE_MODULES:U(tt),CYBERSKILL:{LINT_STAGED_CONFIG:U("".concat(ts,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:U("".concat(ts,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:U("".concat(ts,"/configs/vitest/react/unit.js")),UNIT_TEST_SETUP_CONFIG:U("".concat(ts,"/configs/vitest/react/unit.setup.js")),E2E_TEST_CONFIG:U("".concat(ts,"/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],i=t==="RAW"?!0:K(Y(tR.NODE_MODULES,c));switch(t){case"PNPM_ADD_AND_EXEC":return $(J("".concat(i?"":"".concat(tS," add ").concat(c," && ")).concat(tm," ").concat(a)));case"PNPM_ADD_DEV_AND_EXEC":return $(J("".concat(i?"":"".concat(tS," add -D ").concat(c," && ")).concat(tm," ").concat(a)));case"RAW":return $(J(c))}}var tj={SIMPLE_GIT_HOOKS:th("PNPM_ADD_DEV_AND_EXEC",tg,tP),ESLINT_INSPECT:th("PNPM_ADD_DEV_AND_EXEC",tb,tL),NODE_MODULES_INSPECT:th("PNPM_ADD_DEV_AND_EXEC",tM,tG),ESLINT_CHECK:th("PNPM_ADD_DEV_AND_EXEC",t_,"".concat(tE," ").concat(tR.WORKING_DIRECTORY)),ESLINT_FIX:th("PNPM_ADD_DEV_AND_EXEC",t_,"".concat(tE," ").concat(tR.WORKING_DIRECTORY," --fix")),TYPESCRIPT_CHECK:th("PNPM_ADD_AND_EXEC",ty,"".concat(tD," -p ").concat(tR.TS_CONFIG," --noEmit")),CONFIGURE_GIT_HOOK:th("RAW","".concat(tC," config core.hooksPath ").concat(tR.GIT_HOOK)),BUILD:th("RAW","".concat(tS," run build")),STAGE_BUILD_DIRECTORY:th("RAW","".concat(tC," add ").concat(te)),PNPM_INSTALL_STANDARD:th("RAW","".concat(tS," install")),PNPM_INSTALL_LEGACY:th("RAW","".concat(tS," install --legacy-peer-deps")),PNPM_INSTALL_FORCE:th("RAW","".concat(tS," install --force")),CYBERSKILL:{TEST_UNIT:th("PNPM_ADD_AND_EXEC",tp,"".concat(td," --config ").concat(tR.CYBERSKILL.UNIT_TEST_CONFIG)),TEST_E2E:th("PNPM_ADD_AND_EXEC","".concat(tp," ").concat(tI),"".concat(td," --config ").concat(tR.CYBERSKILL.E2E_TEST_CONFIG)),COMMIT_LINT:th("PNPM_ADD_DEV_AND_EXEC",tN,"".concat(tv," --edit ").concat(tR.GIT_COMMIT_MSG," --config ").concat(tR.CYBERSKILL.COMMITLINT_CONFIG)),LINT_STAGED:th("PNPM_ADD_DEV_AND_EXEC",tO,"".concat(tT," --config ").concat(tR.CYBERSKILL.LINT_STAGED_CONFIG))}};var tw=function(t){return(0,S.defineConfig)(u({plugins:[(0,C.default)()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[tR.CYBERSKILL.UNIT_TEST_SETUP_CONFIG]}},t))};
|