@visulima/vis 1.0.0-alpha.40 → 1.0.0-alpha.42
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/CHANGELOG.md +41 -0
- package/LICENSE.md +265 -35
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +19 -1
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -0
- package/dist/packem_chunks/{bin.js → cli-main.js} +282 -274
- package/dist/packem_chunks/config.js +8 -11
- package/dist/packem_chunks/devtools.js +1 -78
- package/dist/packem_chunks/dispatch.js +4 -0
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +3 -3
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -4
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +5 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -5
- package/dist/packem_chunks/handler27.js +5 -1
- package/dist/packem_chunks/handler28.js +1 -3
- package/dist/packem_chunks/handler29.js +3 -1
- package/dist/packem_chunks/handler3.js +1 -4
- package/dist/packem_chunks/handler30.js +1 -2
- package/dist/packem_chunks/handler31.js +1 -2
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +2 -3
- package/dist/packem_chunks/handler34.js +2 -6
- package/dist/packem_chunks/handler35.js +3 -1
- package/dist/packem_chunks/handler36.js +6 -42
- package/dist/packem_chunks/handler37.js +1 -8
- package/dist/packem_chunks/handler38.js +42 -9
- package/dist/packem_chunks/handler39.js +7 -74
- package/dist/packem_chunks/handler4.js +4 -6
- package/dist/packem_chunks/handler40.js +9 -5
- package/dist/packem_chunks/handler41.js +75 -4
- package/dist/packem_chunks/handler42.js +5 -3
- package/dist/packem_chunks/handler43.js +4 -2
- package/dist/packem_chunks/handler44.js +3 -1
- package/dist/packem_chunks/handler45.js +2 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -3
- package/dist/packem_chunks/handler48.js +1 -1
- package/dist/packem_chunks/handler49.js +3 -7
- package/dist/packem_chunks/handler5.js +4 -8
- package/dist/packem_chunks/handler50.js +1 -33
- package/dist/packem_chunks/handler51.js +7 -3
- package/dist/packem_chunks/handler52.js +33 -8
- package/dist/packem_chunks/handler53.js +3 -4
- package/dist/packem_chunks/handler54.js +8 -1
- package/dist/packem_chunks/handler55.js +4 -12
- package/dist/packem_chunks/handler56.js +1 -7
- package/dist/packem_chunks/handler57.js +12 -5
- package/dist/packem_chunks/handler58.js +5 -11
- package/dist/packem_chunks/handler59.js +11 -3
- package/dist/packem_chunks/handler6.js +6 -1
- package/dist/packem_chunks/handler60.js +3 -22
- package/dist/packem_chunks/handler61.js +21 -60
- package/dist/packem_chunks/handler62.js +61 -3
- package/dist/packem_chunks/handler63.js +3 -6
- package/dist/packem_chunks/handler64.js +6 -708
- package/dist/packem_chunks/handler65.js +8 -23
- package/dist/packem_chunks/handler66.js +24 -25
- package/dist/packem_chunks/handler67.js +25 -153
- package/dist/packem_chunks/handler68.js +153 -10
- package/dist/packem_chunks/handler69.js +10 -24
- package/dist/packem_chunks/handler7.js +8 -1
- package/dist/packem_chunks/handler70.js +24 -322
- package/dist/packem_chunks/handler71.js +322 -48
- package/dist/packem_chunks/handler72.js +700 -19
- package/dist/packem_chunks/handler73.js +48 -3
- package/dist/packem_chunks/handler74.js +21 -184
- package/dist/packem_chunks/handler75.js +3 -38
- package/dist/packem_chunks/handler76.js +190 -0
- package/dist/packem_chunks/handler77.js +38 -0
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +4 -4
- package/dist/packem_chunks/index2.js +1 -1
- package/dist/packem_chunks/index3.js +135 -0
- package/dist/packem_chunks/index4.js +74 -0
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +4 -0
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/orchestrator.js +3 -3
- package/dist/packem_chunks/prompts.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/registry.js +2 -2
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tar.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +2 -0
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +2 -2
- package/dist/packem_shared/CONFIG_FILES-MsOntfYT.js +1 -0
- package/dist/packem_shared/{Table-CcVkyULl-B_ef6zfS.js → Table-CcVkyULl-DLWu6XHL.js} +25 -26
- package/dist/packem_shared/{advisories-DLeO5KMN.js → advisories-aiDtubZQ.js} +1 -1
- package/dist/packem_shared/{affected-shas-cVnX8-zs.js → affected-shas-C1XuRlvo.js} +1 -1
- package/dist/packem_shared/{ai-analysis-BUeX2J2H.js → ai-analysis-CubpCxZJ.js} +4 -4
- package/dist/packem_shared/{ai-fix-9Vzlp6XU.js → ai-fix-Btd5AnSr.js} +2 -2
- package/dist/packem_shared/augment-8fIWWGSc.js +3 -0
- package/dist/packem_shared/bin-CnDBuLh3.js +2 -0
- package/dist/packem_shared/build-scripts-Doxce2VM.js +1 -0
- package/dist/packem_shared/command-runtime-RiCMa2C8.js +1 -0
- package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
- package/dist/packem_shared/{cyclonedx-kYozDyxp.js → cyclonedx-NUJ9R2GQ.js} +1 -1
- package/dist/packem_shared/dependency-scan-B0HV_qeB.js +1 -0
- package/dist/packem_shared/{docker-BMLrNtWm.js → docker-DKlF-gk3.js} +1 -1
- package/dist/packem_shared/failure-log-C7r6UZLP.js +2 -0
- package/dist/packem_shared/{giget-DHY1sQZC.js → giget-DVTFJlbR.js} +2 -2
- package/dist/packem_shared/glob-fqg4KepW-7Bs2kZuM.js +1 -0
- package/dist/packem_shared/index-BKFEWXU_.js +1 -0
- package/dist/packem_shared/index-CPhv-r4c.js +28 -0
- package/dist/packem_shared/{index-CgcF6_wo.js → index-Cb4x6lWY.js} +1 -1
- package/dist/packem_shared/index-DjTWo3sH.js +1 -0
- package/dist/packem_shared/{index-BDmTbWX1.js → index-OQZQyN5R.js} +1 -1
- package/dist/packem_shared/index.server-J83sowC4.js +2 -0
- package/dist/packem_shared/{lifecycle-4z9hHE5b.js → lifecycle-D5roTh0a.js} +2 -2
- package/dist/packem_shared/{lockfile-C8Q1_4KK.js → lockfile-DIGyLfmF.js} +1 -1
- package/dist/packem_shared/main-B3juSU5z.js +1 -0
- package/dist/packem_shared/manifests-pLwnVmCN.js +1 -0
- package/dist/packem_shared/{min-release-age-D1alDE3K.js → min-release-age-pUAqTiv3.js} +3 -3
- package/dist/packem_shared/missing-package-json-DhYzuKhD.js +1 -0
- package/dist/packem_shared/{native-config-sync-BEkJW7g3.js → native-config-sync-4K9wWTj5.js} +1 -1
- package/dist/packem_shared/{osv-bloom-B03tUWf3.js → osv-bloom-OuTfu_LE.js} +1 -1
- package/dist/packem_shared/{pm-runner-OGResYrA.js → pm-runner-Dws_Bw1y.js} +1 -1
- package/dist/packem_shared/provenance-C0P-UYOM.js +1 -0
- package/dist/packem_shared/readJsonSync-CvkZyKmL-CY7PZob_.js +4 -0
- package/dist/packem_shared/registry-keys-D4chF-Wj.js +1 -0
- package/dist/packem_shared/{resolve-explicit-CMDl55Nz.js → resolve-explicit-Cgheka3B.js} +3 -3
- package/dist/packem_shared/resolve-runtime-CJSWV-K8.js +1 -0
- package/dist/packem_shared/run-file-B4TqKa0X.js +1 -0
- package/dist/packem_shared/runtime-check-0lUJvgKt.js +1 -0
- package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
- package/dist/packem_shared/s1ngularity-Du1NnSFP.js +1 -0
- package/dist/packem_shared/scan-progress-CN9ONR0y.js +2 -0
- package/dist/packem_shared/{selectors-GCJIe342.js → selectors-UmnAuc26.js} +1 -1
- package/dist/packem_shared/{signatures-C730vkyK.js → signatures-BOUhghTv.js} +1 -1
- package/dist/packem_shared/{spinner-CV3WVJLv.js → spinner-lhXugSx3.js} +1 -1
- package/dist/packem_shared/tabs-DTiU3usb.js +1 -0
- package/dist/packem_shared/target-options-ChWcK60i.js +1 -0
- package/dist/packem_shared/toolchain-DyCKnGch.js +5 -0
- package/dist/packem_shared/typosquats-DBOvXwph.js +1 -0
- package/dist/packem_shared/use-measured-height-CK2Co3XI.js +1 -0
- package/dist/packem_shared/verify-CVPYlUrF.js +1 -0
- package/dist/packem_shared/vis-update-app-DtHkwBca.js +1 -0
- package/dist/packem_shared/watch-Bkp_AAbc.js +1 -0
- package/dist/packem_shared/watch-loop-D9zbXzRd.js +11 -0
- package/dist/runtime/preload.d.ts +1 -0
- package/dist/runtime/preload.js +1 -0
- package/index.d.ts +14 -0
- package/index.js +28 -27
- package/package.json +18 -27
- package/schemas/vis-config.schema.json +12 -0
- package/dist/packem_shared/CONFIG_FILES-BfaR0jKT.js +0 -1
- package/dist/packem_shared/build-scripts-CCCi8U66.js +0 -1
- package/dist/packem_shared/dependency-scan-DnTgYleU.js +0 -1
- package/dist/packem_shared/failure-log-CEWP3bP0.js +0 -2
- package/dist/packem_shared/glob-fqg4KepW-B7EjLRvw.js +0 -1
- package/dist/packem_shared/index-Du8RWawQ.js +0 -1
- package/dist/packem_shared/index-yBikBkHT.js +0 -30
- package/dist/packem_shared/manifests-Dj3pRKBT.js +0 -1
- package/dist/packem_shared/missing-package-json-8vNHwbqw.js +0 -1
- package/dist/packem_shared/provenance-_CJjMKwu.js +0 -1
- package/dist/packem_shared/registry-keys-BfFto6vI.js +0 -1
- package/dist/packem_shared/runtime-check-Stc9AI78.js +0 -1
- package/dist/packem_shared/s1ngularity-Dhr3bPk0.js +0 -1
- package/dist/packem_shared/scan-progress-CFhc0CMj.js +0 -2
- package/dist/packem_shared/tabs-BuTy5gPV.js +0 -1
- package/dist/packem_shared/toolchain-pR7AJ-tB.js +0 -5
- package/dist/packem_shared/typosquats-DN78xx1x.js +0 -1
- package/dist/packem_shared/use-measured-height-_eVGWtWt.js +0 -1
- package/dist/packem_shared/verify-6WCmFmy8.js +0 -1
- package/dist/packem_shared/vis-update-app-k3fDxech.js +0 -1
- package/dist/packem_shared/watch-BvIwLG4N.js +0 -1
- package/dist/packem_shared/watch-loop-DWkvv2tK.js +0 -11
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{createRequire as K}from"node:module";import{m as g,f as C,v as G,A as S,B as U,a as Q,H as X}from"./index-BDmTbWX1.js";import{aJ as w}from"../packem_chunks/bin.js";import{a as ee}from"../packem_chunks/config.js";import{s as le}from"./watch-BvIwLG4N.js";const H=K(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,s]=x.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return x.getBuiltinModule(e)}return H(e)},{createHash:m}=v("node:crypto"),{fileURLToPath:Y,pathToFileURL:Z}=v("node:url"),{spawnSync:te,spawn:se}=v("node:child_process"),{openSync:ne,writeSync:re,closeSync:oe,statSync:ie,readFileSync:N,mkdirSync:ae,writeFileSync:ce}=v("node:fs"),{availableParallelism:b}=v("node:os"),W=(e,t)=>{for(const s of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const n=e[s];if(n&&typeof n[t]=="string")return n[t]}},k=(e,t)=>{for(const s of t){const n=g(e,s);if(C(n))return n}},ue=e=>{const t=g(e,"package.json");if(!C(t))return{};try{return ee(t)}catch{return{}}},tt=(e,t)=>{const s=ue(e),n=new Map;for(const o of t){const r=o.detect(e,s);r&&n.set(o.id,r)}return n},de={error:"error",info:"info",information:"info",warning:"warning"},st={argsCheck:(e,t)=>j(e,t,!1),argsFix:(e,t)=>j(e,t,!0),bin:()=>["pnpm","exec","biome"],cacheKey:(e,t)=>{const s=["biome",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:(e,t)=>{const s=W(t,w.biome.packageNames[0]),n=k(e,w.biome.configFiles);if(!(!s&&!n))return{adapter:"biome",configFile:n,declared:!!s,declaredVersion:s,root:e}},extensions:["astro","cjs","css","cts","js","json","jsonc","jsx","mjs","mts","svelte","ts","tsx","vue"],id:"biome",kind:"both",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"biome",file:t.root,fixable:!1,message:`biome output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s.diagnostics??[]){const r=o.location?.start,i=o.location?.end,a=fe(t.root,o.location?.path),c=o.category??"",l=c==="format"||c.startsWith("format/");n.push({adapter:"biome",column:r?.column&&r.column>0?r.column:void 0,endColumn:i?.column&&i.column>0?i.column:void 0,endLine:i?.line&&i.line>0?i.line:void 0,file:a,fixable:!0,line:r?.line&&r.line>0?r.line:void 0,message:l?"Code style issues would be auto-fixed":o.message??"",ruleId:c||void 0,severity:de[o.severity??""]??"warning"})}return n}},j=(e,t,s)=>{const n=["check","--reporter=json"];return s&&n.push("--write"),typeof t.maxWarnings=="number"&&n.push(`--max-diagnostics=${String(t.maxWarnings)}`),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},fe=(e,t)=>{const s=typeof t=="string"?t:t?.file;return s?s.startsWith("/")||/^[a-z]:[\\/]/i.test(s)?s:g(e,s):e},B=e=>t=>{const s=k(t,w.deno.configFiles);if(s)return{adapter:e,configFile:s,declared:!1,root:t}},D=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),nt={argsCheck:(e,t)=>F(e,t,!1),argsFix:(e,t)=>F(e,t,!0),bin:()=>["deno","lint"],cacheKey:(e,t)=>{const s=["deno-lint",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:B("deno-lint"),extensions:["js","jsx","mjs","mts","ts","tsx"],id:"deno-lint",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"deno-lint",file:t.root,fixable:!1,message:`deno lint output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s.diagnostics??[]){const r=o.range?.start,i=o.range?.end;n.push({adapter:"deno-lint",column:r?.col===void 0?void 0:r.col+1,endColumn:i?.col===void 0?void 0:i.col+1,endLine:i?.line===void 0?void 0:i.line+1,file:pe(o.filename??t.root,t.root),fixable:!1,line:r?.line===void 0?void 0:r.line+1,message:o.message??"",ruleId:o.code,severity:"warning"})}return n}},rt={argsCheck:(e,t)=>I(e,t,!1),argsFix:(e,t)=>I(e,t,!0),bin:()=>["deno","fmt"],cacheKey:(e,t)=>{const s=["deno-fmt",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:B("deno-fmt"),extensions:["astro","cjs","css","cts","html","ipynb","js","json","jsonc","jsx","less","md","mjs","mts","sass","scss","sql","svelte","ts","tsx","vue","yaml","yml"],id:"deno-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const s=[],n=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=/^from (.+):$/.exec(o);if(!r)continue;const i=r[1];n.has(i)||(n.add(i),s.push({adapter:"deno-fmt",file:D(i)?i:`${t.root}/${i}`,fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return s}},F=(e,t,s)=>{const n=["--json"];return s&&n.push("--fix"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},I=(e,t,s)=>{const n=[];return s||n.push("--check"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},pe=(e,t)=>e.startsWith("file://")?Y(e):D(e)?e:`${t}/${e}`,J="pyproject.toml",ge=/^\[tool\.ruff(?:\.[\w-]+)*\]\s*$/m,he=/^Would reformat:?\s+(.+)$/,me=e=>{const t=g(e,J);if(!C(t))return!1;try{const s=G(t);return ge.test(s)}catch{return!1}},E=e=>(t,s)=>{const n=w.ruff.packageNames.map(a=>W(s,a)).find(a=>a!==void 0),o=k(t,w.ruff.configFiles),r=o?void 0:me(t)?g(t,J):void 0,i=o??r;if(!(!n&&!i))return{adapter:e,configFile:i,declared:!!n,declaredVersion:n,root:t}},ye=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),P=(e,t)=>e?ye(e)?e:g(t,e):t,xe=e=>he.exec(e)?.[1]?.trim(),ot={argsCheck:(e,t)=>L(e,t,!1),argsFix:(e,t)=>L(e,t,!0),bin:()=>["ruff","check"],cacheKey:(e,t)=>{const s=["ruff-check",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:E("ruff-check"),extensions:["py","pyi"],id:"ruff-check",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"ruff-check",file:t.root,fixable:!1,message:`ruff check output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s){const r=o.location,i=o.end_location;n.push({adapter:"ruff-check",column:r?.column,endColumn:i?.column,endLine:i?.row,file:P(o.filename,t.root),fixable:!!o.fix,line:r?.row,message:o.message??"",ruleId:o.code,severity:"warning"})}return n}},it={argsCheck:(e,t)=>R(e,t,!1),argsFix:(e,t)=>R(e,t,!0),bin:()=>["ruff","format"],cacheKey:(e,t)=>{const s=["ruff-fmt",e.declaredVersion??"unknown",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:E("ruff-fmt"),extensions:["py","pyi"],id:"ruff-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const s=[],n=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=xe(o);!r||n.has(r)||(n.add(r),s.push({adapter:"ruff-fmt",file:P(r,t.root),fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return s}},L=(e,t,s)=>{const n=["--output-format=json"];return s&&n.push("--fix"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},R=(e,t,s)=>{const n=[];return s||n.push("--check"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},at=(e,t)=>{const s=$(e,["diff","--name-only","--diff-filter=ACMR","-z",`${t}...HEAD`]);if(s===void 0)return;const n=$(e,["diff","--name-only","--diff-filter=ACMR","-z"]),o=$(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]),r=$(e,["ls-files","--others","--exclude-standard","-z"]),i=new Set;for(const a of[s,n??"",o??"",r??""])for(const c of a.split("\0"))c.length!==0&&i.add(S(c)?c:g(e,c));return[...i].sort()},ct=e=>{const t=$(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]);if(t===void 0)return;const s=new Set;for(const n of t.split("\0"))n.length!==0&&s.add(S(n)?n:g(e,n));return[...s].sort()},$=(e,t)=>{const s=te("git",[...t],{cwd:e,encoding:"utf8",timeout:1e4});if(s.status===0)return s.stdout},lt=(e,t)=>{const s=new Set(t.map(r=>r.toLowerCase())),n=[],o=new Set;for(const r of e){const i=r.lastIndexOf(".");if(i===-1||i===r.length-1)continue;const a=r.slice(i+1).toLowerCase();s.has(a)&&(o.has(r)||(o.add(r),n.push(r)))}return n},$e=new Set(["-","stdout"]),M=e=>({close:()=>{},write:t=>{e.write(t)}}),we=e=>{Q(X(e));const t=ne(e,"w");let s=[];return{close:()=>{s.length>0&&(re(t,s.join("")),s=[]),oe(t)},write:n=>{s.push(n)}}},ut=e=>{const{cwd:t,target:s}=e;if(s===void 0||$e.has(s))return M(process.stdout);if(s==="stderr")return M(process.stderr);const n=S(s)?s:U(t,s);return we(n)},q=["oxlint","oxfmt","biome","eslint","dprint","prettier","stylelint","ruff-check","ruff-fmt","markdownlint","shellcheck","deno-lint","deno-fmt"],dt=(e,t)=>{const s=new Map(e.map(i=>[i.id,i])),n=[],o=new Set,r=t&&t.length>0?t:q;for(const i of r){const a=s.get(i);a&&!o.has(i)&&(n.push(a),o.add(i))}if(t&&t.length>0)for(const i of q){const a=s.get(i);a&&!o.has(i)&&(n.push(a),o.add(i))}for(const i of e)o.has(i.id)||(n.push(i),o.add(i.id));return n},ft=(e,t,s)=>{const n=[];for(const o of t){const r=e.get(o.id);r&&ve(o.kind,s)&&n.push({adapter:o,presence:r})}return n},ve=(e,t)=>e===t||e==="both",pt=(e,t,s={})=>{const n=new Map;for(const o of e){const r=Se(o),i=Ae(r,t,s);if(!i)continue;const a=n.get(i);a?a.push(o):n.set(i,[o])}return n},Se=e=>{const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()},Ae=(e,t,s)=>{const n=s[e];if(n&&t.some(o=>o.adapter.id===n))return n;for(const{adapter:o}of t)if(o.extensions.includes(e))return o.id},Ce=e=>e==="error"?"error":e==="warning"?"warning":"notice",V=e=>e.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
|
|
2
|
-
`,"%0A"),T=e=>V(e).replaceAll(",","%2C").replaceAll(":","%3A").replaceAll("=","%3D"),ke=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,be=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),je=(e,t)=>{const s=Ce(e.severity),n=ke(e.file,t),o=e.ruleId?`${e.adapter}(${e.ruleId})`:e.adapter,r=[`file=${T(n)}`];return e.line!==void 0&&r.push(`line=${String(e.line)}`),e.endLine!==void 0&&r.push(`endLine=${String(e.endLine)}`),e.column!==void 0&&r.push(`col=${String(e.column)}`),e.endColumn!==void 0&&r.push(`endColumn=${String(e.endColumn)}`),r.push(`title=${T(o)}`),`::${s} ${r.join(",")}::${V(e.message)}
|
|
3
|
-
`},gt=e=>e.runs.flatMap(t=>[...t.findings]).sort(be).map(t=>je(t,e.workspaceRoot)).join(""),y=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),Fe=e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,Ie=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),Le=e=>e==="error"?"error":e==="warning"?"warning":"info",Re=(e,t)=>{let{file:s}=e;return t&&e.file.startsWith(`${t}/`)&&(s=e.file.slice(t.length+1)),e.line===void 0?s:e.column===void 0?`${s}:${String(e.line)}`:`${s}:${String(e.line)}:${String(e.column)}`},Me=(e,t,s)=>{const n=Re(e,s),o=Le(e.severity),r=e.ruleId?`[${e.ruleId}] ${e.message}`:e.message;return[` <testcase classname="${y(t)}" name="${y(n)}">`,` <failure type="${y(o)}" message="${y(r)}">${Fe(e.message)}</failure>`," </testcase>",""].join(`
|
|
4
|
-
`)},qe=(e,t,s)=>{const n=[...e.findings].sort(Ie),o=n.filter(l=>l.severity==="error").length,r=n.filter(l=>l.severity==="warning").length,i=n.length,a=(e.durationMs/1e3).toFixed(3),c=n.map(l=>Me(l,e.adapter,s)).join("");return` <testsuite ${[`name="${y(e.adapter)}"`,`tests="${String(i)}"`,`failures="${String(o)}"`,'errors="0"',`skipped="${String(r)}"`,`time="${a}"`,`timestamp="${t}"`].join(" ")}>
|
|
5
|
-
${c} </testsuite>
|
|
6
|
-
`},ht=e=>{const t=(e.now??new Date).toISOString(),s=e.suiteName??"vis-lint-fmt",n=e.runs.map(c=>qe(c,t,e.workspaceRoot)).join(""),o=e.runs.reduce((c,l)=>c+l.findings.length,0),r=e.runs.reduce((c,l)=>c+l.findings.filter(p=>p.severity==="error").length,0),i=e.runs.reduce((c,l)=>c+l.findings.filter(p=>p.severity==="warning").length,0),a=(e.runs.reduce((c,l)=>c+l.durationMs,0)/1e3).toFixed(3);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
7
|
-
<testsuites ${[`name="${y(s)}"`,`tests="${String(o)}"`,`failures="${String(r)}"`,'errors="0"',`skipped="${String(i)}"`,`time="${a}"`].join(" ")}>
|
|
8
|
-
${n}</testsuites>
|
|
9
|
-
`},Te="2.1.0",Oe="https://json.schemastore.org/sarif-2.1.0.json",_e=e=>e==="error"?"error":e==="warning"?"warning":"note",Ne=(e,t)=>t&&e.startsWith(`${t}/`)?{uri:e.slice(t.length+1),uriBaseId:"SRCROOT"}:{uri:e},We=e=>{const{href:t}=Z(e);return t.endsWith("/")?t:`${t}/`},Be=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),De=e=>{const t=new Map;for(const s of e)s.ruleId&&(t.has(s.ruleId)||t.set(s.ruleId,{id:s.ruleId,name:s.ruleId}));return[...t.values()]},Je=(e,t)=>{const{uri:s,uriBaseId:n}=Ne(e.file,t),o={artifactLocation:n?{uri:s,uriBaseId:n}:{uri:s}};if(e.line!==void 0){const i={startLine:e.line};e.column!==void 0&&(i.startColumn=e.column),e.endLine!==void 0&&(i.endLine=e.endLine),e.endColumn!==void 0&&(i.endColumn=e.endColumn),o.region=i}const r={level:_e(e.severity),locations:[{physicalLocation:o}],message:{text:e.message}};return e.ruleId&&(r.ruleId=e.ruleId),r},Ee=(e,t)=>{const s=[...e.findings].sort(Be),n=De(s),o={name:e.adapter,rules:n};e.presence?.declaredVersion&&(o.version=e.presence.declaredVersion);const r={results:s.map(i=>Je(i,t)),tool:{driver:o}};return t&&(r.originalUriBaseIds={SRCROOT:{uri:We(t)}}),r},mt=e=>{const t={$schema:Oe,runs:e.runs.map(s=>Ee(s,e.workspaceRoot)),version:Te};return`${JSON.stringify(t,void 0,2)}
|
|
10
|
-
`},O={error:3,info:1,warning:2},yt=e=>{const t=[],s=[];let n,o=!1;for(const r of e){s.push({adapter:r.adapter,durationMs:r.durationMs,exitCode:r.exitCode,findingCount:r.findings.length}),r.exitCode!==0&&r.exitCode!==null&&r.findings.length===0&&(o=!0);for(const i of r.findings)t.push(i),(!n||O[i.severity]>O[n])&&(n=i.severity)}return{findings:t,hadProcessFailure:o,maxSeverity:n,runs:s}},xt=e=>{const t=new Map;for(const s of e){const n=t.get(s.file);n?n.push(s):t.set(s.file,[s])}return t},$t=e=>e.hadProcessFailure||e.maxSeverity==="error"?1:0,Pe=(e,t)=>{if(t==="fix"||process.env.VIS_NO_CACHE==="1"||e.length===0)return!1;for(const s of e)if(s==="."||s==="./"||s==="..")return!1;return!0},Ve=e=>{try{const t=N(e);return m("sha256").update(t).digest("hex")}catch{return}},ze=(e,t,s,n,o)=>{const r=e.cacheKey(t,n),i=[];for(const c of[...s].sort()){const l=S(c)?c:g(t.root,c);try{ie(l)}catch{return}const p=Ve(l);if(!p)return;i.push({hash:p,path:l})}const a=m("sha256");a.update(e.id),a.update("\0"),a.update(r),a.update("\0"),a.update(o);for(const c of i)a.update("\0"),a.update(c.path),a.update("\0"),a.update(c.hash);return{fileHashes:i,key:a.digest("hex")}},z=(e,t)=>g(e,"lint-fmt",t),Ke=(e,t,s)=>{const n=g(z(e,t.id),`${s}.json`);try{const o=N(n,"utf8"),r=JSON.parse(o);return r.schema!==1?void 0:r}catch{return}},He=(e,t,s,n,o)=>{const r=z(e,t.id),i={fileHashes:o,result:n,savedAt:Date.now(),schema:1};try{ae(r,{recursive:!0}),ce(g(r,`${s}.json`),JSON.stringify(i))}catch{}},_=async(e,t,s,n,o)=>{const r=e.bin(t),i=[...r.slice(1),...o==="fix"?e.argsFix(s,n):e.argsCheck(s,n)];return new Promise(a=>{const c=Date.now(),l=se(r[0],i,{cwd:t.root}),p=[],u=[];let h=!1;const f=setTimeout(()=>{h=!0,l.kill("SIGKILL")},6e4);l.stdout.on("data",d=>p.push(d)),l.stderr.on("data",d=>u.push(d)),l.on("error",d=>{clearTimeout(f),a({durationMs:Date.now()-c,exitCode:null,stderr:d.message,stdout:""})}),l.on("close",d=>{clearTimeout(f),a({durationMs:Date.now()-c,exitCode:h?null:d,stderr:Buffer.concat(u).toString("utf8"),stdout:Buffer.concat(p).toString("utf8")})})})},wt=async(e,t,s,n=b())=>{if(e.length===0)return[];const{cacheRoot:o,concurrency:r}=typeof n=="number"?{concurrency:n}:{cacheRoot:n.cacheRoot,concurrency:n.concurrency??b()},i=async u=>{const h=u.options??t;if(o&&Pe(u.files,s)){const f=ze(u.adapter,u.presence,u.files,h,s);if(f){const d=Ke(o,u.adapter,f.key);if(d)return d.result;const A=await _(u.adapter,u.presence,u.files,h,s);return A.exitCode!==null&&He(o,u.adapter,f.key,A,f.fileHashes),A}}return _(u.adapter,u.presence,u.files,h,s)};if(process.env.VIS_LINT_FMT_SERIAL==="1"){const u=[];for(const h of e)u.push(await i(h));return u}const a=Math.max(1,Math.min(r,e.length)),c=Array.from({length:e.length});let l=0;const p=async()=>{for(;;){const u=l;if(l+=1,u>=e.length)return;c[u]=await i(e[u])}};return await Promise.all(Array.from({length:a},()=>p())),c},Ge=e=>{const t=new Set;for(const s of e)t.add(s.toLowerCase());return t},Ue=(e,t)=>{const s=e.lastIndexOf(".");return s===-1||s===e.length-1?!1:t.has(e.slice(s+1).toLowerCase())},vt=async e=>{const{extensions:t,initialFiles:s,label:n,log:o,runCycle:r,workspaceRoot:i}=e,a=o??(f=>{process.stdout.write(`${f}
|
|
11
|
-
`)}),c=Ge(t);await r(s),a(`▸ ${n}: watching workspace — press Ctrl-C to exit`);let l=new Set,p=!1;const u=async()=>{for(;l.size>0;){const f=[...l];l=new Set;try{await r(f)}catch(d){a(`✗ ${n}: watch cycle failed — ${d.message}`)}}},h=le({debounceMs:200,filter:f=>Ue(f,c),onChange:async f=>{for(const d of f)l.add(S(d)?d:g(i,d));if(!p){p=!0;try{await u()}finally{p=!1}}},paths:[i]});await new Promise(f=>{const d=()=>{h.close(),process.off("SIGINT",d),process.off("SIGTERM",d),f()};process.once("SIGINT",d),process.once("SIGTERM",d)})};export{tt as a,ft as b,at as c,W as d,vt as e,k as f,pt as g,wt as h,yt as i,ut as j,mt as k,ht as l,gt as m,st as n,it as o,rt as p,xt as q,dt as r,ct as s,$t as t,lt as u,ot as v,nt as w};
|