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