@omfalos/mokosh 0.1.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/LICENSE +21 -0
- package/README.md +192 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +139 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.mjs +139 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +1135 -0
- package/dist/index.d.ts +1135 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +26 -0
- package/dist/index.mjs.map +1 -0
- package/dist/mcp.d.mts +15 -0
- package/dist/mcp.d.ts +15 -0
- package/dist/mcp.js +28 -0
- package/dist/mcp.js.map +1 -0
- package/dist/mcp.mjs +28 -0
- package/dist/mcp.mjs.map +1 -0
- package/package.json +103 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
var rt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});import Ft from"fs";import ae from"path";var Rr=[".config.","biome.json","tsconfig.json","package.json",".prettierrc",".eslintrc"],re=[];function st(e){re.push(e)}function se(e){return[...Rr,...re].some(t=>typeof t=="string"?e.includes(t):t instanceof RegExp?t.test(e):t(e))}var Dr=[".test.",".spec.","-test.","-spec."],ne=[];function nt(e){ne.push(e)}function $(){return[...Dr,...ne]}var Ar=["jest","vitest","playwright","cypress","@testing-library/"],oe=[];function ot(e){oe.push(e)}function kt(){return[...Ar,...oe]}var ie=.8;function Et(e){ie=e}function wt(){return ie}var Lr=["mokosh.config.js","mokosh.config.cjs","mokosh.config.json"];function Ct(e,{allowJs:t=!0,isExplicitPath:r=!1}={}){if(r){let s=ae.resolve(e);return Ft.existsSync(s)?s.endsWith(".json")?ce(s):t?pe(s):{}:{}}for(let s of Lr){let n=ae.resolve(e,s);if(Ft.existsSync(n)){if(s.endsWith(".json"))return ce(n);if(t)return pe(n)}}return{}}function ce(e){return JSON.parse(Ft.readFileSync(e,"utf-8"))}function pe(e){let t=rt(e);return t&&typeof t=="object"&&"default"in t&&(t=t.default),typeof t=="function"?t({}):t}function jr(e){for(let t of e.configMatchers??[])st(t);for(let t of e.testPatterns??[])nt(t);for(let t of e.testLibraries??[])ot(t);e.barrelThreshold!==void 0&&Et(e.barrelThreshold)}var Tt=["node_modules",".git","dist","build",".next",".cache","mokosh-cache","coverage"],It=[".ts",".tsx",".js",".jsx",".mjs",".cjs",".css",".scss",".sass",".less",".styl",".coffee",".ls",".lua",".py",".go",".feature"];import Gr from"fs";import le from"path";function Or(e,t){let r=le.resolve(e,t);try{let s=Gr.readFileSync(r,"utf-8"),n=JSON.parse(s),o=new Map;for(let[i,a]of Object.entries(n)){if(i==="total")continue;let c=a?.lines?.pct;if(typeof c!="number")continue;let p=le.relative(e,i);o.set(p,c)}return o}catch{return new Map}}var Pt={serialize(e){let t=["graph TD"],r=new Set;for(let s of e.nodes.values()){let n=`"${s.path}"`;for(let o of s.imports){if(!o.toPath)continue;let i=`"${o.toPath}"`,a=`${s.path} -> ${o.toPath}`;if(!r.has(a)){let c=o.isStyle?"-- styles -->":"-->";t.push(` ${n} ${c} ${i}`),r.add(a)}}}return t.join(`
|
|
2
|
+
`)}};function fe(e){return Pt.serialize(e)}import ue from"fs";import Wr from"path";function Mt(e,t){let r=e.replace(/^\.\//,"");if(t.nodes.has(r))return r;let s=r.replace(/^dist\//,"src/").replace(/\.(js|mjs|cjs)$/,".ts");return t.nodes.has(s)?s:null}function ge(e,t){if(typeof e=="string")return Mt(e,t);if(e&&typeof e=="object"){let r=e;for(let s of["import","require","default"]){let n=ge(r[s],t);if(n)return n}}return null}function _r(e){if(!e)return"unknown";let t=e.trimStart();return t.startsWith("interface ")?"interface":t.startsWith("class ")?"class":t.startsWith("enum ")?"enum":t.startsWith("type ")?"type":t.startsWith("namespace ")?"namespace":t.startsWith("const ")||t.startsWith("let ")||t.startsWith("var ")||t.startsWith("readonly ")?"const":t.startsWith("(")||t.startsWith("async ")||t.startsWith("function ")||t.includes("=>")?"function":"unknown"}function $r(e,t){let r=new Set,s=new Set,n=[...t];for(;n.length;){let o=n.shift();if(s.has(o))continue;s.add(o);let i=e.nodes.get(o);if(i){for(let a of i.exports)r.add(a.name);for(let a of i.imports){if(a.type!=="re-export"||a.isExternal||!a.toPath)continue;if(!a.symbols?.length||a.symbols.includes("*")){let p=e.nodes.get(a.toPath);if(p)for(let u of p.exports)r.add(u.name);n.push(a.toPath)}else for(let p of a.symbols)r.add(p)}}}return r}function zr(e,t){return me(e,t)[0]??null}function me(e,t){let r=[],s=Wr.join(t,"package.json");if(ue.existsSync(s))try{let n=JSON.parse(ue.readFileSync(s,"utf8"));if(n.exports&&typeof n.exports=="object"&&!Array.isArray(n.exports))for(let o of Object.values(n.exports)){let i=ge(o,e);i&&!r.includes(i)&&r.push(i)}else if(typeof n.exports=="string"){let o=Mt(n.exports,e);o&&r.push(o)}if(r.length===0)for(let o of[n.main,n.module].filter(Boolean)){let i=Mt(o,e);i&&!r.includes(i)&&r.push(i)}}catch{}if(r.length===0){for(let n of["src/index.ts","src/index.js","index.ts","index.js"])if(e.nodes.has(n)){r.push(n);break}}return r}function Br(e,t){let r=new Set(t);for(let s of t)e.traverse(s,n=>(r.add(n.path),!0),{direction:"outgoing"});return r}function Ur(e,t,r){let s=new Map;for(let n of t){if(r.includes(n))continue;let o=e.nodes.get(n);if(!o)continue;let i=o.category==="barrel";for(let a of o.exports){let c=s.get(a.name),p=!!(a.signature||a.doc);(!c||p&&!i)&&s.set(a.name,{file:n,symbol:a})}}return s}function Kr(e,t,r,s){let n=[];for(let o of e){let i=t.get(o),a=s.flatMap(f=>r.nodes.get(f)?.exports??[]).find(f=>f.name===o),c=i?.symbol??a,p=i?.file??s.find(f=>r.nodes.get(f)?.exports.some(d=>d.name===o))??s[0],u={name:o,definedIn:p,kind:_r(c?.signature)};c?.doc&&(u.doc=c.doc),c?.signature&&(u.signature=c.signature),n.push(u)}return n.sort((o,i)=>o.name.localeCompare(i.name)),n}function Jr(e,t,r){let s=c=>e.nodes.get(c)?.category==="test",n=[...t].filter(c=>!r.includes(c)&&!s(c)),o=[...e.nodes.keys()].filter(c=>!t.has(c)),i=o.filter(c=>!s(c)),a=o.filter(c=>s(c));return{internalFiles:n,unreachableFromEntry:i,testFiles:a}}function Hr(e,t){if(t.length===0)throw new Error("buildApiSurface requires at least one entry point");for(let p of t)if(!e.nodes.has(p))throw new Error(`Entry point not found in graph: ${p}`);let r=Br(e,t),s=Ur(e,r,t),n=$r(e,t),o=Kr(n,s,e,t),{internalFiles:i,unreachableFromEntry:a,testFiles:c}=Jr(e,r,t);return{entryPoints:t,publicExports:o,internalFiles:i,unreachableFromEntry:a,testFiles:c}}function Vr(e,t){let r=null,s=[];for(let o of e.nodes.values()){o.exports.some(i=>i.name===t)&&(r=o.path);for(let i of o.callEdges??[])i.to===t&&s.push({file:o.path,callerFunction:i.from})}let n=[];if(r){let o=e.nodes.get(r);for(let i of o?.callEdges??[])i.from===t&&n.push({file:i.toFile,calleeFunction:i.to})}return{functionName:t,definedIn:r,callers:s,callees:n}}import z from"fs";import Qr from"path";function Nt(e){let t=[...e.nodes.entries()].sort(([s],[n])=>s.localeCompare(n)).map(([s,n])=>`${s}:${n.mtime}:${n.size}`).join("|"),r=2166136261;for(let s=0;s<t.length;s++)r^=t.charCodeAt(s),r=Math.imul(r,16777619)>>>0;return r.toString(16).padStart(8,"0")}function Xr(e){let t=new Map;for(let r of e.nodes.keys()){let s=[];e.traverse(r,n=>(n.path!==r&&s.push(n.path),!0),{direction:"incoming"}),t.set(r,s)}return{impact:t,graphHash:Nt(e)}}function Zr(e,t){return e.impact.get(t)??[]}function Yr(e,t){return e.graphHash===Nt(t)}function qr(e,t){let r=Qr.dirname(t);z.existsSync(r)||z.mkdirSync(r,{recursive:!0});let s={graphHash:e.graphHash,impact:[...e.impact.entries()]};z.writeFileSync(t,JSON.stringify(s))}function ts(e){if(!z.existsSync(e))return null;try{let t=z.readFileSync(e,"utf-8"),r=JSON.parse(t);return{graphHash:r.graphHash,impact:new Map(r.impact)}}catch{return null}}import it from"path";function es(e){let t=new Map;for(let[r,s]of e){let n=s.imports.filter(o=>o.toPath&&!o.isExternal).length;n>0&&t.set(r,n)}return t}function rs(e,t,r){let s=new Map;for(let[n,o]of t){if(o<r)continue;let i=e.get(n);if(!i||i.category==="test"||i.category==="barrel")continue;let a=it.extname(n),c=it.basename(n,a),p=c==="index"?it.basename(it.dirname(n)):c;s.set(n,{path:n,outDegree:o,tag:`feature:${p}`})}return s}function B(e,t){let r=t?.minOutDegree??5;return rs(e,es(e),r)}var ss=(e,t)=>e.outDegree-t.outDegree;function ns(e,t){let r=new Map;for(let s of t.values()){let n=new Set;e.traverse(s.path,o=>(o.path!==s.path&&n.add(o.path),!0),{direction:"outgoing"}),r.set(s.path,n)}return r}function os(e,t,r,s){let n=new Map;for(let[o]of e){if(t.has(o))continue;let i=null;for(let a of t.values())r.get(a.path)?.has(o)&&(!i||s(a,i)<0)&&(i=a);i&&n.set(o,i.path)}return n}function is(e,t){let r=new Map;for(let s of e.values()){let n=s.tag.replace("feature:",""),o=[];for(let[i,a]of t)a===s.path&&o.push(i);r.set(n,{hub:s.path,outDegree:s.outDegree,files:o})}return r}function as(e,t,r){let s=[];for(let n of e.keys())!t.has(n)&&!r.has(n)&&s.push(n);return s}function Rt(e,t){let r=t?.detectFn??B,s=t?.hubComparator??ss,n=r(e.nodes,t),o=ns(e,n),i=os(e.nodes,n,o,s);return{features:is(n,i),unassigned:as(e.nodes,n,i)}}var U=class{constructor(t){this.nodes=t}nodes;findUnusedFiles(t){let r=new Set(this.nodes.keys());return t.filter(s=>!r.has(s))}findHighExportUsage(t){let r=[];for(let s of this.nodes.values()){if(s.maxExportUsage===void 0||s.maxExportUsage<t)continue;let n=s.imports.reduce((o,i)=>(i.exportUsageRatio??0)>(o?.exportUsageRatio??0)?i:o,null);r.push({path:s.path,maxExportUsage:s.maxExportUsage,tightestDep:n?.toPath??""})}return r.sort((s,n)=>n.maxExportUsage-s.maxExportUsage)}findCycles(){let t=[],r=new Set,s=new Set,n=[],o=i=>{r.add(i),s.add(i),n.push(i);let a=this.nodes.get(i);if(a){for(let c of a.imports)if(!(!c.toPath||c.isExternal))if(s.has(c.toPath)){let p=n.indexOf(c.toPath);t.push([...n.slice(p),c.toPath])}else r.has(c.toPath)||o(c.toPath)}s.delete(i),n.pop()};for(let i of this.nodes.keys())r.has(i)||o(i);return t}};var T=class e{constructor(t){this.nodes=t}nodes;_incomingEdgesCache=null;_callIncomingCache=null;serialize(){return{nodes:Array.from(this.nodes.values())}}static deserialize(t){let r=new Map;for(let s of t.nodes)r.set(s.path,s);return new e(r)}getIncomingEdgesMap(){if(this._incomingEdgesCache)return this._incomingEdgesCache;let t=new Map;for(let r of this.nodes.values())for(let s of r.imports)if(s.toPath){let n=t.get(s.toPath)||[];n.push(r.path),t.set(s.toPath,n)}return this._incomingEdgesCache=t,t}dfs(t,r,s,n){let o=new Set,i=s.maxDepth??1/0,a=(c,p,u)=>{if(p>i||o.has(c))return;let f=this.nodes.get(c);if(f&&(o.add(c),r(f,p,u)!==!1))for(let d of n(c))a(d,p+1,c)};a(t,0,null)}traverse(t,r,s={}){let n=s.direction??"outgoing",o=n==="incoming"?this.getIncomingEdgesMap():null;this.dfs(t,r,s,i=>n==="outgoing"?this.nodes.get(i)?.imports.map(a=>a.toPath).filter(Boolean)??[]:o?.get(i)??[])}getCallIncomingCache(){if(this._callIncomingCache)return this._callIncomingCache;let t=new Map;for(let r of this.nodes.values())for(let s of r.callEdges??[]){let n=t.get(s.toFile)??[];n.push(r.path),t.set(s.toFile,n)}return this._callIncomingCache=t,t}traverseCalls(t,r,s={}){let n=s.direction??"outgoing",o=n==="incoming"?this.getCallIncomingCache():null;this.dfs(t,r,s,i=>n==="outgoing"?this.nodes.get(i)?.callEdges?.map(a=>a.toFile)??[]:o?.get(i)??[])}getCallers(t){let r=[];return this.traverseCalls(t,s=>(s.path!==t&&r.push(s.path),!0),{direction:"incoming",maxDepth:1}),r}getCallEdgesFor(t){return this.nodes.get(t)?.callEdges??[]}getNeighbors(t){let r=this.nodes.get(t);return r?r.imports.map(s=>this.nodes.get(s.toPath)).filter(s=>s!==void 0):[]}findUnusedFiles(t){return new U(this.nodes).findUnusedFiles(t)}findCycles(){return new U(this.nodes).findCycles()}};function de(e){if(e.category==="test")return"test";if(e.category==="config")return"config";if(e.category==="type-only")return"types";let t=e.path;return m(t,"component")||m(t,"components")?"component":m(t,"controller")||m(t,"controllers")?"controller":m(t,"middleware")?"middleware":m(t,"router")||m(t,"routes")||m(t,"route")?"router":m(t,"store")||m(t,"stores")?"store":m(t,"service")||m(t,"services")?"service":m(t,"handler")||m(t,"handlers")?"handler":m(t,"adapter")||m(t,"adapters")?"adapter":m(t,"plugin")||m(t,"plugins")?"plugin":m(t,"api")?"api":m(t,"cli")||m(t,"commands")||K(t)==="cli"?"cli":m(t,"util")||m(t,"utils")||m(t,"helper")||m(t,"helpers")?"util":m(t,"model")||m(t,"models")||K(t)==="model"?"model":m(t,"parser")||m(t,"parsers")||K(t)==="parser"?"parser":K(t)==="builder"?"builder":K(t)==="resolver"?"resolver":"other"}function m(e,t){return e.includes(`/${t}/`)||e.includes(`/${t}.`)}function K(e){let t=e.slice(e.lastIndexOf("/")+1);return t.slice(0,t.lastIndexOf("."))||t}function cs(e,t){let r=Rt(e,t),s=new Map;for(let[o,i]of r.features){for(let a of i.files)s.set(a,o);s.set(i.hub,o)}let n=new Map;for(let o of e.nodes.values()){let i=s.get(o.path);n.set(o.path,{path:o.path,role:de(o),...o.description?{description:o.description}:{},exports:o.exports.map(a=>a.name),...i?{featureHub:i}:{}})}return n}var J=class{affectedSymbols=new Map;constructor(t,r){this.affectedSymbols.set(t,new Set(["default",...r]))}updateAffectedSymbols(t,r){let s=this.affectedSymbols.get(r)||new Set,n=t.imports.find(c=>c.toPath===r);if(!n)return!1;let o=n.symbols||["*"],i=new Set;for(let c of o)(c==="*"||s.has("*")||s.has(c))&&i.add("*");if(i.size===0)return!1;let a=this.affectedSymbols.get(t.path)||new Set;for(let c of i)a.add(c);return this.affectedSymbols.set(t.path,a),!0}};function ps(e){return e?e.startsWith("interface ")?"interface":e.startsWith("class ")?"class":e.startsWith("enum ")?"enum":"type":"type"}function ls(e,t){if(t==="type-only")return!0;let r=e.signature??"";return r.startsWith("interface ")||r.startsWith("class ")||r.startsWith("enum ")}function fs(e){let t=new Map;for(let s of e.nodes.values())if(!(s.type!=="typescript"&&s.type!=="javascript"))for(let n of s.exports){if(!ls(n,s.category))continue;let o=`${s.path}::${n.name}`;t.set(o,{name:n.name,file:s.path,kind:ps(n.signature),...n.doc?{doc:n.doc}:{}})}let r=[];for(let s of e.nodes.values())if(!(s.type!=="typescript"&&s.type!=="javascript")){for(let n of s.imports)if(!(!n.toPath||n.isExternal||!n.symbols?.length))for(let o of n.symbols)t.has(`${n.toPath}::${o}`)&&r.push({fromFile:s.path,toType:o,toFile:n.toPath})}return{types:t,edges:r}}function us(e,t){let r=null;for(let o of e.types.values())if(o.name===t){r=o;break}if(!r)return{type:null,usedByFiles:[],uses:[]};let s=new Set,n=new Map;for(let o of e.edges)if(o.toType===t&&o.toFile===r.file&&s.add(o.fromFile),o.fromFile===r.file){let i=e.types.get(`${o.toFile}::${o.toType}`);i&&n.set(`${i.file}::${i.name}`,i)}return{type:r,usedByFiles:Array.from(s),uses:Array.from(n.values())}}import ws from"path";import At from"fs";import Se from"path";import H from"fs";import v from"path";import he from"fs";import Oi from"path";function ye(e){try{return he.statSync(e,{throwIfNoEntry:!1})?.isDirectory()===!0}catch{return!1}}function at(e){try{return he.statSync(e,{throwIfNoEntry:!1})?.isFile()===!0}catch{return!1}}function Dt(e,t){let r=v.join(t,"package.json");if(!H.existsSync(r))return null;let s={};try{s=JSON.parse(H.readFileSync(r,"utf-8"))}catch{return null}let n=s.name;return n?{name:n,root:t,relativeRoot:v.relative(e,t),entryPoints:gs(t,s)}:null}function gs(e,t){let r=[];if(t.exports){let n=t.exports;if(typeof n=="string")r.push(v.join(e,n));else if(typeof n=="object"&&n!==null){let o=n["."];if(typeof o=="string")r.push(v.join(e,o));else if(typeof o=="object"&&o!==null){let i=o.import??o.require??o.default;typeof i=="string"&&r.push(v.join(e,i))}}}t.main&&r.push(v.join(e,t.main));for(let n of["src/index.ts","src/index.tsx","index.ts","index.tsx","index.js"])r.push(v.join(e,n));let s=r.filter(at);return s.length>0?s.slice(0,1):r.slice(0,1)}function I(e,t){let r=[],s=new Set;for(let n of t){let o=n.replace(/\/$/,"").replace(/^\.\//,"");ms(e,o,s,r)}return r}function ms(e,t,r,s){if(!t.includes("*")){ds(e,t,r,s);return}let n=t.split("/");n.includes("**")?hs(e,n,r,s):ys(e,n,r,s)}function ds(e,t,r,s){let n=v.join(e,t);if(r.has(n)||!ye(n))return;r.add(n);let o=Dt(e,n);o&&s.push(o)}function hs(e,t,r,s){let n=v.join(e,t[0]==="**"?"":t[0]??"");xe(e,n,r,s)}function ys(e,t,r,s){let n=t.findIndex(a=>a.includes("*")),o=v.join(e,...t.slice(0,n)),i;try{i=H.readdirSync(o,{withFileTypes:!0})}catch{return}for(let a of i){if(!a.isDirectory())continue;let c=v.join(o,a.name);if(r.has(c))continue;r.add(c);let p=Dt(e,c);p&&s.push(p)}}function xe(e,t,r,s){let n;try{n=H.readdirSync(t,{withFileTypes:!0})}catch{return}for(let o of n){if(!o.isDirectory()||o.name==="node_modules"||o.name.startsWith("."))continue;let i=v.join(t,o.name);if(H.existsSync(v.join(i,"package.json"))&&!r.has(i)){r.add(i);let a=Dt(e,i);a&&s.push(a)}else xe(e,i,r,s)}}var be={type:"npm",detect(e){let t=Se.join(e,"package.json");if(!At.existsSync(t))return null;let r;try{r=JSON.parse(At.readFileSync(t,"utf-8")).workspaces}catch{return null}if(!r||At.existsSync(Se.join(e,"yarn.lock")))return null;let s=Array.isArray(r)?r:r.packages??[];return s.length===0?null:I(e,s)}};import P from"fs";import y from"path";var ve={type:"nx",detect(e){return P.existsSync(y.join(e,"nx.json"))?ke(e,e,new Set,0).map(r=>xs(e,r,y.join(r,"project.json"))).filter(r=>r!==null):null}};function ke(e,t,r,s){if(s>4)return[];let n;try{n=P.readdirSync(t,{withFileTypes:!0})}catch{return[]}let o=[];for(let i of n){if(!i.isDirectory())continue;let a=i.name;if(a.startsWith(".")||a==="node_modules"||a==="dist"||a===".nx")continue;let c=y.join(t,a);P.existsSync(y.join(c,"project.json"))&&!r.has(c)?(r.add(c),o.push(c)):o.push(...ke(e,c,r,s+1))}return o}function xs(e,t,r){let s={};try{s=JSON.parse(P.readFileSync(r,"utf-8"))}catch{return null}let n=s.name,o,i,a=y.join(t,"package.json");if(P.existsSync(a))try{let c=JSON.parse(P.readFileSync(a,"utf-8"));n=c.name??n,o=c.main,i=c.exports}catch{}return n?{name:n,root:t,relativeRoot:y.relative(e,t),entryPoints:Ss(t,s,o,i)}:null}function Ss(e,t,r,s){let n=[],o=t.targets?.build?.options?.main??t.targets?.build?.options?.entryFile;if(o){let a=y.resolve(e,"../..");n.push(y.resolve(a,o)),n.push(y.resolve(e,o))}if(s){let a=s;if(typeof a=="string")n.push(y.join(e,a));else if(typeof a=="object"&&a!==null){let c=a["."];typeof c=="string"&&n.push(y.join(e,c))}}if(r&&n.push(y.join(e,r)),t.sourceRoot){let a=y.resolve(e,"../.."),c=y.resolve(a,t.sourceRoot);n.push(y.join(c,"index.ts"),y.join(c,"index.tsx"))}for(let a of["src/index.ts","src/index.tsx","index.ts","index.tsx"])n.push(y.join(e,a));let i=n.filter(at);return i.length>0?i.slice(0,1):n.slice(0,1)}import Ee from"fs";import bs from"path";import vs from"js-yaml";var we={type:"pnpm",detect(e){let t=bs.join(e,"pnpm-workspace.yaml");if(!Ee.existsSync(t))return null;let r=[];try{r=vs.load(Ee.readFileSync(t,"utf-8"))?.packages??[]}catch{return null}return I(e,r)}};import ks from"fs";import Es from"path";var Fe={type:"turborepo",detect(e){return ks.existsSync(Es.join(e,"turbo.json"))?[]:null}};import Lt from"fs";import Ce from"path";var Te={type:"yarn",detect(e){if(!Lt.existsSync(Ce.join(e,"yarn.lock")))return null;let t=Ce.join(e,"package.json");if(!Lt.existsSync(t))return null;let r;try{r=JSON.parse(Lt.readFileSync(t,"utf-8")).workspaces}catch{return null}if(!r)return null;let s=Array.isArray(r)?r:r.packages??[];return s.length===0?null:I(e,s)}};var Ie=[];function w(e){Ie.push(e)}function Pe(){return Ie}w(Fe);w(ve);w(we);w(Te);w(be);function jt(e,t=Pe()){let r=ws.resolve(e),s=new Map,n=[];for(let i of t){let a=i.detect(r);if(a!==null){n.push(i.type);for(let c of a)s.has(c.name)||s.set(c.name,c)}}if(n.length===0)return{root:r,type:"none",types:[],packages:[],packageMap:new Map};let o=Array.from(s.values());return{root:r,type:n[0],types:n,packages:o,packageMap:new Map(o.map(i=>[i.name,i]))}}var V=class e{constructor(t,r){this.monorepoRoot=t;this.type=r}monorepoRoot;type;packages=new Map;addPackage(t,r){this.packages.set(t.name,{graph:r,pkg:t})}getPackageForFile(t){for(let{pkg:r}of this.packages.values())if(t===r.relativeRoot||t.startsWith(`${r.relativeRoot}/`))return r}getPackageDependencies(){let t=new Map;for(let{graph:r,pkg:s}of this.packages.values()){let n=new Set;for(let o of r.nodes.values())for(let i of o.imports)i.isWorkspace&&i.workspacePackage&&n.add(i.workspacePackage);t.set(s.name,[...n])}return t}getAffectedAcrossPackages(t){let r=this.getPackageForFile(t);if(!r)return[];let s=this.packages.get(r.name);if(!s)return[];let n=[];s.graph.traverse(t,o=>(o.path!==t&&n.push({file:o.path,package:r.name}),!0),{direction:"incoming"});for(let{graph:o,pkg:i}of this.packages.values())if(i.name!==r.name)for(let a of o.nodes.values())a.imports.some(p=>p.isWorkspace&&p.workspacePackage===r.name)&&n.push({file:a.path,package:i.name});return n}serialize(){return{monorepoRoot:this.monorepoRoot,type:this.type,packages:Array.from(this.packages.values()).map(({graph:t,pkg:r})=>({pkg:{name:r.name,relativeRoot:r.relativeRoot,entryPoints:r.entryPoints},nodes:Array.from(t.nodes.values())}))}}static deserialize(t){let r=new e(t.monorepoRoot,t.type);for(let{pkg:s,nodes:n}of t.packages){let o=new Map(n.map(a=>[a.path,a])),i=new T(o);r.packages.set(s.name,{graph:i,pkg:{...s,root:""}})}return r}};var Me=new Map;function M(e,t){Me.set(e,t)}function Ne(e){return Me.get(e)}function Re(e,t){return t.startsWith("!")?e!==t.slice(1):e===t}function Fs(e,t){return t.startsWith("!")?!e.includes(t.slice(1)):e.includes(t)}var Cs=(e,t)=>!t.category||Re(e.category,t.category),Ts=(e,t)=>!t.type||Re(e.type,t.type),Is=(e,t)=>!t.path||Fs(e.path,t.path),Ps=(e,t)=>t.isExternal===void 0?!0:e.imports.some(s=>s.isExternal)===t.isExternal,Ms=(e,t)=>{if(!t.tags||t.tags.length===0)return!0;let r=t.tags.filter(n=>!n.startsWith("!")),s=t.tags.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return!(r.length>0&&!r.some(n=>e.tags.some(o=>o.name===n))||s.some(n=>e.tags.some(o=>o.name===n)))},Ns=(e,t)=>!t.allTags?.length||t.allTags.every(r=>e.tags.some(s=>s.name===r)),Rs=(e,t)=>!t.importsFile||e.imports.some(r=>r.toPath?.includes(t.importsFile)),Ds=(e,t,r)=>t.importedBy===void 0?!0:(r?.get(e.path)??[]).some(n=>n.includes(t.importedBy)),As=(e,t)=>t.minImports===void 0||e.imports.length>=t.minImports,Ls=(e,t)=>t.maxImports===void 0||e.imports.length<=t.maxImports,js=(e,t)=>t.minSize===void 0||e.size>=t.minSize,Gs=(e,t)=>t.maxSize===void 0||e.size<=t.maxSize,Os=(e,t)=>t.hasDocstring===void 0||!!e.description===t.hasDocstring,Ws=(e,t)=>t.minCoverage===void 0||(e.coveragePct??101)>=t.minCoverage,_s=(e,t)=>t.maxCoverage===void 0||(e.coveragePct??0)<=t.maxCoverage,$s=(e,t)=>t.minExportUsage===void 0||(e.avgExportUsage??-1)>=t.minExportUsage,zs=(e,t)=>t.maxExportUsage===void 0||(e.avgExportUsage??0)<=t.maxExportUsage,De=[Cs,Ts,Is,Ps,Ms,Ns,Rs,Ds,As,Ls,js,Gs,Os,Ws,_s,$s,zs];function Ae(e,t,r){return De.every(s=>s(e,t,r))}function Le(e,t){let r=new Map;if(t.importedBy!==void 0){for(let i of e.nodes)for(let a of i.imports)if(a.toPath){let c=r.get(a.toPath)??[];c.push(i.path),r.set(a.toPath,c)}}let s=e.nodes.filter(i=>Ae(i,t,r)),n=new Set(s.map(i=>i.path)),o=s.map(i=>({...i,imports:i.imports.filter(a=>!a.toPath||n.has(a.toPath))}));return t.sort&&o.sort((i,a)=>t.sort==="size"?a.size-i.size:t.sort==="imports"?a.imports.length-i.imports.length:t.sort==="commitCount90d"?(a.commitCount90d??0)-(i.commitCount90d??0):t.sort==="exportUsage"?(a.avgExportUsage??0)-(i.avgExportUsage??0):0),t.limit!==void 0&&o.splice(t.limit),{nodes:o,cycles:e.cycles?.filter(i=>i.every(a=>n.has(a)))??void 0}}function je(e){let t={},r=e.split(",");for(let s of r){let n=s.indexOf(":");if(n===-1)continue;let o=s.slice(0,n).trim().toLowerCase(),i=s.slice(n+1).trim();if(!(!o||!i))switch(o){case"category":t.category=i;break;case"type":t.type=i;break;case"tag":case"tags":i.includes("+")?t.allTags=[...t.allTags??[],...i.split("+")]:t.tags=[...t.tags??[],i];break;case"path":t.path=i;break;case"external":t.isExternal=i.toLowerCase()==="true";break;case"importsfile":t.importsFile=i;break;case"importedby":t.importedBy=i;break;case"minimports":t.minImports=parseInt(i,10);break;case"maximports":t.maxImports=parseInt(i,10);break;case"minsize":t.minSize=parseInt(i,10);break;case"maxsize":t.maxSize=parseInt(i,10);break;case"sort":t.sort=i;break;case"limit":t.limit=parseInt(i,10);break;case"hasdocstring":t.hasDocstring=i.toLowerCase()!=="false";break;case"mincoverage":t.minCoverage=parseInt(i,10);break;case"maxcoverage":t.maxCoverage=parseInt(i,10);break;case"minexportusage":t.minExportUsage=parseFloat(i);break;case"maxexportusage":t.maxExportUsage=parseFloat(i);break}}return t}import Ve from"fs/promises";import gn from"path";import zt from"path";import dt from"typescript";import Oe from"path";import We from"typescript";import S from"typescript";var Ge=new Set(["describe","test","it"]);function N(e){let t=[];for(let r of e.statements){if(!S.isExpressionStatement(r))continue;let s=r.expression;if(!S.isCallExpression(s))continue;let n=s.expression;S.isIdentifier(n)&&Ge.has(n.text)&&t.push(s),S.isPropertyAccessExpression(n)&&S.isIdentifier(n.expression)&&Ge.has(n.expression.text)&&t.push(s)}return t}function R(e,t,r){for(let s of e.arguments){if(!S.isObjectLiteralExpression(s))continue;let n=s.properties.find(o=>S.isPropertyAssignment(o)&&S.isIdentifier(o.name)&&o.name.text===t);if(!(!n||!S.isArrayLiteralExpression(n.initializer)))return n.initializer.elements.filter(S.isStringLiteral).map(o=>o.text)}return null}function D(e,t,r,s){if(e.arguments.length===0)return null;for(let o=1;o<e.arguments.length;o++){let i=e.arguments[o];if(!S.isObjectLiteralExpression(i))continue;let a=i.properties.find(p=>S.isPropertyAssignment(p)&&S.isIdentifier(p.name)&&p.name.text===t);if(a)return{start:a.initializer.getStart(s),end:a.initializer.getEnd(),text:r};let c=i.getEnd()-1;return{start:c,end:c,text:`${i.properties.length>0?", ":""}${t}: ${r}`}}let n=e.arguments[e.arguments.length-1];return{start:n.getStart(s),end:n.getStart(s),text:`{ ${t}: ${r} }, `}}function A(e,t,r){let s=e.arguments;for(let n=1;n<s.length;n++){let o=s[n];if(!S.isObjectLiteralExpression(o))continue;let i=o.properties.findIndex(c=>S.isPropertyAssignment(c)&&S.isIdentifier(c.name)&&c.name.text===t);if(i<0)continue;if(o.properties.length===1)return{start:s[n-1].getEnd(),end:o.getEnd(),text:""};let a=o.properties[i];return i===o.properties.length-1?{start:o.properties[i-1].getEnd(),end:a.getEnd(),text:""}:{start:a.getStart(r),end:o.properties[i+1].getStart(r),text:""}}return null}function L(e,t){let r=[...t].sort((n,o)=>o.start-n.start),s=e;for(let n of r)s=s.slice(0,n.start)+n.text+s.slice(n.end);return s}function j(e){return`[${e.map(t=>JSON.stringify(t)).join(", ")}]`}var E=new Set([".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"]);function Bs(e){return j(e.map(t=>`@${t}`))}function Us(e){return e.map(t=>t.startsWith("@")?t.slice(1):t)}var ct=class{name="cypress";canHandle(t){return E.has(Oe.extname(t).toLowerCase())}apply(t,r,s){let n=We.createSourceFile(Oe.basename(t),r,We.ScriptTarget.Latest,!0),o=N(n);if(o.length===0)return r;let i=R(o[0],"tags",n),a=[...s].sort();if(i!==null&&JSON.stringify(Us(i).sort())===JSON.stringify(a))return r;let c=o.flatMap(p=>{let u=s.length===0?A(p,"tags",n):D(p,"tags",Bs(a),n);return u?[u]:[]});return c.length>0?L(r,c):r}};import Ks from"path";var Gt=/# <mokosh-tags>[\s\S]*?# <\/mokosh-tags>\n*/,Ot=/^@([a-zA-Z0-9_-]+)/gm;function Js(e){return["# <mokosh-tags>",...e.map(t=>`@${t}`),"# </mokosh-tags>"].join(`
|
|
3
|
+
`)+`
|
|
4
|
+
|
|
5
|
+
`}function Hs(e){let t=new Set;Ot.lastIndex=0;let r=Ot.exec(e);for(;r!==null;)r[1]&&t.add(r[1]),r=Ot.exec(e);return t}var pt=class{name="gherkin";canHandle(t){return Ks.extname(t).toLowerCase()===".feature"}apply(t,r,s){let n=r.replace(Gt,""),o=Hs(n),i=s.filter(c=>!o.has(c)),a=i.length>0?Js(i):"";return Gt.test(r)?r.replace(Gt,a):a?r.replace(/^(Feature:)/m,`${a}$1`):r}};function _e(e,t){let r=e.replace(/\\/g,"/"),s=t.replace(/\\/g,"/"),n="";for(let o=0;o<r.length;o++){let i=r[o];i==="*"?r[o+1]==="*"?(n+=".*",o++):n+="[^/]*":i==="?"?n+="[^/]":i!==void 0&&(n+=i.replace(/[.+^${}()|[\]\\]/g,"\\$&"))}return new RegExp(`^${n}$`).test(s)}import Vs from"path";var Wt=/^\/\/go:build mokosh_[^\n]+\n/m,Qs=/^package\s+\S+/m;function Xs(e){return`//go:build ${e.map(r=>`mokosh_${r}`).join(" || ")}
|
|
6
|
+
`}function Zs(e){let t=Wt.exec(e);if(!t)return null;let r=t[0],s=/mokosh_([a-zA-Z0-9_-]+)/g,n=[],o=s.exec(r);for(;o!==null;)o[1]&&n.push(o[1]),o=s.exec(r);return n}var lt=class{name="go";canHandle(t){return Vs.basename(t).endsWith("_test.go")}apply(t,r,s){let n=Zs(r),o=[...s].sort();if(n!==null&&JSON.stringify([...n].sort())===JSON.stringify(o))return r;if(s.length===0)return r.replace(Wt,"");let i=Xs(o);if(n!==null)return r.replace(Wt,i);let a=Qs.exec(r);if(!a)return r;let c=a.index;return r.slice(0,c)+i+`
|
|
7
|
+
`+r.slice(c)}};import Ys from"path";var qs=/^\/\*\*\n(?: \* @group .+\n)+ \*\/\n+/,_t=/^ \* @group (.+)$/gm;function tn(e){return["/**",...e.map(t=>` * @group ${t}`)," */"].join(`
|
|
8
|
+
`)+`
|
|
9
|
+
|
|
10
|
+
`}function en(e){let t=[];_t.lastIndex=0;let r=_t.exec(e);for(;r!==null;)r[1]&&t.push(r[1]),r=_t.exec(e);return t}var ft=class{name="jest";canHandle(t){return E.has(Ys.extname(t).toLowerCase())}apply(t,r,s){let n=qs.exec(r),o=n?en(n[0]):null,i=[...s].sort();if(o!==null&&JSON.stringify([...o].sort())===JSON.stringify(i))return r;let a=n?r.slice(n[0].length):r;return s.length===0?a:tn(i)+a}};import $e from"path";import ze from"typescript";function rn(e){return j(e.map(t=>`@${t}`))}function sn(e){return e.map(t=>t.startsWith("@")?t.slice(1):t)}var ut=class{name="playwright";canHandle(t){return E.has($e.extname(t).toLowerCase())}apply(t,r,s){let n=ze.createSourceFile($e.basename(t),r,ze.ScriptTarget.Latest,!0),o=N(n);if(o.length===0)return r;let i=R(o[0],"tag",n),a=[...s].sort();if(i!==null&&JSON.stringify(sn(i).sort())===JSON.stringify(a))return r;let c=o.flatMap(p=>{let u=s.length===0?A(p,"tag",n):D(p,"tag",rn(a),n);return u?[u]:[]});return c.length>0?L(r,c):r}};import nn from"path";var $t=/^pytestmark\s*=\s*.+$/m,on=/^import pytest\s*$/m;function an(e){let t=e.map(r=>`pytest.mark.${r}`).join(", ");return e.length===1?`pytestmark = pytest.mark.${e[0]}`:`pytestmark = [${t}]`}function cn(e){let t=$t.exec(e);if(!t)return null;let r=t[0],s=[],n=/pytest\.mark\.([a-zA-Z0-9_-]+)/g,o=n.exec(r);for(;o!==null;)o[1]&&s.push(o[1]),o=n.exec(r);return s}var gt=class{name="pytest";canHandle(t){return nn.extname(t).toLowerCase()===".py"}apply(t,r,s){let n=cn(r),o=[...s].sort();if(n!==null&&JSON.stringify([...n].sort())===JSON.stringify(o))return r;if(s.length===0)return r.replace($t,"").replace(/\n{3,}/g,`
|
|
11
|
+
|
|
12
|
+
`);let i=an(o);if(n!==null)return r.replace($t,i);let a=on.test(r),c=pn(r),p=r.slice(0,c),u=r.slice(c),f=a?"":`import pytest
|
|
13
|
+
`,d=p.endsWith(`
|
|
14
|
+
|
|
15
|
+
`)?"":`
|
|
16
|
+
`;return p+d+f+i+`
|
|
17
|
+
`+u}};function pn(e){let t=e.split(`
|
|
18
|
+
`),r=-1;for(let n=0;n<t.length;n++){let o=t[n].trimStart();(o.startsWith("import ")||o.startsWith("from "))&&(r=n)}if(r<0)return 0;let s=0;for(let n=0;n<=r;n++)s+=t[n].length+1;return s}import Be from"path";import Ue from"typescript";var ln=/\/\/ <mokosh-tags>[\s\S]*?\/\/ <\/mokosh-tags>\n*/,mt=class{name="vitest";canHandle(t){return E.has(Be.extname(t).toLowerCase())}apply(t,r,s){let n=r.replace(ln,""),o=Ue.createSourceFile(Be.basename(t),n,Ue.ScriptTarget.Latest,!0),i=N(o);if(i.length===0)return n;let a=R(i[0],"tags",o),c=[...s].sort();if(a!==null&&JSON.stringify([...a].sort())===JSON.stringify(c))return n;let p=i.flatMap(u=>{let f=s.length===0?A(u,"tags",o):D(u,"tags",j(c),o);return f?[f]:[]});return p.length>0?L(n,p):n}};var Ke={vitest:()=>new mt,playwright:()=>new ut,cypress:()=>new ct,jest:()=>new ft},fn={"@playwright/test":"playwright",cypress:"cypress","@jest/globals":"jest",vitest:"vitest"};function un(e){let t=dt.createSourceFile("detect.ts",e,dt.ScriptTarget.Latest,!0);for(let r of t.statements){if(!dt.isImportDeclaration(r)||!dt.isStringLiteral(r.moduleSpecifier))continue;let s=fn[r.moduleSpecifier.text];if(s)return s}return null}var Bt=class{constructor(t,r,s){this.rootDir=t;this.defaultFramework=r;this.frameworkOverrides=s}rootDir;defaultFramework;frameworkOverrides;name="auto";canHandle(t){return E.has(zt.extname(t).toLowerCase())}apply(t,r,s){let n=un(r)??this.matchOverride(t)??this.defaultFramework;return(Ke[n]??Ke.vitest)().apply(t,r,s)}matchOverride(t){let r=zt.relative(this.rootDir,t).split(zt.sep).join("/");for(let[s,n]of this.frameworkOverrides)if(_e(s,r))return n;return null}};function Je(e="vitest",t={},r=process.cwd()){return[new pt,new gt,new lt,new Bt(r,e,Object.entries(t))]}function He(e,t){return t.find(r=>r.canHandle(e))??null}var mn=/^[a-zA-Z][a-zA-Z0-9_-]{1,}$/,dn=new Set(["import"]),hn=new Set(["common","fixture","fixtures","helper","helpers","index","main","mock","mocks","setup","shared","spec","test","tests","types","util","utils"]);async function yn(e,t,r,s){let n;try{n=await Ve.readFile(e,"utf8")}catch(a){return{path:e,status:"error",error:String(a)}}let o=He(e,s);if(!o)return{path:e,status:"unchanged"};let i=o.apply(e,n,t);return i===n?{path:e,status:"unchanged"}:(r||await Ve.writeFile(e,i,"utf8"),{path:e,status:"updated"})}async function xn(e,t,r){let s=Ct(t),n=s.tagApplier?.framework??"vitest",o=s.tagApplier?.frameworkOverrides??{},i=Je(n,o,t),a={updated:0,unchanged:0,errors:0,files:[]};for(let c of e.nodes.values()){if(c.category!=="test")continue;let p=new Set,u=[];for(let x of c.tags)dn.has(x.kind)&&mn.test(x.name)&&(hn.has(x.name.toLowerCase())||p.has(x.name)||(p.add(x.name),u.push(x.name)));u.sort();let f=gn.resolve(t,c.path),d=await yn(f,u,r.dryRun,i);d.path=c.path,a.files.push(d),d.status==="updated"?a.updated++:d.status==="unchanged"?a.unchanged++:a.errors++}return a}var ht=class{isTestNode(t){return t.category==="test"||t.tags.some(r=>r.name==="test")}};import vt from"fs";import b from"path";import{execSync as Sn}from"child_process";function Qe(e,t){let s=Sn(`git -C "${e}" log --follow --format="%ae" --since="90 days ago" -- "${t}"`,{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).split(`
|
|
19
|
+
`).filter(Boolean);return{commitCount90d:s.length,lastAuthor:s[0]}}import yt from"fs";import bn from"path";import Xe from"js-yaml";function Ze(e){let t=e.lastIndexOf("@");return t>0?e.substring(0,t):e}function vn(e){return e.replace(/:$/,"").split(",").map(t=>{let r=t.trim();return r.startsWith('"')&&(r=r.slice(1)),r.endsWith('"')&&(r=r.slice(0,-1)),Ze(r)}).filter(Boolean)}function kn(e,t){let r=e.startsWith("/")?e.slice(1):e,s=r.lastIndexOf("@");return s>0?{name:r.substring(0,s),version:t||r.substring(s+1)}:{name:r,version:t}}function En(e){try{let t=Xe.load(e),r={dependencies:{}};for(let[s,n]of Object.entries(t))if(!(s==="__metadata"||!n?.version))for(let o of s.split(", ")){let i=Ze(o);i&&(r.dependencies[i]={version:n.version,...n.dependencies!==void 0&&{dependencies:n.dependencies}})}return r}catch{return null}}function wn(e){let t={dependencies:{}};for(let r of e.split(/\n\n+/)){let s=r.split(`
|
|
20
|
+
`).filter(c=>c.trim().length>0&&!c.trim().startsWith("#"));if(s.length<2)continue;let n=s[0];if(!n||n.startsWith(" "))continue;let o=vn(n);if(o.length===0)continue;let a=s.find(c=>c.trim().startsWith('version "'))?.match(/version "(.*?)"/)?.[1]??"";for(let c of o)t.dependencies[c]={version:a}}return t}function Fn(e){let t=yt.readFileSync(e,"utf-8"),r=JSON.parse(t),s={dependencies:{}};if(r.packages)for(let[n,o]of Object.entries(r.packages)){if(!n.startsWith("node_modules/"))continue;let i=n.replace("node_modules/","");i.includes("node_modules/")||(s.dependencies[i]={version:o.version,...o.dependencies!==void 0&&{dependencies:o.dependencies}})}else if(r.dependencies)for(let[n,o]of Object.entries(r.dependencies))s.dependencies[n]={version:o.version,...o.dependencies!==void 0&&{dependencies:o.dependencies}};return s}function Cn(e){let t=yt.readFileSync(e,"utf-8");if(t.includes("__metadata:")){let r=En(t);if(r!==null)return r}return wn(t)}function Tn(e){let t=yt.readFileSync(e,"utf-8"),r={dependencies:{}};try{let s=Xe.load(t);if(s.packages)for(let[n,o]of Object.entries(s.packages)){let{name:i,version:a}=kn(n,o.version);i&&(r.dependencies[i]={version:a,...o.dependencies!==void 0&&{dependencies:o.dependencies}})}if(s.dependencies)for(let[n,o]of Object.entries(s.dependencies)){if(r.dependencies[n])continue;let i=typeof o=="string"?o:o.version;r.dependencies[n]={version:i||""}}}catch{}return r}function Ye(e){let t=[["package-lock.json",Fn],["yarn.lock",Cn],["pnpm-lock.yaml",Tn]];for(let[r,s]of t){let n=bn.join(e,r);if(yt.existsSync(n))return s(n)}return null}import qe from"path";function F(e){switch(qe.extname(e).toLowerCase()){case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".ts":case".tsx":return"typescript";case".css":return"css";case".scss":case".sass":return"scss";case".less":return"less";case".styl":return"stylus";case".coffee":return"coffeescript";case".ls":return"livescript";case".lua":return"lua";case".py":return"python";case".go":return"go";case".java":case".cpp":case".cc":case".cxx":case".c":return"unknown";case".feature":return"gherkin";default:return"unknown"}}function k(e){let t=qe.extname(e).toLowerCase();return[".css",".scss",".sass",".less",".styl"].includes(t)}import In from"coffeescript";function Pn(e){let t=new Set,r=/@tag\s+([a-zA-Z0-9_-]+)/g,s=r.exec(e);for(;s!==null;)s[1]&&t.add(s[1]),s=r.exec(e);return t}function Mn(e,t){let r=e.toLowerCase();return r.includes(".test.")||r.includes(".spec.")||t.has("test")?"test":"logic"}function Nn(e,t){let r=t.source?.value;return r?{fromPath:e,toPath:"",rawSpecifier:r,isStyle:k(r),type:"static"}:null}function Rn(e,t){let r=t.variable?.base?.value==="require",s=t.args?.[0]?.base?.value;return!r||!s?null:{fromPath:e,toPath:"",rawSpecifier:s,isStyle:k(s),type:"require"}}function Dn(e,t,r){let s=t.constructor?.name;if(s==="ImportDeclaration"){let n=Nn(e,t);n&&r.push(n)}else if(s==="Call"){let n=Rn(e,t);n&&r.push(n)}}function Ut(e,t,r){if(!(!t||typeof t!="object")){Dn(e,t,r);for(let s in t){if(s==="locationData")continue;let n=t[s];if(!(!n||typeof n!="object"))if(Array.isArray(n))for(let o of n)Ut(e,o,r);else Ut(e,n,r)}}}function tr(e,t){let r=Pn(t),s=Mn(e,r),n=[];try{Ut(e,In.nodes(t),n)}catch{}return{imports:n,exports:[],tags:Array.from(r).map(o=>({name:o,kind:"comment-marker"})),category:s}}import{AstBuilder as An,GherkinClassicTokenMatcher as Ln,Parser as jn}from"@cucumber/gherkin";import{IdGenerator as Gn}from"@cucumber/messages";var On=Gn.uuid();function Kt(e,t){let r=new Set;try{let s=new An(On),n=new Ln,i=new jn(s,n).parse(t);i.feature&&(i.feature.tags.forEach(a=>{r.add(a.name.startsWith("@")?a.name.slice(1):a.name)}),i.feature.children.forEach(a=>{a.scenario&&(a.scenario.tags.forEach(c=>{r.add(c.name.startsWith("@")?c.name.slice(1):c.name)}),a.scenario.examples.forEach(c=>{c.tags.forEach(p=>{r.add(p.name.startsWith("@")?p.name.slice(1):p.name)})})),a.rule&&a.rule.children.forEach(c=>{c.scenario&&c.scenario.tags.forEach(p=>{r.add(p.name.startsWith("@")?p.name.slice(1):p.name)})})}))}catch(s){console.warn(`[GherkinParser] Failed to parse ${e}:`,s)}return{imports:[],exports:[],tags:Array.from(r).map(s=>({name:s,kind:"comment-marker"})),category:"test"}}M("gherkin",Kt);import Wn from"path";import{parser as _n}from"@lezer/go";var $n=/\/\/\s*@tag\s+([a-zA-Z0-9_-]+)/,zn=/^\/\/go:build\s+(.+)$/,Bn=/^\/\/\s*\+build\s+(.+)$/;function rr(e,t){let r=[],s=new Map,n=new Set,o=new Set,a=_n.parse(t).cursor();do switch(a.name){case"LineComment":{let f=t.slice(a.from,a.to),d=f.match($n);d?.[1]&&n.add(d[1]);let x=f.match(zn);x&&er(x[1],o);let _=f.match(Bn);_&&er(_[1],o);break}case"ImportSpec":{let f=a.node.getChild("String");if(f){let x=t.slice(f.from,f.to).slice(1,-1);r.push({fromPath:e,toPath:"",rawSpecifier:x,isExternal:!0,isStyle:!1,type:"static"})}break}case"FunctionDecl":case"TypeDecl":case"VarDecl":case"ConstDecl":{let f=a.node.getChild("DefName")??a.node.getChild("TypeSpec")?.getChild("DefName")??a.node.getChild("VarSpec")?.getChild("DefName")??a.node.getChild("ConstSpec")?.getChild("DefName");if(f){let d=t.slice(f.from,f.to);d!=="_"&&/^[A-Z]/.test(d)&&!s.has(d)&&s.set(d,{name:d})}break}}while(a.next());let c=r.some(f=>f.rawSpecifier==="testing"),p=Wn.basename(e).endsWith("_test.go")||n.has("test")||c?"test":"logic",u=new Set([...n,...o]);return{imports:r,exports:Array.from(s.values()),tags:Array.from(u).map(f=>({name:f,kind:"comment-marker"})),category:p}}function er(e,t){for(let r of e.split(/[\s,&|!()]+/)){let s=r.trim();s&&s!=="ignore"&&t.add(s)}}import Un from"livescript";function G(e){return e.startsWith("'")||e.startsWith('"')?e.slice(1,-1):e}function Kn(e){let t=new Set,r=/@tag\s+([a-zA-Z0-9_-]+)/g,s=r.exec(e);for(;s!==null;)s[1]&&t.add(s[1]),s=r.exec(e);return t}function Jn(e,t){let r=e.toLowerCase();return r.includes(".test.")||r.includes(".spec.")||t.has("test")?"test":"logic"}var Hn=new Set(["first_line","first_column","last_line","last_column","line","column"]);function Vn(e,t){let r=e.constructor?.name||e.type;if(r==="Import"){let s=e.right?.value;if(typeof s=="string"){let n=G(s);return{fromPath:t,toPath:"",rawSpecifier:n,isStyle:k(n),type:"static"}}}if(r==="Chain"&&e.head?.value==="require"){let s=e.tails?.[0];if(s?.constructor?.name==="Call"||s?.type==="Call"){let n=s.args?.[0]?.value;if(typeof n=="string"){let o=G(n);return{fromPath:t,toPath:"",rawSpecifier:o,isStyle:k(o),type:"require"}}}}return null}function Jt(e,t){if(!e||typeof e!="object")return[];let r=[],s=Vn(e,t);s&&r.push(s);for(let n in e){if(Hn.has(n))continue;let o=e[n];if(!(!o||typeof o!="object"))if(Array.isArray(o))for(let i of o)r.push(...Jt(i,t));else r.push(...Jt(o,t))}return r}function sr(e,t){let r=Kn(t),s=Jn(e,r),n=[];try{n=Jt(Un.ast(t),e)}catch{}return{imports:n,exports:[],tags:Array.from(r).map(o=>({name:o,kind:"comment-marker"})),category:s}}import Qn from"luaparse";function Xn(e){let t=new Set,r=/@tag\s+([a-zA-Z0-9_-]+)/g,s=r.exec(e);for(;s!==null;)s[1]&&t.add(s[1]),s=r.exec(e);return t}function Zn(e,t){let r=e.toLowerCase();return r.includes(".test.")||r.includes(".spec.")||t.has("test")?"test":"logic"}function Yn(e,t){let r=[];function s(n){if(!(!n||typeof n!="object")){if((n.type==="CallExpression"||n.type==="StringCallExpression")&&n.base?.type==="Identifier"&&n.base?.name==="require"){let o;if(n.type==="CallExpression"){let i=n.arguments?.[0];i?.type==="StringLiteral"&&(o=G(i.raw))}else if(n.type==="StringCallExpression"){let i=n.argument;i?.type==="StringLiteral"&&(o=G(i.raw))}o&&r.push({fromPath:t,toPath:"",rawSpecifier:o,isStyle:k(o),type:"require"})}for(let o in n){if(o==="loc")continue;let i=n[o];if(i&&typeof i=="object")if(Array.isArray(i))for(let a of i)s(a);else s(i)}}}return s(e),r}function nr(e,t){let r=Xn(t),s=Zn(e,r),n=[];try{let o=Qn.parse(t);n=Yn(o,e)}catch{}return{imports:n,exports:[],tags:Array.from(r).map(o=>({name:o,kind:"comment-marker"})),category:s}}import qn from"path";import{parser as to}from"@lezer/python";var eo=new Set(["pytest","unittest","nose","hypothesis"]);function or(e,t){let r=[],s=[],n=new Set,o=qn.basename(e).toLowerCase(),a=to.parse(t).cursor();do switch(a.name){case"Comment":{let p=t.slice(a.from,a.to).match(/#\s*@tag\s+([a-zA-Z0-9_-]+)/);p?.[1]&&n.add(p[1]);break}case"ImportStatement":{for(let p of ro(a.node,t,e))r.push(p);break}case"FunctionDefinition":case"ClassDefinition":{let p=a.node.parent;if(p?.name==="Script"||p?.name==="DecoratedStatement"&&p.parent?.name==="Script"){let f=a.node.getChild("VariableName");f&&s.push({name:t.slice(f.from,f.to)})}break}case"AssignStatement":{if(a.node.parent?.name==="Script"){let p=a.node.firstChild;p?.name==="VariableName"&&s.push({name:t.slice(p.from,p.to)})}break}}while(a.next());let c=io(o,r,n);return c==="test"&&n.add("test"),{imports:r,exports:s,tags:Array.from(n).map(p=>({name:p,kind:"comment-marker"})),category:c}}function ro(e,t,r){let s=e.firstChild;return s?s.name==="from"?so(e,t,r):no(e,t,r):[]}function so(e,t,r){let s=e.firstChild;if(!s)return[];let n=s.nextSibling;for(;n&&n.name!=="import";)n=n.nextSibling;if(!n)return[];let o=t.slice(s.to,n.from).trim(),i=oo(n.nextSibling,t);if(!i.length)return[];let a=0;for(;a<o.length&&o[a]===".";)a++;let c=o.slice(a);if(a===0)return[Q(r,o,i,!0)];let p=a===1?"./":"../".repeat(a-1);return c?[Q(r,p+c.replace(/\./g,"/"),i,!1)]:i[0]==="*"?[Q(r,p.slice(0,-1),["*"],!1)]:i.map(u=>Q(r,p+u,[u],!1))}function no(e,t,r){let s=[],n=e.firstChild?.nextSibling??null;for(;n;){if(n.name==="VariableName"){let o=t.slice(n.from,n.to);for(;n.nextSibling?.name==="."&&n.nextSibling.nextSibling?.name==="VariableName";)n=n.nextSibling.nextSibling,o+=`.${t.slice(n.from,n.to)}`;n.nextSibling?.name==="as"&&(n=n.nextSibling.nextSibling??n.nextSibling),s.push(Q(r,o,["*"],!0))}n=n.nextSibling}return s}function oo(e,t){let r=[],s=e;for(;s;)s.name==="*"?r.push("*"):s.name==="VariableName"&&(r.push(t.slice(s.from,s.to)),s.nextSibling?.name==="as"&&(s=s.nextSibling.nextSibling??s.nextSibling)),s=s.nextSibling;return r}function Q(e,t,r,s){return{fromPath:e,toPath:"",rawSpecifier:t,isStyle:!1,isExternal:s,type:"static",symbols:r.length>0?r:void 0}}function io(e,t,r){return e.startsWith("test_")||e.endsWith("_test.py")?"test":e==="conftest.py"||e==="setup.py"?"config":r.has("test")||t.some(s=>eo.has(s.rawSpecifier))?"test":"logic"}import ar from"path";import l from"typescript";import g from"typescript";function ao(e){let t=1;function r(s){switch(s.kind){case g.SyntaxKind.IfStatement:case g.SyntaxKind.ConditionalExpression:case g.SyntaxKind.ForStatement:case g.SyntaxKind.ForInStatement:case g.SyntaxKind.ForOfStatement:case g.SyntaxKind.WhileStatement:case g.SyntaxKind.DoStatement:case g.SyntaxKind.CatchClause:case g.SyntaxKind.CaseClause:t++;break;case g.SyntaxKind.BinaryExpression:{let n=s.operatorToken.kind;(n===g.SyntaxKind.AmpersandAmpersandToken||n===g.SyntaxKind.BarBarToken||n===g.SyntaxKind.QuestionQuestionToken)&&t++;break}}g.forEachChild(s,r)}return r(e),t}function co(e){let t=0;function r(s,n,o){if(g.isIfStatement(s)){t+=o?1:1+n;let a=o?n:n+1;r(s.expression,a,!1),r(s.thenStatement,a,!1),s.elseStatement&&(g.isIfStatement(s.elseStatement)?r(s.elseStatement,n,!0):(t+=1,r(s.elseStatement,n+1,!1)));return}if(g.isForStatement(s)||g.isForInStatement(s)||g.isForOfStatement(s)||g.isWhileStatement(s)||g.isDoStatement(s)||g.isSwitchStatement(s)){t+=1+n,g.forEachChild(s,a=>r(a,n+1,!1));return}if(g.isCatchClause(s)){t+=1+n,g.forEachChild(s,a=>r(a,n,!1));return}if(g.isConditionalExpression(s)&&(t+=1),g.isBinaryExpression(s)){let a=s.operatorToken.kind;(a===g.SyntaxKind.AmpersandAmpersandToken||a===g.SyntaxKind.BarBarToken||a===g.SyntaxKind.QuestionQuestionToken)&&(t+=1)}if(n>0&&(g.isFunctionDeclaration(s)||g.isFunctionExpression(s)||g.isArrowFunction(s))){t+=1+n,g.forEachChild(s,a=>r(a,n+1,!1));return}g.forEachChild(s,a=>r(a,n,!1))}return r(e,0,!1),t}function Ht(e){return{complexity:ao(e),cognitiveComplexity:co(e)}}import h from"typescript";var Vt=new Set(["test","describe","it"]);function ir(e,t){po(e,t),fo(e,t),uo(e,t),go(e,t)}function po(e,t){if((h.isFunctionDeclaration(e)||h.isVariableDeclaration(e))&&e.name&&h.isIdentifier(e.name)&&lo(e)){let r;if(h.isFunctionDeclaration(e))r="function";else{let s=e.initializer;r=s&&(h.isArrowFunction(s)||h.isFunctionExpression(s))?"function":"variable"}t.tags.add({name:e.name.text,kind:r})}}function lo(e){if(h.isFunctionDeclaration(e))return h.isSourceFile(e.parent);let t=e.parent?.parent;return!!t&&h.isSourceFile(t.parent)}function fo(e,t){if(!h.isStringLiteral(e))return;let r=e.text.match(/@[\w-]+/g);if(r)for(let s of r)t.tags.add({name:s.substring(1),kind:"comment-marker"})}function uo(e,t){if(!h.isSourceFile(e))return;let r=/@tag\s+([a-zA-Z0-9_-]+)/g,s=e.getFullText(),n=r.exec(s);for(;n!==null;)n[1]&&t.tags.add({name:n[1],kind:"comment-marker"}),n=r.exec(s)}function go(e,t){if(h.isCallExpression(e)&&mo(e.expression))for(let r of e.arguments)h.isObjectLiteralExpression(r)&&ho(r,t)}function mo(e){return h.isIdentifier(e)?Vt.has(e.text):!!(h.isPropertyAccessExpression(e)&&(Vt.has(e.name.text)||h.isIdentifier(e.expression)&&Vt.has(e.expression.text)))}function ho(e,t){for(let r of e.properties){if(!h.isPropertyAssignment(r)||!h.isIdentifier(r.name)||r.name.text!=="tags"&&r.name.text!=="tag")continue;let{initializer:s}=r,n=h.isArrayLiteralExpression(s)?s.elements.filter(h.isStringLiteral):r.name.text==="tag"&&h.isStringLiteral(s)?[s]:[];for(let o of n)t.tags.add({name:o.text.replace(/^@/,""),kind:"comment-marker"})}}function Qt(e,t,r){let s=[],n=new Map,o=new Set,i=l.createSourceFile(e,t,l.ScriptTarget.Latest,!0,r==="typescript"?l.ScriptKind.TSX:l.ScriptKind.JSX),a={filePath:e,imports:s,exports:n,tags:o,rawCallEdges:[],sourceFile:i,hasUI:!1,hasTypesOnly:!0,totalStatements:0,exportStatements:0},c=ee=>{bo(ee,a),l.forEachChild(ee,c)};c(i);let p=No(e,a);(p==="test"||p==="barrel")&&o.add({name:p,kind:"comment-marker"}),p!=="test"&&Ro(a,i);let u=i.statements[0],f=u?pr(u):void 0,{complexity:d,cognitiveComplexity:x}=Ht(i),_=yo(i);return{imports:s,exports:Array.from(n.values()),tags:Array.from(o),category:p,rawCallEdges:a.rawCallEdges??[],complexity:d,cognitiveComplexity:x,..._.length>0?{functions:_}:{},...f!==void 0?{description:f}:{}}}function yo(e){let t=[],r=(n,o)=>{let{complexity:i,cognitiveComplexity:a}=Ht(o),c=e.getLineAndCharacterOfPosition(o.getStart(e)).line+1;t.push({name:n,line:c,complexity:i,cognitiveComplexity:a})},s=(n,o)=>{if(l.isFunctionDeclaration(n)&&n.name&&n.body?r(n.name.text,n):l.isVariableDeclaration(n)&&l.isIdentifier(n.name)&&n.initializer&&(l.isArrowFunction(n.initializer)||l.isFunctionExpression(n.initializer))?r(n.name.text,n.initializer):o&&l.isMethodDeclaration(n)&&l.isIdentifier(n.name)&&n.body?r(`${o}.${n.name.text}`,n):o&&l.isConstructorDeclaration(n)&&n.body?r(`${o}.constructor`,n):o&&l.isGetAccessorDeclaration(n)&&l.isIdentifier(n.name)&&n.body?r(`${o}.get ${n.name.text}`,n):o&&l.isSetAccessorDeclaration(n)&&l.isIdentifier(n.name)&&n.body&&r(`${o}.set ${n.name.text}`,n),l.isClassDeclaration(n)&&n.name){let i=n.name.text;l.forEachChild(n,a=>s(a,i));return}l.forEachChild(n,i=>s(i,o))};return s(e,void 0),t}function cr(e,t,r,s){let n={name:e},o=pr(r);o!==void 0&&(n.doc=o);let i=xo(t);i!==void 0&&(n.flags=i);let a=So(t,s);return a!==void 0&&(n.signature=a),n}function pr(e){let t=l.getJSDocCommentsAndTags(e);for(let r of t)if(l.isJSDoc(r)&&r.comment)return l.getTextOfJSDocComment(r.comment)||void 0}function xo(e){let t=new Set(["deprecated","internal","public","alpha","beta"]),r=l.getJSDocTags(e).map(s=>s.tagName.text).filter(s=>t.has(s));return r.length>0?r:void 0}function So(e,t){let r=l.createPrinter({removeComments:!0}),s=n=>r.printNode(l.EmitHint.Unspecified,n,t);if(l.isFunctionDeclaration(e)||l.isMethodDeclaration(e)){let n=e.parameters.map(s).join(", "),o=e.type?s(e.type):"void";return`${e.typeParameters?`<${e.typeParameters.map(a=>a.name.text).join(", ")}>`:""}(${n}) => ${o}`}if(l.isVariableDeclaration(e)){if(e.type)return s(e.type);if(e.initializer&&(l.isArrowFunction(e.initializer)||l.isFunctionExpression(e.initializer))){let n=e.initializer,o=n.parameters.map(s).join(", "),i=n.type?s(n.type):"unknown";return`(${o}) => ${i}`}return}if(l.isClassDeclaration(e)&&e.name)return`class ${e.name.text}`;if(l.isInterfaceDeclaration(e))return`interface ${e.name.text}`;if(l.isTypeAliasDeclaration(e))return s(e.type);if(l.isEnumDeclaration(e))return`enum ${e.name.text}`}function bo(e,t){vo(e,t),ko(e,t),wo(e,t),Fo(e,t),Mo(e,t),ir(e,t)}function vo(e,t){if(!l.isSourceFile(e))return;let r=e.statements.filter(s=>!l.isEmptyStatement(s));t.totalStatements=r.length,t.exportStatements=r.filter(s=>l.isExportDeclaration(s)||l.isExportAssignment(s)||Xt(s)).length}function ko(e,t){if(l.isJsxElement(e)||l.isJsxSelfClosingElement(e)||l.isJsxFragment(e)){t.hasUI=!0,t.hasTypesOnly=!1;return}if(l.isFunctionDeclaration(e)||l.isMethodDeclaration(e)||l.isArrowFunction(e)||l.isClassDeclaration(e)||l.isVariableStatement(e)||l.isEnumDeclaration(e)){t.hasTypesOnly=!1;return}l.isExportDeclaration(e)&&!Eo(e)&&(t.hasTypesOnly=!1)}function Eo(e){return e.isTypeOnly?!0:!e.exportClause||!l.isNamedExports(e.exportClause)?!1:e.exportClause.elements.every(t=>t.isTypeOnly)}function wo(e,t){if(!l.isImportDeclaration(e)||!e.moduleSpecifier||!l.isStringLiteral(e.moduleSpecifier))return;let r=[];if(e.importClause&&(e.importClause.name&&r.push("default"),e.importClause.namedBindings))if(l.isNamedImports(e.importClause.namedBindings))for(let n of e.importClause.namedBindings.elements)r.push(n.name.text);else l.isNamespaceImport(e.importClause.namedBindings)&&r.push("*");let s=r.length>0?"static":"side-effect";t.imports.push({fromPath:t.filePath,toPath:"",rawSpecifier:e.moduleSpecifier.text,isStyle:k(e.moduleSpecifier.text),type:s,symbols:r.length>0?r:void 0})}function Fo(e,t){l.isExportDeclaration(e)?Co(e,t):l.isExportAssignment(e)?t.exports.set("default",{name:"default"}):Xt(e)&&Po(e,t)}function Co(e,t){if(e.moduleSpecifier&&l.isStringLiteral(e.moduleSpecifier))To(e,e.moduleSpecifier.text,t);else if(e.exportClause&&l.isNamedExports(e.exportClause))for(let r of e.exportClause.elements){let s=r.name.text;t.exports.set(s,{name:s})}}function To(e,t,r){let s=Io(e),n={fromPath:r.filePath,toPath:"",rawSpecifier:t,isStyle:k(t),type:"re-export"};s.length>0&&(n.symbols=s),r.imports.push(n)}function Io(e){return e.exportClause?l.isNamedExports(e.exportClause)?e.exportClause.elements.map(t=>t.name.text):[]:["*"]}function Po(e,t){if((l.isFunctionDeclaration(e)||l.isClassDeclaration(e)||l.isInterfaceDeclaration(e)||l.isTypeAliasDeclaration(e)||l.isEnumDeclaration(e))&&e.name){let s=e.name.text;t.exports.set(s,cr(s,e,e,t.sourceFile));return}if(l.isVariableStatement(e)){for(let s of e.declarationList.declarations)if(l.isIdentifier(s.name)){let n=s.name.text;t.exports.set(n,cr(n,s,e,t.sourceFile))}}}function Mo(e,t){if(!l.isCallExpression(e))return;let r=e.arguments[0];!r||!l.isStringLiteral(r)||(e.expression.kind===l.SyntaxKind.ImportKeyword?t.imports.push({fromPath:t.filePath,toPath:"",rawSpecifier:r.text,isStyle:k(r.text),type:"dynamic"}):l.isIdentifier(e.expression)&&e.expression.text==="require"&&t.imports.push({fromPath:t.filePath,toPath:"",rawSpecifier:r.text,isStyle:k(r.text),type:"require"}))}function No(e,t){let r=ar.basename(e).toLowerCase(),s=ar.extname(e).toLowerCase();return $().some(o=>r.includes(o))?"test":se(r)?"config":t.imports.some(o=>kt().some(i=>o.rawSpecifier.includes(i)))?"test":s===".tsx"||s===".jsx"||t.hasUI?"ui":t.hasTypesOnly&&t.totalStatements>0?"type-only":t.totalStatements>0&&t.exportStatements/t.totalStatements>wt()?"barrel":"logic"}function Xt(e){return l.canHaveModifiers(e)&&l.getModifiers(e)?.some(t=>t.kind===l.SyntaxKind.ExportKeyword)===!0}function Ro(e,t){let r=e.rawCallEdges??[];e.rawCallEdges=r;let s=new Map;for(let n of t.statements){if(!l.isImportDeclaration(n)||!l.isStringLiteral(n.moduleSpecifier))continue;let o=n.moduleSpecifier.text,i=n.importClause;if(i&&(i.name&&s.set(i.name.text,o),i.namedBindings&&l.isNamedImports(i.namedBindings)))for(let a of i.namedBindings.elements)s.set(a.name.text,o)}if(s.size!==0)for(let n of t.statements){let o=Ao(n);if(o){let i=Lo(n);i&&xt(i,o,s,r);continue}l.isClassDeclaration(n)&&n.name&&Do(n,s,r)}}function Do(e,t,r){let s=e.name.text;for(let n of e.members)l.isMethodDeclaration(n)&&n.body&&l.isIdentifier(n.name)?xt(n.body,`${s}.${n.name.text}`,t,r):l.isConstructorDeclaration(n)&&n.body&&xt(n.body,`${s}.constructor`,t,r)}function Ao(e){if(Xt(e)){if(l.isFunctionDeclaration(e)&&e.name)return e.name.text;if(l.isVariableStatement(e)){for(let t of e.declarationList.declarations)if(l.isIdentifier(t.name)&&t.initializer&&(l.isArrowFunction(t.initializer)||l.isFunctionExpression(t.initializer)))return t.name.text}}}function Lo(e){if(l.isFunctionDeclaration(e))return e.body;if(l.isVariableStatement(e)){for(let t of e.declarationList.declarations)if(t.initializer&&(l.isArrowFunction(t.initializer)||l.isFunctionExpression(t.initializer)))return t.initializer}}function xt(e,t,r,s){if(l.isCallExpression(e)&&l.isIdentifier(e.expression)){let n=e.expression.text,o=r.get(n);o&&!s.some(i=>i.from===t&&i.to===n&&i.toSpecifier===o)&&s.push({from:t,to:n,toSpecifier:o})}l.forEachChild(e,n=>xt(n,t,r,s))}function St(e,t){if(t.length===0)return"ui";let r=!1;return e.walk(s=>{if(s.type==="rule")return r=!0,!1}),r?"ui":"barrel"}import fr from"postcss";var jo=rt("postcss-less"),ur=new Set(["reference","inline"]);function lr(e){return e.startsWith("~")||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||e.startsWith("data:")}function Go(e){let t=e.trim();return t.length>0&&!t.startsWith("http://")&&!t.startsWith("https://")&&!t.startsWith("//")&&!t.startsWith("data:")&&!t.startsWith("#")}function Oo(e,t){let r=e.match(/^\(([^)]+)\)\s+['"]([^'"]+)['"]/);if(r){let o=r[1]?.trim()??"",i=r[2]??"";if(!i)return null;let a=ur.has(o)?"side-effect":"static";return{fromPath:t,toPath:"",rawSpecifier:i,isStyle:!0,type:a,...lr(i)?{isExternal:!0}:{}}}let s=e.match(/^url\(['"]?([^'")]+)['"]?\)/),n=s?s[1]?.trim()??"":e.match(/^['"]([^'"]+)['"]/)?.[1]??"";return n?{fromPath:t,toPath:"",rawSpecifier:n,isStyle:!0,type:"static",...lr(n)?{isExternal:!0}:{}}:null}function Wo(e,t){let r=[],s=/url\(['"]?([^'")]+)['"]?\)/g,n=s.exec(e);for(;n!==null;){let o=n[1]?.trim()??"";Go(o)&&r.push({fromPath:t,toPath:"",rawSpecifier:o,isStyle:!0,type:"static"}),n=s.exec(e)}return r}function gr(e,t){let r=[];return e.walk(s=>{if(s.type==="atrule"&&s.name==="import"){let n=Oo(s.params,t);n&&r.push(n)}s.type==="decl"&&r.push(...Wo(s.value,t))}),r}function _o(e){return e.replace(/(?<!:)\/\/.*/g,"")}function $o(e,t){let r=[],s=/@import\s+(?:\(([^)]+)\)\s+)?['"]([^'"]+)['"]/g,n=s.exec(e);for(;n!==null;){let o=n[1]?.trim()??"",i=n[2]??"";if(i){let a=ur.has(o)?"side-effect":"static";r.push({fromPath:t,toPath:"",rawSpecifier:i,isStyle:!0,type:a})}n=s.exec(e)}return r}function mr(e,t){let r=fr.parse(_o(e));return{imports:gr(r,t),root:r}}function dr(e,t){try{let r=jo.parse(e);return{imports:gr(r,t),root:r}}catch{return{imports:$o(e,t),root:fr.parse("")}}}import{parse as zo}from"postcss-scss";function Bo(e){return!!(e.startsWith("sass:")||e.startsWith("~")||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("//")||!e.startsWith(".")&&!e.startsWith("/")&&!e.startsWith("_"))}function Uo(e){let t=e.match(/^['"]([^'"]+)['"]/);if(!t?.[1])return{specifier:""};let r=t[1],n=e.match(/\bas\s+(\S+)/)?.[1];return n!==void 0?{specifier:r,alias:n}:{specifier:r}}function hr(e,t){let r=zo(e),s=[];return r.walk(n=>{if(n.type!=="atrule")return;let{name:o,params:i}=n;if(o!=="import"&&o!=="use"&&o!=="forward")return;let{specifier:a,alias:c}=Uo(i);if(!a)return;let p={fromPath:t,toPath:"",rawSpecifier:a,isStyle:!0,type:o==="forward"?"re-export":"static",...Bo(a)?{isExternal:!0}:{}};c&&(p.symbols=[c]),s.push(p)}),{imports:s,root:r}}function yr(e,t){let r=[],s=/@require\s+['"]([^'"]+)['"]/g,n=s.exec(e);for(;n!==null;){let i=n[1];i&&r.push({fromPath:t,toPath:"",rawSpecifier:i,isStyle:!0,type:"require"}),n=s.exec(e)}let o=/(?<!@)(?:import|require)\s*\(?\s*['"]([^'"]+)['"]/g;for(n=o.exec(e);n!==null;){let i=n[1];i&&r.push({fromPath:t,toPath:"",rawSpecifier:i,isStyle:!0,type:"static"}),n=o.exec(e)}return r}function xr(e,t){if(t.length===0)return"ui";try{let r=rt("stylus");return new r.Parser(e).parse().nodes.some(o=>o.constructor.name!=="Import")?"ui":"barrel"}catch{return e.replace(/^\s*@?(?:require|import)\b.*/gm,"").trim().length>0?"ui":"barrel"}}function X(e,t){let r=F(e);if(r==="stylus"){let o=yr(t,e);return{imports:o,exports:[],tags:[],category:xr(t,o)}}if(r==="scss"){let{imports:o,root:i}=hr(t,e);return{imports:o,exports:[],tags:[],category:St(i,o)}}if(r==="less"){let{imports:o,root:i}=dr(t,e);return{imports:o,exports:[],tags:[],category:St(i,o)}}let{imports:s,root:n}=mr(t,e);return{imports:s,exports:[],tags:[],category:St(n,s)}}for(let[e,t]of[["javascript",(r,s)=>Qt(r,s,"javascript")],["typescript",(r,s)=>Qt(r,s,"typescript")],["css",X],["scss",X],["less",X],["stylus",X],["coffeescript",tr],["livescript",sr],["lua",nr],["python",or],["go",rr],["gherkin",Kt]])M(e,t);async function Sr(e,t){let r=F(e),s=Ne(r);return s?s(e,t):{imports:[],exports:[],tags:[],category:"other"}}import Zt from"path";function vr(e,t){for(let r of e.values()){let s=t.get(r.path);s!==void 0&&(r.coveragePct=s)}}function kr(e,t){for(let r of e)if(!r.rawSpecifier.startsWith(".")&&!Zt.isAbsolute(r.rawSpecifier)){let s=r.rawSpecifier.startsWith("@")?r.rawSpecifier.split("/").slice(0,2).join("/"):r.rawSpecifier.split("/")[0];s&&!t.some(n=>n.name===s)&&t.push({name:s,kind:"library"})}}function Er(e){for(let t of e.values())if(t.category==="test")for(let r of t.imports){if(r.isExternal||!r.toPath)continue;let s=e.get(r.toPath);s&&(s.category!=="logic"&&s.category!=="barrel"||(s.testedBy??=[],s.testedBy.includes(t.path)||s.testedBy.push(t.path)))}}function br(e){return Math.round(e*1e4)/1e4}function wr(e){for(let t of e.values()){let r=[];for(let s of t.imports){if(s.isExternal||!s.toPath)continue;let n=e.get(s.toPath);if(!n||n.exports.length===0)continue;let o;if(s.symbols===void 0){if(s.type==="side-effect")continue;o=1}else s.symbols.includes("*")?o=1:o=s.symbols.length/n.exports.length;s.exportUsageRatio=br(Math.min(1,o)),r.push(s.exportUsageRatio)}r.length>0&&(t.avgExportUsage=br(r.reduce((s,n)=>s+n,0)/r.length),t.maxExportUsage=Math.max(...r))}}function Yt(e,t,r){t&&(e.some(s=>s.name===t&&s.kind===r)||e.push({name:t,kind:r}))}function Ko(e,t){let r=t.toPath,s=Zt.basename(r,Zt.extname(r)).replace(/\.(test|spec)$/,"");Yt(e.tags,s,"import")}function Jo(e,t){if(!(!t.symbols||t.symbols.includes("*")))for(let r of t.symbols)Yt(e.tags,r,"import")}function Ho(e,t,r){let s=r.get(t.toPath);if(!(!s||s.category==="test"))for(let n of s.tags)n.kind==="comment-marker"&&Yt(e.tags,n.name,"comment-marker")}function Fr(e){for(let t of e.values())if(t.category==="test")for(let r of t.imports)!r.toPath||r.isExternal||(Ko(t,r),Jo(t,r),Ho(t,r,e))}import bt from"fs";import C from"path";import Ir from"fs";import O from"path";var Z=class{extensions=[".go"];goModCache=new Map;resolve(t,r,s,n){let{mod:o,replaces:i}=this.readGoMod(s);if(!o)return null;let a=this.applyReplace(r,i,s);if(a!==void 0)return Tr(a);if(r!==o&&!r.startsWith(`${o}/`))return null;let c=r.slice(o.length).replace(/^\//,"");return c?Tr(O.join(s,c)):null}readGoMod(t){let r=this.goModCache.get(t);if(r!==void 0)return r;let s={mod:null,replaces:new Map};try{let n=Ir.readFileSync(O.join(t,"go.mod"),"utf-8"),o=Vo(n,t);return this.goModCache.set(t,o),o}catch{return this.goModCache.set(t,s),s}}applyReplace(t,r,s){for(let[n,o]of r){if(t===n)return o;if(t.startsWith(`${n}/`)){let i=t.slice(n.length+1);return O.join(o,i)}}}};function Vo(e,t){let r=e.split(`
|
|
21
|
+
`),s=null,n=new Map,o=!1;for(let i of r){let a=i.trim();if(a.startsWith("module ")){s=a.slice(7).trim();continue}if(/^replace\s*\(/.test(a)){o=!0;continue}if(o&&a===")"){o=!1;continue}if(o&&a.includes("=>")){Cr(a,t,n);continue}!o&&/^replace\s+/.test(a)&&a.includes("=>")&&Cr(a.replace(/^replace\s+/,""),t,n)}return{mod:s,replaces:n}}function Cr(e,t,r){let[s,n]=e.split("=>").map(a=>a.trim());if(!s||!n)return;let o=s.split(/\s+/)[0];if(!n.startsWith(".")&&!n.startsWith("/"))return;let i=O.isAbsolute(n)?n:O.resolve(t,n);r.set(o,i)}function Tr(e){let t;try{t=Ir.readdirSync(e,{withFileTypes:!0})}catch{return null}let r=t.filter(s=>s.isFile()&&s.name.endsWith(".go")&&!s.name.endsWith("_test.go")).map(s=>({path:O.join(e,s.name),isExternal:!1})).sort((s,n)=>s.path.localeCompare(n.path));return r.length>0?r:null}import Qo from"fs";import qt from"path";var Y=class{extensions=[".lua"];resolve(t,r,s,n){let o=r.replace(/\./g,qt.sep),i=[s,qt.join(s,"lib")];for(let a of i){if(!Qo.existsSync(a))continue;let c=n(qt.join(a,"_dummy.lua"),o);if(c)return[c]}return null}};import Xo from"fs";import te from"path";var q=class{extensions=[".py"];resolve(t,r,s,n){let o=r.replace(/\./g,te.sep),i=te.join(s,`${o}.py`);if(Pr(i))return[{path:i,isExternal:!1}];let a=te.join(s,o,"__init__.py");return Pr(a)?[{path:a,isExternal:!1}]:null}};function Pr(e){try{return Xo.statSync(e,{throwIfNoEntry:!1})?.isFile()===!0}catch{return!1}}var W=class{constructor(t,r={}){this.rootDir=t;this.workspaceMap=r.workspaceMap??new Map,this.tsconfigSearchPaths=r.tsconfigSearchPaths??[t],this.langResolvers=r.langResolvers??[new q,new Y,new Z]}rootDir;workspaceMap;tsconfigSearchPaths;langResolvers;resolveAll(t,r){let s=this.resolvePathAlias(r);if(s)return[s];if(r.startsWith(".")||r.startsWith("/")){let i=this.resolveLocalPath(t,r);return i?[i]:[]}let n=(i,a)=>this.resolveLocalPath(i,a);for(let i of this.langResolvers)if(i.extensions.some(a=>t.endsWith(a))){let a=i.resolve(t,r,this.rootDir,n);if(a)return a}let o=this.resolveWorkspaceImport(r);return o?[o]:[{path:r,isExternal:!0}]}resolve(t,r){let s=this.resolvePathAlias(r);if(s)return s;if(r.startsWith(".")||r.startsWith("/"))return this.resolveLocalPath(t,r);let n=(i,a)=>this.resolveLocalPath(i,a);for(let i of this.langResolvers)if(i.extensions.some(a=>t.endsWith(a))){let a=i.resolve(t,r,this.rootDir,n);if(a)return a[0]??null}let o=this.resolveWorkspaceImport(r);return o||{path:r,isExternal:!0}}resolveLocalPath(t,r){let s=C.dirname(t),n=r.startsWith("/")?r:C.resolve(s,r),o=!n.startsWith(this.rootDir),i=["",".ts",".tsx",".js",".jsx",".mjs",".cjs",".css",".scss",".sass",".less",".styl",".coffee",".ls",".lua",".py",".feature"],a=n.match(/\.(js|mjs|cjs)$/);if(a){let c=n.slice(0,-a[0].length);for(let p of[".ts",".tsx"]){let u=this.tryExtensions(c,p,o);if(u)return u}}for(let c of i){let p=this.tryExtensions(n,c,o);if(p)return p}return o?{path:n,isExternal:!0}:null}tryExtensions(t,r,s){let n=t+r;if(this.isFile(n))return{path:n,isExternal:s};let o=C.join(t,`index${r}`);if(this.isFile(o))return{path:o,isExternal:s};if(r===".py"){let i=C.join(t,"__init__.py");if(this.isFile(i))return{path:i,isExternal:s}}return null}isFile(t){try{return bt.statSync(t,{throwIfNoEntry:!1})?.isFile()===!0}catch{return!1}}resolvePathAlias(t){for(let r of this.tsconfigSearchPaths){let s=C.join(r,"tsconfig.json");if(bt.existsSync(s))try{let o=JSON.parse(bt.readFileSync(s,"utf-8")).compilerOptions?.paths;if(!o)continue;for(let i in o){let a=this.matchAliasPattern(i,t);if(a){let c=this.tryAliasSubstitutions(o[i],a[1]||"",r);if(c)return c}}}catch{}}return null}aliasRegexCache=new Map;matchAliasPattern(t,r){let s=this.aliasRegexCache.get(t);if(!s){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace("\\*","(.*)");s=new RegExp(`^${n}$`),this.aliasRegexCache.set(t,s)}return r.match(s)}tryAliasSubstitutions(t,r,s=this.rootDir){let n=["",".ts",".tsx",".js",".jsx",".coffee",".ls",".lua",".feature"];for(let o of t){let i=o.replace("*",r),a=C.resolve(s,i);for(let c of n){let p=this.tryExtensions(a,c,!1);if(p)return p}}return null}resolveWorkspaceImport(t){if(this.workspaceMap.size===0)return null;for(let[r,s]of this.workspaceMap){if(t!==r&&!t.startsWith(`${r}/`))continue;let n=t.slice(r.length),o={path:"",isExternal:!1,isWorkspace:!0,workspacePackage:r};if(!n){for(let a of["src/index.ts","src/index.tsx","index.ts","index.tsx","index.js"]){let c=C.join(s,a);try{if(bt.statSync(c,{throwIfNoEntry:!1})?.isFile())return{...o,path:c}}catch{}}return{...o,path:s}}let i=this.resolveLocalPath(C.join(s,"_dummy"),n.slice(1));return i?{...o,path:i.path}:null}return null}};var Zo=["tests","test","__tests__","specs","spec"];function Yo(e,t){if(e.length===0)return t;let r=e.map(i=>b.dirname(i).split(b.sep)),s=r[0];for(let i of r.slice(1)){let a=0;for(;a<s.length&&a<i.length&&s[a]===i[a];)a++;s=s.slice(0,a)}let n=s.join(b.sep)||b.sep,o=b.relative(t,n);return o.startsWith("..")||b.isAbsolute(o)?t:n}var tt=class{constructor(t,r=null,s,n,o=!1,i=new Map){this.rootDir=t;this.enableGitStats=o;this.coverageMap=i;this.previousGraph=r,this.resolver=s||new W(t),this.lockFile=Ye(t),n&&(this.progressCallback=n)}rootDir;enableGitStats;coverageMap;graph={nodes:new Map};visited=new Set;previousGraph=null;resolver;lockFile=null;progressCallback;async build(t){let r=t.map(s=>b.isAbsolute(s)?s:b.resolve(this.rootDir,s));for(let s of r)await this.processFile(s);return await this.processTestFiles(Yo(r,this.rootDir)),this.progressCallback&&this.visited.size>=100&&process.stderr.write(`
|
|
22
|
+
Done. Total processed: ${this.visited.size} nodes.
|
|
23
|
+
`),Fr(this.graph.nodes),Er(this.graph.nodes),wr(this.graph.nodes),this.coverageMap.size>0&&vr(this.graph.nodes,this.coverageMap),new T(this.graph.nodes)}async processTestFiles(t){let r=$(),s=new Set(["node_modules",".git","dist","build",".next",".cache","mokosh-cache","coverage"]),n=async i=>{let a;try{a=vt.readdirSync(i,{withFileTypes:!0})}catch{return}for(let c of a){let p=b.join(i,c.name);c.isDirectory()?s.has(c.name)||await n(p):c.isFile()&&r.some(u=>c.name.includes(u))&&await this.processFile(p)}};await n(t);let o=t;for(;o!==this.rootDir;){let i=b.dirname(o);if(i===o)break;for(let a of Zo){let c=b.join(i,a);try{vt.statSync(c).isDirectory()&&await n(c)}catch{}}o=i}}async processFile(t){if(this.visited.has(t))return;this.visited.add(t),this.showProgress();let r=vt.statSync(t,{throwIfNoEntry:!1});if(!r?.isFile())return;let s=b.relative(this.rootDir,t),n=await this.getNode(t,s,r);n.imports=await this.resolveImports(t,n.imports),this.graph.nodes.set(n.path,n)}async getNode(t,r,s){let n=this.previousGraph?.nodes.get(r);if(n&&n.mtime===s.mtimeMs&&n.size===s.size)return{...n};let o=await this.tryParse(t,r);if(!o)return this.makeStubNode(t,r,s);kr(o.imports,o.tags);let i=this.resolveCallEdges(t,o.rawCallEdges),a=this.buildNode(t,r,s,o,i);return this.attachGitStats(a,r),a}async tryParse(t,r){let s=vt.readFileSync(t,"utf-8");try{return await Sr(t,s)}catch(n){return process.stderr.write(`
|
|
24
|
+
Warning: failed to parse ${r}: ${n}
|
|
25
|
+
`),null}}makeStubNode(t,r,s){return{path:r,type:F(t),category:"other",imports:[],exports:[],tags:[],mtime:s.mtimeMs,size:s.size}}resolveCallEdges(t,r){let s=[];for(let n of r??[])try{let o=this.resolver.resolve(t,n.toSpecifier);o&&!o.isExternal&&s.push({from:n.from,to:n.to,toFile:b.relative(this.rootDir,o.path)})}catch{}return s}buildNode(t,r,s,n,o){let{imports:i,exports:a,tags:c,category:p,description:u,complexity:f,cognitiveComplexity:d,functions:x}=n;return{path:r,type:F(t),category:p,imports:i,exports:a,tags:c,mtime:s.mtimeMs,size:s.size,...u!==void 0?{description:u}:{},...o.length>0?{callEdges:o}:{},...f!==void 0?{complexity:f}:{},...d!==void 0?{cognitiveComplexity:d}:{},...x!==void 0?{functions:x}:{}}}attachGitStats(t,r){if(this.enableGitStats)try{let s=Qe(this.rootDir,r);t.commitCount90d=s.commitCount90d,s.lastAuthor!==void 0&&(t.lastAuthor=s.lastAuthor)}catch{}}async resolveImports(t,r){let s=[];for(let n of r){let o=this.resolver.resolveAll(t,n.rawSpecifier);if(o.length!==0)for(let i of o){let a={...n,toPath:i.isExternal?i.path:b.relative(this.rootDir,i.path),isExternal:i.isExternal};i.isWorkspace&&(a.isWorkspace=!0,a.workspacePackage=i.workspacePackage),i.isExternal?this.attachLockfileVersion(a):await this.processFile(i.path),s.push(a)}}return s}attachLockfileVersion(t){if(!this.lockFile)return;let r=t.rawSpecifier.startsWith("@")?t.rawSpecifier.split("/").slice(0,2).join("/"):t.rawSpecifier.split("/")[0],s=r?this.lockFile.dependencies[r]:void 0;s&&(t.version=s.version)}showProgress(){this.progressCallback&&this.visited.size%100===0&&this.progressCallback(this.visited.size)}};function Mr(e,t){return{identifier:t?.identifier??new ht,featureMap:t?.featureDetection===!1?new Map:B(e.nodes,t?.featureDetection??void 0)}}function Nr(e,t,r,s,n){for(let o of t){let i=e.nodes.get(o);if(!i)continue;let a=new J(o,["*",...i.exports.map(c=>c.name)]);e.traverse(o,(c,p,u)=>{if(!u)return!0;if(!a.updateAffectedSymbols(c,u))return!1;if(p>0){let f=r.get(c.path);if(f)return s(f),!1}return n(c),!0},{direction:"incoming"})}}function qo(e,t,r){let{identifier:s,featureMap:n}=Mr(e,r),o=new Set;for(let i of t){let a=n.get(i);a&&o.add(a.tag)}return Nr(e,t,n,i=>o.add(i.tag),i=>{if(s.isTestNode(i))for(let a of i.tags)o.add(a.name)}),Array.from(o)}function ti(e,t,r){let{identifier:s,featureMap:n}=Mr(e,r),o=new Set;return Nr(e,t,n,()=>{},i=>{s.isTestNode(i)&&o.add(i.path)}),Array.from(o)}import ei from"fs";import et from"path";async function Ll(e,t,r=null,s={}){let n=s.silent?void 0:i=>{process.stderr.write(`Processed ${i} files...\r`)};return await new tt(et.resolve(e),r,void 0,n,s.gitStats??!1,s.coverageMap??new Map).build(t)}async function jl(e,t={}){let r=et.resolve(e),s=jt(r),n=t.packages?s.packages.filter(a=>t.packages?.includes(a.name)||t.packages?.includes(a.relativeRoot)):s.packages,o=new Map(s.packages.map(a=>[a.name,a.root])),i=new V(r,s.type);for(let a of n){let c=t.silent?void 0:f=>{process.stderr.write(`[${a.name}] Processed ${f} files...\r`)},u=await new tt(r,null,new W(r,{workspaceMap:o,tsconfigSearchPaths:[a.root,r]}),c,t.gitStats??!1).build(a.entryPoints);i.addPackage(a,u)}return i}function Gl(e,t={}){let r=[],s=new Set([...t.ignoreDirs??Tt,...t.additionalIgnoreDirs??[]]),n=new Set([...t.extensions??It,...t.additionalExtensions??[]]);function o(i){try{let a=ei.readdirSync(i,{withFileTypes:!0});for(let c of a){let p=et.join(i,c.name);c.isDirectory()?s.has(c.name)||o(p):c.isFile()&&n.has(et.extname(c.name).toLowerCase())&&r.push(et.relative(e,p))}}catch{}}return o(e),r}export{It as DEFAULT_EXTENSIONS,Tt as DEFAULT_IGNORE_DIRS,T as Graph,Pt as MermaidExporter,J as SymbolTraversalContext,V as WorkspaceGraph,jr as applyConfig,xn as applyTags,Hr as buildApiSurface,Xr as buildChangeImpactCache,Rt as buildFeatureGraph,cs as buildResponsibilityGraph,fs as buildTypeGraph,Nt as computeGraphHash,Ll as createImportMap,jl as createWorkspaceGraph,me as detectAllEntryPoints,zr as detectEntryPoint,B as detectFeatures,jt as detectMonorepo,Le as filterGraph,Gl as getAllProjectFiles,Yr as isChangeImpactCacheValid,ts as loadChangeImpactCache,Or as loadCoverageMap,Ct as loadMokoshConfig,je as parseQuery,ti as proposeAffectedTests,qo as proposeTags,Vr as queryCallGraph,Zr as queryChangeImpact,us as queryTypeGraph,st as registerConfigMatcher,w as registerMonorepoDetector,M as registerParser,ot as registerTestLibrary,nt as registerTestPattern,qr as saveChangeImpactCache,fe as toMermaid};
|
|
26
|
+
//# sourceMappingURL=index.mjs.map
|