@cyberskill/shared 1.201.0 → 1.202.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/magic-string.es-D_iPNVbJ.cjs +10 -0
- package/dist/magic-string.es-cELbkQ5L.js +901 -0
- package/dist/{path.constant-Y6ImOuVK.cjs → path.constant-CPGOAxEp.cjs} +2 -2
- package/dist/{path.constant-CFKXX6cG.js → path.constant-DJq0jtD0.js} +63 -64
- package/dist/src/config/vitest/vitest.unit.cjs +1 -1
- package/dist/src/config/vitest/vitest.unit.js +1 -1
- package/dist/src/config/vitest/vitest.unit.setup.cjs +1 -1
- package/dist/src/config/vitest/vitest.unit.setup.js +1 -1
- package/dist/src/node/cli/cli.util.cjs +1 -1
- package/dist/src/node/cli/cli.util.js +19 -19
- package/dist/src/node/command/command.util.cjs +1 -1
- package/dist/src/node/command/command.util.js +1 -1
- package/dist/src/node/command/index.cjs +1 -1
- package/dist/src/node/command/index.js +1 -1
- package/dist/src/node/express/express.util.cjs +1 -1
- package/dist/src/node/express/express.util.js +43 -42
- package/dist/src/node/mongo/mongo.util.cjs +1 -1
- package/dist/src/node/mongo/mongo.util.js +1 -1
- package/dist/src/node/package/index.cjs +1 -1
- package/dist/src/node/package/index.js +1 -1
- package/dist/src/node/package/package.util.cjs +1 -1
- package/dist/src/node/package/package.util.js +1 -1
- package/dist/src/node/path/index.cjs +1 -1
- package/dist/src/node/path/index.js +20 -21
- package/dist/src/node/path/path.constant.cjs +1 -1
- package/dist/src/node/path/path.constant.d.ts +0 -1
- package/dist/src/node/path/path.constant.js +25 -26
- package/dist/src/node/upload/upload.util.cjs +1 -1
- package/dist/src/node/upload/upload.util.js +1 -1
- package/dist/src/react/apollo-client/apollo-client.util.cjs +1 -1
- package/dist/src/react/apollo-client/apollo-client.util.js +29 -29
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.cjs +1 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.d.ts +3 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.component.js +20 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs +1 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts +6 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js +6 -0
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.cjs +1 -0
- package/dist/src/react/apollo-client-nextjs/{apollo-client.util.d.ts → apollo-client-nextjs.util.d.ts} +1 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client-nextjs.util.js +24 -0
- package/dist/src/react/apollo-client-nextjs/index.cjs +1 -1
- package/dist/src/react/apollo-client-nextjs/index.d.ts +2 -2
- package/dist/src/react/apollo-client-nextjs/index.js +4 -4
- package/package.json +9 -5
- package/dist/magic-string.es-CyLHbrL2.js +0 -871
- package/dist/magic-string.es-hjygV5wN.cjs +0 -10
- package/dist/src/react/apollo-client-nextjs/apollo-client.component.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client.component.d.ts +0 -3
- package/dist/src/react/apollo-client-nextjs/apollo-client.component.js +0 -33
- package/dist/src/react/apollo-client-nextjs/apollo-client.util.cjs +0 -1
- package/dist/src/react/apollo-client-nextjs/apollo-client.util.js +0 -31
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var ve=Object.defineProperty;var se=Object.getOwnPropertySymbols;var Ve=Object.prototype.hasOwnProperty,
|
|
2
|
-
`).forEach(o=>{var r,T,d,f,O,
|
|
1
|
+
"use strict";var ve=Object.defineProperty;var se=Object.getOwnPropertySymbols;var Ve=Object.prototype.hasOwnProperty,we=Object.prototype.propertyIsEnumerable;var re=(e,t,n)=>t in e?ve(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ae=(e,t)=>{for(var n in t||(t={}))Ve.call(t,n)&&re(e,n,t[n]);if(se)for(var n of se(t))we.call(t,n)&&re(e,n,t[n]);return e};var I=(e,t,n)=>new Promise((s,a)=>{var c=r=>{try{o(n.next(r))}catch(T){a(T)}},p=r=>{try{o(n.throw(r))}catch(T){a(T)}},o=r=>r.done?s(r.value):Promise.resolve(r.value).then(c,p);o((n=n.apply(e,t)).next())});const Ye=require("fs-extra"),X=require("./src/config/env/env.util.cjs"),E=require("./src/node/command/command.type.cjs"),je=require("node:child_process"),oe=require("node:process"),Je=require("node:util"),g=require("./src/node/log/log.type.cjs"),C=require("./src/node/log/log.util.cjs"),Ue=require("node-fetch"),y=require("./src/node/fs/fs.util.cjs"),i=require("./src/node/package/package.type.cjs"),m=require("./src/node/path/path.util.cjs"),v=require("./src/node/storage/storage.util.cjs");function Fe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const We=Fe(Je),xe=X.getEnv();function ie(e){return I(this,null,function*(){try{const t=yield Ue(`https://registry.npmjs.org/${e}/latest`);if(!t.ok)throw new Error(`Failed to fetch latest version: ${t.status} ${t.statusText}`);const{version:n}=yield t.json();return{success:!0,result:n}}catch(t){return C.catchError(t)}})}function U(e){return I(this,null,function*(){var t,n;try{if(!e){if(y.pathExistsSync(_.PACKAGE_JSON)){const h=y.readJsonSync(_.PACKAGE_JSON),{name:$="",version:M=""}=h;return{success:!0,result:{name:$,currentVersion:M,latestVersion:M,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:!1,isDevDependency:!1,installedPath:_.PACKAGE_JSON,file:h}}}return{success:!0,result:{name:"",currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:!1,isDevDependency:!1,installedPath:"",file:{}}}}if(!y.pathExistsSync(_.PACKAGE_JSON))return{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===i.E_PackageType.DEPENDENCY,isDevDependency:e.type===i.E_PackageType.DEV_DEPENDENCY,installedPath:"",file:{}}};const s=y.readJsonSync(_.PACKAGE_JSON),{name:a,version:c="",dependencies:p={},devDependencies:o={}}=s;if(e.name===a)return{success:!0,result:{name:a,currentVersion:c,latestVersion:c,isCurrentProject:!0,isInstalled:!0,isUpToDate:!0,isDependency:e.type===i.E_PackageType.DEPENDENCY,isDevDependency:e.type===i.E_PackageType.DEV_DEPENDENCY,installedPath:_.PACKAGE_JSON,file:s}};const r=e.name in p,T=e.name in o,d=yield ie(e.name);if(!d.success)return{success:!0,result:{name:e.name,currentVersion:"",latestVersion:"",isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:r,isDevDependency:T,installedPath:"",file:{}}};if(!r&&!T)return{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:e.type===i.E_PackageType.DEPENDENCY,isDevDependency:e.type===i.E_PackageType.DEV_DEPENDENCY,installedPath:"",file:{}}};const f=(n=(t=p[e.name])!=null?t:o[e.name])!=null?n:"",O=m.join(xe.CWD,F,e.name,W);if(!y.pathExistsSync(O))return{success:!0,result:{name:e.name,currentVersion:"",latestVersion:d.result,isCurrentProject:!1,isInstalled:!1,isUpToDate:!1,isDependency:r,isDevDependency:T,installedPath:"",file:{}}};const S=y.readJsonSync(O),{version:A=""}=S;return f!==A?{success:!0,result:{name:e.name,currentVersion:A||f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:!1,isDependency:r,isDevDependency:T,installedPath:O,file:S}}:{success:!0,result:{name:e.name,currentVersion:f,latestVersion:d.result,isCurrentProject:!1,isInstalled:!0,isUpToDate:f===d.result,isDependency:r,isDevDependency:T,installedPath:O,file:S}}}catch(s){return C.catchError(s)}})}function x(e){return I(this,null,function*(){var t,n;try{const s=y.readJsonSync(_.PACKAGE_JSON),a=(t=s.dependencies)!=null?t:{},c=(n=s.devDependencies)!=null?n:{};e.isDependency?a[e.name]=e.latestVersion:e.isDevDependency&&(c[e.name]=e.latestVersion),y.writeFileSync(_.PACKAGE_JSON,JSON.stringify(s,null,4)),C.log.info(`Updated "${e.name}" to version ${e.latestVersion}`)}catch(s){C.catchError(s)}})}function Ee(){return I(this,null,function*(){try{const e=[{command:()=>k.pnpmInstallStandard(),message:"Installing dependencies (standard)"},{command:()=>k.pnpmInstallLegacy(),message:"Retrying with legacy peer dependencies"},{command:()=>k.pnpmInstallForce(),message:"Retrying with force install"}];for(const{command:t,message:n}of e)try{const s=yield t();yield Q(`${n} using: ${s}`,s);return}catch(s){C.catchError(s)}}catch(e){C.catchError(e)}})}function _e(e,t){return I(this,null,function*(){var n;try{if(!y.pathExistsSync(_.PACKAGE_JSON)){C.log.error("package.json not found. Aborting setup.");return}const a=(yield Promise.all(e.map(U))).filter(r=>r.success&&!!r.result&&!r.result.isCurrentProject).map(r=>r.result),c=a.filter(r=>!r.isInstalled),p=a.filter(r=>!r.isUpToDate),o=[];t!=null&&t.install&&c.length>0&&o.push(...c.map(x)),t!=null&&t.update&&p.length>0&&o.push(...p.map(x)),o.length>0&&(yield Promise.all(o),yield Ee(),yield Q("Running ESLint with auto-fix",yield k.eslintFix()));for(const r of(n=t==null?void 0:t.callbacks)!=null?n:[])yield r()}catch(s){C.catchError(s)}})}const le=X.getEnv(),be=We.promisify(je.exec);function z(){return I(this,null,function*(){const e=yield U();return e.success?e.result.name:Date.now().toString()})}function me(e){return I(this,null,function*(){if(e.length===0)return;const t=yield z();try{yield v.storage.set(t,e),setTimeout(()=>I(null,null,function*(){const n=yield v.storage.getLogLink(t);n&&C.log.info(`📂 Open the error list manually: ${n}`)}),0)}catch(n){C.catchError(n)}})}function He(){return I(this,null,function*(){try{const e=yield z(),t=yield v.storage.get(e);return t!=null?t:[]}catch(e){return C.catchError(e,{returnValue:[]})}})}function Be(){return I(this,null,function*(){try{const e=yield z();yield v.storage.remove(e)}catch(e){C.catchError(e)}})}function qe(e){const t=[],n=[];let s="";const a=/^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/,c=/^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/,p=/^✖\s+(.*?)\s+\[(.*?)\]$/;e.split(`
|
|
2
|
+
`).forEach(o=>{var r,T,d,f,O,S,A,h,$,M,ne;if(o.startsWith("/"))s=o.trim();else{const u=a.exec(o)||[],N=c.exec(o)||[],D=p.exec(o)||[];u.length&&s?t.push({file:s,position:`${u[1]}:${u[2]}`,type:u[3]===g.E_IssueType.Error?g.E_IssueType.Error:g.E_IssueType.Warning,message:(T=(r=u==null?void 0:u[4])==null?void 0:r.trim())!=null?T:"",rule:(f=(d=u==null?void 0:u[5])==null?void 0:d.trim())!=null?f:""}):N.length?t.push({file:(O=N==null?void 0:N[1])!=null?O:"",position:`${N[2]}:${N[3]}`,type:N[4]===g.E_IssueType.Error?g.E_IssueType.Error:g.E_IssueType.Warning,message:(A=(S=N==null?void 0:N[5])==null?void 0:S.trim())!=null?A:""}):D.length?t.push({file:"commitlint",type:g.E_IssueType.Error,message:($=(h=D==null?void 0:D[1])==null?void 0:h.trim())!=null?$:"",rule:(ne=(M=D==null?void 0:D[2])==null?void 0:M.trim())!=null?ne:""}):n.push(o.trim())}}),t.length&&me(t),le.DEBUG&&n.length&&(C.log.warn("Unmatched lines:"),n.forEach(o=>C.log.info(` ${o}`)))}function Xe(e){try{const t=JSON.parse(e),n=[];t.forEach(({filePath:s,messages:a})=>{a.forEach(({severity:c,line:p,column:o,ruleId:r,message:T})=>{n.push({type:c===2?g.E_IssueType.Error:g.E_IssueType.Warning,file:s,position:`${p}:${o}`,rule:r,message:T})})}),n.length&&me(n)}catch(t){qe(e)}}function ze(n){return I(this,arguments,function*(e,t=Xe){const s=new AbortController;oe.on("SIGINT",()=>{C.log.warn("Process interrupted. Terminating..."),s.abort(),oe.exit()});try{if(typeof e=="string"){const{stdout:a,stderr:c}=yield be(e,{maxBuffer:104857600,signal:s.signal});[a,c].forEach(p=>p&&t(p))}}catch(a){const{stdout:c,stderr:p,message:o}=a;[c,p].forEach(r=>r&&t(r)),!p&&!c&&C.log.error(`Command failed: ${o}`)}})}function V(e){return{raw:!0,cmd:e}}function ce(e,t){return t!=null&&t.isCurrentProject?`${J} ${P} ${Oe} ${e}`:`${J} ${fe} ${e}`}function w(e,t){return typeof e=="function"?ce(e(t),t):typeof e=="object"&&(e==null?void 0:e.raw)===!0?e.cmd:typeof e=="string"?ce(e,t):e}function Qe(e){return I(this,null,function*(){const t=yield U({name:j});if(t.success){const n={isCurrentProject:t.result.isCurrentProject},s=typeof e=="function"?e(n):e;return Object.fromEntries(Object.entries(s).map(([a,c])=>[a,w(c,n)]))}})}function Q(e,t){return I(this,null,function*(){try{C.log.start(`${e}`),le.DEBUG&&C.log.info(`→ ${t}`),yield ze(t),C.log.success(`${e} done.`)}catch(n){C.catchError(n)}})}const Ze=X.getEnv(),Y=Ze.CWD,j="@cyberskill/shared",F="node_modules",Ce="dist",pe="public",W="package.json",Ie="package-lock.json",Te="tsconfig.json",ue=".gitignore",Ne=".simple-git-hooks.json",de="pnpm-lock.yaml",ge=".git/hooks/",ye=".git/COMMIT_EDITMSG",Pe=".migrate-mongo.config.js",G=(()=>{const t=Ye.readJsonSync(m.resolveWorkingPath(W)).name===j?Y:m.join(Y,F,j);return m.join(t,Ce)})(),fe="cyberskill",Oe="src/node/cli/index.ts",b="eslint",H="eslint",B="vitest",q="vitest",De="@commitlint/cli",Ge="@commitlint/config-conventional",Z="commitlint",Le="lint-staged",ee="lint-staged",Se="typescript",Ae="tsc",P="tsx",te="git",L="pnpm",J="pnpm exec",he="simple-git-hooks",Me="simple-git-hooks",ke="@eslint/config-inspector",$e="eslint-config-inspector",Ke="node-modules-inspector",Re="node-modules-inspector",K="migrate-mongo",R="./node_modules/migrate-mongo/bin/migrate-mongo",_={CYBERSKILL_DIRECTORY:G,WORKING_DIRECTORY:Y,PUBLIC_DIRECTORY:m.resolveWorkingPath(pe),TS_CONFIG:m.resolveWorkingPath(Te),GIT_IGNORE:m.resolveWorkingPath(ue),GIT_HOOK:m.resolveWorkingPath(ge),GIT_COMMIT_MSG:m.resolveWorkingPath(ye),SIMPLE_GIT_HOOKS_JSON:m.resolveWorkingPath(Ne),PACKAGE_JSON:m.resolveWorkingPath(W),PACKAGE_LOCK_JSON:m.resolveWorkingPath(Ie),PNPM_LOCK_YAML:m.resolveWorkingPath(de),NODE_MODULES:m.resolveWorkingPath(F),MIGRATE_MONGO_CONFIG:m.resolveWorkingPath(Pe),LINT_STAGED_CONFIG:m.resolveWorkingPath(`${G}/src/config/lint-staged/index.js`),COMMITLINT_CONFIG:m.resolveWorkingPath(`${G}/src/config/commitlint/index.js`),VITEST_UNIT_CONFIG:m.resolveWorkingPath(`${G}/src/config/vitest/vitest.unit.js`),VITEST_UNIT_SETUP_CONFIG:m.resolveWorkingPath(`${G}/src/config/vitest/vitest.unit.setup.js`),VITEST_E2E_CONFIG:m.resolveWorkingPath(`${G}/src/config/vitest/vitest.e2e.js`)};function et({isCurrentProject:e}){return ae({"pre-commit":ee,"commit-msg":Z},e&&{"pre-push":V(`${te} pull`)})}function l({type:e,packages:t,command:n}){const s=t==null?void 0:t.reduce((a,c)=>(a.some(p=>p.name===c.name)||a.push(c),a),[]);return()=>I(null,null,function*(){switch(e){case E.E_CommandType.CLI:return s!=null&&s.length&&(yield _e(s,{install:!0})),w(V(`${J} ${n}`));case E.E_CommandType.STRING:return w(V(n));default:throw new Error("Unsupported command type")}})}const k={simpleGitHooks:l({type:E.E_CommandType.CLI,packages:[{name:he,type:i.E_PackageType.DEV_DEPENDENCY}],command:Me}),eslintInspect:l({type:E.E_CommandType.CLI,packages:[{name:ke,type:i.E_PackageType.DEV_DEPENDENCY}],command:$e}),nodeModulesInspect:l({type:E.E_CommandType.CLI,packages:[{name:Ke,type:i.E_PackageType.DEV_DEPENDENCY}],command:Re}),eslintCheck:l({type:E.E_CommandType.CLI,packages:[{name:b,type:i.E_PackageType.DEV_DEPENDENCY}],command:`${H} ${_.WORKING_DIRECTORY} --no-cache`}),eslintFix:l({type:E.E_CommandType.CLI,packages:[{name:b,type:i.E_PackageType.DEV_DEPENDENCY}],command:`${H} ${_.WORKING_DIRECTORY} --fix --no-cache`}),typescriptCheck:l({type:E.E_CommandType.CLI,packages:[{name:Se,type:i.E_PackageType.DEV_DEPENDENCY}],command:`${Ae} -p ${_.TS_CONFIG} --noEmit`}),testUnit:l({type:E.E_CommandType.CLI,packages:[{name:B,type:i.E_PackageType.DEV_DEPENDENCY}],command:`${q} --config ${_.VITEST_UNIT_CONFIG}`}),testE2e:l({type:E.E_CommandType.CLI,packages:[{name:B,type:i.E_PackageType.DEV_DEPENDENCY}],command:`${q} --config ${_.VITEST_E2E_CONFIG}`}),mongoMigrateCreate:e=>l({type:E.E_CommandType.CLI,packages:[{name:P,type:i.E_PackageType.DEPENDENCY},{name:K,type:i.E_PackageType.DEPENDENCY}],command:`${P} ${R} create ${e} -f ${_.MIGRATE_MONGO_CONFIG}`})(),mongoMigrateUp:l({type:E.E_CommandType.CLI,packages:[{name:P,type:i.E_PackageType.DEPENDENCY},{name:K,type:i.E_PackageType.DEPENDENCY}],command:`${P} ${R} up -f ${_.MIGRATE_MONGO_CONFIG}`}),mongoMigrateDown:l({type:E.E_CommandType.CLI,packages:[{name:P,type:i.E_PackageType.DEPENDENCY},{name:K,type:i.E_PackageType.DEPENDENCY}],command:`${P} ${R} down -f ${_.MIGRATE_MONGO_CONFIG}`}),commitLint:l({type:E.E_CommandType.CLI,packages:[{name:De,type:i.E_PackageType.DEV_DEPENDENCY},{name:Ge,type:i.E_PackageType.DEV_DEPENDENCY}],command:`${Z} --edit ${_.GIT_COMMIT_MSG} --config ${_.COMMITLINT_CONFIG}`}),lintStaged:l({type:E.E_CommandType.CLI,packages:[{name:Le,type:i.E_PackageType.DEV_DEPENDENCY}],command:`${ee} --config ${_.LINT_STAGED_CONFIG}`}),configureGitHook:l({type:E.E_CommandType.STRING,command:`${te} config core.hooksPath ${_.GIT_HOOK}`}),build:l({type:E.E_CommandType.STRING,command:`${L} run --if-present build`}),pnpmInstallStandard:l({type:E.E_CommandType.STRING,command:`${L} install --ignore-scripts`}),pnpmInstallLegacy:l({type:E.E_CommandType.STRING,command:`${L} install --ignore-scripts --legacy-peer-deps`}),pnpmInstallForce:l({type:E.E_CommandType.STRING,command:`${L} install --ignore-scripts --force`}),pnpmPruneStore:l({type:E.E_CommandType.STRING,command:`${L} store prune`}),pnpmCleanCache:l({type:E.E_CommandType.STRING,command:`${L} cache delete`})};exports.BUILD_DIRECTORY=Ce;exports.COMMIT_LINT_CLI=Z;exports.COMMIT_LINT_CONVENTIONAL_CONFIG_PACKAGE_NAME=Ge;exports.COMMIT_LINT_PACKAGE_NAME=De;exports.CYBERSKILL_CLI=fe;exports.CYBERSKILL_CLI_PATH=Oe;exports.CYBERSKILL_DIRECTORY=G;exports.CYBERSKILL_PACKAGE_NAME=j;exports.ESLINT_CLI=H;exports.ESLINT_INSPECT_CLI=$e;exports.ESLINT_INSPECT_PACKAGE_NAME=ke;exports.ESLINT_PACKAGE_NAME=b;exports.GIT_CLI=te;exports.GIT_COMMIT_EDITMSG=ye;exports.GIT_HOOK=ge;exports.GIT_IGNORE=ue;exports.LINT_STAGED_CLI=ee;exports.LINT_STAGED_PACKAGE_NAME=Le;exports.MIGRATE_MONGO_CLI=R;exports.MIGRATE_MONGO_CONFIG=Pe;exports.MIGRATE_MONGO_PACKAGE_NAME=K;exports.NODE_MODULES=F;exports.NODE_MODULES_INSPECT_CLI=Re;exports.NODE_MODULES_INSPECT_PACKAGE_NAME=Ke;exports.PACKAGE_JSON=W;exports.PACKAGE_LOCK_JSON=Ie;exports.PATH=_;exports.PNPM_CLI=L;exports.PNPM_EXEC_CLI=J;exports.PNPM_LOCK_YAML=de;exports.PUBLIC_DIRECTORY=pe;exports.SIMPLE_GIT_HOOKS_PACKAGE_NAME=he;exports.SIMPLE_GIT_HOOK_CLI=Me;exports.SIMPLE_GIT_HOOK_JSON=Ne;exports.TSCONFIG_JSON=Te;exports.TSC_CLI=Ae;exports.TSC_PACKAGE_NAME=Se;exports.TSX_CLI=P;exports.VITEST_CLI=q;exports.VITEST_PACKAGE_NAME=B;exports.WORKING_DIRECTORY=Y;exports.clearAllErrorLists=Be;exports.command=k;exports.createGitHooksConfig=et;exports.formatCommand=w;exports.getLatestPackageVersion=ie;exports.getPackage=U;exports.getStoredErrorLists=He;exports.installDependencies=Ee;exports.rawCommand=V;exports.resolveCommands=Qe;exports.runCommand=Q;exports.setupPackages=_e;exports.updatePackage=x;
|
|
@@ -160,7 +160,7 @@ function H(e) {
|
|
|
160
160
|
file: {}
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
|
-
const T = (s = (t = p[e.name]) != null ? t : o[e.name]) != null ? s : "", g = j(ye.CWD,
|
|
163
|
+
const T = (s = (t = p[e.name]) != null ? t : o[e.name]) != null ? s : "", g = j(ye.CWD, W, e.name, X);
|
|
164
164
|
if (!V(g))
|
|
165
165
|
return {
|
|
166
166
|
success: !0,
|
|
@@ -177,12 +177,12 @@ function H(e) {
|
|
|
177
177
|
file: {}
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
|
-
const P = R(g), { version:
|
|
181
|
-
return T !==
|
|
180
|
+
const P = R(g), { version: A = "" } = P;
|
|
181
|
+
return T !== A ? {
|
|
182
182
|
success: !0,
|
|
183
183
|
result: {
|
|
184
184
|
name: e.name,
|
|
185
|
-
currentVersion:
|
|
185
|
+
currentVersion: A || T,
|
|
186
186
|
latestVersion: D.result,
|
|
187
187
|
isCurrentProject: !1,
|
|
188
188
|
isInstalled: !0,
|
|
@@ -262,7 +262,7 @@ function Oe(e, t) {
|
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
264
|
const ie = b(), Ge = Ne.promisify(_e);
|
|
265
|
-
function
|
|
265
|
+
function B() {
|
|
266
266
|
return C(this, null, function* () {
|
|
267
267
|
const e = yield H();
|
|
268
268
|
return e.success ? e.result.name : Date.now().toString();
|
|
@@ -272,7 +272,7 @@ function ce(e) {
|
|
|
272
272
|
return C(this, null, function* () {
|
|
273
273
|
if (e.length === 0)
|
|
274
274
|
return;
|
|
275
|
-
const t = yield
|
|
275
|
+
const t = yield B();
|
|
276
276
|
try {
|
|
277
277
|
yield K.set(t, e), setTimeout(() => C(null, null, function* () {
|
|
278
278
|
const s = yield K.getLogLink(t);
|
|
@@ -286,7 +286,7 @@ function ce(e) {
|
|
|
286
286
|
function pt() {
|
|
287
287
|
return C(this, null, function* () {
|
|
288
288
|
try {
|
|
289
|
-
const e = yield
|
|
289
|
+
const e = yield B(), t = yield K.get(e);
|
|
290
290
|
return t != null ? t : [];
|
|
291
291
|
} catch (e) {
|
|
292
292
|
return d(e, {
|
|
@@ -298,7 +298,7 @@ function pt() {
|
|
|
298
298
|
function ut() {
|
|
299
299
|
return C(this, null, function* () {
|
|
300
300
|
try {
|
|
301
|
-
const e = yield
|
|
301
|
+
const e = yield B();
|
|
302
302
|
yield K.remove(e);
|
|
303
303
|
} catch (e) {
|
|
304
304
|
d(e);
|
|
@@ -311,7 +311,7 @@ function Pe(e) {
|
|
|
311
311
|
const a = /^\s*(\d+):(\d+)\s+(error|warning)\s+(.+?)\s+(\S+)$/, i = /^(.+?)\((\d+),(\d+)\):\s+(error|warning)\s+TS\d+:\s+(\S.+)$/, p = /^✖\s+(.*?)\s+\[(.*?)\]$/;
|
|
312
312
|
e.split(`
|
|
313
313
|
`).forEach((o) => {
|
|
314
|
-
var r, f, D, T, g, P,
|
|
314
|
+
var r, f, D, T, g, P, A, $, M, h, z;
|
|
315
315
|
if (o.startsWith("/"))
|
|
316
316
|
n = o.trim();
|
|
317
317
|
else {
|
|
@@ -326,7 +326,7 @@ function Pe(e) {
|
|
|
326
326
|
file: (g = _ == null ? void 0 : _[1]) != null ? g : "",
|
|
327
327
|
position: `${_[2]}:${_[3]}`,
|
|
328
328
|
type: _[4] === y.Error ? y.Error : y.Warning,
|
|
329
|
-
message: (
|
|
329
|
+
message: (A = (P = _ == null ? void 0 : _[5]) == null ? void 0 : P.trim()) != null ? A : ""
|
|
330
330
|
}) : O.length ? t.push({
|
|
331
331
|
file: "commitlint",
|
|
332
332
|
type: y.Error,
|
|
@@ -354,7 +354,7 @@ function Se(e) {
|
|
|
354
354
|
Pe(e);
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function Le(s) {
|
|
358
358
|
return C(this, arguments, function* (e, t = Se) {
|
|
359
359
|
const n = new AbortController();
|
|
360
360
|
ee.on("SIGINT", () => {
|
|
@@ -397,16 +397,16 @@ function Ct(e) {
|
|
|
397
397
|
function le(e, t) {
|
|
398
398
|
return C(this, null, function* () {
|
|
399
399
|
try {
|
|
400
|
-
N.start(`${e}`), ie.DEBUG && N.info(`→ ${t}`), yield
|
|
400
|
+
N.start(`${e}`), ie.DEBUG && N.info(`→ ${t}`), yield Le(t), N.success(`${e} done.`);
|
|
401
401
|
} catch (s) {
|
|
402
402
|
d(s);
|
|
403
403
|
}
|
|
404
404
|
});
|
|
405
405
|
}
|
|
406
|
-
const
|
|
407
|
-
const t = Ie.readJsonSync(u(X)).name === F ? k : j(k,
|
|
406
|
+
const Ae = b(), k = Ae.CWD, F = "@cyberskill/shared", W = "node_modules", $e = "dist", he = "public", X = "package.json", Me = "package-lock.json", Ve = "tsconfig.json", Re = ".gitignore", we = ".simple-git-hooks.json", Ke = "pnpm-lock.yaml", Ye = ".git/hooks/", ve = ".git/COMMIT_EDITMSG", je = ".migrate-mongo.config.js", S = (() => {
|
|
407
|
+
const t = Ie.readJsonSync(u(X)).name === F ? k : j(k, W, F);
|
|
408
408
|
return j(t, $e);
|
|
409
|
-
})(), Ue = "cyberskill", Je = "src/node/cli/index.ts", ne = "eslint", re = "eslint", ae = "vitest",
|
|
409
|
+
})(), Ue = "cyberskill", Je = "src/node/cli/index.ts", ne = "eslint", re = "eslint", ae = "vitest", oe = "vitest", ke = "@commitlint/cli", Fe = "@commitlint/config-conventional", Ee = "commitlint", xe = "lint-staged", me = "lint-staged", be = "typescript", He = "tsc", G = "tsx", pe = "git", L = "pnpm", x = "pnpm exec", Be = "simple-git-hooks", We = "simple-git-hooks", Xe = "@eslint/config-inspector", ze = "eslint-config-inspector", Qe = "node-modules-inspector", Ze = "node-modules-inspector", Y = "migrate-mongo", v = "./node_modules/migrate-mongo/bin/migrate-mongo", E = {
|
|
410
410
|
CYBERSKILL_DIRECTORY: S,
|
|
411
411
|
WORKING_DIRECTORY: k,
|
|
412
412
|
PUBLIC_DIRECTORY: u(he),
|
|
@@ -418,15 +418,15 @@ const Le = b(), k = Le.CWD, F = "@cyberskill/shared", B = "node_modules", $e = "
|
|
|
418
418
|
PACKAGE_JSON: u(X),
|
|
419
419
|
PACKAGE_LOCK_JSON: u(Me),
|
|
420
420
|
PNPM_LOCK_YAML: u(Ke),
|
|
421
|
-
NODE_MODULES: u(
|
|
421
|
+
NODE_MODULES: u(W),
|
|
422
422
|
MIGRATE_MONGO_CONFIG: u(je),
|
|
423
|
-
LINT_STAGED_CONFIG: u(`${S}/config/lint-staged/index.js`),
|
|
424
|
-
COMMITLINT_CONFIG: u(`${S}/config/commitlint/index.js`),
|
|
425
|
-
VITEST_UNIT_CONFIG: u(`${S}/config/vitest/vitest.unit.js`),
|
|
426
|
-
VITEST_UNIT_SETUP_CONFIG: u(`${S}/config/vitest/vitest.unit.setup.js`),
|
|
427
|
-
VITEST_E2E_CONFIG: u(`${S}/config/vitest/vitest.e2e.js`)
|
|
423
|
+
LINT_STAGED_CONFIG: u(`${S}/src/config/lint-staged/index.js`),
|
|
424
|
+
COMMITLINT_CONFIG: u(`${S}/src/config/commitlint/index.js`),
|
|
425
|
+
VITEST_UNIT_CONFIG: u(`${S}/src/config/vitest/vitest.unit.js`),
|
|
426
|
+
VITEST_UNIT_SETUP_CONFIG: u(`${S}/src/config/vitest/vitest.unit.setup.js`),
|
|
427
|
+
VITEST_E2E_CONFIG: u(`${S}/src/config/vitest/vitest.e2e.js`)
|
|
428
428
|
};
|
|
429
|
-
function
|
|
429
|
+
function ft({ isCurrentProject: e }) {
|
|
430
430
|
return q({
|
|
431
431
|
"pre-commit": me,
|
|
432
432
|
"commit-msg": Ee
|
|
@@ -452,11 +452,11 @@ const w = {
|
|
|
452
452
|
type: l.CLI,
|
|
453
453
|
packages: [
|
|
454
454
|
{
|
|
455
|
-
name:
|
|
455
|
+
name: Be,
|
|
456
456
|
type: c.DEV_DEPENDENCY
|
|
457
457
|
}
|
|
458
458
|
],
|
|
459
|
-
command:
|
|
459
|
+
command: We
|
|
460
460
|
}),
|
|
461
461
|
eslintInspect: m({
|
|
462
462
|
type: l.CLI,
|
|
@@ -600,60 +600,59 @@ const w = {
|
|
|
600
600
|
}),
|
|
601
601
|
build: m({
|
|
602
602
|
type: l.STRING,
|
|
603
|
-
command: `${
|
|
603
|
+
command: `${L} run --if-present build`
|
|
604
604
|
}),
|
|
605
605
|
pnpmInstallStandard: m({
|
|
606
606
|
type: l.STRING,
|
|
607
|
-
command: `${
|
|
607
|
+
command: `${L} install --ignore-scripts`
|
|
608
608
|
}),
|
|
609
609
|
pnpmInstallLegacy: m({
|
|
610
610
|
type: l.STRING,
|
|
611
|
-
command: `${
|
|
611
|
+
command: `${L} install --ignore-scripts --legacy-peer-deps`
|
|
612
612
|
}),
|
|
613
613
|
pnpmInstallForce: m({
|
|
614
614
|
type: l.STRING,
|
|
615
|
-
command: `${
|
|
615
|
+
command: `${L} install --ignore-scripts --force`
|
|
616
616
|
}),
|
|
617
617
|
pnpmPruneStore: m({
|
|
618
618
|
type: l.STRING,
|
|
619
|
-
command: `${
|
|
619
|
+
command: `${L} store prune`
|
|
620
620
|
}),
|
|
621
621
|
pnpmCleanCache: m({
|
|
622
622
|
type: l.STRING,
|
|
623
|
-
command: `${
|
|
623
|
+
command: `${L} cache delete`
|
|
624
624
|
})
|
|
625
625
|
};
|
|
626
626
|
export {
|
|
627
|
-
|
|
628
|
-
|
|
627
|
+
le as $,
|
|
628
|
+
Y as A,
|
|
629
629
|
$e as B,
|
|
630
630
|
F as C,
|
|
631
|
-
|
|
631
|
+
v as D,
|
|
632
632
|
ne as E,
|
|
633
|
-
|
|
633
|
+
E as F,
|
|
634
634
|
Re as G,
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
635
|
+
ft as H,
|
|
636
|
+
w as I,
|
|
637
|
+
Te as J,
|
|
638
|
+
H as K,
|
|
639
639
|
xe as L,
|
|
640
640
|
je as M,
|
|
641
|
-
|
|
642
|
-
|
|
641
|
+
W as N,
|
|
642
|
+
te as O,
|
|
643
643
|
he as P,
|
|
644
|
-
|
|
645
|
-
|
|
644
|
+
ge as Q,
|
|
645
|
+
Oe as R,
|
|
646
646
|
we as S,
|
|
647
647
|
Ve as T,
|
|
648
|
-
|
|
648
|
+
pt as U,
|
|
649
649
|
ae as V,
|
|
650
650
|
k as W,
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
651
|
+
ut as X,
|
|
652
|
+
U as Y,
|
|
653
|
+
J as Z,
|
|
654
|
+
Ct as _,
|
|
655
655
|
X as a,
|
|
656
|
-
le as a0,
|
|
657
656
|
Me as b,
|
|
658
657
|
Ke as c,
|
|
659
658
|
Ye as d,
|
|
@@ -662,21 +661,21 @@ export {
|
|
|
662
661
|
Ue as g,
|
|
663
662
|
Je as h,
|
|
664
663
|
re as i,
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
664
|
+
oe as j,
|
|
665
|
+
ke as k,
|
|
666
|
+
Fe as l,
|
|
667
|
+
Ee as m,
|
|
668
|
+
me as n,
|
|
669
|
+
be as o,
|
|
670
|
+
He as p,
|
|
671
|
+
G as q,
|
|
672
|
+
pe as r,
|
|
673
|
+
L as s,
|
|
674
|
+
x as t,
|
|
675
|
+
Be as u,
|
|
677
676
|
We as v,
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
677
|
+
Xe as w,
|
|
678
|
+
ze as x,
|
|
679
|
+
Qe as y,
|
|
680
|
+
Ze as z
|
|
682
681
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var n=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;var r=(i,e,t)=>e in i?o(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,s=(i,e)=>{for(var t in e||(e={}))u.call(e,t)&&r(i,t,e[t]);if(n)for(var t of n(e))c.call(e,t)&&r(i,t,e[t]);return i};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@vitejs/plugin-react-swc"),a=require("../../../config-DDQ9k8fw.cjs"),g=require("../../../path.constant-
|
|
1
|
+
"use strict";var o=Object.defineProperty;var n=Object.getOwnPropertySymbols;var u=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;var r=(i,e,t)=>e in i?o(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,s=(i,e)=>{for(var t in e||(e={}))u.call(e,t)&&r(i,t,e[t]);if(n)for(var t of n(e))c.call(e,t)&&r(i,t,e[t]);return i};Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@vitejs/plugin-react-swc"),a=require("../../../config-DDQ9k8fw.cjs"),g=require("../../../path.constant-CPGOAxEp.cjs");require("../../node/path/path.util.cjs");function d(i){return a.defineConfig(s({plugins:[l()],test:{globals:!0,environment:"jsdom",pool:"vmThreads",include:["**/*.test.unit.?(c|m)[jt]s?(x)"],setupFiles:[g.PATH.VITEST_UNIT_SETUP_CONFIG]}},i))}exports.vitestUnit=d;
|
|
@@ -11,7 +11,7 @@ var r = (o, t, e) => t in o ? s(o, t, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
};
|
|
12
12
|
import u from "@vitejs/plugin-react-swc";
|
|
13
13
|
import { d as f } from "../../../config-B7WSlzSh.js";
|
|
14
|
-
import {
|
|
14
|
+
import { F as l } from "../../../path.constant-DJq0jtD0.js";
|
|
15
15
|
import "../../node/path/path.util.js";
|
|
16
16
|
function v(o) {
|
|
17
17
|
return f(n({
|
|
@@ -471,7 +471,7 @@ One of the following is possible:
|
|
|
471
471
|
- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues
|
|
472
472
|
`;throw new Error(t)}return e}function f3(){const e=eu();return e==null?void 0:e.environment.name}function PT(){return typeof process!="undefined"&&!!process.send}function p3(e,t=!1){const r=[/\/vitest\/dist\//,/\/vite-node\/dist\//,/vitest-virtual-\w+\/dist/,/@vitest\/dist/,...t?[]:[/^mock:/]];e.forEach((n,a)=>{r.some(o=>o.test(a))||e.invalidateModule(n)})}function m3(){const{setTimeout:e}=Fr();return new Promise(t=>e(t,0))}function xT(){return me(this,null,function*(){yield m3();const e=eu(),t=[];let r=0;for(const n of e.moduleCache.values())n.promise&&!n.evaluated&&t.push(n.promise),n.resolving&&r++;!t.length&&!r||(yield Promise.allSettled(t),yield xT())})}var Xp=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function h3(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const b3=44,nE="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v3=new Uint8Array(64),TT=new Uint8Array(128);for(let e=0;e<nE.length;e++){const t=nE.charCodeAt(e);v3[e]=t,TT[t]=e}function wl(e,t){let r=0,n=0,a=0;do{const i=e.next();a=TT[i],r|=(a&31)<<n,n+=5}while(a&32);const o=r&1;return r>>>=1,o&&(r=-2147483648|-r),t+r}function aE(e,t){return e.pos>=t?!1:e.peek()!==b3}class y3{constructor(t){this.pos=0,this.buffer=t}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(t){const{buffer:r,pos:n}=this,a=r.indexOf(t,n);return a===-1?r.length:a}}function g3(e){const{length:t}=e,r=new y3(e),n=[];let a=0,o=0,i=0,s=0,u=0;do{const l=r.indexOf(";"),c=[];let f=!0,d=0;for(a=0;r.pos<l;){let m;a=wl(r,a),a<d&&(f=!1),d=a,aE(r,l)?(o=wl(r,o),i=wl(r,i),s=wl(r,s),aE(r,l)?(u=wl(r,u),m=[a,o,i,s,u]):m=[a,o,i,s]):m=[a],c.push(m),r.pos++}f||R3(c),n.push(c),r.pos=l+1}while(r.pos<=t);return n}function R3(e){e.sort(w3)}function w3(e,t){return e[0]-t[0]}const _3=/^[\w+.-]+:\/\//,q3=/^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/,C3=/^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;var Le;(function(e){e[e.Empty=1]="Empty",e[e.Hash=2]="Hash",e[e.Query=3]="Query",e[e.RelativePath=4]="RelativePath",e[e.AbsolutePath=5]="AbsolutePath",e[e.SchemeRelative=6]="SchemeRelative",e[e.Absolute=7]="Absolute"})(Le||(Le={}));function E3(e){return _3.test(e)}function P3(e){return e.startsWith("//")}function ST(e){return e.startsWith("/")}function x3(e){return e.startsWith("file:")}function oE(e){return/^[.?#]/.test(e)}function hu(e){const t=q3.exec(e);return $T(t[1],t[2]||"",t[3],t[4]||"",t[5]||"/",t[6]||"",t[7]||"")}function T3(e){const t=C3.exec(e),r=t[2];return $T("file:","",t[1]||"","",ST(r)?r:"/"+r,t[3]||"",t[4]||"")}function $T(e,t,r,n,a,o,i){return{scheme:e,user:t,host:r,port:n,path:a,query:o,hash:i,type:Le.Absolute}}function iE(e){if(P3(e)){const r=hu("http:"+e);return r.scheme="",r.type=Le.SchemeRelative,r}if(ST(e)){const r=hu("http://foo.com"+e);return r.scheme="",r.host="",r.type=Le.AbsolutePath,r}if(x3(e))return T3(e);if(E3(e))return hu(e);const t=hu("http://foo.com/"+e);return t.scheme="",t.host="",t.type=e?e.startsWith("?")?Le.Query:e.startsWith("#")?Le.Hash:Le.RelativePath:Le.Empty,t}function S3(e){if(e.endsWith("/.."))return e;const t=e.lastIndexOf("/");return e.slice(0,t+1)}function $3(e,t){OT(t,t.type),e.path==="/"?e.path=t.path:e.path=S3(t.path)+e.path}function OT(e,t){const r=t<=Le.RelativePath,n=e.path.split("/");let a=1,o=0,i=!1;for(let u=1;u<n.length;u++){const l=n[u];if(!l){i=!0;continue}if(i=!1,l!=="."){if(l===".."){o?(i=!0,o--,a--):r&&(n[a++]=l);continue}n[a++]=l,o++}}let s="";for(let u=1;u<a;u++)s+="/"+n[u];(!s||i&&!s.endsWith("/.."))&&(s+="/"),e.path=s}function O3(e,t){if(!e&&!t)return"";const r=iE(e);let n=r.type;if(t&&n!==Le.Absolute){const o=iE(t),i=o.type;switch(n){case Le.Empty:r.hash=o.hash;case Le.Hash:r.query=o.query;case Le.Query:case Le.RelativePath:$3(r,o);case Le.AbsolutePath:r.user=o.user,r.host=o.host,r.port=o.port;case Le.SchemeRelative:r.scheme=o.scheme}i>n&&(n=i)}OT(r,n);const a=r.query+r.hash;switch(n){case Le.Hash:case Le.Query:return a;case Le.RelativePath:{const o=r.path.slice(1);return o?oE(t||e)&&!oE(o)?"./"+o+a:o+a:a||"."}case Le.AbsolutePath:return r.path+a;default:return r.scheme+"//"+r.user+r.host+r.port+r.path+a}}function sE(e,t){return t&&!t.endsWith("/")&&(t+="/"),O3(e,t)}function M3(e){if(!e)return"";const t=e.lastIndexOf("/");return e.slice(0,t+1)}const tr=0,A3=1,I3=2,N3=3,k3=4;function j3(e,t){const r=lE(e,0);if(r===e.length)return e;t||(e=e.slice());for(let n=r;n<e.length;n=lE(e,n+1))e[n]=L3(e[n],t);return e}function lE(e,t){for(let r=t;r<e.length;r++)if(!D3(e[r]))return r;return e.length}function D3(e){for(let t=1;t<e.length;t++)if(e[t][tr]<e[t-1][tr])return!1;return!0}function L3(e,t){return t||(e=e.slice()),e.sort(F3)}function F3(e,t){return e[tr]-t[tr]}let Ju=!1;function B3(e,t,r,n){for(;r<=n;){const a=r+(n-r>>1),o=e[a][tr]-t;if(o===0)return Ju=!0,a;o<0?r=a+1:n=a-1}return Ju=!1,r-1}function H3(e,t,r){for(let n=r+1;n<e.length&&e[n][tr]===t;r=n++);return r}function U3(e,t,r){for(let n=r-1;n>=0&&e[n][tr]===t;r=n--);return r}function V3(){return{lastKey:-1,lastNeedle:-1,lastIndex:-1}}function z3(e,t,r,n){const{lastKey:a,lastNeedle:o,lastIndex:i}=r;let s=0,u=e.length-1;if(n===a){if(t===o)return Ju=i!==-1&&e[i][tr]===t,i;t>=o?s=i===-1?0:i:u=i}return r.lastKey=n,r.lastNeedle=t,r.lastIndex=B3(e,t,s,u)}const W3="`line` must be greater than 0 (lines start at line 1)",G3="`column` must be greater than or equal to 0 (columns start at column 0)",uE=-1,J3=1;class K3{constructor(t,r){const n=typeof t=="string";if(!n&&t._decodedMemo)return t;const a=n?JSON.parse(t):t,{version:o,file:i,names:s,sourceRoot:u,sources:l,sourcesContent:c}=a;this.version=o,this.file=i,this.names=s||[],this.sourceRoot=u,this.sources=l,this.sourcesContent=c,this.ignoreList=a.ignoreList||a.x_google_ignoreList||void 0;const f=sE(u||"",M3(r));this.resolvedSources=l.map(m=>sE(m||"",f));const{mappings:d}=a;typeof d=="string"?(this._encoded=d,this._decoded=void 0):(this._encoded=void 0,this._decoded=j3(d,n)),this._decodedMemo=V3(),this._bySources=void 0,this._bySourceMemos=void 0}}function X3(e){var t;return(t=e)._decoded||(t._decoded=g3(e._encoded))}function Y3(e,t){let{line:r,column:n,bias:a}=t;if(r--,r<0)throw new Error(W3);if(n<0)throw new Error(G3);const o=X3(e);if(r>=o.length)return bu(null,null,null,null);const i=o[r],s=Q3(i,e._decodedMemo,r,n,a||J3);if(s===-1)return bu(null,null,null,null);const u=i[s];if(u.length===1)return bu(null,null,null,null);const{names:l,resolvedSources:c}=e;return bu(c[u[A3]],u[I3]+1,u[N3],u.length===5?l[u[k3]]:null)}function bu(e,t,r,n){return{source:e,line:t,column:r,name:n}}function Q3(e,t,r,n,a){let o=z3(e,n,t,r);return Ju?o=(a===uE?H3:U3)(e,n,o):a===uE&&o++,o===-1||o===e.length?-1:o}function MT(e){return e!=null}function Z3(e){return e===null||typeof e!="function"&&typeof e!="object"}function Pu(e){return e!=null&&typeof e=="object"&&!Array.isArray(e)}function eV(e){let t=-1,r=null,n=0,a=0,o=null;for(;t<=e.length;){o=e[t],t++;const i=e[t];if((i==='"'||i==="'"||i==="`")&&o!=="\\"&&(r===i?r=null:r||(r=i)),r||(i==="("&&n++,i===")"&&a++),n&&a&&n===a)return t}return null}const AT=/^\s*at .*(?:\S:\d+|\(native\))/m,tV=/^(?:eval@)?(?:\[native code\])?$/,rV=["node:internal",/\/packages\/\w+\/dist\//,/\/@vitest\/\w+\/dist\//,"/vitest/dist/","/vitest/src/","/vite-node/dist/","/vite-node/src/","/node_modules/chai/","/node_modules/tinypool/","/node_modules/tinyspy/","/deps/chunk-","/deps/@vitest","/deps/loupe","/deps/chai",/node:\w+/,/__vitest_test__/,/__vitest_browser__/,/\/deps\/vitest_/];function IT(e){if(!e.includes(":"))return[e];const r=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/^\(|\)$/g,""));if(!r)return[e];let n=r[1];if(n.startsWith("async ")&&(n=n.slice(6)),n.startsWith("http:")||n.startsWith("https:")){const a=new URL(n);a.searchParams.delete("import"),a.searchParams.delete("browserv"),n=a.pathname+a.hash+a.search}if(n.startsWith("/@fs/")){const a=/^\/@fs\/[a-zA-Z]:\//.test(n);n=n.slice(a?5:4)}return[n,r[2]||void 0,r[3]||void 0]}function nV(e){let t=e.trim();if(tV.test(t)||(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!t.includes("@")&&!t.includes(":")))return null;const r=/((.*".+"[^@]*)?[^@]*)(@)/,n=t.match(r),a=n&&n[1]?n[1]:void 0,[o,i,s]=IT(t.replace(r,""));return!o||!i||!s?null:{file:o,method:a||"",line:Number.parseInt(i),column:Number.parseInt(s)}}function aV(e){let t=e.trim();if(!AT.test(t))return null;t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;const[a,o,i]=IT(n?n[1]:r);let s=n&&r||"",u=a&&["eval","<anonymous>"].includes(a)?void 0:a;return!u||!o||!i?null:(s.startsWith("async ")&&(s=s.slice(6)),u.startsWith("file://")&&(u=u.slice(7)),u=u.startsWith("node:")||u.startsWith("internal:")?u:AU(u),s&&(s=s.replace(/__vite_ssr_import_\d+__\./g,"")),{method:s,file:u,line:Number.parseInt(o),column:Number.parseInt(i)})}function Df(e,t={}){const{ignoreStackEntries:r=rV}=t;return(AT.test(e)?iV(e):oV(e)).map(a=>{var o;t.getUrlId&&(a.file=t.getUrlId(a.file));const i=(o=t.getSourceMap)===null||o===void 0?void 0:o.call(t,a.file);if(!i||typeof i!="object"||!i.version)return cE(r,a.file)?null:a;const s=new K3(i),{line:u,column:l,source:c,name:f}=Y3(s,a);let d=a.file;if(c){const m=a.file.startsWith("file://")?a.file:`file://${a.file}`,b=i.sourceRoot?new URL(i.sourceRoot,m):m;d=new URL(c,b).pathname,d.match(/\/\w:\//)&&(d=d.slice(1))}return cE(r,d)?null:u!=null&&l!=null?{line:u,column:l,file:d,method:f||a.method}:a}).filter(a=>a!=null)}function cE(e,t){return e.some(r=>t.match(r))}function oV(e){return e.split(`
|
|
473
473
|
`).map(t=>nV(t)).filter(MT)}function iV(e){return e.split(`
|
|
474
|
-
`).map(t=>aV(t)).filter(MT)}function sV(e,t={}){if(!e||Z3(e))return[];if(e.stacks)return e.stacks;const r=e.stack||"";let n=typeof r=="string"?Df(r,t):[];if(!n.length){const a=e;a.fileName!=null&&a.lineNumber!=null&&a.columnNumber!=null&&(n=Df(`${a.fileName}:${a.lineNumber}:${a.columnNumber}`,t)),a.sourceURL!=null&&a.line!=null&&a._column!=null&&(n=Df(`${a.sourceURL}:${a.line}:${a.column}`,t))}return t.frameFilter&&(n=n.filter(a=>t.frameFilter(e,a)!==!1)),e.stacks=n,n}let lV=()=>"Promise{…}";try{const{getPromiseDetails:e,kPending:t,kRejected:r}=process.binding("util");Array.isArray(e(Promise.resolve()))&&(lV=(n,a)=>{const[o,i]=e(n);return o===t?"Promise{<pending>}":`Promise${o===r?"!":""}{${a.inspect(i,a)}}`})}catch(e){}function uV(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lf,dE;function cV(){if(dE)return Lf;dE=1;var e,t,r,n,a,o,i,s,u,l,c,f,d,m,b,h,v,p,R;return d=/\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu,f=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,e=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu,b=/(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y,c=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,h=/[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y,R=/[\t\v\f\ufeff\p{Zs}]+/yu,s=/\r?\n|[\r\u2028\u2029]/y,u=/\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y,m=/\/\/.*/y,r=/[<>.:={}]|\/(?![\/*])/y,t=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu,n=/(['"])(?:(?!\1)[^])*(\1)?/y,a=/[^<>{}]+/y,p=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,v=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,o=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,i=/^(?:return|throw|yield)$/,l=RegExp(s.source),Lf=function*(C,{jsx:q=!1}={}){var w,y,g,_,E,O,P,$,N,L,W,F,B,J;for({length:O}=C,_=0,E="",J=[{tag:"JS"}],w=[],W=0,F=!1;_<O;){switch($=J[J.length-1],$.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(C[_]==="/"&&(p.test(E)||o.test(E))&&(d.lastIndex=_,P=d.exec(C))){_=d.lastIndex,E=P[0],F=!0,yield{type:"RegularExpressionLiteral",value:P[0],closed:P[1]!==void 0&&P[1]!=="\\"};continue}if(f.lastIndex=_,P=f.exec(C)){switch(B=P[0],N=f.lastIndex,L=B,B){case"(":E==="?NonExpressionParenKeyword"&&J.push({tag:"JSNonExpressionParen",nesting:W}),W++,F=!1;break;case")":W--,F=!0,$.tag==="JSNonExpressionParen"&&W===$.nesting&&(J.pop(),L="?NonExpressionParenEnd",F=!1);break;case"{":f.lastIndex=0,g=!v.test(E)&&(p.test(E)||o.test(E)),w.push(g),F=!1;break;case"}":switch($.tag){case"InterpolationInTemplate":if(w.length===$.nesting){h.lastIndex=_,P=h.exec(C),_=h.lastIndex,E=P[0],P[1]==="${"?(E="?InterpolationInTemplate",F=!1,yield{type:"TemplateMiddle",value:P[0]}):(J.pop(),F=!0,yield{type:"TemplateTail",value:P[0],closed:P[1]==="`"});continue}break;case"InterpolationInJSX":if(w.length===$.nesting){J.pop(),_+=1,E="}",yield{type:"JSXPunctuator",value:"}"};continue}}F=w.pop(),L=F?"?ExpressionBraceEnd":"}";break;case"]":F=!0;break;case"++":case"--":L=F?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(q&&(p.test(E)||o.test(E))){J.push({tag:"JSXTag"}),_+=1,E="<",yield{type:"JSXPunctuator",value:B};continue}F=!1;break;default:F=!1}_=N,E=L,yield{type:"Punctuator",value:B};continue}if(e.lastIndex=_,P=e.exec(C)){switch(_=e.lastIndex,L=P[0],P[0]){case"for":case"if":case"while":case"with":E!=="."&&E!=="?."&&(L="?NonExpressionParenKeyword")}E=L,F=!o.test(P[0]),yield{type:P[1]==="#"?"PrivateIdentifier":"IdentifierName",value:P[0]};continue}if(b.lastIndex=_,P=b.exec(C)){_=b.lastIndex,E=P[0],F=!0,yield{type:"StringLiteral",value:P[0],closed:P[2]!==void 0};continue}if(c.lastIndex=_,P=c.exec(C)){_=c.lastIndex,E=P[0],F=!0,yield{type:"NumericLiteral",value:P[0]};continue}if(h.lastIndex=_,P=h.exec(C)){_=h.lastIndex,E=P[0],P[1]==="${"?(E="?InterpolationInTemplate",J.push({tag:"InterpolationInTemplate",nesting:w.length}),F=!1,yield{type:"TemplateHead",value:P[0]}):(F=!0,yield{type:"NoSubstitutionTemplate",value:P[0],closed:P[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(r.lastIndex=_,P=r.exec(C)){switch(_=r.lastIndex,L=P[0],P[0]){case"<":J.push({tag:"JSXTag"});break;case">":J.pop(),E==="/"||$.tag==="JSXTagEnd"?(L="?JSX",F=!0):J.push({tag:"JSXChildren"});break;case"{":J.push({tag:"InterpolationInJSX",nesting:w.length}),L="?InterpolationInJSX",F=!1;break;case"/":E==="<"&&(J.pop(),J[J.length-1].tag==="JSXChildren"&&J.pop(),J.push({tag:"JSXTagEnd"}))}E=L,yield{type:"JSXPunctuator",value:P[0]};continue}if(t.lastIndex=_,P=t.exec(C)){_=t.lastIndex,E=P[0],yield{type:"JSXIdentifier",value:P[0]};continue}if(n.lastIndex=_,P=n.exec(C)){_=n.lastIndex,E=P[0],yield{type:"JSXString",value:P[0],closed:P[2]!==void 0};continue}break;case"JSXChildren":if(a.lastIndex=_,P=a.exec(C)){_=a.lastIndex,E=P[0],yield{type:"JSXText",value:P[0]};continue}switch(C[_]){case"<":J.push({tag:"JSXTag"}),_++,E="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":J.push({tag:"InterpolationInJSX",nesting:w.length}),_++,E="?InterpolationInJSX",F=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(R.lastIndex=_,P=R.exec(C)){_=R.lastIndex,yield{type:"WhiteSpace",value:P[0]};continue}if(s.lastIndex=_,P=s.exec(C)){_=s.lastIndex,F=!1,i.test(E)&&(E="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:P[0]};continue}if(u.lastIndex=_,P=u.exec(C)){_=u.lastIndex,l.test(P[0])&&(F=!1,i.test(E)&&(E="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:P[0],closed:P[1]!==void 0};continue}if(m.lastIndex=_,P=m.exec(C)){_=m.lastIndex,F=!1,yield{type:"SingleLineComment",value:P[0]};continue}y=String.fromCodePoint(C.codePointAt(_)),_+=y.length,E=y,F=!1,yield{type:$.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:y}}},Lf}cV();var NT={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(NT.keyword);new Set(NT.strict);var dV={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},fV=Object.entries(dV);function vh(e){return String(e)}vh.open="";vh.close="";function pV(e=!1){let t=typeof process!="undefined"?process:void 0,r=(t==null?void 0:t.env)||{},n=(t==null?void 0:t.argv)||[];return!("NO_COLOR"in r||n.includes("--no-color"))&&("FORCE_COLOR"in r||n.includes("--color")||(t==null?void 0:t.platform)==="win32"||e&&r.TERM!=="dumb"||"CI"in r)||typeof window!="undefined"&&!!window.chrome}function mV(e=!1){let t=pV(e),r=(i,s,u,l)=>{let c="",f=0;do c+=i.substring(f,l)+u,f=l+s.length,l=i.indexOf(s,f);while(~l);return c+i.substring(f)},n=(i,s,u=i)=>{let l=c=>{let f=String(c),d=f.indexOf(s,i.length);return~d?i+r(f,s,u,d)+s:i+f+s};return l.open=i,l.close=s,l},a={isColorSupported:t},o=i=>`\x1B[${i}m`;for(let[i,s]of fV)a[i]=t?n(o(s[0]),o(s[1]),s[2]):vh;return a}mV();const yh=/\r?\n/;function hV(e,t,r){const n=e.split(yh),a=/\r\n/.test(e)?2:1;let o=0;if(t>n.length)return e.length;for(let i=0;i<t-1;i++)o+=n[i].length+a;return o+r}function bV(e,t){if(t>e.length)throw new Error(`offset is longer than source length! offset ${t} > length ${e.length}`);const r=e.split(yh),n=/\r\n/.test(e)?2:1;let a=0,o=0;for(;o<r.length;o++){const i=r[o].length+n;if(a+i>=t)break;a+=i}return o+1}function vV(e,t){return me(this,null,function*(){const r=(yield Promise.resolve().then(()=>require("../../../magic-string.es-
|
|
474
|
+
`).map(t=>aV(t)).filter(MT)}function sV(e,t={}){if(!e||Z3(e))return[];if(e.stacks)return e.stacks;const r=e.stack||"";let n=typeof r=="string"?Df(r,t):[];if(!n.length){const a=e;a.fileName!=null&&a.lineNumber!=null&&a.columnNumber!=null&&(n=Df(`${a.fileName}:${a.lineNumber}:${a.columnNumber}`,t)),a.sourceURL!=null&&a.line!=null&&a._column!=null&&(n=Df(`${a.sourceURL}:${a.line}:${a.column}`,t))}return t.frameFilter&&(n=n.filter(a=>t.frameFilter(e,a)!==!1)),e.stacks=n,n}let lV=()=>"Promise{…}";try{const{getPromiseDetails:e,kPending:t,kRejected:r}=process.binding("util");Array.isArray(e(Promise.resolve()))&&(lV=(n,a)=>{const[o,i]=e(n);return o===t?"Promise{<pending>}":`Promise${o===r?"!":""}{${a.inspect(i,a)}}`})}catch(e){}function uV(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lf,dE;function cV(){if(dE)return Lf;dE=1;var e,t,r,n,a,o,i,s,u,l,c,f,d,m,b,h,v,p,R;return d=/\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu,f=/--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y,e=/(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu,b=/(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y,c=/(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y,h=/[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y,R=/[\t\v\f\ufeff\p{Zs}]+/yu,s=/\r?\n|[\r\u2028\u2029]/y,u=/\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y,m=/\/\/.*/y,r=/[<>.:={}]|\/(?![\/*])/y,t=/[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu,n=/(['"])(?:(?!\1)[^])*(\1)?/y,a=/[^<>{}]+/y,p=/^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/,v=/^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/,o=/^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/,i=/^(?:return|throw|yield)$/,l=RegExp(s.source),Lf=function*(C,{jsx:q=!1}={}){var w,y,g,_,E,O,P,$,N,L,W,F,B,J;for({length:O}=C,_=0,E="",J=[{tag:"JS"}],w=[],W=0,F=!1;_<O;){switch($=J[J.length-1],$.tag){case"JS":case"JSNonExpressionParen":case"InterpolationInTemplate":case"InterpolationInJSX":if(C[_]==="/"&&(p.test(E)||o.test(E))&&(d.lastIndex=_,P=d.exec(C))){_=d.lastIndex,E=P[0],F=!0,yield{type:"RegularExpressionLiteral",value:P[0],closed:P[1]!==void 0&&P[1]!=="\\"};continue}if(f.lastIndex=_,P=f.exec(C)){switch(B=P[0],N=f.lastIndex,L=B,B){case"(":E==="?NonExpressionParenKeyword"&&J.push({tag:"JSNonExpressionParen",nesting:W}),W++,F=!1;break;case")":W--,F=!0,$.tag==="JSNonExpressionParen"&&W===$.nesting&&(J.pop(),L="?NonExpressionParenEnd",F=!1);break;case"{":f.lastIndex=0,g=!v.test(E)&&(p.test(E)||o.test(E)),w.push(g),F=!1;break;case"}":switch($.tag){case"InterpolationInTemplate":if(w.length===$.nesting){h.lastIndex=_,P=h.exec(C),_=h.lastIndex,E=P[0],P[1]==="${"?(E="?InterpolationInTemplate",F=!1,yield{type:"TemplateMiddle",value:P[0]}):(J.pop(),F=!0,yield{type:"TemplateTail",value:P[0],closed:P[1]==="`"});continue}break;case"InterpolationInJSX":if(w.length===$.nesting){J.pop(),_+=1,E="}",yield{type:"JSXPunctuator",value:"}"};continue}}F=w.pop(),L=F?"?ExpressionBraceEnd":"}";break;case"]":F=!0;break;case"++":case"--":L=F?"?PostfixIncDec":"?UnaryIncDec";break;case"<":if(q&&(p.test(E)||o.test(E))){J.push({tag:"JSXTag"}),_+=1,E="<",yield{type:"JSXPunctuator",value:B};continue}F=!1;break;default:F=!1}_=N,E=L,yield{type:"Punctuator",value:B};continue}if(e.lastIndex=_,P=e.exec(C)){switch(_=e.lastIndex,L=P[0],P[0]){case"for":case"if":case"while":case"with":E!=="."&&E!=="?."&&(L="?NonExpressionParenKeyword")}E=L,F=!o.test(P[0]),yield{type:P[1]==="#"?"PrivateIdentifier":"IdentifierName",value:P[0]};continue}if(b.lastIndex=_,P=b.exec(C)){_=b.lastIndex,E=P[0],F=!0,yield{type:"StringLiteral",value:P[0],closed:P[2]!==void 0};continue}if(c.lastIndex=_,P=c.exec(C)){_=c.lastIndex,E=P[0],F=!0,yield{type:"NumericLiteral",value:P[0]};continue}if(h.lastIndex=_,P=h.exec(C)){_=h.lastIndex,E=P[0],P[1]==="${"?(E="?InterpolationInTemplate",J.push({tag:"InterpolationInTemplate",nesting:w.length}),F=!1,yield{type:"TemplateHead",value:P[0]}):(F=!0,yield{type:"NoSubstitutionTemplate",value:P[0],closed:P[1]==="`"});continue}break;case"JSXTag":case"JSXTagEnd":if(r.lastIndex=_,P=r.exec(C)){switch(_=r.lastIndex,L=P[0],P[0]){case"<":J.push({tag:"JSXTag"});break;case">":J.pop(),E==="/"||$.tag==="JSXTagEnd"?(L="?JSX",F=!0):J.push({tag:"JSXChildren"});break;case"{":J.push({tag:"InterpolationInJSX",nesting:w.length}),L="?InterpolationInJSX",F=!1;break;case"/":E==="<"&&(J.pop(),J[J.length-1].tag==="JSXChildren"&&J.pop(),J.push({tag:"JSXTagEnd"}))}E=L,yield{type:"JSXPunctuator",value:P[0]};continue}if(t.lastIndex=_,P=t.exec(C)){_=t.lastIndex,E=P[0],yield{type:"JSXIdentifier",value:P[0]};continue}if(n.lastIndex=_,P=n.exec(C)){_=n.lastIndex,E=P[0],yield{type:"JSXString",value:P[0],closed:P[2]!==void 0};continue}break;case"JSXChildren":if(a.lastIndex=_,P=a.exec(C)){_=a.lastIndex,E=P[0],yield{type:"JSXText",value:P[0]};continue}switch(C[_]){case"<":J.push({tag:"JSXTag"}),_++,E="<",yield{type:"JSXPunctuator",value:"<"};continue;case"{":J.push({tag:"InterpolationInJSX",nesting:w.length}),_++,E="?InterpolationInJSX",F=!1,yield{type:"JSXPunctuator",value:"{"};continue}}if(R.lastIndex=_,P=R.exec(C)){_=R.lastIndex,yield{type:"WhiteSpace",value:P[0]};continue}if(s.lastIndex=_,P=s.exec(C)){_=s.lastIndex,F=!1,i.test(E)&&(E="?NoLineTerminatorHere"),yield{type:"LineTerminatorSequence",value:P[0]};continue}if(u.lastIndex=_,P=u.exec(C)){_=u.lastIndex,l.test(P[0])&&(F=!1,i.test(E)&&(E="?NoLineTerminatorHere")),yield{type:"MultiLineComment",value:P[0],closed:P[1]!==void 0};continue}if(m.lastIndex=_,P=m.exec(C)){_=m.lastIndex,F=!1,yield{type:"SingleLineComment",value:P[0]};continue}y=String.fromCodePoint(C.codePointAt(_)),_+=y.length,E=y,F=!1,yield{type:$.tag.startsWith("JSX")?"JSXInvalid":"Invalid",value:y}}},Lf}cV();var NT={keyword:["break","case","catch","continue","debugger","default","do","else","finally","for","function","if","return","switch","throw","try","var","const","while","with","new","this","super","class","extends","export","import","null","true","false","in","instanceof","typeof","void","delete"],strict:["implements","interface","let","package","private","protected","public","static","yield"]};new Set(NT.keyword);new Set(NT.strict);var dV={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},fV=Object.entries(dV);function vh(e){return String(e)}vh.open="";vh.close="";function pV(e=!1){let t=typeof process!="undefined"?process:void 0,r=(t==null?void 0:t.env)||{},n=(t==null?void 0:t.argv)||[];return!("NO_COLOR"in r||n.includes("--no-color"))&&("FORCE_COLOR"in r||n.includes("--color")||(t==null?void 0:t.platform)==="win32"||e&&r.TERM!=="dumb"||"CI"in r)||typeof window!="undefined"&&!!window.chrome}function mV(e=!1){let t=pV(e),r=(i,s,u,l)=>{let c="",f=0;do c+=i.substring(f,l)+u,f=l+s.length,l=i.indexOf(s,f);while(~l);return c+i.substring(f)},n=(i,s,u=i)=>{let l=c=>{let f=String(c),d=f.indexOf(s,i.length);return~d?i+r(f,s,u,d)+s:i+f+s};return l.open=i,l.close=s,l},a={isColorSupported:t},o=i=>`\x1B[${i}m`;for(let[i,s]of fV)a[i]=t?n(o(s[0]),o(s[1]),s[2]):vh;return a}mV();const yh=/\r?\n/;function hV(e,t,r){const n=e.split(yh),a=/\r\n/.test(e)?2:1;let o=0;if(t>n.length)return e.length;for(let i=0;i<t-1;i++)o+=n[i].length+a;return o+r}function bV(e,t){if(t>e.length)throw new Error(`offset is longer than source length! offset ${t} > length ${e.length}`);const r=e.split(yh),n=/\r\n/.test(e)?2:1;let a=0,o=0;for(;o<r.length;o++){const i=r[o].length+n;if(a+i>=t)break;a+=i}return o+1}function vV(e,t){return me(this,null,function*(){const r=(yield Promise.resolve().then(()=>require("../../../magic-string.es-D_iPNVbJ.cjs"))).default,n=new Set(t.map(a=>a.file));yield Promise.all(Array.from(n).map(a=>me(null,null,function*(){const o=t.filter(l=>l.file===a),i=yield e.readSnapshotFile(a),s=new r(i);for(const l of o){const c=hV(i,l.line,l.column);qV(i,s,c,l.snapshot)}const u=s.toString();u!==i&&(yield e.saveSnapshotFile(a,u))})))})}const yV=/(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*\{/;function gV(e,t,r,n){let a=e.slice(r);const o=yV.exec(a);if(!o)return!1;a=a.slice(o.index);let i=eV(a);if(i===null)return!1;i+=r+o.index;const s=r+o.index+o[0].length,u=RV(e,s),l=`, ${kT(n,e,r)}`;return u===i?t.appendLeft(i,l):t.overwrite(u,i,l),!0}function RV(e,t){let r=1,n=0;for(;r!==n&&t<e.length;){const a=e[t++];a==="{"?r++:a==="}"&&n++}return t}function kT(e,t,r){const n=bV(t,r),o=t.split(yh)[n-1].match(/^\s*/)[0]||"",i=o.includes(" ")?`${o} `:`${o} `,s=e.trim().replace(/\\/g,"\\\\").split(/\n/g),u=s.length<=1,l="`";return u?`${l}${s.join(`
|
|
475
475
|
`).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}${l}`:`${l}
|
|
476
476
|
${s.map(c=>c?i+c:"").join(`
|
|
477
477
|
`).replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}
|
|
@@ -29146,7 +29146,7 @@ One of the following is possible:
|
|
|
29146
29146
|
}
|
|
29147
29147
|
function vV(e, t) {
|
|
29148
29148
|
return me(this, null, function* () {
|
|
29149
|
-
const r = (yield import("../../../magic-string.es-
|
|
29149
|
+
const r = (yield import("../../../magic-string.es-cELbkQ5L.js")).default, n = new Set(t.map((o) => o.file));
|
|
29150
29150
|
yield Promise.all(Array.from(n).map((o) => me(null, null, function* () {
|
|
29151
29151
|
const a = t.filter((l) => l.file === o), i = yield e.readSnapshotFile(o), s = new r(i);
|
|
29152
29152
|
for (const l of a) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var s=(t,i,n)=>new Promise((d,g)=>{var w=o=>{try{l(n.next(o))}catch(p){g(p)}},h=o=>{try{l(n.throw(o))}catch(p){g(p)}},l=o=>o.done?d(o.value):Promise.resolve(o.value).then(w,h);l((n=n.apply(t,i)).next())});const m=require("node:process"),q=require("yargs/helpers"),k=require("yargs/yargs"),e=require("../../../path.constant-Y6ImOuVK.cjs"),r=require("../fs/fs.util.cjs"),u=require("../log/log.type.cjs"),c=require("../log/log.util.cjs");require("../path/path.util.cjs");const C="@cyberskill/shared",v="module",E="1.200.0",_="CyberSkill Shared",S="Stephen Cheng",b="MIT",I="https://github.com/cyberskill-world/shared#readme",L={type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},T={url:"https://github.com/cyberskill-world/shared/issues"},M={"./config":{types:"./dist/src/config/index.d.ts",import:"./dist/src/config/index.js",require:"./dist/src/config/index.cjs"},"./config/commitlint":{types:"./dist/src/config/commitlint/index.d.ts",import:"./dist/src/config/commitlint/index.js",require:"./dist/src/config/commitlint/index.cjs"},"./config/env":{types:"./dist/src/config/env/index.d.ts",import:"./dist/src/config/env/index.js",require:"./dist/src/config/env/index.cjs"},"./config/eslint":{types:"./dist/src/config/eslint/index.d.ts",import:"./dist/src/config/eslint/index.js",require:"./dist/src/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/src/config/graphql-codegen/index.d.ts",import:"./dist/src/config/graphql-codegen/index.js",require:"./dist/src/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/src/config/lint-staged/index.d.ts",import:"./dist/src/config/lint-staged/index.js",require:"./dist/src/config/lint-staged/index.cjs"},"./config/vitest":{types:"./dist/src/config/vitest/index.d.ts",import:"./dist/src/config/vitest/index.js",require:"./dist/src/config/vitest/index.cjs"},"./constant":{types:"./dist/src/constant/index.d.ts",import:"./dist/src/constant/index.js",require:"./dist/src/constant/index.cjs"},"./node/apollo-server":{types:"./dist/src/node/apollo-server/index.d.ts",import:"./dist/src/node/apollo-server/index.js",require:"./dist/src/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/src/node/cli/index.d.ts",import:"./dist/src/node/cli/index.js",require:"./dist/src/node/cli/index.cjs"},"./node/command":{types:"./dist/src/node/command/index.d.ts",import:"./dist/src/node/command/index.js",require:"./dist/src/node/command/index.cjs"},"./node/express":{types:"./dist/src/node/express/index.d.ts",import:"./dist/src/node/express/index.js",require:"./dist/src/node/express/index.cjs"},"./node/fs":{types:"./dist/src/node/fs/index.d.ts",import:"./dist/src/node/fs/index.js",require:"./dist/src/node/fs/index.cjs"},"./node/log":{types:"./dist/src/node/log/index.d.ts",import:"./dist/src/node/log/index.js",require:"./dist/src/node/log/index.cjs"},"./node/mongo":{types:"./dist/src/node/mongo/index.d.ts",import:"./dist/src/node/mongo/index.js",require:"./dist/src/node/mongo/index.cjs"},"./node/package":{types:"./dist/src/node/package/index.d.ts",import:"./dist/src/node/package/index.js",require:"./dist/src/node/package/index.cjs"},"./node/path":{types:"./dist/src/node/path/index.d.ts",import:"./dist/src/node/path/index.js",require:"./dist/src/node/path/index.cjs"},"./node/storage":{types:"./dist/src/node/storage/index.d.ts",import:"./dist/src/node/storage/index.js",require:"./dist/src/node/storage/index.cjs"},"./node/upload":{types:"./dist/src/node/upload/index.d.ts",import:"./dist/src/node/upload/index.js",require:"./dist/src/node/upload/index.cjs"},"./node/ws":{types:"./dist/src/node/ws/index.d.ts",import:"./dist/src/node/ws/index.js",require:"./dist/src/node/ws/index.cjs"},"./react/apollo-client":{types:"./dist/src/react/apollo-client/index.d.ts",import:"./dist/src/react/apollo-client/index.js",require:"./dist/src/react/apollo-client/index.cjs"},"./react/apollo-client-nextjs":{types:"./dist/src/react/apollo-client-nextjs/index.d.ts",import:"./dist/src/react/apollo-client-nextjs/index.js",require:"./dist/src/react/apollo-client-nextjs/index.cjs"},"./react/apollo-error":{types:"./dist/src/react/apollo-error/index.d.ts",import:"./dist/src/react/apollo-error/index.js",require:"./dist/src/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/src/react/i18next/index.d.ts",import:"./dist/src/react/i18next/index.js",require:"./dist/src/react/i18next/index.cjs"},"./react/loading":{types:"./dist/src/react/loading/index.d.ts",import:"./dist/src/react/loading/index.js",require:"./dist/src/react/loading/index.cjs"},"./react/log":{types:"./dist/src/react/log/index.d.ts",import:"./dist/src/react/log/index.js",require:"./dist/src/react/log/index.cjs"},"./react/next-intl":{types:"./dist/src/react/next-intl/index.d.ts",import:"./dist/src/react/next-intl/index.js",require:"./dist/src/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/src/react/storage/index.d.ts",import:"./dist/src/react/storage/index.js",require:"./dist/src/react/storage/index.cjs"},"./react/toast":{types:"./dist/src/react/toast/index.d.ts",import:"./dist/src/react/toast/index.js",require:"./dist/src/react/toast/index.cjs"},"./react/userback":{types:"./dist/src/react/userback/index.d.ts",import:"./dist/src/react/userback/index.js",require:"./dist/src/react/userback/index.cjs"},"./typescript":{types:"./dist/src/typescript/index.d.ts",import:"./dist/src/typescript/index.js",require:"./dist/src/typescript/index.cjs"},"./util":{types:"./dist/src/util/index.d.ts",import:"./dist/src/util/index.js",require:"./dist/src/util/index.cjs"},"./style.css":{import:"./dist/style.css",require:"./dist/style.css"}},P={cyberskill:"dist/src/node/cli/index.js"},A=["dist","public"],O={build:"vite build",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"vite build --watch",inspect:"tsx src/node/cli/index.ts inspect",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},G={"@antfu/eslint-config":"4.16.1","@apollo/client":"3.13.8","@apollo/client-integration-nextjs":"0.12.2","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.3","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@userback/widget":"0.3.11","@vitejs/plugin-react-swc":"3.10.2","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",envalid:"8.0.0",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-ws":"6.0.5",i18next:"25.2.1",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.3.1","node-fetch":"3.3.2","node-persist":"4.0.4",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"7.0.0",ws:"8.18.3",yargs:"18.0.0"},R={"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint-react/eslint-plugin":"1.52.2","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/migrate-mongo":"10.0.5","@types/node":"24.0.7","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","@vitest/browser":"3.2.4",eslint:"9.30.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",glob:"11.0.3","lint-staged":"16.1.2","node-modules-inspector":"1.0.0",playwright:"1.53.1",postcss:"8.5.6","postcss-modules":"6.0.1",sass:"1.89.2","simple-git-hooks":"2.13.0",tsx:"4.20.3",typescript:"5.8.3",vite:"7.0.0","vite-plugin-dts":"4.5.4",vitest:"3.2.4"},H={access:"public",registry:"https://registry.npmjs.org/"},N={name:C,type:v,version:E,description:_,author:S,license:b,homepage:I,repository:L,bugs:T,exports:M,bin:P,files:A,scripts:O,dependencies:G,devDependencies:R,publishConfig:H};function y(){return s(this,null,function*(){r.pathExistsSync(e.PATH.TS_CONFIG)?yield e.runCommand("Performing TypeScript validation",yield e.command.typescriptCheck()):c.log.warn("No TypeScript configuration found. Skipping type check.")})}function f(t=!1){return s(this,null,function*(){t?yield e.runCommand("Running ESLint with auto-fix",yield e.command.eslintFix()):yield e.runCommand("Running ESLint check",yield e.command.eslintCheck())})}function x(t,i){if(!i.length)return;const n=t==="Errors"?"red":"yellow";c.log.printBoxedLog(t==="Errors"?"✖ Errors":"⚠ Warnings",i,n)}function a(){return s(this,null,function*(){setTimeout(()=>s(null,null,function*(){const t=yield e.getStoredErrorLists(),i=t.filter(d=>d.type===u.E_IssueType.Error),n=t.filter(d=>d.type===u.E_IssueType.Warning);!i.length&&!n.length?c.log.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(x("Warnings",n),x("Errors",i),(i.length>0||n.length>0)&&m.exit(1))}),0)})}function D(){return s(this,null,function*(){yield e.clearAllErrorLists();const t=yield e.getPackage({name:e.CYBERSKILL_PACKAGE_NAME});if(!t.success){c.log.error("Failed to retrieve package information. Aborting lint-staged.");return}t.result.isCurrentProject&&(yield e.runCommand(`Building package: ${e.CYBERSKILL_PACKAGE_NAME}`,yield e.command.build())),yield e.runCommand("Executing lint-staged",yield e.command.lintStaged()),a()})}function B(){return s(this,null,function*(){yield e.runCommand("Inspecting ESLint configuration",yield e.command.eslintInspect())})}function F(){return s(this,null,function*(){yield e.clearAllErrorLists(),yield Promise.all([y(),f()]),a()})}function K(){return s(this,null,function*(){yield e.clearAllErrorLists(),yield Promise.all([y(),f(!0)]),a()})}function U(){return s(this,null,function*(){yield e.clearAllErrorLists(),yield e.runCommand("Validating commit message",yield e.command.commitLint()),a()})}function j(){return s(this,null,function*(){yield e.runCommand("Configuring Git hooks",yield e.command.configureGitHook()),r.removeSync(e.PATH.GIT_HOOK);const t=yield e.resolveCommands(e.createGitHooksConfig);r.writeFileSync(e.PATH.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));const i=`
|
|
2
|
+
"use strict";var s=(t,i,n)=>new Promise((a,g)=>{var w=o=>{try{l(n.next(o))}catch(p){g(p)}},h=o=>{try{l(n.throw(o))}catch(p){g(p)}},l=o=>o.done?a(o.value):Promise.resolve(o.value).then(w,h);l((n=n.apply(t,i)).next())});const m=require("node:process"),q=require("yargs/helpers"),k=require("yargs/yargs"),e=require("../../../path.constant-CPGOAxEp.cjs"),r=require("../fs/fs.util.cjs"),u=require("../log/log.type.cjs"),c=require("../log/log.util.cjs");require("../path/path.util.cjs");const C="@cyberskill/shared",v="module",E="1.201.1",_="CyberSkill Shared",S="Stephen Cheng",b="MIT",I="https://github.com/cyberskill-world/shared#readme",L={type:"git",url:"git+https://github.com/cyberskill-world/shared.git"},T={url:"https://github.com/cyberskill-world/shared/issues"},M={"./config":{types:"./dist/src/config/index.d.ts",import:"./dist/src/config/index.js",require:"./dist/src/config/index.cjs"},"./config/commitlint":{types:"./dist/src/config/commitlint/index.d.ts",import:"./dist/src/config/commitlint/index.js",require:"./dist/src/config/commitlint/index.cjs"},"./config/env":{types:"./dist/src/config/env/index.d.ts",import:"./dist/src/config/env/index.js",require:"./dist/src/config/env/index.cjs"},"./config/eslint":{types:"./dist/src/config/eslint/index.d.ts",import:"./dist/src/config/eslint/index.js",require:"./dist/src/config/eslint/index.cjs"},"./config/graphql-codegen":{types:"./dist/src/config/graphql-codegen/index.d.ts",import:"./dist/src/config/graphql-codegen/index.js",require:"./dist/src/config/graphql-codegen/index.cjs"},"./config/lint-staged":{types:"./dist/src/config/lint-staged/index.d.ts",import:"./dist/src/config/lint-staged/index.js",require:"./dist/src/config/lint-staged/index.cjs"},"./config/vitest":{types:"./dist/src/config/vitest/index.d.ts",import:"./dist/src/config/vitest/index.js",require:"./dist/src/config/vitest/index.cjs"},"./constant":{types:"./dist/src/constant/index.d.ts",import:"./dist/src/constant/index.js",require:"./dist/src/constant/index.cjs"},"./node/apollo-server":{types:"./dist/src/node/apollo-server/index.d.ts",import:"./dist/src/node/apollo-server/index.js",require:"./dist/src/node/apollo-server/index.cjs"},"./node/cli":{types:"./dist/src/node/cli/index.d.ts",import:"./dist/src/node/cli/index.js",require:"./dist/src/node/cli/index.cjs"},"./node/command":{types:"./dist/src/node/command/index.d.ts",import:"./dist/src/node/command/index.js",require:"./dist/src/node/command/index.cjs"},"./node/express":{types:"./dist/src/node/express/index.d.ts",import:"./dist/src/node/express/index.js",require:"./dist/src/node/express/index.cjs"},"./node/fs":{types:"./dist/src/node/fs/index.d.ts",import:"./dist/src/node/fs/index.js",require:"./dist/src/node/fs/index.cjs"},"./node/log":{types:"./dist/src/node/log/index.d.ts",import:"./dist/src/node/log/index.js",require:"./dist/src/node/log/index.cjs"},"./node/mongo":{types:"./dist/src/node/mongo/index.d.ts",import:"./dist/src/node/mongo/index.js",require:"./dist/src/node/mongo/index.cjs"},"./node/package":{types:"./dist/src/node/package/index.d.ts",import:"./dist/src/node/package/index.js",require:"./dist/src/node/package/index.cjs"},"./node/path":{types:"./dist/src/node/path/index.d.ts",import:"./dist/src/node/path/index.js",require:"./dist/src/node/path/index.cjs"},"./node/storage":{types:"./dist/src/node/storage/index.d.ts",import:"./dist/src/node/storage/index.js",require:"./dist/src/node/storage/index.cjs"},"./node/upload":{types:"./dist/src/node/upload/index.d.ts",import:"./dist/src/node/upload/index.js",require:"./dist/src/node/upload/index.cjs"},"./node/ws":{types:"./dist/src/node/ws/index.d.ts",import:"./dist/src/node/ws/index.js",require:"./dist/src/node/ws/index.cjs"},"./react/apollo-client":{types:"./dist/src/react/apollo-client/index.d.ts",import:"./dist/src/react/apollo-client/index.js",require:"./dist/src/react/apollo-client/index.cjs"},"./react/apollo-client-nextjs":{types:"./dist/src/react/apollo-client-nextjs/index.d.ts",import:"./dist/src/react/apollo-client-nextjs/index.js",require:"./dist/src/react/apollo-client-nextjs/index.cjs"},"./react/apollo-client-nextjs/rsc":{types:"./dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.d.ts",import:"./dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.js",require:"./dist/src/react/apollo-client-nextjs/apollo-client-nextjs.rsc.cjs"},"./react/apollo-error":{types:"./dist/src/react/apollo-error/index.d.ts",import:"./dist/src/react/apollo-error/index.js",require:"./dist/src/react/apollo-error/index.cjs"},"./react/i18next":{types:"./dist/src/react/i18next/index.d.ts",import:"./dist/src/react/i18next/index.js",require:"./dist/src/react/i18next/index.cjs"},"./react/loading":{types:"./dist/src/react/loading/index.d.ts",import:"./dist/src/react/loading/index.js",require:"./dist/src/react/loading/index.cjs"},"./react/log":{types:"./dist/src/react/log/index.d.ts",import:"./dist/src/react/log/index.js",require:"./dist/src/react/log/index.cjs"},"./react/next-intl":{types:"./dist/src/react/next-intl/index.d.ts",import:"./dist/src/react/next-intl/index.js",require:"./dist/src/react/next-intl/index.cjs"},"./react/storage":{types:"./dist/src/react/storage/index.d.ts",import:"./dist/src/react/storage/index.js",require:"./dist/src/react/storage/index.cjs"},"./react/toast":{types:"./dist/src/react/toast/index.d.ts",import:"./dist/src/react/toast/index.js",require:"./dist/src/react/toast/index.cjs"},"./react/userback":{types:"./dist/src/react/userback/index.d.ts",import:"./dist/src/react/userback/index.js",require:"./dist/src/react/userback/index.cjs"},"./typescript":{types:"./dist/src/typescript/index.d.ts",import:"./dist/src/typescript/index.js",require:"./dist/src/typescript/index.cjs"},"./util":{types:"./dist/src/util/index.d.ts",import:"./dist/src/util/index.js",require:"./dist/src/util/index.cjs"},"./style.css":{import:"./dist/style.css",require:"./dist/style.css"}},P={cyberskill:"dist/src/node/cli/index.js"},A=["dist","public"],O={build:"vite build",commitlint:"tsx src/node/cli/index.ts commitlint",dev:"vite build --watch",inspect:"tsx src/node/cli/index.ts inspect",lint:"tsx src/node/cli/index.ts lint","lint:fix":"tsx src/node/cli/index.ts lint:fix","lint:inspect":"tsx src/node/cli/index.ts lint:inspect",ready:"tsx src/node/cli/index.ts ready",reset:"tsx src/node/cli/index.ts reset","test:e2e":"tsx src/node/cli/index.ts test:e2e","test:unit":"tsx src/node/cli/index.ts test:unit"},G={"@antfu/eslint-config":"4.16.1","@apollo/client":"3.13.8","@apollo/client-integration-nextjs":"0.12.2","@apollo/server":"4.12.2","@dotenvx/dotenvx":"1.45.1","@eddeee888/gcg-typescript-resolver-files":"0.12.1","@graphql-codegen/cli":"5.0.7","@graphql-codegen/client-preset":"4.8.3","@nestjs/common":"11.1.3","@nestjs/core":"11.1.3","@userback/widget":"0.3.11","@vitejs/plugin-react-swc":"3.10.2","body-parser":"2.2.0",chalk:"5.4.1",clsx:"2.1.1",compression:"1.8.0",consola:"3.4.2","cookie-parser":"1.4.7",cors:"2.8.5","crypto-js":"4.2.0","date-fns":"4.1.0",envalid:"8.0.0",express:"4.21.2","express-session":"1.18.1","express-useragent":"1.0.15","fs-extra":"11.3.0",globals:"16.2.0",graphql:"16.11.0","graphql-upload":"17.0.0","graphql-ws":"6.0.5",i18next:"25.3.0",jsdom:"26.1.0",localforage:"1.10.0","migrate-mongo":"12.1.3",mongodb:"6.17.0",mongoose:"8.16.1","mongoose-aggregate-paginate-v2":"1.1.4","mongoose-paginate-v2":"1.9.1","next-intl":"4.3.1","node-fetch":"3.3.2","node-persist":"4.0.4",qs:"6.14.0",react:"19.1.0","react-dom":"19.1.0","react-hot-toast":"2.5.2","react-i18next":"15.5.3",slugify:"1.6.6",unorm:"1.6.0",uuid:"11.1.0",vite:"7.0.0",ws:"8.18.3",yargs:"18.0.0"},R={"@commitlint/cli":"19.8.1","@commitlint/config-conventional":"19.8.1","@eslint-react/eslint-plugin":"1.52.2","@eslint/config-inspector":"1.1.0","@microsoft/api-extractor":"7.52.8","@next/eslint-plugin-next":"15.3.4","@testing-library/jest-dom":"6.6.3","@testing-library/react":"16.3.0","@types/body-parser":"1.19.6","@types/compression":"1.8.1","@types/cookie-parser":"1.4.9","@types/cors":"2.8.19","@types/crypto-js":"4.2.2","@types/express":"4.17.21","@types/express-session":"1.18.2","@types/express-useragent":"1.0.5","@types/fs-extra":"11.0.4","@types/graphql-upload":"17.0.0","@types/migrate-mongo":"10.0.5","@types/node":"24.0.7","@types/node-persist":"3.1.8","@types/react":"19.1.8","@types/react-dom":"19.1.6","@types/unorm":"1.3.31","@types/uuid":"10.0.0","@types/ws":"8.18.1","@types/yargs":"17.0.33","@vitest/browser":"3.2.4",eslint:"9.30.0","eslint-config-next":"15.3.4","eslint-plugin-format":"1.0.1","eslint-plugin-react-hooks":"5.2.0","eslint-plugin-react-refresh":"0.4.20",glob:"11.0.3","lint-staged":"16.1.2","node-modules-inspector":"1.0.0",sass:"1.89.2","simple-git-hooks":"2.13.0",tsx:"4.20.3",typescript:"5.8.3",vite:"7.0.0","vite-plugin-dts":"4.5.4",vitest:"3.2.4"},H={access:"public",registry:"https://registry.npmjs.org/"},N={name:C,type:v,version:E,description:_,author:S,license:b,homepage:I,repository:L,bugs:T,exports:M,bin:P,files:A,scripts:O,dependencies:G,devDependencies:R,publishConfig:H};function y(){return s(this,null,function*(){r.pathExistsSync(e.PATH.TS_CONFIG)?yield e.runCommand("Performing TypeScript validation",yield e.command.typescriptCheck()):c.log.warn("No TypeScript configuration found. Skipping type check.")})}function f(t=!1){return s(this,null,function*(){t?yield e.runCommand("Running ESLint with auto-fix",yield e.command.eslintFix()):yield e.runCommand("Running ESLint check",yield e.command.eslintCheck())})}function x(t,i){if(!i.length)return;const n=t==="Errors"?"red":"yellow";c.log.printBoxedLog(t==="Errors"?"✖ Errors":"⚠ Warnings",i,n)}function d(){return s(this,null,function*(){setTimeout(()=>s(null,null,function*(){const t=yield e.getStoredErrorLists(),i=t.filter(a=>a.type===u.E_IssueType.Error),n=t.filter(a=>a.type===u.E_IssueType.Warning);!i.length&&!n.length?c.log.printBoxedLog("✔ NO ISSUES FOUND",[],"green"):(x("Warnings",n),x("Errors",i),(i.length>0||n.length>0)&&m.exit(1))}),0)})}function D(){return s(this,null,function*(){yield e.clearAllErrorLists();const t=yield e.getPackage({name:e.CYBERSKILL_PACKAGE_NAME});if(!t.success){c.log.error("Failed to retrieve package information. Aborting lint-staged.");return}t.result.isCurrentProject&&(yield e.runCommand(`Building package: ${e.CYBERSKILL_PACKAGE_NAME}`,yield e.command.build())),yield e.runCommand("Executing lint-staged",yield e.command.lintStaged()),d()})}function B(){return s(this,null,function*(){yield e.runCommand("Inspecting ESLint configuration",yield e.command.eslintInspect())})}function F(){return s(this,null,function*(){yield e.clearAllErrorLists(),yield Promise.all([y(),f()]),d()})}function K(){return s(this,null,function*(){yield e.clearAllErrorLists(),yield Promise.all([y(),f(!0)]),d()})}function U(){return s(this,null,function*(){yield e.clearAllErrorLists(),yield e.runCommand("Validating commit message",yield e.command.commitLint()),d()})}function j(){return s(this,null,function*(){yield e.runCommand("Configuring Git hooks",yield e.command.configureGitHook()),r.removeSync(e.PATH.GIT_HOOK);const t=yield e.resolveCommands(e.createGitHooksConfig);r.writeFileSync(e.PATH.SIMPLE_GIT_HOOKS_JSON,JSON.stringify(t,null,4));const i=`
|
|
3
3
|
${e.SIMPLE_GIT_HOOK_JSON}
|
|
4
4
|
`;r.pathExistsSync(e.PATH.GIT_IGNORE)?r.readFileSync(e.PATH.GIT_IGNORE,"utf-8").split(`
|
|
5
5
|
`).includes(e.SIMPLE_GIT_HOOK_JSON)||r.appendFileSync(e.PATH.GIT_IGNORE,i):r.writeFileSync(e.PATH.GIT_IGNORE,i),yield e.runCommand("Setting up simple-git-hooks",yield e.command.simpleGitHooks())})}function J(){return s(this,null,function*(){yield e.installDependencies(),yield j()})}function Y(){return s(this,null,function*(){r.removeSync(e.PATH.NODE_MODULES,e.PATH.PNPM_LOCK_YAML),yield e.runCommand("Pruning pnpm store",yield e.command.pnpmPruneStore()),yield e.runCommand("Clearing pnpm cache",yield e.command.pnpmCleanCache()),yield e.installDependencies(),yield j()})}function $(){return s(this,null,function*(){yield e.runCommand("Inspecting project dependencies",yield e.command.nodeModulesInspect())})}function V(){return s(this,null,function*(){yield e.runCommand("Running unit tests",yield e.command.testUnit())})}function W(){return s(this,null,function*(){yield e.runCommand("Running end-to-end tests",yield e.command.testE2e())})}function z(t){return s(this,null,function*(){yield e.runCommand("Creating MongoDB migration",yield e.command.mongoMigrateCreate(t))})}function Q(){return s(this,null,function*(){yield e.runCommand("Running MongoDB migrations",yield e.command.mongoMigrateUp())})}function X(){return s(this,null,function*(){yield e.runCommand("Rolling back MongoDB migration",yield e.command.mongoMigrateDown())})}s(null,null,function*(){try{yield k(q.hideBin(m.argv)).scriptName(e.CYBERSKILL_CLI).usage("$0 <command> [options]").command("lint","Check code for linting issues",F).command("lint:fix","Fix linting issues automatically",K).command("lint:inspect","View active ESLint configuration",B).command("lint-staged","Run lint checks on staged files",D).command("commitlint","Validate commit message format",U).command("ready","Initialize project and dependencies",J).command("reset","Reset the project and reinstall dependencies",Y).command("inspect","Analyze installed project dependencies",$).command("test:unit","Run unit test suite",V).command("test:e2e","Run end-to-end test suite",W).command("mongo:migrate:create <name>","Create a MongoDB migration",t=>t.positional("name",{describe:"Migration name",type:"string"}),t=>s(null,null,function*(){if(!t.name){c.log.error("Migration name is required.");return}yield z(t.name)})).command("mongo:migrate:up","Apply all MongoDB migrations",Q).command("mongo:migrate:down","Rollback last MongoDB migration",X).demandCommand(1,"Please specify a valid command.").strict().help().alias("h","help").alias("v","version").version(N.version).epilog(`💡 Tip: Use "--help" with any command to see options
|