@cyberskill/shared 1.84.0 → 1.86.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 +2 -2
- package/dist/_tsup-dts-rollup.d.ts +2 -2
- package/dist/configs/config.type.cjs +1 -1
- package/dist/configs/config.type.js +1 -1
- package/dist/configs/config.util.cjs +1 -1
- package/dist/configs/config.util.js +1 -1
- package/dist/configs/graphql-codegen/graphql-codegen.util.cjs +1 -1
- package/dist/configs/graphql-codegen/graphql-codegen.util.js +1 -1
- package/dist/configs/graphql-codegen/index.cjs +1 -1
- package/dist/configs/graphql-codegen/index.js +1 -1
- package/dist/configs/index.cjs +1 -1
- package/dist/configs/index.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/nodejs/cli/cli.util.cjs +1 -1
- package/dist/nodejs/cli/cli.util.js +1 -1
- package/dist/nodejs/cli/index.cjs +1 -1
- package/dist/nodejs/cli/index.js +1 -1
- package/dist/nodejs/command/command.type.cjs +1 -1
- package/dist/nodejs/command/command.type.js +1 -1
- package/dist/nodejs/command/command.util.cjs +1 -1
- package/dist/nodejs/command/command.util.js +1 -1
- package/dist/nodejs/command/index.cjs +1 -1
- package/dist/nodejs/command/index.js +1 -1
- package/dist/nodejs/fs/fs.util.cjs +1 -1
- package/dist/nodejs/fs/fs.util.js +1 -1
- package/dist/nodejs/fs/index.cjs +1 -1
- package/dist/nodejs/fs/index.js +1 -1
- package/dist/nodejs/index.cjs +1 -1
- package/dist/nodejs/index.js +1 -1
- package/dist/nodejs/log/index.cjs +1 -1
- package/dist/nodejs/log/index.js +1 -1
- package/dist/nodejs/log/log.type.cjs +1 -1
- package/dist/nodejs/log/log.type.js +1 -1
- package/dist/nodejs/log/log.util.cjs +1 -1
- package/dist/nodejs/log/log.util.js +1 -1
- package/dist/nodejs/mongo/index.cjs +1 -1
- package/dist/nodejs/mongo/index.js +1 -1
- package/dist/nodejs/mongo/mongo.cjs +1 -1
- package/dist/nodejs/mongo/mongo.js +1 -1
- package/dist/nodejs/mongo/mongo.type.cjs +1 -1
- package/dist/nodejs/mongo/mongo.type.js +1 -1
- package/dist/nodejs/package/index.cjs +1 -1
- package/dist/nodejs/package/index.js +1 -1
- package/dist/nodejs/package/package.constant.js +1 -1
- package/dist/nodejs/package/package.util.cjs +1 -1
- package/dist/nodejs/package/package.util.js +1 -1
- package/dist/nodejs/path/index.cjs +1 -1
- package/dist/nodejs/path/index.js +1 -1
- package/dist/nodejs/path/path.constant.cjs +1 -1
- package/dist/nodejs/path/path.constant.js +1 -1
- package/dist/nodejs/path/path.util.cjs +1 -1
- package/dist/nodejs/path/path.util.js +1 -1
- package/dist/nodejs/storage/index.cjs +1 -1
- package/dist/nodejs/storage/index.js +1 -1
- package/dist/nodejs/storage/storage.util.cjs +1 -1
- package/dist/nodejs/storage/storage.util.js +1 -1
- package/dist/react/apollo-client/apollo-client.component.cjs +1 -1
- package/dist/react/apollo-client/apollo-client.component.js +1 -1
- package/dist/react/apollo-client/index.cjs +1 -1
- package/dist/react/apollo-client/index.js +1 -1
- package/dist/react/apollo-error/apollo-error.component.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.component.js +1 -1
- package/dist/react/apollo-error/apollo-error.hook.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.hook.js +1 -1
- package/dist/react/apollo-error/apollo-error.provider.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.provider.js +1 -1
- package/dist/react/apollo-error/apollo-error.util.cjs +1 -1
- package/dist/react/apollo-error/apollo-error.util.js +1 -1
- package/dist/react/apollo-error/index.cjs +1 -1
- package/dist/react/apollo-error/index.js +1 -1
- package/dist/react/i18next/i18next.hook.js +1 -1
- package/dist/react/i18next/i18next.util.cjs +1 -1
- package/dist/react/i18next/i18next.util.js +1 -1
- package/dist/react/i18next/index.cjs +1 -1
- package/dist/react/i18next/index.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/loading/index.cjs +1 -1
- package/dist/react/loading/index.js +1 -1
- package/dist/react/loading/loading.component.cjs +1 -1
- package/dist/react/loading/loading.component.js +1 -1
- package/dist/react/loading/loading.hook.cjs +1 -1
- package/dist/react/loading/loading.hook.js +1 -1
- package/dist/react/loading/loading.provider.cjs +1 -1
- package/dist/react/loading/loading.provider.js +1 -1
- package/dist/react/next-intl/index.cjs +1 -1
- package/dist/react/next-intl/index.js +1 -1
- package/dist/react/next-intl/next-intl.hoc.cjs +1 -1
- package/dist/react/next-intl/next-intl.hoc.js +1 -1
- package/dist/react/next-intl/next-intl.hook.cjs +1 -1
- package/dist/react/next-intl/next-intl.hook.js +1 -1
- package/dist/react/next-intl/next-intl.provider.cjs +1 -1
- package/dist/react/next-intl/next-intl.provider.js +1 -1
- package/dist/react/storage/index.cjs +1 -1
- package/dist/react/storage/index.js +1 -1
- package/dist/react/storage/storage.hook.cjs +1 -1
- package/dist/react/storage/storage.hook.js +1 -1
- package/dist/react/vitest/index.cjs +1 -1
- package/dist/react/vitest/index.js +1 -1
- package/dist/react/vitest/vitest.e2e.cjs +1 -1
- package/dist/react/vitest/vitest.e2e.js +1 -1
- package/dist/react/vitest/vitest.unit.cjs +1 -1
- package/dist/react/vitest/vitest.unit.js +1 -1
- package/dist/utils/common/common.util.cjs +1 -1
- package/dist/utils/common/common.util.js +1 -1
- package/dist/utils/common/index.cjs +1 -1
- package/dist/utils/common/index.js +1 -1
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/object/index.cjs +1 -1
- package/dist/utils/object/index.js +1 -1
- package/dist/utils/object/object.util.cjs +1 -1
- package/dist/utils/object/object.util.js +1 -1
- package/dist/utils/serializer/index.cjs +1 -1
- package/dist/utils/serializer/index.js +1 -1
- package/dist/utils/serializer/serializer.util.cjs +1 -1
- package/dist/utils/serializer/serializer.util.js +1 -1
- package/dist/utils/string/index.cjs +1 -1
- package/dist/utils/string/index.js +1 -1
- package/dist/utils/string/string.util.cjs +1 -1
- package/dist/utils/string/string.util.js +1 -1
- package/package.json +1 -1
- package/public/tsconfig.base.json +8 -2
package/dist/configs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t,r,n,o,i,a){try{var c=e[i](a);var s=c.value}catch(e){r(e);return}if(c.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var a=e.apply(t,r);function c(e){n(a,o,i,c,s,"next",e)}function s(e){n(a,o,i,c,s,"throw",e)}c(undefined)})}}function i(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var i=false;var a,c;try{for(r=r.call(e);!(o=(a=r.next()).done);o=true){n.push(a.value);if(t&&n.length===t)break}}catch(e){i=true;c=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(i)throw c}}return n}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){i(e,t,r[t])})}return e}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{f(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function d(e,t){if(e==null)return{};var r=v(e,t);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function v(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function y(e,r){return t(e)||c(e,r)||h(e,r)||s()}function g(e){return r(e)||a(e)||h(e)||u()}function m(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function h(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.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(t,r)}function b(e,t){var r,n,o,i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(c){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(i=0)),i)try{if(r=1,n&&(o=c[0]&2?n["return"]:c[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;if(n=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;n=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(c[0]===6&&i.label<o[1]){i.label=o[1];o=c;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(c);break}if(o[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];n=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var w={extends:["@commitlint/config-conventional"]};var I=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}(I||{});import O from"@antfu/eslint-config";import S from"@vitejs/plugin-react-swc";import{defineConfig as E}from"vitest/config";function T(e){return E(l({plugins:[S()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}import _ from"@vitejs/plugin-react-swc";import{defineConfig as C}from"vitest/config";import j from"node:process";import{exec as A}from"node:child_process";import k from"node:process";import*as N from"node:util";import P from"node:process";var G=P.env.DEBUG==="true";import L from"chalk";import x from"consola";import{GraphQLError as D}from"graphql";G||(x.level=4);function R(e){var t=L[e];return typeof t=="function"?t:L.green}var F={silent:x.silent,level:x.level,fatal:x.fatal,error:x.error,warn:x.warn,log:x.log,info:x.info,success:x.success,ready:x.ready,start:x.start,box:x.box,debug:x.debug,trace:x.trace,verbose:x.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){x.box(L.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,o=e.rule,i=e.message;x.log("".concat(L.gray("File:")," ").concat(L.blue("".concat(t).concat(n?":".concat(n):"")))),o&&x.log(" ".concat(R(r)("Rule:")," ").concat(o)),x.log(" ".concat(R(r)("Message:")," ").concat(i))}),x.box(R(r)("".concat(e," : ").concat(t.length))),x.log(L.gray("─".repeat(40)))}};var M={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import U from"node-fetch";import*as J from"node:fs";function K(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return J.existsSync(e)})}function W(e,t){var r=J.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":m(n))=="object"&&n!==null)return n;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 r}function Y(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,o=n===void 0?!1:n,i=o&&(typeof t==="undefined"?"undefined":m(t))=="object"?JSON.stringify(t,null,4):String(t);J.writeFileSync(e,i,"utf-8")}function B(e){var t=eO(eS,ej);if(!K(t))return!1;try{var r=W(t,{asJson:!0}),n=r.name,o=r.dependencies,i=o===void 0?{}:o,a=r.devDependencies,c=a===void 0?{}:a,s=n===e,u=e in i,l=e in c;return s||u||l?{path:t,file:r,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return F.warn("Failed to read package.json: ".concat(e.message)),!1}}function H(e){return $.apply(this,arguments)}function $(){$=o(function(e){var t,r,n,o;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,U("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=i.sent(),n=r.version;return[2,n];case 3:o=i.sent();throw F.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})});return $.apply(this,arguments)}function q(e,t){return V.apply(this,arguments)}function V(){V=o(function(e,t){var r,n,o,i,a,c,s,u,f,p,d,v,y,g,m,h,w,I,O,S,E;return b(this,function(b){switch(b.label){case 0:b.trys.push([0,4,,5]);r=B(e);if(!r)return[2,l({},M)];s=r.path,u=r.file,f=r.isCurrentProject,p=r.isDepend,d=r.isDevDepend,v=(n=u.dependencies)!==null&&n!==void 0?n:{},y=(o=u.devDependencies)!==null&&o!==void 0?o:{},g=f?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(a=v[e])!==null&&a!==void 0?a:"0.0.0":d?(c=y[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=g;return[3,3];case 1:return[4,H(e)];case 2:w=b.sent();b.label=3;case 3:m=w,h=f||g===m;if(!h&&(t===null||t===void 0?void 0:t.update)){;O=p?"dependencies":d?"devDependencies":null;O&&((I=u[O])===null||I===void 0?void 0:I[e])!==m&&(u[O]=(S=u[O])!==null&&S!==void 0?S:{},u[O][e]=m,Y(s,u,{isJson:!0}),F.info('Updated "'.concat(e,'" to version ').concat(m)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:h}];case 4:E=b.sent();return[2,(F.error('Error checking package "'.concat(e,'": ').concat(E.message)),l({},M))];case 5:return[2]}})});return V.apply(this,arguments)}function Q(){return z.apply(this,arguments)}function z(){z=o(function(){var e,t,r,n,o,i,a,c,s,u,l,f;return b(this,function(p){switch(p.label){case 0:e=[{command:function(){return te.pnpmInstallStandard()},message:"Installing dependencies (standard)"},{command:function(){return te.pnpmInstallLegacy()},message:"Retrying with legacy peer dependencies"},{command:function(){return te.pnpmInstallForce()},message:"Retrying with force install"}];t=true,r=false,n=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);o=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=o.next()).done))return[3,8];a=i.value,c=a.command,s=a.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,eh("".concat(s," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();F.warn("Installation attempt failed: ".concat(s)),F.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=p.sent();r=true;n=f;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return z.apply(this,arguments)}function X(e,t){return Z.apply(this,arguments)}function Z(){Z=o(function(e,t){var r,n,o,i,a,c,s,u,f,p,d;return b(this,function(v){switch(v.label){case 0:if(!K(e5.PACKAGE_JSON)){F.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);r=g(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return q(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=v.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,Q()];case 3:n=v.sent();v.label=4;case 4:n;i=true,a=false,c=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();v.label=6;case 6:if(!!(i=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:p=v.sent();a=true;c=p;return[3,12];case 11:try{if(!i&&s.return!=null){s.return()}}finally{if(a){throw c}}return[7];case 12:return[3,14];case 13:d=v.sent();throw F.error('Failed to setup "'.concat(e.join(", "),'": ').concat(d.message)),d;case 14:return[2]}})});return Z.apply(this,arguments)}import ee from"node-persist";import et from"node:os";import er from"node:process";function en(){return er.env.CYBERSKILL_STORAGE_DIR||eO(et.homedir(),eT)}function eo(){return ei.apply(this,arguments)}function ei(){ei=o(function(){var e;return b(this,function(t){switch(t.label){case 0:e=ee.defaultInstance;if(e)return[3,2];return[4,ee.init({dir:en(),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 ei.apply(this,arguments)}var ea={get:function e(e){return o(function(){var t,r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eo()];case 1:n.sent();return[4,ee.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(F.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,eo()];case 1:n.sent();return[4,ee.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();F.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eo()];case 1:r.sent();return[4,ee.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();F.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 b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,eo()];case 1:r.sent();return[4,ee.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(F.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(F.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return b(this,function(t){try{return[2,"".concat(en()," (key: ").concat(e,")")]}catch(e){return[2,(F.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ec=N.promisify(A);function es(e){return"error_list:".concat(e)}function eu(e){return el.apply(this,arguments)}function el(){el=o(function(e){var t,r,n;return b(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),r=es(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,ea.set(r,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,ea.getLogLink(r)];case 1:e=t.sent();e&&F.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=i.sent();F.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return el.apply(this,arguments)}function ef(e){var t=[],r=[],n="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var c,s,u,l,f;var p=o.exec(e)||[],d=i.exec(e)||[],v=a.exec(e)||[];var y,g,m,h,b,w;p.length&&n?t.push({file:n,position:"".concat(p[1],":").concat(p[2]),type:p[3]==="error"?"error":"warning",message:(y=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&y!==void 0?y:"",rule:(g=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&g!==void 0?g:""}):d.length?t.push({file:(m=d===null||d===void 0?void 0:d[1])!==null&&m!==void 0?m:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]==="error"?"error":"warning",message:(h=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):v.length?t.push({file:"commitlint",type:"error",message:(b=v===null||v===void 0?void 0:(l=v[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=v===null||v===void 0?void 0:(f=v[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):r.push(e.trim())}}),t.length&&eu(t),G&&r.length&&(F.warn("Unmatched lines:"),r.forEach(function(e){return F.info(" ".concat(e))}))}function ep(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,o=e.line,i=e.column,a=e.ruleId,c=e.message;r.push({type:n===2?"error":"warning",file:t,position:"".concat(o,":").concat(i),rule:a,message:c})})}),r.length&&eu(r)}catch(t){ef(e)}}function ed(e){return ev.apply(this,arguments)}function ev(){ev=o(function(e){var t,r,n,o,i,a,c,s,u;var l=arguments;return b(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:ep;r=new AbortController;k.on("SIGINT",function(){F.warn("Process interrupted. Terminating..."),r.abort(),k.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,ec(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=f.sent(),o=n.stdout,i=n.stderr;[o,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:a=f.sent();c=a.stdout,s=a.stderr,u=a.message;[c,s].forEach(function(e){return e&&t(e)}),!s&&!c&&F.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return ev.apply(this,arguments)}function ey(e){return{raw:!0,cmd:e}}function eg(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(eZ," ").concat(eE," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(eZ," ").concat(eQ," ").concat(eF," ").concat(e):"".concat(eZ," ").concat(eR," ").concat(e)}function em(e,t){return typeof e=="function"?eg(e(t),t):(typeof e==="undefined"?"undefined":m(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?eg(e,t):e}function eh(e,t){return eb.apply(this,arguments)}function eb(){eb=o(function(e,t){var r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);F.start("".concat(e)),G&&F.info("→ ".concat(t));return[4,ed(t)];case 1:n.sent(),F.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw F.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return eb.apply(this,arguments)}import*as ew from"node:path";function eI(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=ew).resolve.apply(n,[eS].concat(g(t)))}function eO(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=ew).join.apply(n,g(t))}var eS=j.env.INIT_CWD||j.cwd(),eE="@cyberskill/shared",eT=".cyberskill-storage",e_="node_modules",eC="dist",ej="package.json",eA="package-lock.json",ek="tsconfig.json",eN=".gitignore",eP=".simple-git-hooks.json",eG="pnpm-lock.yaml",eL=".git/hooks/",ex=".git/COMMIT_EDITMSG",eD=eO(eS,e_,eE,eC),eR="cyberskill",eF="src/nodejs/cli/index.ts",eM="eslint",eU="eslint",eJ="vitest",eK="playwright",eW="vitest",eY="@commitlint/cli",eB="commitlint",eH="lint-staged",e$="lint-staged",eq="typescript",eV="tsc",eQ="tsx",ez="git",eX="pnpm",eZ="pnpm exec",e0="simple-git-hooks",e1="simple-git-hooks",e2="@eslint/config-inspector",e4="eslint-config-inspector",e3="node-modules-inspector",e8="node-modules-inspector",e5={CYBERSKILL_DIRECTORY:eD,WORKING_DIRECTORY:eS,TS_CONFIG:eI(ek),GIT_IGNORE:eI(eN),GIT_HOOK:eI(eL),GIT_COMMIT_MSG:eI(ex),SIMPLE_GIT_HOOKS_JSON:eI(eP),PACKAGE_JSON:eI(ej),PACKAGE_LOCK_JSON:eI(eA),PNPM_LOCK_YAML:eI(eG),NODE_MODULES:eI(e_),LINT_STAGED_CONFIG:eI("".concat(eD,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eI("".concat(eD,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eI("".concat(eD,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eI("".concat(eD,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eI("".concat(eD,"/react/vitest/vitest.e2e.js"))};function e6(e){return e7.apply(this,arguments)}function e7(){e7=o(function(e){var t,r,n,o,i,a;var c=arguments;return b(this,function(s){switch(s.label){case 0:for(t=c.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=c[n]}o=y(r,2),i=o[0],a=o[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case"CLI":return[3,1];case"RAW":return[3,3]}return[3,4];case 1:return[4,X(i.split(" "),{update:!0})];case 2:return[2,(s.sent(),em(ey("".concat(eZ," ").concat(a))))];case 3:return[2,em(ey(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return e7.apply(this,arguments)}function e9(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return /*#__PURE__*/o(function(){return b(this,function(t){return[2,e6.apply(void 0,[e].concat(g(r)))]})})}var te={simpleGitHooks:e9("CLI",e0,e1),eslintInspect:e9("CLI",e2,e4),nodeModulesInspect:e9("CLI",e3,e8),eslintCheck:e9("CLI",eM,"".concat(eU," ").concat(e5.WORKING_DIRECTORY)),eslintFix:e9("CLI",eM,"".concat(eU," ").concat(e5.WORKING_DIRECTORY," --fix")),typescriptCheck:e9("CLI",eq,"".concat(eV," -p ").concat(e5.TS_CONFIG," --noEmit")),configureGitHook:e9("RAW","".concat(ez," config core.hooksPath ").concat(e5.GIT_HOOK)),testUnit:e9("CLI",eJ,"".concat(eW," --config ").concat(e5.UNIT_TEST_CONFIG)),testE2e:e9("CLI","".concat(eJ," ").concat(eK),"".concat(eW," --config ").concat(e5.E2E_TEST_CONFIG)),commitLint:e9("CLI",eY,"".concat(eB," --edit ").concat(e5.GIT_COMMIT_MSG," --config ").concat(e5.COMMITLINT_CONFIG)),lintStaged:e9("CLI",eH,"".concat(e$," --config ").concat(e5.LINT_STAGED_CONFIG)),stageBuildDirectory:e9("RAW","".concat(ez," add ").concat(eC)),build:e9("RAW","".concat(eX," run build")),pnpmInstallStandard:e9("RAW","".concat(eX," install")),pnpmInstallLegacy:e9("RAW","".concat(eX," install --legacy-peer-deps")),pnpmInstallForce:e9("RAW","".concat(eX," install --force"))};function tt(e){return C(l({plugins:[_()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[e5.UNIT_TEST_SETUP_CONFIG]}},e))}function tr(e){return!!e&&(typeof e==="undefined"?"undefined":m(e))=="object"&&!Array.isArray(e)}function tn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,o=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),a;!(r=(a=i.next()).done);r=true){var c=y(a.value,2),s=c[0],u=c[1];var l=e[s];Array.isArray(u)?e[s]=Array.from(new Set(g(Array.isArray(l)?l:[]).concat(g(u)))):tr(u)?e[s]=tn(tr(l)?l:{},u):e[s]=u}}catch(e){n=true;o=e}finally{try{if(!r&&i.return!=null){i.return()}}finally{if(n){throw o}}}return e},{})}import*as to from"globals";var ti=[{languageOptions:{globals:l({},to.node,to.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var ta=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tn.apply(void 0,g(t))},tc=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tn.apply(void 0,[ti].concat(g(t))),o=n.ignores,i=d(n,["ignores"]),a=Array.isArray(o)&&o.every(function(e){return typeof e=="string"})?{ignores:o}:void 0,c=[i].concat(g(a?[a]:[]));return O.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(g(c)))},ts=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return T.apply(void 0,g(t))},tu=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tt.apply(void 0,g(t))},tl={eslint:tc,commitlint:ta,"lint-staged":ta,"vitest-react-e2e":ts,"vitest-react-unit":tu};function tf(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var o=tl[e];if(!o)throw new Error("Unknown config type: ".concat(e));return o.apply(void 0,g(r))}import{defineConfig as tp}from"@eddeee888/gcg-typescript-resolver-files";function td(e){var t=e.uri,r=e.from,n=e.to,o=e.target,a=o===void 0?"client":o;var c=a==="client",s=a==="server";return p(l({schema:t,ignoreNoDocuments:!0,overwrite:!0},c&&{documents:[r]}),{generates:l({},c&&i({},n,{preset:"client",config:{useTypeImports:!0}}),s&&i({},n,tp()))})}var tv={"*":["eslint --fix"]};export{I as E_ConfigType,w as commitlintConfig,td as createGraphqlCodegenConfig,ti as eslintConfig,tv as lintStagedConfig,tf as mergeConfigs};
|
|
1
|
+
function e(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function t(e){if(Array.isArray(e))return e}function r(t){if(Array.isArray(t))return e(t)}function n(e,t,r,n,o,i,a){try{var c=e[i](a);var s=c.value}catch(e){r(e);return}if(c.done){t(s)}else{Promise.resolve(s).then(n,o)}}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var a=e.apply(t,r);function c(e){n(a,o,i,c,s,"next",e)}function s(e){n(a,o,i,c,s,"throw",e)}c(undefined)})}}function i(e,t,r){if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function a(e){if(typeof Symbol!=="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function c(e,t){var r=e==null?null:typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r==null)return;var n=[];var o=true;var i=false;var a,c;try{for(r=r.call(e);!(o=(a=r.next()).done);o=true){n.push(a.value);if(t&&n.length===t)break}}catch(e){i=true;c=e}finally{try{if(!o&&r["return"]!=null)r["return"]()}finally{if(i)throw c}}return n}function s(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function l(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};var n=Object.keys(r);if(typeof Object.getOwnPropertySymbols==="function"){n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))}n.forEach(function(t){i(e,t,r[t])})}return e}function f(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);if(t){n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})}r.push.apply(r,n)}return r}function p(e,t){t=t!=null?t:{};if(Object.getOwnPropertyDescriptors){Object.defineProperties(e,Object.getOwnPropertyDescriptors(t))}else{f(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}function d(e,t){if(e==null)return{};var r=v(e,t);var n,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++){n=i[o];if(t.indexOf(n)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(e,n))continue;r[n]=e[n]}}return r}function v(e,t){if(e==null)return{};var r={};var n=Object.keys(e);var o,i;for(i=0;i<n.length;i++){o=n[i];if(t.indexOf(o)>=0)continue;r[o]=e[o]}return r}function g(e,r){return t(e)||c(e,r)||h(e,r)||s()}function m(e){return r(e)||a(e)||h(e)||u()}function y(e){"@swc/helpers - typeof";return e&&typeof Symbol!=="undefined"&&e.constructor===Symbol?"symbol":typeof e}function h(t,r){if(!t)return;if(typeof t==="string")return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor)n=t.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(t,r)}function b(e,t){var r,n,o,i={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},a=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return a.next=c(0),a["throw"]=c(1),a["return"]=c(2),typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(e){return function(t){return s([e,t])}}function s(c){if(r)throw new TypeError("Generator is already executing.");while(a&&(a=0,c[0]&&(i=0)),i)try{if(r=1,n&&(o=c[0]&2?n["return"]:c[0]?n["throw"]||((o=n["return"])&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;if(n=0,o)c=[c[0]&2,o.value];switch(c[0]){case 0:case 1:o=c;break;case 4:i.label++;return{value:c[1],done:false};case 5:i.label++;n=c[1];c=[0];continue;case 7:c=i.ops.pop();i.trys.pop();continue;default:if(!(o=i.trys,o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){i=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(c[0]===6&&i.label<o[1]){i.label=o[1];o=c;break}if(o&&i.label<o[2]){i.label=o[2];i.ops.push(c);break}if(o[2])i.ops.pop();i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e];n=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}}var w=Object.defineProperty;var I=function(e,t){return w(e,"name",{value:t,configurable:!0})};var E={extends:["@commitlint/config-conventional"]};var O=function(e){return e.ESLINT="eslint",e.COMMITLINT="commitlint",e.LINT_STAGED="lint-staged",e.VITEST_REACT_E2E="vitest-react-e2e",e.VITEST_REACT_UNIT="vitest-react-unit",e}({});import S from"@antfu/eslint-config";import T from"@vitejs/plugin-react-swc";import{defineConfig as C}from"vitest/config";function _(e){return C(l({plugins:[T()],test:{include:["**/*.test.e2e.?(c|m)[jt]s?(x)"],browser:{enabled:!0,provider:"playwright",instances:[{browser:"chromium"},{browser:"firefox"},{browser:"webkit"}]}}},e))}I(_,"vitestE2E");import j from"@vitejs/plugin-react-swc";import{defineConfig as A}from"vitest/config";import k from"node:process";var N=function(e){return e.CLI="CLI",e.RAW="RAW",e}({});import{exec as L}from"node:child_process";import P from"node:process";import*as G from"node:util";import x from"node:process";var D=x.env.DEBUG==="true";var R=function(e){return e.Error="error",e.Warning="warning",e}({});import F from"chalk";import M from"consola";import{GraphQLError as U}from"graphql";D||(M.level=4);function W(e){var t=F[e];return typeof t=="function"?t:F.green}I(W,"chalkKeyword");var J={silent:M.silent,level:M.level,fatal:M.fatal,error:M.error,warn:M.warn,log:M.log,info:M.info,success:M.success,ready:M.ready,start:M.start,box:M.box,debug:M.debug,trace:M.trace,verbose:M.verbose,printBoxedLog:function e(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"red";if(!(t===null||t===void 0?void 0:t.length)){M.box(F.green(e));return}t.forEach(function(e){var t=e.file,n=e.position,o=e.rule,i=e.message;M.log("".concat(F.gray("File:")," ").concat(F.blue("".concat(t).concat(n?":".concat(n):"")))),o&&M.log(" ".concat(W(r)("Rule:")," ").concat(o)),M.log(" ".concat(W(r)("Message:")," ").concat(i))}),M.box(W(r)("".concat(e," : ").concat(t.length))),M.log(F.gray("─".repeat(40)))}};var K={isCurrentProject:!1,installedPath:"",file:{},isUpToDate:!1};import V from"node-fetch";import*as Y from"node:fs";function B(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.every(function(e){return Y.existsSync(e)})}I(B,"existsSync");function H(e,t){var r=Y.readFileSync(e,"utf-8");if(t===null||t===void 0?void 0:t.asJson)try{var n=JSON.parse(r);if((typeof n==="undefined"?"undefined":y(n))=="object"&&n!==null)return n;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 r}I(H,"readFileSync");function q(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var n=r.isJson,o=n===void 0?!1:n,i=o&&(typeof t==="undefined"?"undefined":y(t))=="object"?JSON.stringify(t,null,4):String(t);Y.writeFileSync(e,i,"utf-8")}I(q,"writeFileSync");function $(e){var t=eC(e_,eL);if(!B(t))return!1;try{var r=H(t,{asJson:!0}),n=r.name,o=r.dependencies,i=o===void 0?{}:o,a=r.devDependencies,c=a===void 0?{}:a,s=n===e,u=e in i,l=e in c;return s||u||l?{path:t,file:r,isCurrentProject:s,isDepend:u,isDevDepend:l}:!1}catch(e){return J.warn("Failed to read package.json: ".concat(e.message)),!1}}I($,"getPackage");function Q(e){return z.apply(this,arguments)}function z(){z=o(function(e){var t,r,n,o;return b(this,function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,V("https://registry.npmjs.org/".concat(e,"/latest"))];case 1:t=i.sent();if(!t.ok)throw new Error("Failed to fetch latest version: ".concat(t.status," ").concat(t.statusText));return[4,t.json()];case 2:r=i.sent(),n=r.version;return[2,n];case 3:o=i.sent();throw J.error('Failed to fetch version for "'.concat(e,'": ').concat(o.message)),o;case 4:return[2]}})});return z.apply(this,arguments)}I(Q,"getLatestPackageVersion");function X(e,t){return Z.apply(this,arguments)}function Z(){Z=o(function(e,t){var r,n,o,i,a,c,s,u,f,p,d,v,g,m,y,h,w,I,E,O,S;return b(this,function(b){switch(b.label){case 0:b.trys.push([0,4,,5]);r=$(e);if(!r)return[2,l({},K)];s=r.path,u=r.file,f=r.isCurrentProject,p=r.isDepend,d=r.isDevDepend,v=(n=u.dependencies)!==null&&n!==void 0?n:{},g=(o=u.devDependencies)!==null&&o!==void 0?o:{},m=f?(i=u.version)!==null&&i!==void 0?i:"0.0.0":p?(a=v[e])!==null&&a!==void 0?a:"0.0.0":d?(c=g[e])!==null&&c!==void 0?c:"0.0.0":"0.0.0";if(!f)return[3,1];w=m;return[3,3];case 1:return[4,Q(e)];case 2:w=b.sent();b.label=3;case 3:y=w,h=f||m===y;if(!h&&(t===null||t===void 0?void 0:t.update)){;E=p?"dependencies":d?"devDependencies":null;E&&((I=u[E])===null||I===void 0?void 0:I[e])!==y&&(u[E]=(O=u[E])!==null&&O!==void 0?O:{},u[E][e]=y,q(s,u,{isJson:!0}),J.info('Updated "'.concat(e,'" to version ').concat(y)))}return[2,{isCurrentProject:f,installedPath:s,file:u,isUpToDate:h}];case 4:S=b.sent();return[2,(J.error('Error checking package "'.concat(e,'": ').concat(S.message)),l({},K))];case 5:return[2]}})});return Z.apply(this,arguments)}I(X,"checkPackage");function ee(){return et.apply(this,arguments)}function et(){et=o(function(){var e,t,r,n,o,i,a,c,s,u,l,f;return b(this,function(p){switch(p.label){case 0:e=[{command:I(function(){return to.pnpmInstallStandard()},"command"),message:"Installing dependencies (standard)"},{command:I(function(){return to.pnpmInstallLegacy()},"command"),message:"Retrying with legacy peer dependencies"},{command:I(function(){return to.pnpmInstallForce()},"command"),message:"Retrying with force install"}];t=true,r=false,n=undefined;p.label=1;case 1:p.trys.push([1,9,10,11]);o=e[Symbol.iterator]();p.label=2;case 2:if(!!(t=(i=o.next()).done))return[3,8];a=i.value,c=a.command,s=a.message;p.label=3;case 3:p.trys.push([3,6,,7]);return[4,c()];case 4:u=p.sent();return[4,eE("".concat(s," using: ").concat(u),u)];case 5:p.sent();return[2];case 6:l=p.sent();J.warn("Installation attempt failed: ".concat(s)),J.error("Details: ".concat(l.message));return[3,7];case 7:t=true;return[3,2];case 8:return[3,11];case 9:f=p.sent();r=true;n=f;return[3,11];case 10:try{if(!t&&o.return!=null){o.return()}}finally{if(r){throw n}}return[7];case 11:throw new Error("All dependency installation strategies failed.")}})});return et.apply(this,arguments)}I(ee,"installDependencies");function er(e,t){return en.apply(this,arguments)}function en(){en=o(function(e,t){var r,n,o,i,a,c,s,u,f,p,d;return b(this,function(v){switch(v.label){case 0:if(!B(te.PACKAGE_JSON)){J.error("package.json not found. Aborting setup.");return[2]}v.label=1;case 1:v.trys.push([1,13,,14]);r=m(new Set(e)).sort();return[4,Promise.all(r.map(function(e){return X(e,l({},(t===null||t===void 0?void 0:t.update)&&{update:t.update}))}))];case 2:n=v.sent().every(function(e){return e.isUpToDate});if(n)return[3,4];return[4,ee()];case 3:n=v.sent();v.label=4;case 4:n;i=true,a=false,c=undefined;v.label=5;case 5:v.trys.push([5,10,11,12]);s=((o=t===null||t===void 0?void 0:t.postInstallActions)!==null&&o!==void 0?o:[])[Symbol.iterator]();v.label=6;case 6:if(!!(i=(u=s.next()).done))return[3,9];f=u.value;return[4,f()];case 7:v.sent();v.label=8;case 8:i=true;return[3,6];case 9:return[3,12];case 10:p=v.sent();a=true;c=p;return[3,12];case 11:try{if(!i&&s.return!=null){s.return()}}finally{if(a){throw c}}return[7];case 12:return[3,14];case 13:d=v.sent();throw J.error('Failed to setup "'.concat(e.join(", "),'": ').concat(d.message)),d;case 14:return[2]}})});return en.apply(this,arguments)}I(er,"setupPackages");import eo from"node-persist";import ei from"node:os";import ea from"node:process";function ec(){return ea.env.CYBERSKILL_STORAGE_DIR||eC(ei.homedir(),eA)}I(ec,"getStorageDir");function es(){return eu.apply(this,arguments)}function eu(){eu=o(function(){var e;return b(this,function(t){switch(t.label){case 0:e=eo.defaultInstance;if(e)return[3,2];return[4,eo.init({dir:ec(),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 eu.apply(this,arguments)}I(es,"initNodePersist");var el={get:function e(e){return o(function(){var t,r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,es()];case 1:n.sent();return[4,eo.getItem(e)];case 2:return[2,(t=n.sent())!==null&&t!==void 0?t:null];case 3:r=n.sent();return[2,(J.error('[Storage:get] Error getting key "'.concat(e,'":'),r),null)];case 4:return[2]}})})()},set:function e(e,t){return o(function(){var r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,es()];case 1:n.sent();return[4,eo.setItem(e,t)];case 2:n.sent();return[3,4];case 3:r=n.sent();J.error('[Storage:set] Error setting key "'.concat(e,'":'),r);return[3,4];case 4:return[2]}})})()},remove:function e(e){return o(function(){var t;return b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,es()];case 1:r.sent();return[4,eo.removeItem(e)];case 2:r.sent();return[3,4];case 3:t=r.sent();J.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 b(this,function(r){switch(r.label){case 0:r.trys.push([0,3,,4]);return[4,es()];case 1:r.sent();return[4,eo.keys()];case 2:e=r.sent();return[2,Array.isArray(e)?e:(J.warn("[Storage:keys] Invalid keys response:",e),[])];case 3:t=r.sent();return[2,(J.error("[Storage:keys] Error getting keys:",t),[])];case 4:return[2]}})})()},getLogLink:function e(e){return o(function(){return b(this,function(t){try{return[2,"".concat(ec()," (key: ").concat(e,")")]}catch(e){return[2,(J.error("[Storage:getLogLink] Error getting log link:",e),null)]}return[2]})})()}};var ef=G.promisify(L);function ep(e){return"error_list:".concat(e)}I(ep,"getErrorListKey");function ed(e){return ev.apply(this,arguments)}function ev(){ev=o(function(e){var t,r,n;return b(this,function(i){switch(i.label){case 0:if(e.length===0)return[2];t=Date.now(),r=ep(t);i.label=1;case 1:i.trys.push([1,3,,4]);return[4,el.set(r,{errors:e,timestamp:t})];case 2:i.sent(),setTimeout(/*#__PURE__*/o(function(){var e;return b(this,function(t){switch(t.label){case 0:return[4,el.getLogLink(r)];case 1:e=t.sent();e&&J.info("\uD83D\uDCC2 Open the error list manually: ".concat(e));return[2]}})}),10);return[3,4];case 3:n=i.sent();J.error("Failed to save errors: ".concat(n.message));return[3,4];case 4:return[2]}})});return ev.apply(this,arguments)}I(ed,"saveErrorListToStorage");function eg(e){var t=[],r=[],n="",o=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,i=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,a=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split("\n").forEach(function(e){if(e.startsWith("/"))n=e.trim();else{var c,s,u,l,f;var p=o.exec(e)||[],d=i.exec(e)||[],v=a.exec(e)||[];var g,m,y,h,b,w;p.length&&n?t.push({file:n,position:"".concat(p[1],":").concat(p[2]),type:p[3]===R.Error?R.Error:R.Warning,message:(g=p===null||p===void 0?void 0:(c=p[4])===null||c===void 0?void 0:c.trim())!==null&&g!==void 0?g:"",rule:(m=p===null||p===void 0?void 0:(s=p[5])===null||s===void 0?void 0:s.trim())!==null&&m!==void 0?m:""}):d.length?t.push({file:(y=d===null||d===void 0?void 0:d[1])!==null&&y!==void 0?y:"",position:"".concat(d[2],":").concat(d[3]),type:d[4]===R.Error?R.Error:R.Warning,message:(h=d===null||d===void 0?void 0:(u=d[5])===null||u===void 0?void 0:u.trim())!==null&&h!==void 0?h:""}):v.length?t.push({file:"commitlint",type:R.Error,message:(b=v===null||v===void 0?void 0:(l=v[1])===null||l===void 0?void 0:l.trim())!==null&&b!==void 0?b:"",rule:(w=v===null||v===void 0?void 0:(f=v[2])===null||f===void 0?void 0:f.trim())!==null&&w!==void 0?w:""}):r.push(e.trim())}}),t.length&&ed(t),D&&r.length&&(J.warn("Unmatched lines:"),r.forEach(function(e){return J.info(" ".concat(e))}))}I(eg,"parseTextErrors");function em(e){try{var t=JSON.parse(e),r=[];t.forEach(function(e){var t=e.filePath,n=e.messages;n.forEach(function(e){var n=e.severity,o=e.line,i=e.column,a=e.ruleId,c=e.message;r.push({type:n===2?R.Error:R.Warning,file:t,position:"".concat(o,":").concat(i),rule:a,message:c})})}),r.length&&ed(r)}catch(t){eg(e)}}I(em,"parseCommandOutput");function ey(e){return eh.apply(this,arguments)}function eh(){eh=o(function(e){var t,r,n,o,i,a,c,s,u;var l=arguments;return b(this,function(f){switch(f.label){case 0:t=l.length>1&&l[1]!==void 0?l[1]:em;r=new AbortController;P.on("SIGINT",function(){J.warn("Process interrupted. Terminating..."),r.abort(),P.exit()});f.label=1;case 1:f.trys.push([1,3,,4]);return[4,ef(e,{maxBuffer:0x6400000,signal:r.signal})];case 2:n=f.sent(),o=n.stdout,i=n.stderr;[o,i].forEach(function(e){return e&&t(e)});return[3,4];case 3:a=f.sent();c=a.stdout,s=a.stderr,u=a.message;[c,s].forEach(function(e){return e&&t(e)}),!s&&!c&&J.error("Command failed: ".concat(u));return[3,4];case 4:return[2]}})});return eh.apply(this,arguments)}I(ey,"executeCommand");function eb(e){return{raw:!0,cmd:e}}I(eb,"rawCommand");function ew(e,t){return(t===null||t===void 0?void 0:t.isRemote)?"".concat(e4," ").concat(ej," ").concat(e):(t===null||t===void 0?void 0:t.isCurrentProject)?"".concat(e4," ").concat(e0," ").concat(eJ," ").concat(e):"".concat(e4," ").concat(eW," ").concat(e)}I(ew,"formatCLI");function eI(e,t){return typeof e=="function"?ew(e(t),t):(typeof e==="undefined"?"undefined":y(e))=="object"&&(e===null||e===void 0?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ew(e,t):e}I(eI,"formatCommand");function eE(e,t){return eO.apply(this,arguments)}function eO(){eO=o(function(e,t){var r;return b(this,function(n){switch(n.label){case 0:n.trys.push([0,2,,3]);J.start("".concat(e)),D&&J.info("→ ".concat(t));return[4,ey(t)];case 1:n.sent(),J.success("".concat(e," done."));return[3,3];case 2:r=n.sent();throw J.error("".concat(e," failed: ").concat(r.message)),r;case 3:return[2]}})});return eO.apply(this,arguments)}I(eE,"runCommand");import*as eS from"node:path";function eT(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eS).resolve.apply(n,[e_].concat(m(t)))}I(eT,"resolveWorkingPath");function eC(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n;return(n=eS).join.apply(n,m(t))}I(eC,"join");var e_=k.env.INIT_CWD||k.cwd(),ej="@cyberskill/shared",eA=".cyberskill-storage",ek="node_modules",eN="dist",eL="package.json",eP="package-lock.json",eG="tsconfig.json",ex=".gitignore",eD=".simple-git-hooks.json",eR="pnpm-lock.yaml",eF=".git/hooks/",eM=".git/COMMIT_EDITMSG",eU=eC(e_,ek,ej,eN),eW="cyberskill",eJ="src/nodejs/cli/index.ts",eK="eslint",eV="eslint",eY="vitest",eB="playwright",eH="vitest",eq="@commitlint/cli",e$="commitlint",eQ="lint-staged",ez="lint-staged",eX="typescript",eZ="tsc",e0="tsx",e1="git",e2="pnpm",e4="pnpm exec",e3="simple-git-hooks",e8="simple-git-hooks",e5="@eslint/config-inspector",e6="eslint-config-inspector",e7="node-modules-inspector",e9="node-modules-inspector",te={CYBERSKILL_DIRECTORY:eU,WORKING_DIRECTORY:e_,TS_CONFIG:eT(eG),GIT_IGNORE:eT(ex),GIT_HOOK:eT(eF),GIT_COMMIT_MSG:eT(eM),SIMPLE_GIT_HOOKS_JSON:eT(eD),PACKAGE_JSON:eT(eL),PACKAGE_LOCK_JSON:eT(eP),PNPM_LOCK_YAML:eT(eR),NODE_MODULES:eT(ek),LINT_STAGED_CONFIG:eT("".concat(eU,"/configs/lint-staged/base.js")),COMMITLINT_CONFIG:eT("".concat(eU,"/configs/commitlint/base.js")),UNIT_TEST_CONFIG:eT("".concat(eU,"/react/vitest/vitest.unit.js")),UNIT_TEST_SETUP_CONFIG:eT("".concat(eU,"/react/vitest/vitest.unit.setup.js")),E2E_TEST_CONFIG:eT("".concat(eU,"/react/vitest/vitest.e2e.js"))};function tt(e){return tr.apply(this,arguments)}function tr(){tr=o(function(e){var t,r,n,o,i,a;var c=arguments;return b(this,function(s){switch(s.label){case 0:for(t=c.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=c[n]}o=g(r,2),i=o[0],a=o[1];if(!i)throw new Error("'first' argument is undefined");switch(e){case N.CLI:return[3,1];case N.RAW:return[3,3]}return[3,4];case 1:return[4,er(i.split(" "),{update:!0})];case 2:return[2,(s.sent(),eI(eb("".concat(e4," ").concat(a))))];case 3:return[2,eI(eb(i))];case 4:throw new Error("Unsupported command type");case 5:return[2]}})});return tr.apply(this,arguments)}I(tt,"buildCommand");function tn(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}return /*#__PURE__*/o(function(){return b(this,function(t){return[2,tt.apply(void 0,[e].concat(m(r)))]})})}I(tn,"commandFactory");var to={simpleGitHooks:tn(N.CLI,e3,e8),eslintInspect:tn(N.CLI,e5,e6),nodeModulesInspect:tn(N.CLI,e7,e9),eslintCheck:tn(N.CLI,eK,"".concat(eV," ").concat(te.WORKING_DIRECTORY)),eslintFix:tn(N.CLI,eK,"".concat(eV," ").concat(te.WORKING_DIRECTORY," --fix")),typescriptCheck:tn(N.CLI,eX,"".concat(eZ," -p ").concat(te.TS_CONFIG," --noEmit")),configureGitHook:tn(N.RAW,"".concat(e1," config core.hooksPath ").concat(te.GIT_HOOK)),testUnit:tn(N.CLI,eY,"".concat(eH," --config ").concat(te.UNIT_TEST_CONFIG)),testE2e:tn(N.CLI,"".concat(eY," ").concat(eB),"".concat(eH," --config ").concat(te.E2E_TEST_CONFIG)),commitLint:tn(N.CLI,eq,"".concat(e$," --edit ").concat(te.GIT_COMMIT_MSG," --config ").concat(te.COMMITLINT_CONFIG)),lintStaged:tn(N.CLI,eQ,"".concat(ez," --config ").concat(te.LINT_STAGED_CONFIG)),stageBuildDirectory:tn(N.RAW,"".concat(e1," add ").concat(eN)),build:tn(N.RAW,"".concat(e2," run build")),pnpmInstallStandard:tn(N.RAW,"".concat(e2," install")),pnpmInstallLegacy:tn(N.RAW,"".concat(e2," install --legacy-peer-deps")),pnpmInstallForce:tn(N.RAW,"".concat(e2," install --force"))};function ti(e){return A(l({plugins:[j()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[te.UNIT_TEST_SETUP_CONFIG]}},e))}I(ti,"vitestUnit");function ta(e){return!!e&&(typeof e==="undefined"?"undefined":y(e))=="object"&&!Array.isArray(e)}I(ta,"isPlainObject");function tc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return t.flat().reduce(function(e,t){var r=true,n=false,o=undefined;try{for(var i=Object.entries(t)[Symbol.iterator](),a;!(r=(a=i.next()).done);r=true){var c=g(a.value,2),s=c[0],u=c[1];var l=e[s];Array.isArray(u)?e[s]=Array.from(new Set(m(Array.isArray(l)?l:[]).concat(m(u)))):ta(u)?e[s]=tc(ta(l)?l:{},u):e[s]=u}}catch(e){n=true;o=e}finally{try{if(!r&&i.return!=null){i.return()}}finally{if(n){throw o}}}return e},{})}I(tc,"deepMerge");import*as ts from"globals";var tu=[{languageOptions:{globals:l({},ts.node,ts.browser)},rules:{"perfectionist/sort-imports":["error",{internalPattern:["^#.*","^@/.*"]}]},ignores:["build","dist"]}];var tl;var tf=I(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return tc.apply(void 0,m(t))},"passThroughHandler"),tp=I(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}var n=tc.apply(void 0,[tu].concat(m(t))),o=n.ignores,i=d(n,["ignores"]),a=Array.isArray(o)&&o.every(function(e){return typeof e=="string"})?{ignores:o}:void 0,c=[i].concat(m(a?[a]:[]));return S.apply(void 0,[{stylistic:{semi:!0,indent:4,quotes:"single"},formatters:{css:!0,html:!0,markdown:"prettier"},yaml:!1,react:!0}].concat(m(c)))},"handleESLint"),td=I(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return _.apply(void 0,m(t))},"handleVitestReactE2E"),tv=I(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++){t[r]=arguments[r]}return ti.apply(void 0,m(t))},"handleVitestReactUnit"),tg=(tl={},i(tl,O.ESLINT,tp),i(tl,O.COMMITLINT,tf),i(tl,O.LINT_STAGED,tf),i(tl,O.VITEST_REACT_E2E,td),i(tl,O.VITEST_REACT_UNIT,tv),tl);function tm(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++){r[n-1]=arguments[n]}var o=tg[e];if(!o)throw new Error("Unknown config type: ".concat(e));return o.apply(void 0,m(r))}I(tm,"mergeConfigs");import{defineConfig as ty}from"@eddeee888/gcg-typescript-resolver-files";function th(e){var t=e.uri,r=e.from,n=e.to,o=e.target,a=o===void 0?"client":o;var c=a==="client",s=a==="server";return p(l({schema:t,ignoreNoDocuments:!0,overwrite:!0},c&&{documents:[r]}),{generates:l({},c&&i({},n,{preset:"client",presetConfig:{fragmentMasking:!1,persistedDocuments:!0},config:{useTypeImports:!0}}),s&&i({},n,ty()))})}I(th,"createGraphqlCodegenConfig");var tb={"*":["eslint --fix"]};export{O as E_ConfigType,E as commitlintConfig,th as createGraphqlCodegenConfig,tu as eslintConfig,tb as lintStagedConfig,tm as mergeConfigs};
|