@visulima/vis 6.4.4 → 6.5.1
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 +21 -0
- package/LICENSE.md +0 -51
- package/README.md +27 -25
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cargo-plan.js +1 -1
- package/dist/packem_chunks/catalog-detector.js +1 -1
- package/dist/packem_chunks/catalog.js +11 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +130 -131
- package/dist/packem_chunks/context.js +4 -4
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler39.js +5 -5
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/handler54.js +1 -1
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +5 -5
- package/dist/packem_chunks/handler58.js +1 -1
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +1 -1
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +1 -1
- package/dist/packem_chunks/handler64.js +1 -1
- package/dist/packem_chunks/handler65.js +1 -1
- package/dist/packem_chunks/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +1 -1
- package/dist/packem_chunks/handler68.js +12 -28
- package/dist/packem_chunks/handler69.js +37 -12
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +1 -1
- package/dist/packem_chunks/handler71.js +1 -1
- package/dist/packem_chunks/handler72.js +311 -10
- package/dist/packem_chunks/handler73.js +10 -133
- package/dist/packem_chunks/handler74.js +133 -23
- package/dist/packem_chunks/handler75.js +23 -323
- package/dist/packem_chunks/handler76.js +1 -1
- package/dist/packem_chunks/handler77.js +1 -1
- package/dist/packem_chunks/handler78.js +1 -1
- package/dist/packem_chunks/handler79.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index3.js +28 -35
- package/dist/packem_chunks/index5.js +140 -801
- package/dist/packem_chunks/index6.js +801 -140
- package/dist/packem_chunks/index7.js +1 -1
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/native-addon.js +12 -0
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/python-plan.js +1 -1
- package/dist/packem_chunks/python-projects.js +1 -1
- package/dist/packem_chunks/python.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- 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/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +1 -1
- package/dist/packem_chunks/workspace.js +1 -1
- package/dist/packem_shared/{ReleaseClient-DaoIXjdn.js → ReleaseClient-CQaGkUHL.js} +1 -1
- package/dist/packem_shared/{advisories-CePsyvwG.js → advisories-DzWrfMwP.js} +1 -1
- package/dist/packem_shared/{affected-selection-CeiYNePc.js → affected-selection-mQmHyn-j.js} +1 -1
- package/dist/packem_shared/{ai-analysis-BA0POlbg.js → ai-analysis-CIN__RZj.js} +1 -1
- package/dist/packem_shared/{ai-cache-DPBsl-hV.js → ai-cache-BgoifbUT.js} +1 -1
- package/dist/packem_shared/{ai-fix-B77m7n2b.js → ai-fix-BG2olCnp.js} +1 -1
- package/dist/packem_shared/apply-BrRx__KL.js +8 -0
- package/dist/packem_shared/apply-release-plan-Cf6TJxK2.js +15 -0
- package/dist/packem_shared/{bin-D3ykhfdS.js → bin-DcZlUzKR.js} +1 -1
- package/dist/packem_shared/{build-scripts-DroekY_B.js → build-scripts-BtdNDGRO.js} +1 -1
- package/dist/packem_shared/createVersionActions-GD1Y4pNe.js +1 -0
- package/dist/packem_shared/{dependency-scan-DRFM_81X.js → dependency-scan-BmnwM6FX.js} +1 -1
- package/dist/packem_shared/{detect-BcgSLkMm.js → detect-DwXq9NzG.js} +1 -1
- package/dist/packem_shared/{docker-BvjXmtDx.js → docker-CN9h1ZAl.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-cnVeegV2.js → ecosystem-gate-DX0ZULH7.js} +1 -1
- package/dist/packem_shared/{env-Aebh_7xU.js → env-BUf_aJzW.js} +1 -1
- package/dist/packem_shared/{env-consistency-CsRtFVjG.js → env-consistency-B69mYzeD.js} +1 -1
- package/dist/packem_shared/{failure-log-Busa1iE8.js → failure-log-DiIZhhLI.js} +1 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-CoX0RPCo.js +1 -0
- package/dist/packem_shared/{index-CiJWXOfI.js → index-CBn2VY5B.js} +1 -1
- package/dist/packem_shared/{index-BGIPGEa6.js → index-DhxUCW8T.js} +1 -1
- package/dist/packem_shared/junit-audit-CuJShWCH.js +13 -0
- package/dist/packem_shared/{lifecycle-C9PINrzB.js → lifecycle-GbShWxRp.js} +1 -1
- package/dist/packem_shared/{manifests-CGl2k8eD.js → manifests-dmM8N980.js} +1 -1
- package/dist/packem_shared/{min-release-age-Bm6IFgxW.js → min-release-age-PO0aM3R7.js} +1 -1
- package/dist/packem_shared/{missing-package-json-CNN9E7An.js → missing-package-json-BhiqxoDg.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-DrgeQKa3.js → multi-eco-lockfiles-BK7QtgHY.js} +1 -1
- package/dist/packem_shared/{native-config-sync-CKePir7A.js → native-config-sync-B0GvRp9j.js} +1 -1
- package/dist/packem_shared/{osv-CtKBUlaU.js → osv-J53omdC9.js} +1 -1
- package/dist/packem_shared/{package-version-ChA7gKlB.js → package-version-C6xroAcI.js} +1 -1
- package/dist/packem_shared/{packument-DV0k4rzI.js → packument-DZRLzoJA.js} +1 -1
- package/dist/packem_shared/{project-name-filter-BnHcuGOv.js → project-name-filter-DHT0wEZm.js} +1 -1
- package/dist/packem_shared/{provenance-hAvGHOgZ.js → provenance-Cv6Fj_BX.js} +1 -1
- package/dist/packem_shared/{publish-missing-Df39xUBX.js → publish-missing-CfwPeX1q.js} +1 -1
- package/dist/packem_shared/{registry-D8odQGcR.js → registry-B5KGXKED.js} +1 -1
- package/dist/packem_shared/{registry-keys-BLiJKMuS.js → registry-keys-BXUXfg-B.js} +1 -1
- package/dist/packem_shared/{renderToString-DR0zDUjh-lzGitq_6.js → renderToString-DR0zDUjh-BY4_eILr.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-CODAmTx4.js → resolve-explicit-Sfza3_kc.js} +1 -1
- package/dist/packem_shared/{run-summary-utils-CINjiLBE.js → run-summary-utils-CQjbLnkh.js} +1 -1
- package/dist/packem_shared/{runtime-check-BMDR1_bb.js → runtime-check-BTZdc1k2.js} +1 -1
- package/dist/packem_shared/{s1ngularity-RvRfoneb.js → s1ngularity-BrjAz--X.js} +1 -1
- package/dist/packem_shared/{scaffold-files-BdvNqI-N.js → scaffold-files-B77HPWjE.js} +1 -1
- package/dist/packem_shared/{scan-progress-aGfhWB5U.js → scan-progress-D5c-HQ_W.js} +1 -1
- package/dist/packem_shared/{selectors-CB84rN3y.js → selectors-l6BxIFLB.js} +1 -1
- package/dist/packem_shared/{signatures-yyWil8DY.js → signatures-C4MN75Bv.js} +1 -1
- package/dist/packem_shared/{spinner-DeG1597-.js → spinner-BryD7iJl.js} +1 -1
- package/dist/packem_shared/{table-B80pPNSi.js → table-BzBEMntH.js} +1 -1
- package/dist/packem_shared/{tabs-BAZbyp4k.js → tabs-DL_c_u-P.js} +1 -1
- package/dist/packem_shared/{toolchain-BPOxrpDU.js → toolchain-CbsBoqgN.js} +1 -1
- package/dist/packem_shared/{typosquats-Ch-a1qTB.js → typosquats-DRl1AA90.js} +1 -1
- package/dist/packem_shared/{use-measured-height-DVKGDAAE.js → use-measured-height-DobMKRXG.js} +1 -1
- package/dist/packem_shared/{vis-update-app-u5igJf_k.js → vis-update-app-CyCv-5iU.js} +1 -1
- package/dist/packem_shared/{vis-user-error-cD2VO4b_.js → vis-user-error-DjdeJsEK.js} +1 -1
- package/dist/packem_shared/{watch-loop-dAIFTLTH.js → watch-loop-D2QKvSts.js} +1 -1
- package/dist/release/index.js +1 -1
- package/index.js +26 -26
- package/package.json +10 -10
- package/dist/packem_chunks/cargo-lock.js +0 -5
- package/dist/packem_chunks/catalog2.js +0 -11
- package/dist/packem_shared/apply-DA-Dv8Pq.js +0 -8
- package/dist/packem_shared/apply-release-plan-BZ_E8GXQ.js +0 -15
- package/dist/packem_shared/clean-package-json-rutwkKl-.js +0 -1
- package/dist/packem_shared/createVersionActions-DXo4z8VN.js +0 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-z7dfCruF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as T}from"node:module";import{readLastRunSummary as _}from"@visulima/task-runner";import{a as $}from"./failure-log-
|
|
1
|
+
import{createRequire as T}from"node:module";import{readLastRunSummary as _}from"@visulima/task-runner";import{a as $}from"./failure-log-DiIZhhLI.js";import{f as v,a as P,d as D,r as j}from"./run-summary-utils-CQjbLnkh.js";import{d as E}from"./env-BUf_aJzW.js";import{v as x,U as y,e as R,a as L}from"./index-0dnGN3GP.js";import{a as M,b as B,e as H}from"./ai-analysis-CIN__RZj.js";import{g as C,s as U,b as k}from"./ai-cache-BgoifbUT.js";let I;const F=e=>(I??=T(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[t,n]=h.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return h.getBuiltinModule(e)}return F(e)},{readFile:N,writeFile:A}=O("node:fs/promises"),q=32*1024,W=(e,t)=>{if(e.length<=t)return e;const n=e.slice(-t),o=e.length-n.length;return`[…${String(o)} bytes truncated from head…]
|
|
2
2
|
${n}`},J=async(e,t)=>t===void 0?_(e,{dataDirectory:E(e)}):j(e,t),le=async(e,t,n={})=>{const o=n.terminalOutputLimit??q,[r,i]=await Promise.all([$(e,t),J(e,n.runId)]),s=i?v(i,t):void 0;if(!r&&!s)return;let a,c;if(i&&s){const u=await P(e,i.id),f=u?v(u,t):void 0;a=D(s.hashDetails,f?.hashDetails),c=u?.id}const d=r?.terminalOutput??"";return{command:r?.command??void 0,cwd:r?.cwd??void 0,dependencies:s?.dependencies??[],duration:s?.duration,exitCode:r?.exitCode??s?.exitCode,hash:s?.hash??r?.hash,hashDetails:s?.hashDetails,hashDiff:a,previousRunId:c,project:s?.target.project,runId:i?.id??r?.runId,status:r?.status??(s?K(s):void 0),target:s?.target.target,taskId:t,terminalOutput:W(d,o),terminalOutputCaptured:!!r,timestamp:r?.timestamp??s?.endTime??s?.startTime}},K=e=>{if(e.exitCode!==void 0&&e.exitCode!==0)return"failure";switch(e.cacheStatus){case"HIT":return"local-cache";case"REMOTE_HIT":return"remote-cache";case"SKIPPED":return"skipped";default:return e.exitCode===0?"success":void 0}},Y=3600*1e3,w=80,V=new Set(["high","low","medium"]),X=()=>`You are an expert software engineer helping fix a failing build/test/lint task.
|
|
3
3
|
|
|
4
4
|
You will be given:
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{createRequire as L}from"node:module";import{DEFAULT_CHANGES_DIR as I}from"../packem_chunks/DEFAULT_CLEAN_KEEP.js";import{VisReleaseError as b}from"./VisReleaseError-DZtgcKf8.js";import{a as T}from"./apply-release-plan-Cf6TJxK2.js";import{createShellRunner as F}from"../packem_chunks/shell-runner.js";import{R as H}from"../packem_chunks/context.js";let D;const G=e=>(D??=L(import.meta.url))(e),C=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=e=>{if(typeof C<"u"&&C.versions&&C.versions.node){const[i,t]=C.versions.node.split(".").map(Number);if(i>22||i===22&&t>=3||i===20&&t>=16)return C.getBuiltinModule(e)}return G(e)},{writeFile:A,unlink:N}=j("node:fs/promises"),{resolve:O}=j("node:path"),q=e=>{const i=e.channel?.tag??e.branch??"main",{releases:t}=e.plan,l=t.length<=3?t.map(r=>`${r.name}@${r.newVersion}`).join(", "):`version ${t.length} packages`,f=t.map(r=>`- ${r.name}: ${r.oldVersion} → ${r.newVersion}`).join(`
|
|
2
|
+
`);return`release(${i}): ${l} [skip ci]
|
|
3
|
+
|
|
4
|
+
${f}`},U=async(e,i,t,l)=>{const f=await import("node:fs/promises"),{getCurrentSha:r,LOCKFILE_NAMES:w,RELEASE_SOURCE_TRAILER:p,stageAndCommit:o}=await import("../packem_chunks/git.js"),d=F(),s=await import("node:path"),a=[];for(const c of w)try{await f.access(s.join(e.cwd,c)),a.push(s.join(e.cwd,c))}catch{}const n=e.config.tagTarget==="source"?l??await r({cwd:e.cwd,runner:d}):void 0,m=n===void 0?"":`
|
|
5
|
+
|
|
6
|
+
${p}: ${n}`,g=e.config.aggregateRelease===!0||typeof e.config.aggregateRelease=="object"&&e.config.aggregateRelease.enabled;let h;if(e.config.oneCommitPerPackage===!0&&!g&&e.plan.releases.length>0){const c=e.channel?.tag??e.branch??"main",y=i.writes.map(k=>k.path),u=new Set,{releases:v}=e.plan;for(let k=0;k<v.length;k+=1){const P=v[k],V=e.depGraph.getPackage(P.name),E=V?`${V.dir}${s.sep}`:void 0,S=E?y.filter(R=>R.startsWith(E)):[];for(const R of S)u.add(R);const M=k===v.length-1?[...y.filter(R=>!u.has(R)),...i.deletions,...a]:[],_=[...S,...M];_.length!==0&&(h=await o({cwd:e.cwd,runner:d},_,`release(${c}): ${P.name}@${P.newVersion} [skip ci]${m}`,{author:e.config.gitUser}))}}else{const c=t??q(e),y=[...i.writes.map(u=>u.path),...i.deletions,...a];h=await o({cwd:e.cwd,runner:d},y,`${c}${m}`,{author:e.config.gitUser})}return h},W=async(e,i)=>{const t=[],{applyExtraFilesForRelease:l}=await import("../packem_chunks/extra-files.js"),{applyVersionFilesForRelease:f}=await import("../packem_chunks/native-addon.js").then(a=>a.v),{cargoManifestPaths:r}=await import("../packem_chunks/native-addon.js").then(a=>a.m),w=await Promise.all(e.plan.releases.map(async a=>{const n=e.depGraph.getPackage(a.name);if(!n)return{warnings:[],writes:[]};const m=e.perPackageConfig.get(a.name)?.extraFiles??[],g=e.config.publish?.extraFiles??[],h=e.perPackageConfig.get(a.name)?.versionFiles??[],y=m.length>0||g.length>0?await l(e.cwd,n.dir,a.newVersion,a.name,g,m):{warnings:[],writes:[]},u=h.length>0?await f(n.dir,h,a.newVersion,a.name,new Map(y.writes.map(v=>[v.path,v.content]))):{writes:[]};return{warnings:y.warnings,writes:[...y.writes,...u.writes]}})),p=new Map,o=new Set;for(const a of w){for(const n of a.writes)p.set(n.path,n.content),o.add(n.path);t.push(...a.warnings)}const d=e.packages.filter(a=>a.ecosystem==="cargo"),s=e.plan.releases.flatMap(a=>{const n=e.depGraph.getPackage(a.name);if(!n||n.ecosystem!==void 0&&n.ecosystem!=="cargo")return[];const m=n.ecosystem==="cargo"?[n.manifestPath]:r(n.dir,e.perPackageConfig.get(a.name)??{});return m.length>0||n.ecosystem==="cargo"?[{ecosystem:n.ecosystem,manifestPaths:m,name:a.name,newVersion:a.newVersion}]:[]});if(s.length>0){const a=new Set(d.map(g=>g.manifestPath));d.length>0&&a.add(O(e.cwd,"Cargo.toml"));for(const g of e.packages)if(g.ecosystem===void 0)for(const h of r(g.dir,e.perPackageConfig.get(g.name)??{}))a.add(h);const{planCargoWorkspace:n}=await import("../packem_chunks/cargo-plan.js"),m=await n({crateManifests:d.map(g=>g.manifestPath),cwd:e.cwd,pending:p,releases:s,rewriteDependents:e.config.cargo?.discover===!0,scanManifests:[...a]});for(const g of m.touched)o.add(g);t.push(...m.warnings)}for(const a of H){const n=e.plan.releases.flatMap(g=>e.depGraph.getPackage(g.name)?.ecosystem===a.id?[{name:g.name,newVersion:g.newVersion}]:[]);if(n.length===0||a.plan===void 0)continue;const m=await a.plan({context:e,pending:p,projects:e.projectsByEcosystem?.get(a.id)??[],releases:n});for(const g of m.touched)o.add(g);t.push(...m.warnings)}for(const a of o)i.writes.push({content:p.get(a),path:a});t.length>0&&e.plan.warnings.push(...t)},B=async(e,i)=>{if(e.length===0)return;const{join:t}=await import("node:path");let l;try{const{createRequire:r}=await import("node:module"),{pathToFileURL:w}=await import("node:url"),p=r(t(i,"package.json"));l=await import(w(p.resolve("prettier")).href)}catch{return}const f=await import("node:fs/promises");for(const r of e)try{const w=await l.getFileInfo(r);if(w.ignored||!w.inferredParser)continue;const p=await f.readFile(r,"utf8"),o=await l.resolveConfig(r),d=await l.format(p,{...o,filepath:r});d!==p&&await f.writeFile(r,d)}catch{}},$=async(e,i,t)=>{if(!i||i.trim()==="")return;const l=F(),f=process.platform==="win32",r=f?"cmd":"sh",w=f?["/c",i]:["-c",i],p=await l.run(r,w,{cwd:e,silent:!1});if(p.exitCode!==0)throw new Error(`${t} failed (exit ${p.exitCode}): ${i}`)},K=async(e,i)=>{const{normaliseGroup:t}=await import("../release/types.js"),l=[...e.config.fixed??[],...e.config.linked??[]].map(r=>t(r)),{default:f}=await import("../packem_chunks/index.js");for(const[r,w]of Object.entries(i)){const p=Number.parseInt(r.replace(/^group-/,""),10),o=l[p];!o||!e.plan.releases.some(s=>o.packages.some(a=>s.name===a||f(a,s.name)))||await $(e.cwd,w,`groupPreVersionCommand[${r}]`)}},z=async e=>{const i=e.config.verifyLockfile;if(i===!0&&!e.pm.verifyLockfile)throw new b({code:"CONFIG_INVALID",message:`release.verifyLockfile is not supported for ${e.pm.id} (only pnpm); remove it or set it to false.`});const t=i!==!1&&e.pm.verifyLockfile!==void 0;try{await e.pm.installLockfileOnly({cwd:e.cwd,silent:!0})}catch(l){if(!t||(await e.pm.runner.run(e.pm.id,["--version"],{cwd:e.cwd,silent:!0})).exitCode!==0)return;throw l}t&&await e.pm.verifyLockfile?.({cwd:e.cwd})},J=async(e,i,t,l={})=>{const{findConflictingPendingStages:f,readStagedRegistry:r,removePendingStages:w,writeStagedRegistry:p}=await import("../packem_chunks/staged-registry.js"),o=e.config.changesDir??I;let d=t??await r(e.cwd,o);if(d.pending.length===0)return;const s=new Map(e.plan.releases.map(c=>[c.name,c.newVersion])),a=[...s.keys()];let n=f(d,a).filter(c=>s.get(c.name)!==c.version);if(n.length===0)return;let m=[];if(!l.skipSelfHeal){const c=l.runner??F();m=(await Promise.all(n.map(async u=>{const v=await c.run("npm",["view",`${u.name}@${u.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return v.exitCode===0&&v.stdout.trim().length>0?u.id:void 0}))).filter(u=>u!==void 0)}if(m.length>0){if(d=w(d,m),l.persistSelfHeal!==!1)try{await p(e.cwd,o,d)}catch{}if(n=f(d,a).filter(c=>s.get(c.name)!==c.version),n.length===0)return}const g=n.map(c=>` • ${c.name}@${c.version} — stage ${c.id} (${c.reason}, recorded ${c.stagedAt})`).join(`
|
|
7
|
+
`),h=i==="version"?"version":"publish";throw new b({code:"STAGE_PENDING",hint:"Resolve via `vis release stage approve <id>` / `--all` or `vis release stage reject <id>`, commit the updated staged.json, then retry.",message:`Refusing to ${h} — ${n.length} package(s) have a pending stage from a prior wave:
|
|
8
|
+
${g}`})},ae=async(e,i={})=>{if(e.plan.releases.length===0)return{changedFiles:[],deletedFiles:[],plan:e.plan};await J(e,"version",void 0,{persistSelfHeal:!1}),!i.dryRun&&e.config.preVersionCommand&&await $(e.cwd,e.config.preVersionCommand,"preVersionCommand"),!i.dryRun&&e.config.groupPreVersionCommands&&await K(e,e.config.groupPreVersionCommands);const{readFileSync:t}=await import("node:fs"),{resolveFormatter:l}=await import("../packem_chunks/resolveFormatter.js"),{resolveGroupChangelogRouting:f}=await import("../packem_chunks/workspace.js"),r=await l(e.config.changelog,e.cwd),w=new Date().toISOString().slice(0,10),p=f(e.config,e.packages,e.cwd),o=await T(e.plan,e.depGraph,{changelogPath:s=>p.get(s.name)??`${s.dir}/CHANGELOG.md`,internalDependencyRanges:e.config.internalDependencyRanges,readChangelog:s=>{try{return t(s,"utf8")}catch{return}},readManifest:s=>{try{return t(s,"utf8")}catch{return}},renderChangelogEntry:s=>r({changeFiles:s.changeFiles,date:w,release:s,target:"changelog"})});if(await W(e,o),i.dryRun)return{changedFiles:o.writes.map(s=>s.path),deletedFiles:o.deletions,plan:e.plan};if(await Promise.all([...o.writes.map(s=>A(s.path,s.content)),...o.deletions.map(async s=>{try{await N(s)}catch{}})]),!i.dryRun&&e.config.formatChangedFiles&&await B(o.writes.map(s=>s.path),e.cwd),e.config.plugins?.length){const{runApplyDraftHooks:s}=await import("../packem_chunks/defineReleasePlugin.js");await s({config:e.config,cwd:e.cwd},e.plan)}await z(e);const d=i.commit?await U(e,o,i.commitMessage,i.releaseSource):void 0;if(!i.dryRun&&e.config.postVersionCommand&&await $(e.cwd,e.config.postVersionCommand,"postVersionCommand"),!i.dryRun&&e.preMode?.mode==="exit-pending"){const{deletePreMode:s,preModeFilePath:a}=await import("../packem_chunks/pre-mode.js"),n=e.config.changesDir??".vis/release";await s(e.cwd,n)&&e.plan.warnings.push(`Pre-mode exited: \`${a(e.cwd,n)}\` was deleted. Commit the deletion so the registry stays consistent across CI runs.`)}return{changedFiles:o.writes.map(s=>s.path),commitSha:d,deletedFiles:o.deletions,plan:e.plan}};export{ae as a,J as b,$ as r,z as s};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import{s as h}from"./index--eV4qIz5.js";import{VisReleaseError as E}from"./VisReleaseError-DZtgcKf8.js";import{c as $}from"../packem_chunks/native-addon.js";const w=["dependencies","devDependencies","peerDependencies","optionalDependencies"],y=(e,t)=>{if(e.startsWith("catalog:")||e==="*"||e==="workspace:*"||e==="workspace:^"||e==="workspace:~")return e;if(e.startsWith("workspace:")){const n=e.slice(10);return`workspace:${m(n)}${t}`}if(e.startsWith("npm:")){const n=e.lastIndexOf("@");if(n<=4)return e;const i=e.slice(4,n),r=e.slice(n+1),c=m(r);return`npm:${i}@${c}${t}`}return`${m(e)}${t}`},P=/^([\^~=]|>=?|<=?)/,m=e=>{const t=P.exec(e);return t?t[1]??"^":"^"},D=/^[\^~=]?\s*v?\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/,C=(e,t,s="rewrite",n={})=>{const i=s==="preserve-satisfying"?$(e):null;if(i===null||D.test(i.trim())||h.validRange(i)===null)return y(e,t);if(h.satisfies(t,i))return e;const r=i.split("||").map(a=>a.trim()),c=r.findIndex(a=>h.satisfies(t,a,{includePrerelease:!0}));if(c===-1){const a=n.dependent?` in ${n.dependent}'s ${n.kind??"dependencies"}`:"";throw new E({code:"DEPENDENCY_RANGE_EXCEEDED",hint:'Widen the range by hand (or set `internalDependencyRanges: "rewrite"`), then re-run the release.',message:`${n.depName??"dependency"}@${t} is outside "${e}"${a}; refusing to rewrite the range.`,packageName:n.dependent})}const p=(new h.Range(r[c]).set[0]??[]).filter(a=>a.operator.startsWith("<")).map(a=>a.value);return r[c]=[`>=${t}`,...p].join(" "),`${e.slice(0,e.length-i.length)}${r.join(" || ")}`},A=async(e,t,s={})=>{const n=s.serializeManifest??_,i=s.changelogPath??M,r=s.renderChangelogEntry??S,c=new Map(e.releases.map(o=>[o.name,o.newVersion])),p=await Promise.all(e.releases.map(async o=>{const l=t.getPackage(o.name);if(!l)return;const d=k(l.manifest,o.newVersion,c,s.internalDependencyRanges),g=s.readManifest?.(l.manifestPath),u=i(l);return{changelogEntry:await r(o),changelogPath:u,manifestWrite:l.ecosystem===void 0?{content:n(d,g),path:l.manifestPath}:void 0}})),a=[],f=new Map;for(const o of p){if(!o)continue;o.manifestWrite&&a.push(o.manifestWrite);const l=f.get(o.changelogPath);l?l.push(o.changelogEntry):f.set(o.changelogPath,[o.changelogEntry])}for(const[o,l]of f){const d=l.join(`
|
|
2
|
+
|
|
3
|
+
`),g=s.readChangelog?.(o);a.push({content:W(d,g),path:o})}return{deletions:e.consumedChangeFiles.map(o=>o.path),writes:a}},k=(e,t,s,n)=>{const i={...e,version:t};for(const r of w){const c=e[r];if(!c||typeof c!="object")continue;const p={...c};let a=!1;for(const[f,o]of Object.entries(c)){const l=s.get(f);if(l===void 0)continue;const d=C(o,l,n,{dependent:e.name,depName:f,kind:r});d!==o&&(p[f]=d,a=!0)}a&&(i[r]=p)}return i},v=/^# .+/,N=/^## /m,W=(e,t)=>{const s=e.trim();if(!t||t.trim()==="")return`# Changelog
|
|
4
|
+
|
|
5
|
+
${s}
|
|
6
|
+
`;const n=t.split(/\r?\n/);if(n[0]&&v.test(n[0])){let i=1;for(;i<n.length&&!(n[i]??"").startsWith("## ");)i+=1;const r=n.slice(0,i),c=n.slice(i);return r.length>0&&r[r.length-1]!==""&&r.push(""),[...r,s,"",...c].join(`
|
|
7
|
+
`).replaceAll(/\n{3,}/g,`
|
|
8
|
+
|
|
9
|
+
`)}return N.test(t)?`${s}
|
|
10
|
+
|
|
11
|
+
${t.trimStart()}`:`${s}
|
|
12
|
+
|
|
13
|
+
${t.trimStart()}`},_=(e,t)=>{const s=b(t);return`${JSON.stringify(e,null,s)}
|
|
14
|
+
`},b=e=>{if(!e)return 4;const t=/\n(\s+)"/.exec(e);if(!t)return 4;const s=(t[1]??"").length;return s===2||s===4?s:4},M=e=>`${e.dir}/CHANGELOG.md`,S=e=>{const t=new Date().toISOString().slice(0,10),s=[`## ${e.newVersion}`,`<sub>${t}</sub>`,""];if(e.isCascadeBump||e.isGroupBump)for(const n of e.sources)s.push(`- Version bump from ${n.name}@${n.newVersion}`);else if(e.isDependencyBump&&e.changeFiles.length===0)for(const n of e.sources)n.newVersion===""?s.push(`- Removed dependency ${n.name}`):s.push(`- Updated dependency ${n.name}@${n.newVersion}`);else for(const n of e.changeFiles)for(const i of n.body.split(/\r?\n/)){if(i.trim()===""){s.push("");continue}s.push(i.startsWith("-")||i.startsWith("*")?i:`- ${i}`)}return s.join(`
|
|
15
|
+
`)};export{A as a,W as p,y as r,C as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{a as w,c as R,i as $,t as M,u as m,g as S}from"./package-version-
|
|
1
|
+
import{createRequire as v}from"node:module";import{t as T}from"./compile-cache-DoMHRsRZ.js";import{a as w,c as R,i as $,t as M,u as m,g as S}from"./package-version-C6xroAcI.js";import{i as j}from"./index-BjdW45xX.js";let _;const x=s=>(_??=v(import.meta.url))(s),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=s=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,o]=t.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return t.getBuiltinModule(s)}return x(s)},{createRequire:y}=b("node:module");let N;const O=s=>(N??=y(import.meta.url))(s),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=s=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,o]=r.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return r.getBuiltinModule(s)}return O(s)},{execFileSync:C}=f("node:child_process"),{totalmem:I}=f("node:os"),q=/--max-old-space-size=(\d+)/,z=/--max-semi-space-size=(\d+)/,E=s=>Math.floor(I()/1024/1024*s),P=s=>s<=512?4:s<=1024?8:s<=2048?16:s<=4096?32:s<=8192?64:Math.floor(Math.log2(s))*8,d=(s,e)=>{for(const o of e){const n=s.exec(o);if(n)return Number.parseInt(n[1],10)}},B=s=>{const o=[...w()],n=[...R()],a=d(q,o),p=d(z,o);if(a!==void 0&&p!==void 0)return;const l=a??E(.75),g=p??P(l),c=[];if(a===void 0&&c.push(`--max-old-space-size=${String(l)}`),p===void 0&&c.push(`--max-semi-space-size=${String(g)}`),c.length!==0)try{C($(),[...c,...o,...n.slice(1)],{env:M(),stdio:"inherit"}),m(0)}catch(h){const u=h.status;m(typeof u=="number"?u:1)}},V=()=>{process.env.VIS_VERSION=S()},H=s=>{!process.stdout.isTTY||j||process.env.TERM==="dumb"||process.stdout.write(`\x1B]0;${s}\x07`)},A=new Set(["","--help","--version","-h","-v","completion","dlx","exec","x"]),i=process.argv[2]??"";!A.has(i)&&!process.argv.includes("--help")&&!process.argv.includes("-h")&&B();process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");V();T();(async()=>{if(i==="__pm-shim"){const{dispatchShim:e}=await import("../packem_chunks/dispatch.js");e(process.argv[3]??"",process.argv.slice(4));return}if(i==="x"){const{runLeanX:e}=await import("../packem_chunks/lean.js");await e(process.argv.slice(3));return}if(i==="exec"||i==="dlx"){const{runExecCli:e}=await import("../packem_chunks/cli-exec.js");await e();return}const{runCli:s}=await import("../packem_chunks/cli-main.js").then(e=>e.ap);await s()})();export{H as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as W}from"node:module";import{e as h}from"./index-0dnGN3GP.js";import{y as g}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as O}from"./package-version-
|
|
1
|
+
import{createRequire as W}from"node:module";import{e as h}from"./index-0dnGN3GP.js";import{y as g}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as O}from"./package-version-C6xroAcI.js";let S;const B=e=>(S??=W(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,n]=_.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return _.getBuiltinModule(e)}return B(e)},{readdirSync:y,statSync:M}=w("node:fs"),P=["preinstall","install","postinstall","prepare"],$=e=>{const s=h(e,"node_modules");if(!g(s))return[];const n=new Map,o=(p,f="")=>{let l;try{l=y(p)}catch{return}for(const r of l){const i=h(p,r);if(r.startsWith("@")){o(i,`${r}/`);continue}if(r===".pnpm"&&f===""){let u;try{u=y(i)}catch{continue}for(const a of u){const c=h(i,a,"node_modules");g(c)&&o(c)}continue}if(r.startsWith("."))continue;const m=f+r,t=h(i,"package.json");try{if(!M(i).isDirectory()||!g(t))continue;const u=O(t),a=u.scripts??{},c=P.filter(v=>a[v]);!a.preinstall&&!a.install&&!a.postinstall&&g(h(i,"binding.gyp"))&&c.push("install (binding.gyp)"),c.length>0&&!n.has(m)&&n.set(m,{directory:i,hooks:c,name:m,version:typeof u.version=="string"?u.version:void 0});const d=h(i,"node_modules");g(d)&&o(d)}catch{}}};return o(s),[...n.values()]},b=e=>{const s=e.startsWith("@"),n=e.indexOf("@",s?1:0);return n===-1?{name:e}:{name:e.slice(0,n),version:e.slice(n+1)}},k=(e,s,n)=>{for(const[o,p]of Object.entries(s)){if(!p)continue;if(o.endsWith("@*")){if(o.slice(0,-2)===e.name)return!0;continue}if(o.endsWith("*")){if(e.name.startsWith(o.slice(0,-1)))return!0;continue}const{name:f,version:l}=b(o);if(f===e.name&&(!n||l===void 0||e.version===l))return!0}return!1},q=(e,s,n={})=>{const o=n.pinVersions===!0,p=$(e),f=[],l=[],r=new Map(p.map(t=>[t.name,t]));for(const t of p)k(t,s,o)?l.push(t):f.push(t);const i=[],m=[];for(const[t,u]of Object.entries(s)){if(!u)continue;if(t.endsWith("@*")){const v=t.slice(0,-2);r.has(v)||i.push(t);continue}if(t.endsWith("*")){const v=t.slice(0,-1);[...r.keys()].some(j=>j.startsWith(v))||i.push(t);continue}const{name:a,version:c}=b(t),d=r.get(a);if(!d){i.push(t);continue}o&&c!==void 0&&c!=="*"&&d.version&&d.version!==c&&m.push({from:t,to:`${a}@${d.version}`})}return{excess:i,installed:l,unapproved:f,versionDrift:m}},T=(e,s)=>q(e,s).unapproved.map(n=>`${n.name} (${n.hooks.join(", ")})`);export{q as a,T as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as i}from"../packem_chunks/index3.js";import"../packem_chunks/native-addon.js";import"../packem_chunks/python.js";export{i as createVersionActions};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as l,z as d}from"./index-0dnGN3GP.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{h as g,i as D}from"./registry-
|
|
1
|
+
import{e as l,z as d}from"./index-0dnGN3GP.js";import{S as m}from"./lockfile-DhHAaHN5.js";import{h as g,i as D}from"./registry-B5KGXKED.js";import{y as S}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";const k={vite:"Separate vite copies each load their own plugin and config state. Pin one version with a package manager override.",vitest:"Separate vitest copies each keep their own expect, mocks and runner state. Pin one version with a package manager override."},P={bun:{file:"bun.lock",type:"bun"},npm:{aliases:["npm-shrinkwrap.json"],file:"package-lock.json",type:"npm"},pnpm:{file:"pnpm-lock.yaml",type:"pnpm"},yarn:{file:"yarn.lock",type:"yarn"}},b=t=>{const o=P[t];return o?[...o.aliases??[],o.file].map(n=>({file:n,type:o.type})):[]},h=(t,o)=>{const n=b(o);if(n.length!==0)return n.find(r=>S(l(t,r.file)))??n[n.length-1]},v=t=>{try{return JSON.parse(d(t))}catch{return}},y=t=>{const o=[],n=v(l(t,"package.json"));n&&o.push(n);const r=g(t);let c;if(r?c=r:n?.workspaces&&(Array.isArray(n.workspaces)?c=n.workspaces:n.workspaces.packages&&(c=n.workspaces.packages)),!c)return o;const i=D(t,c);for(const s of i){const e=v(l(t,s,"package.json"));e&&o.push(e)}return o},w=(t,o)=>{const n=new Set,r=[],c=new Map;for(const s of o){const e=c.get(s.name);e?e.push(s):c.set(s.name,[s])}const i=s=>{if(s)for(const e of Object.keys(s))n.has(e)||(n.add(e),r.push(e))};for(const s of y(t))i(s.dependencies),i(s.peerDependencies),i(s.optionalDependencies);for(;r.length>0;){const s=r.shift(),e=c.get(s);if(e){for(const a of e)for(const f of[a.dependencies,a.peerDependencies,a.optionalDependencies])if(f)for(const p of Object.keys(f))n.has(p)||(n.add(p),r.push(p))}}return n},L=(t,o,n={})=>{const r=h(t,o);if(!r)return[];let c;try{c=d(l(t,r.file))}catch{return[]}const i=m(c,r.type);if(i.length===0)return[];const e=n.includeDev??!0?void 0:w(t,i),a=new Set,f=[];for(const p of i){if(e&&!e.has(p.name))continue;const u=`${p.name}@${p.version}`;a.has(u)||(a.add(u),f.push({isDev:!1,name:p.name,version:p.version}))}return f},O=(t,o)=>{const n=h(t,o);if(!n)return[];let r;try{r=d(l(t,n.file))}catch{return[]}const c=m(r,n.type);if(c.length===0)return[];const i=new Map;for(const e of c)i.has(e.name)||i.set(e.name,new Set),i.get(e.name).add(e.version);const s=[];for(const[e,a]of i){if(a.size<=1)continue;const f={name:e,versions:[...a]};k[e]&&(f.hint=k[e]),s.push(f)}return s.sort((e,a)=>e.name.localeCompare(a.name))},M=(t,o)=>{const n=h(t,o);if(!n)return;let r;try{r=d(l(t,n.file))}catch{return}const c=m(r,n.type);if(c.length===0)return;const i=[],s=new Set;for(const e of y(t))for(const a of[e.dependencies,e.devDependencies,e.peerDependencies,e.optionalDependencies])if(a)for(const[f,p]of Object.entries(a)){const u=`${f}@${p}`;s.has(u)||(s.add(u),i.push({name:f,version:p}))}return{entries:c,roots:i}};export{P as L,M as a,O as f,L as l,h as r};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as c}from"./index-0dnGN3GP.js";import{y as a}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as i}from"./package-version-
|
|
1
|
+
import{e as c}from"./index-0dnGN3GP.js";import{y as a}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as i}from"./package-version-C6xroAcI.js";const g=(n,e)=>{for(const o of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const t=n[o];if(t&&typeof t[e]=="string")return t[e]}},k=(n,e)=>{for(const o of e){const t=c(n,o);if(a(t))return t}},d=n=>{const e=c(n,"package.json");if(!a(e))return{};try{return i(e)}catch{return{}}},l=(n,e)=>{const o=d(n),t=new Map;for(const r of e){const s=r.detect(n,o);s&&t.set(r.id,s)}return t};export{l as a,g as d,k as f,d as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as Xs}from"node:module";import{e as Le,a as to,m as _i}from"./index-0dnGN3GP.js";import{h as so,S as oo}from"./index-BisalDCf.js";import{y as fo}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ns}from"./package-version-
|
|
1
|
+
import{createRequire as Xs}from"node:module";import{e as Le,a as to,m as _i}from"./index-0dnGN3GP.js";import{h as so,S as oo}from"./index-BisalDCf.js";import{y as fo}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ns}from"./package-version-C6xroAcI.js";import{U as ut,h as lo}from"./env-BUf_aJzW.js";let Zs;const eo=a=>(Zs??=Xs(import.meta.url))(a),zr=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ro=a=>{if(typeof zr<"u"&&zr.versions&&zr.versions.node){const[g,C]=zr.versions.node.split(".").map(Number);if(g>22||g===22&&C>=3||g===20&&C>=16)return zr.getBuiltinModule(a)}return eo(a)},{rmSync:ki,existsSync:es,readFileSync:at,cpSync:rs,lstatSync:no,readdirSync:io}=ro("node:fs");class Ze extends Error{constructor(g){super(g),this.name="LockfilePruneError"}}const is=a=>{let g=a.startsWith("/")?a.slice(1):a;const C=g.indexOf("(");return C!==-1&&(g=g.slice(0,C)),g},co=(a,g)=>{if(!(g.startsWith("link:")||g.startsWith("file:")||g.startsWith("workspace:")))return`${a}@${g}`},ao=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))h?.version&&g.push({name:s,version:h.version});return g},pt=a=>{const g=[];for(const C of[a.dependencies,a.optionalDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,version:h});return g},ht=a=>{const g=new Map;if(!a)return g;for(const C of Object.keys(a)){const s=is(C),h=g.get(s);h?h.push(C):g.set(s,[C])}return g},ts=a=>{const g=a.displayName??"pnpm-lock.yaml",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=so(C)}catch(V){throw new Ze(`${g}: parse failed — ${V.message}`)}const h=V=>V.packages?Object.keys(V.packages).length:0;let e;for(const V of s){const[ne]=V.errors;if(ne)throw new Ze(`${g}: parse failed — ${ne.message}`);const M=V.toJS();if(!M||typeof M!="object")continue;const le=M;(e===void 0||h(le)>h(e))&&(e=le)}if(e===void 0)throw new Ze(`${g}: top-level value is not an object`);const d=e.importers??{},w=ht(e.packages),m=ht(e.snapshots),A=new Set(["."]);for(const V of a.closure)A.add(V.relativeRoot===""?".":V.relativeRoot);const x={};for(const[V,ne]of Object.entries(d))A.has(V)&&(x[V]=ne);const Y=new Set,y=new Set,v=[];for(const V of Object.values(x))for(const ne of ao(V))v.push(ne);for(;v.length>0;){const{name:V,version:ne}=v.shift(),M=co(V,ne);if(!M)continue;const le=is(M),we=m.get(le)??m.get(M)??[];for(const ve of we){if(y.has(ve))continue;y.add(ve);const Se=e.snapshots?.[ve];if(Se)for(const xe of pt(Se))v.push(xe)}const ge=w.get(le)??w.get(M)??[];for(const ve of ge){if(Y.has(ve))continue;Y.add(ve);const Se=e.packages?.[ve];if(Se&&!e.snapshots)for(const xe of pt(Se))v.push(xe)}}const $={lockfileVersion:e.lockfileVersion};for(const V of["settings","overrides","patchedDependencies","catalogs"])e[V]!==void 0&&($[V]=e[V]);if($.importers=x,e.packages){const V={};for(const ne of Object.keys(e.packages))Y.has(ne)&&(V[ne]=e.packages[ne]);$.packages=V}if(e.snapshots){const V={};for(const ne of Object.keys(e.snapshots))y.has(ne)&&(V[ne]=e.snapshots[ne]);$.snapshots=V}const P=Object.keys(e.packages??{}).length,ie=Object.keys($.packages??{}).length,oe=P-ie,R=Object.keys(d).length-Object.keys(x).length;return{content:oo($,{lineWidth:0}),message:`${g}: kept ${ie}/${P} packages and ${Object.keys(x).length} importers (dropped ${oe} packages, ${R} importers)`,status:"pruned"}},uo=a=>ts({...a,displayName:a.displayName??"aube-lock.yaml"}),po=a=>{let g="",C=!1,s=!1,h=!1;for(let e=0;e<a.length;e+=1){const d=a[e],w=a[e+1];if(s){d===`
|
|
2
2
|
`&&(s=!1,g+=d);continue}if(h){d==="*"&&w==="/"&&(h=!1,e+=1);continue}if(C){if(d==="\\"){g+=d,w!==void 0&&(g+=w,e+=1);continue}d==='"'&&(C=!1),g+=d;continue}if(d==='"'){C=!0,g+=d;continue}if(d==="/"&&w==="/"){s=!0,e+=1;continue}if(d==="/"&&w==="*"){h=!0,e+=1;continue}g+=d}return g},ho=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const[s,h]of Object.entries(C))typeof h=="string"&&g.push({name:s,spec:h});return g},go=a=>{for(const g of a)if(typeof g=="object"&&!Array.isArray(g))return g},mo=a=>{if(!a)return[];const g=[];for(const C of["dependencies","optionalDependencies","peerDependencies"]){const s=a[C];s!==null&&typeof s=="object"&&!Array.isArray(s)&&g.push(...Object.keys(s))}return g},yo=a=>{if(Buffer.isBuffer(a.lockfileContent))return{message:"bun.lockb is binary; run `bun install --save-text-lockfile` to regenerate as bun.lock, then rerun `vis docker scaffold`.",status:"skipped"};const g=po(a.lockfileContent);let C;try{C=JSON.parse(g)}catch(P){throw new Ze(`bun.lock: parse failed — ${P.message}`)}if(!C||typeof C!="object")throw new Ze("bun.lock: top-level value is not an object");const s=C.workspaces??{},h=C.packages??{},e=new Set([""]);for(const P of a.closure)e.add(P.relativeRoot===""?"":P.relativeRoot);const d={},w=[];for(const[P,ie]of Object.entries(s))e.has(P)&&(d[P]=ie,w.push(...ho(ie)));const m=new Set;for(const{name:P}of w)m.add(P);const A=[...m];for(;A.length>0;){const P=A.shift();for(const ie of Object.keys(h)){if(ie.split("/")[0]!==P&&ie!==P)continue;const R=go(h[ie]);for(const V of mo(R))m.has(V)||(m.add(V),A.push(V))}}const x={};for(const[P,ie]of Object.entries(h)){const oe=P.split("/")[0];(m.has(oe)||m.has(P))&&(x[P]=ie)}const Y={...C,packages:x,workspaces:d},y=Object.keys(h).length,v=Object.keys(x).length,$=y-v;return{content:`${JSON.stringify(Y,null,2)}
|
|
3
3
|
`,message:`bun.lock: kept ${v}/${y} packages (dropped ${$})`,status:"pruned"}},Jn="node_modules/",$o=(a,g,C)=>{let s=g;for(;;){const h=s===""?`${Jn}${C}`:`${s}/${Jn}${C}`;if(a[h]!==void 0)return h;if(s==="")return;const e=s.lastIndexOf(`/${Jn.slice(0,-1)}/`);s=e===-1?"":s.slice(0,e)}},vo=a=>{const g=[];for(const C of[a.dependencies,a.devDependencies,a.optionalDependencies,a.peerDependencies])if(C)for(const s of Object.keys(C))g.push(s);return g},Ao=a=>{const g=a.displayName??"package-lock.json",C=typeof a.lockfileContent=="string"?a.lockfileContent:a.lockfileContent.toString("utf8");let s;try{s=JSON.parse(C)}catch($){throw new Ze(`${g}: parse failed — ${$.message}`)}if(!s||typeof s!="object")throw new Ze(`${g}: top-level value is not an object`);const h=s.packages??{},e=new Set([""]);for(const $ of a.closure)$.relativeRoot!==""&&e.add($.relativeRoot);const d=new Set,w=[];for(const $ of Object.keys(h))e.has($)&&(d.add($),w.push($));for(const[$,P]of Object.entries(h))P.link===!0&&typeof P.resolved=="string"&&e.has(P.resolved)&&d.add($);for(;w.length>0;){const $=w.shift(),P=h[$];if(P)for(const ie of vo(P)){const oe=$o(h,$,ie);if(!oe||d.has(oe))continue;d.add(oe);const R=h[oe];R.link===!0&&typeof R.resolved=="string"&&h[R.resolved]!==void 0&&!d.has(R.resolved)?(d.add(R.resolved),w.push(R.resolved)):w.push(oe)}}const m={};for(const $ of Object.keys(h))d.has($)&&(m[$]=h[$]);const A=m[""];A&&Array.isArray(A.workspaces)&&(A.workspaces=A.workspaces.filter($=>{if(typeof $!="string")return!1;const P=$.replace(/\/?\*+$/,"").replace(/\/$/,"");if(P===""||P==="*")return!0;for(const ie of e)if(ie===$||ie===P||ie.startsWith(`${P}/`))return!0;return!1}));const x={...s,packages:m};delete x.dependencies;const Y=Object.keys(h).length,y=Object.keys(m).length,v=Y-y;return{content:`${JSON.stringify(x,null,2)}
|
|
4
4
|
`,message:`${g}: kept ${y}/${Y} entries (dropped ${v})`,status:"pruned"}};var Qn={},Fe={},zn,gt;function wo(){if(gt)return zn;gt=1;function a(s,h){function e(){this.constructor=s}e.prototype=h.prototype,s.prototype=new e}function g(s,h,e,d){this.message=s,this.expected=h,this.found=e,this.location=d,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,g)}a(g,Error),g.buildMessage=function(s,h){var e={literal:function(y){return'"'+w(y.text)+'"'},class:function(y){var v="",$;for($=0;$<y.parts.length;$++)v+=y.parts[$]instanceof Array?m(y.parts[$][0])+"-"+m(y.parts[$][1]):m(y.parts[$]);return"["+(y.inverted?"^":"")+v+"]"},any:function(y){return"any character"},end:function(y){return"end of input"},other:function(y){return y.description}};function d(y){return y.charCodeAt(0).toString(16).toUpperCase()}function w(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function m(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+d(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+d(v)})}function A(y){return e[y.type](y)}function x(y){var v=new Array(y.length),$,P;for($=0;$<y.length;$++)v[$]=A(y[$]);if(v.sort(),v.length>0){for($=1,P=1;$<v.length;$++)v[$-1]!==v[$]&&(v[P]=v[$],P++);v.length=P}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function Y(y){return y?'"'+w(y)+'"':"end of input"}return"Expected "+x(s)+" but "+Y(h)+" found."};function C(s,h){h=h!==void 0?h:{};var e={},d={Start:Vi},w=Vi,m=function(r){return r||[]},A=function(r,t,o){return[{command:r,type:t}].concat(o||[])},x=function(r,t){return[{command:r,type:t||";"}]},Y=function(r){return r},y=";",v=ce(";",!1),$="&",P=ce("&",!1),ie=function(r,t){return t?{chain:r,then:t}:{chain:r}},oe=function(r,t){return{type:r,line:t}},R="&&",V=ce("&&",!1),ne="||",M=ce("||",!1),le=function(r,t){return t?{...r,then:t}:r},we=function(r,t){return{type:r,chain:t}},ge="|&",ve=ce("|&",!1),Se="|",xe=ce("|",!1),je="=",Be=ce("=",!1),$e=function(r,t){return{name:r,args:[t]}},Ne=function(r){return{name:r,args:[]}},Qe="(",Ee=ce("(",!1),re=")",Ie=ce(")",!1),De=function(r,t){return{type:"subshell",subshell:r,args:t}},Oe="{",Pe=ce("{",!1),_e="}",B=ce("}",!1),G=function(r,t){return{type:"group",group:r,args:t}},X=function(r,t){return{type:"command",args:t,envs:r}},me=function(r){return{type:"envs",envs:r}},qe=function(r){return r},ze=function(r){return r},Me=/^[0-9]/,Ye=We([["0","9"]],!1,!1),er=function(r,t,o){return{type:"redirection",subtype:t,fd:r!==null?parseInt(r):null,args:[o]}},or=">>",hr=ce(">>",!1),fr=">&",lr=ce(">&",!1),Cr=">",gr=ce(">",!1),Ke="<<<",rr=ce("<<<",!1),Ge="<&",dr=ce("<&",!1),mr="<",yr=ce("<",!1),Ue=function(r){return{type:"argument",segments:[].concat(...r)}},n=function(r){return r},k="$'",j=ce("$'",!1),J="'",l=ce("'",!1),b=function(r){return[{type:"text",text:r}]},E='""',T=ce('""',!1),O=function(){return{type:"text",text:""}},q='"',U=ce('"',!1),N=function(r){return r},Z=function(r){return{type:"arithmetic",arithmetic:r,quoted:!0}},Q=function(r){return{type:"shell",shell:r,quoted:!0}},ae=function(r){return{type:"variable",...r,quoted:!0}},de=function(r){return{type:"text",text:r}},se=function(r){return{type:"arithmetic",arithmetic:r,quoted:!1}},En=function(r){return{type:"shell",shell:r,quoted:!1}},kn=function(r){return{type:"variable",...r,quoted:!1}},tn=function(r){return{type:"glob",pattern:r}},jr=/^[^']/,Fr=We(["'"],!0,!1),$r=function(r){return r.join("")},sn=/^[^$"]/,on=We(["$",'"'],!0,!1),Kr=`\\
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-0dnGN3GP.js";import{r as qe}from"./docker-
|
|
1
|
+
import{createRequire as ze}from"node:module";import{e as M,z as Fe}from"./index-0dnGN3GP.js";import{r as qe}from"./docker-CN9h1ZAl.js";import{parse as We}from"../packem_chunks/index4.js";import Re from"../packem_chunks/index.js";import{b as fe,l as Ke,a as Ze,d as Qe,e as en,f as nn,g as tn}from"./multi-eco-lockfiles-BK7QtgHY.js";import{p as ke,r as ue,c as sn}from"./composer-DR3D-Psb.js";import{p as Ie}from"./package-version-C6xroAcI.js";import{e as on}from"./license-DvlYdo6T.js";import{S as rn}from"./lockfile-DhHAaHN5.js";import{s as cn}from"./index--eV4qIz5.js";import{V as Le}from"./vis-user-error-DjdeJsEK.js";import{w as an,r as pn,Z as Ce}from"./zig-manifest-P7ydLEOa.js";let He;const Ve=e=>(He??=ze(import.meta.url))(e),ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof ee<"u"&&ee.versions&&ee.versions.node){const[t,n]=ee.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ee.getBuiltinModule(e)}return Ve(e)},{randomUUID:Be}=be("node:crypto"),{readFileSync:G,readdirSync:Pe,statSync:Xe,existsSync:Je}=be("node:fs"),{join:A,relative:$e,resolve:De,basename:Ye}=be("node:path"),ne=e=>e.replaceAll(/[^\w.~-]/g,t=>`%${(t.codePointAt(0)??0).toString(16).toUpperCase().padStart(2,"0")}`),j=(e,t)=>{const n=e.toLowerCase();if(n.startsWith("@")){const s=n.indexOf("/");if(s>0){const o=n.slice(0,s),r=n.slice(s+1);return`pkg:npm/${ne(o)}/${ne(r)}@${ne(t)}`}}return`pkg:npm/${ne(n)}@${ne(t)}`},_={ARRAY:"array",BOOLEAN:"boolean",DATE:"date",FUNCTION:"function",JSTOXML_OBJECT:"jstoxml-object",NULL:"null",NUMBER:"number",OBJECT:"object",STRING:"string"},ln=[_.STRING,_.NUMBER,_.BOOLEAN],un='<?xml version="1.0" encoding="UTF-8"?>',Ee=["_selfCloseTag","_attrs"],fn=(e="",t=0)=>e.repeat(t),pe=e=>Array.isArray(e)&&_.ARRAY||typeof e===_.OBJECT&&e!==null&&e._name&&_.JSTOXML_OBJECT||e instanceof Date&&_.DATE||e===null&&_.NULL||typeof e,Ue=e=>e.startsWith("<![CDATA["),je=(e="",t={},n)=>{let s=e;if(typeof e===_.STRING){if(Ue(e))return e;const o=new RegExp(`(${Object.keys(t).join("|")})(?!(\\w|#)*;)`,"g");s=String(e).replace(o,(r,l)=>t[l]||"")}return typeof n=="function"?n(s):s},dn=(e={},t,n,s)=>(Array.isArray(e)?e:Object.entries(e).map(([r,l])=>({[r]:l}))).reduce((r,l)=>{const c=Object.keys(l)[0],i=l[c];if(typeof n===_.FUNCTION&&n(c,i))return r;const a=t?je(i,t):i,f=!s&&a===!0?"":`="${a}"`;return r.push(`${c}${f}`),r},[]),mn=(e={},t,n,s)=>{const o=dn(e,t,n,s);return o.length===0?"":` ${o.join(" ")}`},hn=(e={})=>Object.keys(e).map(t=>({_name:t,_content:e[t]})),gn=e=>ln.includes(pe(e)),vn=e=>!e.match("<"),yn=({header:e,isOutputStart:t})=>e&&t?typeof e===_.BOOLEAN?un:e:"",Ae={"<":"<",">":">","&":"&",'"':"""},q=(e={},t={})=>{const{depth:n=0,indent:s,_isFirstItem:o,_isOutputStart:r=!0,header:l,attributeReplacements:c={},attributeFilter:i,attributeExplicitTrue:a=!1,contentReplacements:f={},contentMap:g,selfCloseTags:y=!0}=t,X=typeof c=="boolean"&&!c?{}:{...Ae,...c},z=typeof f=="boolean"&&!f?{}:{...Ae,...f},N=typeof s=="string",H=fn(s,n),J=pe(e),Y=yn({header:l,isOutputStart:r}),O=r&&!Y&&o&&n===0,V=N&&!O?`
|
|
2
2
|
`:"";let k="";switch(J){case _.JSTOXML_OBJECT:{const{_name:b,_content:S}=e;if(S===null&&typeof g!="function"){k=`${V}${H}${b}`;break}if(Array.isArray(S)&&S.every(gn))return S.map(ae=>q({_name:b,_content:ae},{...t,depth:n,_isOutputStart:!1})).join("");if(Ee.includes(b))break;const $=q(S,{...t,depth:n+1,_isOutputStart:O}),B=pe($),E=vn($),oe=Ue($),T=`${V}${H}`;if(b==="_comment"){k+=`${T}<!-- ${S} -->`;break}const R=B==="undefined"||$==="",D=y,W=e._selfCloseTag,K=typeof W===_.BOOLEAN?R&&W:R&&D,I=K?"/":"",re=mn(e._attrs,X,i,a),Z=`<${b}${re}${I}>`,ce=N&&!E&&!oe?`
|
|
3
3
|
${H}`:"",ie=K?"":`${$}${ce}</${b}>`;k+=`${T}${Z}${ie}`;break}case _.OBJECT:{const b=Object.keys(e);k=b.map((v,$)=>{const B={...t,_isFirstItem:$===0,_isLastItem:$+1===b.length,_isOutputStart:O},E={_name:v};if(pe(e[v])===_.OBJECT&&(Ee.forEach(R=>{const D=e[v][R];typeof D<"u"&&(E[R]=D,delete e[v][R])}),typeof e[v]._content<"u"&&Object.keys(e[v]).length>1)){const R=Object.assign({},e[v]);delete R._content,E._content=[...hn(R),e[v]._content]}return typeof E._content>"u"&&(E._content=e[v]),q(E,B)},t).join("");break}case _.FUNCTION:{const b=e(t);k=q(b,t);break}case _.ARRAY:{k=e.map((S,v)=>{const $={...t,_isFirstItem:v===0,_isLastItem:v+1===e.length,_isOutputStart:O};return q(S,$)}).join("");break}default:{k=je(e,z,g);break}}return`${Y}${k}`},_n=(e,t)=>`pkg:cargo/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,se=e=>e,bn=e=>{const t=e.split(" ")[0];if(t===void 0||t==="")return;const n=/^\S+\s+(\d[^\s(]*)/.exec(e)?.[1],s=/\(([^)]+)\)/.exec(e)?.[1];return{kind:"main",name:t,source:s,version:n}},$n=e=>{const t=[];let n,s=!1;const o=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.source===void 0,name:n.name,source:n.source,version:n.version})};for(const r of e.split(`
|
|
4
4
|
`)){const l=r.trim();if(l==="[[package]]"){o(),n={deps:[]},s=!1;continue}if(n===void 0)continue;if(s){const i=/^"([^"]+)",?$/.exec(l);if(i){const a=bn(i[1]);a!==void 0&&n.deps.push(a)}else l==="]"&&(s=!1);continue}if(l==="dependencies = ["){s=!0;continue}const c=/^(name|version|source)\s*=\s*"([^"]*)"$/.exec(l);if(c){const[,i="",a=""]=c;i==="name"?n.name=a:i==="version"?n.version=a:n.source=a}}return o(),t},Cn=(e,t)=>{const n=typeof t=="object"&&t!==null?t.package:void 0;return typeof n=="string"?n:e},Sn=(e,t)=>{const n=Array.isArray(t.workspace?.members)?t.workspace.members.filter(r=>typeof r=="string"):[],s=Array.isArray(t.workspace?.exclude)?t.workspace.exclude.filter(r=>typeof r=="string"):[],o=new Set;for(const r of n){let l=[e];for(const c of r.split("/").filter(i=>i!==""&&i!==".")){const i=[];for(const a of l){if(!/[*?[{]/.test(c)){i.push(A(a,c));continue}let f;try{f=Pe(a)}catch{f=[]}for(const g of f){const y=A(a,g);Re(c,g)&&Xe(y).isDirectory()&&i.push(y)}}l=i}for(const c of l){const i=c.slice(e.length+1).split("\\").join("/");s.some(a=>Re(a,i))||o.add(c)}}return[...o]},Rn=e=>{const t=new Map;let n;try{n=Oe(G(A(e,"Cargo.toml"),"utf8"))}catch{return t}const s=Sn(e,n);n.package?.name!==void 0&&s.push(e);for(const o of s){let r;try{r=Oe(G(A(o,"Cargo.toml"),"utf8"))}catch{continue}if(typeof r.package?.name!="string")continue;const l=new Set,c=i=>{for(const[a,f]of Object.entries(i??{}))l.add(se(Cn(a,f)))};c(r.dependencies),c(r["build-dependencies"]);for(const i of Object.values(r.target??{}))c(i.dependencies),c(i["build-dependencies"]);t.set(se(r.package.name),l)}return t},Oe=e=>We(e),kn=(e,t={})=>{let n;try{n=G(A(e,"Cargo.lock"),"utf8")}catch{return{components:[],dependencies:[]}}const s=Rn(e),o=$n(n).map(r=>{const l=r.member?s.get(se(r.name)):void 0;return l===void 0?r:{...r,deps:r.deps.map(c=>l.has(se(c.name))?c:{...c,kind:"dev"})}});return fe(o,{focusNames:t.focusNames,includeDev:t.includeDev,normalize:se,purl:_n})},En=(e,t)=>`pkg:composer/${e.split("/").map(n=>encodeURIComponent(n)).join("/")}@${encodeURIComponent(t)}`,te=e=>e.toLowerCase(),An=e=>{const t=[];for(const[n,s]of[["packages",!1],["packages-dev",!0]]){const o=e[n];if(Array.isArray(o))for(const r of o){if(typeof r.name!="string"||typeof r.version!="string")continue;const l=[...ue(r,"require").map(c=>({kind:s?"dev":"main",name:c})),...ue(r,"require-dev").map(c=>({kind:"dev",name:c}))];t.push({deps:l,member:!1,name:r.name,version:sn(r.version)})}}return t},On=(e,t={})=>{const n={components:[],dependencies:[]};let s,o;try{s=ke(G(A(e,"composer.lock"),"utf8")),o=ke(G(A(e,"composer.json"),"utf8"))}catch{return n}const r=typeof o.name=="string"?te(o.name):void 0;if(t.focusNames!==void 0&&!t.focusNames.some(i=>te(i)===r))return n;const l=new Set([...ue(o,"require"),...t.includeDev?ue(o,"require-dev"):[]].map(i=>te(i))),c=An(s).map(i=>({...i,member:l.has(te(i.name))}));return fe(c,{includeDev:t.includeDev,normalize:te,purl:En})},Te=e=>e.split("/").map(t=>encodeURIComponent(t)).join("/"),Tn={Go:(e,t)=>`pkg:golang/${Te(e)}@${encodeURIComponent(t)}`,Pub:(e,t)=>`pkg:pub/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,SwiftURL:(e,t)=>`pkg:swift/${Te(e)}@${encodeURIComponent(t)}`},wn=(e,t)=>{const n=Ke(e,t).map(s=>{const o=Tn[t](s.name,s.version);return{"bom-ref":o,name:s.name,purl:o,type:"library",version:s.version}}).sort((s,o)=>(s["bom-ref"]??"").localeCompare(o["bom-ref"]??""));return{components:n,dependencies:n.map(s=>({ref:s["bom-ref"]??""}))}},xn=(e,t)=>`pkg:gem/${encodeURIComponent(e)}@${encodeURIComponent(t)}`,Nn=/^ {4}(\S+) \(([^()]+)\)\s*$/,Pn=/^ {6}(\S+)(?: \(.*\))?\s*$/,Dn=e=>{const t=new Map;let n,s,o;for(const r of e.split(/\r?\n/)){if(r.length>0&&!r.startsWith(" ")){n=r.trim(),s=void 0,o=void 0;continue}if(n!=="PATH"&&n!=="GEM"&&n!=="GIT")continue;const l=/^ {2}remote: (.+)$/.exec(r);if(l?.[1]!==void 0){s=l[1].trim();continue}const c=Nn.exec(r);if(c?.[1]!==void 0&&c[2]!==void 0){const a=c[1],f=c[2].split("-")[0]??c[2],g=n==="GIT"&&s!==void 0?`git:${s}`:void 0,y=`${a}\0${f}\0${g??""}`;o=t.get(y)??{deps:[],member:n==="PATH",name:a,source:g,version:f},t.set(y,o);continue}const i=Pn.exec(r);i?.[1]!==void 0&&o!==void 0&&o.deps.push({kind:"main",name:i[1]})}return[...t.values()]},In=(e,t={})=>{let n;try{n=G(A(e,"Gemfile.lock"),"utf8")}catch{return{components:[],dependencies:[]}}return fe(Dn(n),{focusNames:t.focusNames,includeDev:t.includeDev,normalize:s=>s,purl:xn})},ye=e=>{try{return Ie(e)}catch{return}},Ln=e=>{if(e.length===0||e.includes("..")||e.startsWith(".")||e.includes("\0")||e.includes("\\"))return!1;if(e.startsWith("@")){const t=e.indexOf("/");return t>1&&!e.includes("/",t+1)}return!e.includes("/")},Un=e=>e.length>0&&!e.includes("/")&&!e.includes("\\")&&!e.includes("..")&&!e.includes("\0"),jn=(e,t,n)=>{const o=`${t.replaceAll("/","+")}@${n}`,r=M(e,"node_modules",".pnpm"),l=ye(M(r,o,"node_modules",t,"package.json"));if(l)return l;let c;try{c=Pe(r)}catch{return}const i=`${o}_`;for(const a of c){if(!a.startsWith(i))continue;const f=ye(M(r,a,"node_modules",t,"package.json"));if(f)return f}},Mn=(e,t,n)=>{const s=ye(M(e,"node_modules",t,"package.json"));return s?.version===n?s:void 0},Gn=(e,t,n)=>{if(!(!Ln(t)||!Un(n)))return jn(e,t,n)??Mn(e,t,n)},zn={sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512"},Hn={sha256:64,sha384:96,sha512:128},Vn=e=>{const t={name:e.name,version:e.version},{integrity:n}=e;return n&&n.hex.length===Hn[n.algorithm]&&(t.hash={alg:zn[n.algorithm],content:n.hex}),e.dependencies&&(t.dependencies=e.dependencies),e.peerDependencies&&(t.peerDependencies=e.peerDependencies),e.optionalDependencies&&(t.optionalDependencies=e.optionalDependencies),t},Bn=[{file:"pnpm-lock.yaml",type:"pnpm"},{file:"npm-shrinkwrap.json",type:"npm"},{file:"package-lock.json",type:"npm"},{file:"yarn.lock",type:"yarn"},{file:"bun.lock",type:"bun"}],Fn=e=>{for(const{file:t,type:n}of Bn){let s;try{s=Fe(M(e,t))}catch{continue}const o=new Map;for(const r of rn(s,n))o.set(`${r.name}@${r.version}`,Vn(r));return{packages:o,type:n}}},Me=e=>e.toLowerCase().replaceAll(/[-_.]+/g,"-"),qn=(e,t)=>`pkg:pypi/${encodeURIComponent(Me(e))}@${encodeURIComponent(t)}`,Xn=/^source\s*=\s*\{\s*(?:editable|virtual|directory)\s*=/,Jn=/\{\s*name\s*=\s*"([^"]+)"([^}]*)\}/,Yn=e=>{const t=[];let n,s="none",o=!1;const r=()=>{n?.name!==void 0&&n.version!==void 0&&t.push({deps:n.deps,member:n.member,name:n.name,source:n.source,version:n.version})};for(const l of e.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as oe}from"node:module";import{n as q,C as ue,o as le,m as de,e as f}from"./index-0dnGN3GP.js";import{y as B}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ye}from"./package-version-ChA7gKlB.js";let ce;const ae=e=>(ce??=oe(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[n,t]=S.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return S.getBuiltinModule(e)}return ae(e)},{createRequire:N}=x("node:module"),{existsSync:fe,readdirSync:G,statSync:pe,rmSync:Y,writeFileSync:he}=x("node:fs"),{spawn:O}=x("node:child_process"),{createHash:we}=x("node:crypto"),{homedir:me,platform:ge}=x("node:os");let Se=class extends Error{constructor(n){super(`EEXIST: ${n}`)}get code(){return"EEXIST"}set code(n){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(n){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const L=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let $e;const Ee=e=>($e??=N(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[n,t]=$.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return $.getBuiltinModule(e)}return Ee(e)},{lstatSync:P,mkdirSync:xe}=be("node:fs"),ve=e=>{q(e);try{const n=P(e);if(!n.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(n))}'`);return}catch(n){if(n.code!=="ENOENT")throw n}try{xe(e,{recursive:!0})}catch(n){if(n.code!=="EEXIST")throw n;const t=P(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(t))}'`,{cause:n})}},ke=e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let Te;const Ie=e=>(Te??=N(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Re=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[n,t]=E.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return E.getBuiltinModule(e)}return Ie(e)},{randomBytes:Be}=Re("node:crypto"),We=e=>`${e}.${process.pid.toString(36)}.${Be(6).toString("hex")}.tmp`,Ae=new TextEncoder,Me=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return Ae.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(n)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let _e;const Ce=e=>(_e??=N(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,t]=b.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return b.getBuiltinModule(e)}return Ce(e)},{mkdirSync:Fe,readFileSync:je,writeFileSync:De,statSync:Oe,renameSync:V,chownSync:Le,chmodSync:Pe,unlinkSync:Ve}=Ne("node:fs"),jt=(e,n,t)=>{t={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},q(e),ke(n),e=ue(e);const i=B(e,le),c=t.flag??"w",a=c.includes("a"),s=c.includes("x");if(i&&(!t.overwrite||s))throw new Se(`file already exists, open '${e}'`);const r=We(e);try{!i&&t.recursive&&Fe(de(e),{recursive:!0});let o,u=typeof n=="string"?Buffer.from(n,t.encoding??"utf8"):Me(n);if(a&&i&&(u=Buffer.concat([je(e),u])),De(r,u,{flag:"wx"}),i&&t.backup&&(o=Oe(e),t.chown??={gid:o.gid,uid:o.uid},V(e,`${e}.bak`)),t.chown)try{Le(r,t.chown.uid,t.chown.gid)}catch{}const d=o&&t.mode===void 0?o.mode:t.mode;d!==void 0&&Pe(r,d),V(r,e)}catch(o){throw new Error(`Failed to write file at: ${e} - ${o.message}`,{cause:o})}finally{B(r)&&Ve(r)}},ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ue=12288,He=65510,Ke=[12288,12288,65281,65376,65504,65510],qe=8361,Ge=65518,Ye=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Xe=32,Je=10630,Ze=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Qe=4352,et=262141,X=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],v=(e,n)=>{let t=0,i=Math.floor(e.length/2)-1;for(;t<=i;){const c=Math.floor((t+i)/2),a=c*2;if(n<e[a])i=c-1;else if(n>e[a+1])t=c+1;else return!0}return!1},z=19968,[tt,nt]=st(X);function st(e){let n=e[0],t=e[1];for(let i=0;i<e.length;i+=2){const c=e[i],a=e[i+1];if(z>=c&&z<=a)return[c,a];a-c>t-n&&(n=c,t=a)}return[n,t]}const it=e=>e<161||e>1114109?!1:v(ze,e),rt=e=>e<Ue||e>He?!1:v(Ke,e),ot=e=>e<qe||e>Ge?!1:v(Ye,e),ct=e=>e<Xe||e>Je?!1:v(Ze,e),at=e=>e>=tt&&e<=nt?!0:e<Qe||e>et?!1:v(X,e);function ut(e){return it(e)?"ambiguous":rt(e)?"fullwidth":ot(e)?"halfwidth":ct(e)?"narrow":at(e)?"wide":"neutral"}function lt(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function J(e){return lt(e),ut(e)}const Z=String.raw,U=Z`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dt=()=>new RegExp(Z`\p{RI}{2}|(?)${U}(?:\u200D${U})*`,"gu"),Dt=new Set(["\x1B",""]),Ot="\x07",Lt="]8;;",Pt=/[\u200B\uFEFF\u2060-\u2064]/g,Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,Vt=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,zt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,T=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ee=dt(),Ut=/[-_./\s]+/g,Ht=/(\u001B\[[0-9;]*[a-z])/i,Kt=new RegExp("\\p{Script=Arabic}","u"),qt=new RegExp("\\p{Script=Bengali}","u"),Gt=new RegExp("\\p{Script=Cyrillic}","u"),Yt=new RegExp("\\p{Script=Devanagari}","u"),Xt=new RegExp("\\p{Script=Ethiopic}","u"),Jt=new RegExp("\\p{Script=Greek}","u"),Zt=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),Qt=new RegExp("\\p{Script=Gujarati}","u"),en=new RegExp("\\p{Script=Gurmukhi}","u"),tn=new RegExp("\\p{Script=Hangul}","u"),nn=new RegExp("\\p{Script=Hebrew}","u"),sn=new RegExp("\\p{Script=Hiragana}","u"),rn=new RegExp("\\p{Script=Han}","u"),on=new RegExp("\\p{Script=Kannada}","u"),cn=new RegExp("\\p{Script=Katakana}","u"),an=new RegExp("\\p{Script=Khmer}","u"),un=new RegExp("\\p{Script=Lao}","u"),ln=new RegExp("\\p{Script=Latin}","u"),dn=new RegExp("\\p{Script=Malayalam}","u"),fn=new RegExp("\\p{Script=Myanmar}","u"),pn=new RegExp("\\p{Script=Oriya}","u"),hn=new RegExp("\\p{Script=Sinhala}","u"),wn=new RegExp("\\p{Script=Tamil}","u"),mn=new RegExp("\\p{Script=Telugu}","u"),gn=new RegExp("\\p{Script=Thai}","u"),yn=new RegExp("\\p{Script=Tibetan}","u"),Sn=/[\u02BB\u02BC\u0027]/u,$n=e=>e.replace(ee,""),H=new Map,ft=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),pt=e=>{const n=ft(e.width);let t=H.get(n);return t||(t=new Map,H.set(n,t)),t},I=new RegExp(Q.source,"y"),_=new RegExp(ee.source,"uy"),R=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,te=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",ht=(e,n)=>{const t=pt(n),i=Math.floor(e/65536),c=e%65536;let a=t.get(i);if(a||(a=new Map,t.set(i,a)),a.has(c))return a.get(c);let s;switch(te(e)){case"control":{s=n.width.control;break}case"latin":{s=n.width.regular;break}case"wide":{s=n.width.wide;break}case"zero":{s=0;break}default:switch(J(e)){case"ambiguous":{s=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{s=n.width.fullWidth;break}case"wide":{s=n.width.wide;break}default:s=n.width.regular}}return a.set(c,s),s},wt=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,C=(e,n={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const t={truncation:{countAnsiEscapeCodes:n.countAnsiEscapeCodes??!1,ellipsis:n.ellipsis??"",ellipsisWidth:n.ellipsisWidth??(n.ellipsis?C(n.ellipsis,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:n.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:n.ambiguousIsNarrow??!1,ansi:n.ansiWidth??0,control:n.controlWidth??0,emoji:n.emojiWidth??2,fullWidth:n.fullWidth??2,halfWidth:n.halfWidth??1,regular:n.regularWidth??1,tab:n.tabWidth??8,wide:n.wideWidth??2}},i=Math.max(0,t.truncation.limit-t.truncation.ellipsisWidth),{length:c}=e,a=c>1e4;let s=0,r=0,o=c,u=!1;const d=e.includes("\x1B")||e.includes("");for(;s<c;){if(d&&(e[s]==="\x1B"||e[s]==="")){if(e.startsWith("\x1B]8;;",s)){const h="\x1B]8;;\x07",w=h.length,W=e.indexOf("\x07",s+5);if(W!==-1){const A=e.indexOf(h,W+1);if(A!==-1){const ie=A+w,re=e.slice(W+1,A).replace(Q,""),D=C(re,{ambiguousIsNarrow:t.width.ambiguousIsNarrow,ansiWidth:t.width.ansi,controlWidth:t.width.control,countAnsiEscapeCodes:!1,ellipsis:t.truncation.ellipsis,ellipsisWidth:t.truncation.ellipsisWidth,emojiWidth:t.width.emoji,fullWidth:t.width.fullWidth,halfWidth:t.width.halfWidth,limit:Math.max(0,i-r),regularWidth:t.width.regular,tabWidth:t.width.tab,wideWidth:t.width.wide}),M=D.width;if(D.truncated)u=!0,o=Math.min(o,s);else if(r+M>i&&(o=Math.min(o,s),u=!0,r+M>t.truncation.limit))break;if(r+=M,s=ie,u&&r>=t.truncation.limit)break;continue}}}if(I.lastIndex=s,I.test(e)){const h=I.lastIndex-s,w=t.truncation.countAnsiEscapeCodes?h:t.width.ansi;if(r+w>i&&(o=Math.min(o,s),r+w>t.truncation.limit)){u=!0;break}r+=w,s=I.lastIndex;continue}}const l=e.codePointAt(s);if(l===8203||l===65279||l>=8288&&l<=8292){s+=1;continue}if(l===9){if(r+t.width.tab>i&&(o=Math.min(o,s),r+t.width.tab>t.truncation.limit)){u=!0;break}r+=t.width.tab,s+=1;continue}if(R.lastIndex=s,R.test(e)){const h=(R.lastIndex-s)*t.width.regular;if(r+h>i){const w=t.width.regular>0?Math.floor((i-r)/t.width.regular):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=R.lastIndex;continue}if((l<=31||l>=127&&l<=159)&&(T.lastIndex=s,T.test(e))){const h=(T.lastIndex-s)*t.width.control;if(r+h>i){const w=t.width.control>0?Math.floor((i-r)/t.width.control):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=T.lastIndex;continue}if(_.lastIndex=s,_.test(e)){if(r+t.width.emoji>i&&(o=Math.min(o,s),r+t.width.emoji>t.truncation.limit)){u=!0;break}r+=t.width.emoji,s=_.lastIndex;continue}const g=e.codePointAt(s)??0;if(wt(g)){s+=g>65535?2:1;continue}let p;if(a)p=ht(g,t);else switch(te(g)){case"control":{p=t.width.control;break}case"latin":{p=t.width.regular;break}case"wide":{p=t.width.wide;break}case"zero":{p=0;break}default:switch(J(g)){case"ambiguous":{p=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{p=t.width.fullWidth;break}case"wide":{p=t.width.wide;break}default:p=t.width.regular}}if(r+p>i&&(o=Math.min(o,s),r+p>t.truncation.limit)){u=!0;break}r+=p,s+=g>65535?2:1}let m=r,y=!1;return u&&t.truncation.limit>=t.truncation.ellipsisWidth&&(m=t.truncation.limit,y=!0),{ellipsed:y,index:u?o:c,truncated:u,width:m}},En=(e,n={})=>C(e,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,F=()=>f(me(),".vis"),mt=()=>f(F(),"cache"),bn=()=>f(F(),"state"),gt=e=>we("sha256").update(e).digest("hex").slice(0,12),xn=e=>f(F(),"workspaces",gt(e)),yt=".vis",j=e=>f(e,yt),vn="node_modules/.cache/vis",kn=e=>f(j(e),"runs"),Tn=e=>f(j(e),"last-summary.json"),In=e=>f(j(e),"last-failures"),Rn=e=>{const n=ge()==="win32";for(const t of[".task-runner",".task-runner-cache"]){const i=f(e,t);if(fe(i))try{const c=n?O("cmd.exe",["/c","rmdir","/s","/q",i],{detached:!0,stdio:"ignore"}):O("rm",["-rf",i],{detached:!0,stdio:"ignore"});c.on("error",()=>{}),c.unref()}catch{}}},St="https://api.socket.dev/v0/purl?alerts=true",k=()=>f(mt(),"socket-security"),$t=3600*1e3,ne=.4,K=100,Et=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm",bt=()=>{ve(k())},se=(e,n)=>`${encodeURIComponent(e)}@${encodeURIComponent(n)}`,xt=(e,n)=>{const t=se(e,n),i=f(k(),`${t}.json`);try{const c=ye(i);if(Date.now()-c.createdAt>c.ttlMs){Y(i,{force:!0});return}return c.report}catch{return}},vt=(e,n,t,i)=>{const c=se(e,n),a={createdAt:Date.now(),report:t,ttlMs:i};he(f(k(),`${c}.json`),JSON.stringify(a),"utf8")},kt=e=>{const n=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((n.reduce((t,i)=>t+i,0)/n.length).toFixed(2))},Tt=async(e,n={})=>{const{apiToken:t,cacheTtlMs:i=$t,timeoutMs:c=15e3}=n,a=new Map;if(e.length===0||!t)return a;const s=[];for(const u of e){const d=xt(u.name,u.version);d?a.set(`${u.name}@${u.version}`,d):s.push(u)}if(s.length===0)return a;const r=`Basic ${Buffer.from(`${t}:`).toString("base64")}`;bt();const o=[];for(let u=0;u<s.length;u+=K)o.push(s.slice(u,u+K));for(const u of o){const d=u.map(l=>({purl:`pkg:npm/${l.name}@${l.version}`})),m=new AbortController,y=setTimeout(()=>{m.abort()},c);try{const l=await fetch(St,{body:JSON.stringify({components:d}),headers:{Authorization:r,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:m.signal});if(!l.ok)continue;const g=await l.text();It(g,u,a,i)}catch{}finally{clearTimeout(y)}}return a},It=(e,n,t,i)=>{const c=new Map;for(const s of n)c.set(`${s.name}@${s.version}`,s);const a=e.split(`}
|
|
1
|
+
import{createRequire as oe}from"node:module";import{n as q,C as ue,o as le,m as de,e as f}from"./index-0dnGN3GP.js";import{y as B}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as ye}from"./package-version-C6xroAcI.js";let ce;const ae=e=>(ce??=oe(import.meta.url))(e),S=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=e=>{if(typeof S<"u"&&S.versions&&S.versions.node){const[n,t]=S.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return S.getBuiltinModule(e)}return ae(e)},{createRequire:N}=x("node:module"),{existsSync:fe,readdirSync:G,statSync:pe,rmSync:Y,writeFileSync:he}=x("node:fs"),{spawn:O}=x("node:child_process"),{createHash:we}=x("node:crypto"),{homedir:me,platform:ge}=x("node:os");let Se=class extends Error{constructor(n){super(`EEXIST: ${n}`)}get code(){return"EEXIST"}set code(n){throw new Error("Cannot overwrite code EEXIST")}get name(){return"AlreadyExistsError"}set name(n){throw new Error("Cannot overwrite name of AlreadyExistsError")}};const L=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let $e;const Ee=e=>($e??=N(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,be=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[n,t]=$.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return $.getBuiltinModule(e)}return Ee(e)},{lstatSync:P,mkdirSync:xe}=be("node:fs"),ve=e=>{q(e);try{const n=P(e);if(!n.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(n))}'`);return}catch(n){if(n.code!=="ENOENT")throw n}try{xe(e,{recursive:!0})}catch(n){if(n.code!=="EEXIST")throw n;const t=P(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(L(t))}'`,{cause:n})}},ke=e=>{if(typeof e!="string"&&!(e instanceof ArrayBuffer)&&!ArrayBuffer.isView(e))throw new TypeError("File contents must be a string, ArrayBuffer, or ArrayBuffer view.")};let Te;const Ie=e=>(Te??=N(import.meta.url))(e),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Re=e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[n,t]=E.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return E.getBuiltinModule(e)}return Ie(e)},{randomBytes:Be}=Re("node:crypto"),We=e=>`${e}.${process.pid.toString(36)}.${Be(6).toString("hex")}.tmp`,Ae=new TextEncoder,Me=e=>{if(e instanceof Uint8Array)return e;if(typeof e=="string")return Ae.encode(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e)){const n=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(n)}throw new TypeError("Invalid contents type. Expected string or ArrayBuffer.")};let _e;const Ce=e=>(_e??=N(import.meta.url))(e),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ne=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,t]=b.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return b.getBuiltinModule(e)}return Ce(e)},{mkdirSync:Fe,readFileSync:je,writeFileSync:De,statSync:Oe,renameSync:V,chownSync:Le,chmodSync:Pe,unlinkSync:Ve}=Ne("node:fs"),jt=(e,n,t)=>{t={backup:!1,encoding:"utf8",flag:"w",overwrite:!0,recursive:!0,...t},q(e),ke(n),e=ue(e);const i=B(e,le),c=t.flag??"w",a=c.includes("a"),s=c.includes("x");if(i&&(!t.overwrite||s))throw new Se(`file already exists, open '${e}'`);const r=We(e);try{!i&&t.recursive&&Fe(de(e),{recursive:!0});let o,u=typeof n=="string"?Buffer.from(n,t.encoding??"utf8"):Me(n);if(a&&i&&(u=Buffer.concat([je(e),u])),De(r,u,{flag:"wx"}),i&&t.backup&&(o=Oe(e),t.chown??={gid:o.gid,uid:o.uid},V(e,`${e}.bak`)),t.chown)try{Le(r,t.chown.uid,t.chown.gid)}catch{}const d=o&&t.mode===void 0?o.mode:t.mode;d!==void 0&&Pe(r,d),V(r,e)}catch(o){throw new Error(`Failed to write file at: ${e} - ${o.message}`,{cause:o})}finally{B(r)&&Ve(r)}},ze=[161,161,164,164,167,168,170,170,173,174,176,180,182,186,188,191,198,198,208,208,215,216,222,225,230,230,232,234,236,237,240,240,242,243,247,250,252,252,254,254,257,257,273,273,275,275,283,283,294,295,299,299,305,307,312,312,319,322,324,324,328,331,333,333,338,339,358,359,363,363,462,462,464,464,466,466,468,468,470,470,472,472,474,474,476,476,593,593,609,609,708,708,711,711,713,715,717,717,720,720,728,731,733,733,735,735,768,879,913,929,931,937,945,961,963,969,1025,1025,1040,1103,1105,1105,8208,8208,8211,8214,8216,8217,8220,8221,8224,8226,8228,8231,8240,8240,8242,8243,8245,8245,8251,8251,8254,8254,8308,8308,8319,8319,8321,8324,8364,8364,8451,8451,8453,8453,8457,8457,8467,8467,8470,8470,8481,8482,8486,8486,8491,8491,8531,8532,8539,8542,8544,8555,8560,8569,8585,8585,8592,8601,8632,8633,8658,8658,8660,8660,8679,8679,8704,8704,8706,8707,8711,8712,8715,8715,8719,8719,8721,8721,8725,8725,8730,8730,8733,8736,8739,8739,8741,8741,8743,8748,8750,8750,8756,8759,8764,8765,8776,8776,8780,8780,8786,8786,8800,8801,8804,8807,8810,8811,8814,8815,8834,8835,8838,8839,8853,8853,8857,8857,8869,8869,8895,8895,8978,8978,9312,9449,9451,9547,9552,9587,9600,9615,9618,9621,9632,9633,9635,9641,9650,9651,9654,9655,9660,9661,9664,9665,9670,9672,9675,9675,9678,9681,9698,9701,9711,9711,9733,9734,9737,9737,9742,9743,9756,9756,9758,9758,9792,9792,9794,9794,9824,9825,9827,9829,9831,9834,9836,9837,9839,9839,9886,9887,9919,9919,9926,9933,9935,9939,9941,9953,9955,9955,9960,9961,9963,9969,9972,9972,9974,9977,9979,9980,9982,9983,10045,10045,10102,10111,11094,11097,12872,12879,57344,63743,65024,65039,65533,65533,127232,127242,127248,127277,127280,127337,127344,127373,127375,127376,127387,127404,917760,917999,983040,1048573,1048576,1114109],Ue=12288,He=65510,Ke=[12288,12288,65281,65376,65504,65510],qe=8361,Ge=65518,Ye=[8361,8361,65377,65470,65474,65479,65482,65487,65490,65495,65498,65500,65512,65518],Xe=32,Je=10630,Ze=[32,126,162,163,165,166,172,172,175,175,10214,10221,10629,10630],Qe=4352,et=262141,X=[4352,4447,8986,8987,9001,9002,9193,9196,9200,9200,9203,9203,9725,9726,9748,9749,9776,9783,9800,9811,9855,9855,9866,9871,9875,9875,9889,9889,9898,9899,9917,9918,9924,9925,9934,9934,9940,9940,9962,9962,9970,9971,9973,9973,9978,9978,9981,9981,9989,9989,9994,9995,10024,10024,10060,10060,10062,10062,10067,10069,10071,10071,10133,10135,10160,10160,10175,10175,11035,11036,11088,11088,11093,11093,11904,11929,11931,12019,12032,12245,12272,12287,12289,12350,12353,12438,12441,12543,12549,12591,12593,12686,12688,12773,12783,12830,12832,12871,12880,42124,42128,42182,43360,43388,44032,55203,63744,64255,65040,65049,65072,65106,65108,65126,65128,65131,94176,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,119552,119638,119648,119670,126980,126980,127183,127183,127374,127374,127377,127386,127488,127490,127504,127547,127552,127560,127568,127569,127584,127589,127744,127776,127789,127797,127799,127868,127870,127891,127904,127946,127951,127955,127968,127984,127988,127988,127992,128062,128064,128064,128066,128252,128255,128317,128331,128334,128336,128359,128378,128378,128405,128406,128420,128420,128507,128591,128640,128709,128716,128716,128720,128722,128725,128728,128732,128735,128747,128748,128756,128764,128992,129003,129008,129008,129292,129338,129340,129349,129351,129535,129648,129660,129664,129674,129678,129734,129736,129736,129741,129756,129759,129770,129775,129784,131072,196605,196608,262141],v=(e,n)=>{let t=0,i=Math.floor(e.length/2)-1;for(;t<=i;){const c=Math.floor((t+i)/2),a=c*2;if(n<e[a])i=c-1;else if(n>e[a+1])t=c+1;else return!0}return!1},z=19968,[tt,nt]=st(X);function st(e){let n=e[0],t=e[1];for(let i=0;i<e.length;i+=2){const c=e[i],a=e[i+1];if(z>=c&&z<=a)return[c,a];a-c>t-n&&(n=c,t=a)}return[n,t]}const it=e=>e<161||e>1114109?!1:v(ze,e),rt=e=>e<Ue||e>He?!1:v(Ke,e),ot=e=>e<qe||e>Ge?!1:v(Ye,e),ct=e=>e<Xe||e>Je?!1:v(Ze,e),at=e=>e>=tt&&e<=nt?!0:e<Qe||e>et?!1:v(X,e);function ut(e){return it(e)?"ambiguous":rt(e)?"fullwidth":ot(e)?"halfwidth":ct(e)?"narrow":at(e)?"wide":"neutral"}function lt(e){if(!Number.isSafeInteger(e))throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}function J(e){return lt(e),ut(e)}const Z=String.raw,U=Z`\p{Emoji}(?:\p{EMod}|[\u{E0020}-\u{E007E}]+\u{E007F}|\uFE0F?\u20E3?)`,dt=()=>new RegExp(Z`\p{RI}{2}|(?)${U}(?:\u200D${U})*`,"gu"),Dt=new Set(["\x1B",""]),Ot="\x07",Lt="]8;;",Pt=/[\u200B\uFEFF\u2060-\u2064]/g,Q=/[\u001B\u009B](?:[[()#;?]{0,10}(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><]|\]8;;[^\u0007\u001B]{0,100}(?:\u0007|\u001B\\)|\][^\u0007\u001B]{0,1000}(?:\u0007|\u001B\\))/g,Vt=/\u001B\[[\d;]*m[^\u001B]*(?:\u001B\[[\d;]*m|$)/g,zt=/\u001B\]8;[^\u0007\u001B]*(?:\u0007|\u001B\\)[^\u001B]*\u001B\]8;;(?:\u0007|\u001B\\)/g,T=/[\u0000-\u0008\n-\u001F\u007F-\u009F]{1,1000}/y,ee=dt(),Ut=/[-_./\s]+/g,Ht=/(\u001B\[[0-9;]*[a-z])/i,Kt=new RegExp("\\p{Script=Arabic}","u"),qt=new RegExp("\\p{Script=Bengali}","u"),Gt=new RegExp("\\p{Script=Cyrillic}","u"),Yt=new RegExp("\\p{Script=Devanagari}","u"),Xt=new RegExp("\\p{Script=Ethiopic}","u"),Jt=new RegExp("\\p{Script=Greek}","u"),Zt=new RegExp("\\p{Script=Greek}+|\\p{Script=Latin}+|[^\\p{Script=Greek}\\p{Script=Latin}]+","gu"),Qt=new RegExp("\\p{Script=Gujarati}","u"),en=new RegExp("\\p{Script=Gurmukhi}","u"),tn=new RegExp("\\p{Script=Hangul}","u"),nn=new RegExp("\\p{Script=Hebrew}","u"),sn=new RegExp("\\p{Script=Hiragana}","u"),rn=new RegExp("\\p{Script=Han}","u"),on=new RegExp("\\p{Script=Kannada}","u"),cn=new RegExp("\\p{Script=Katakana}","u"),an=new RegExp("\\p{Script=Khmer}","u"),un=new RegExp("\\p{Script=Lao}","u"),ln=new RegExp("\\p{Script=Latin}","u"),dn=new RegExp("\\p{Script=Malayalam}","u"),fn=new RegExp("\\p{Script=Myanmar}","u"),pn=new RegExp("\\p{Script=Oriya}","u"),hn=new RegExp("\\p{Script=Sinhala}","u"),wn=new RegExp("\\p{Script=Tamil}","u"),mn=new RegExp("\\p{Script=Telugu}","u"),gn=new RegExp("\\p{Script=Thai}","u"),yn=new RegExp("\\p{Script=Tibetan}","u"),Sn=/[\u02BB\u02BC\u0027]/u,$n=e=>e.replace(ee,""),H=new Map,ft=e=>[e.ambiguousIsNarrow?1:0,e.control,e.fullWidth,e.regular,e.wide].join("|"),pt=e=>{const n=ft(e.width);let t=H.get(n);return t||(t=new Map,H.set(n,t)),t},I=new RegExp(Q.source,"y"),_=new RegExp(ee.source,"uy"),R=/(?:[\u0020-\u007E\u00A0-\u00FF](?!\uFE0F)){1,1000}/y,te=e=>e>=32&&e<=126?"latin":e===8203||e===8204||e===8205||e===8288?"zero":e<=31||e>=127&&e<=159?"control":e>=160&&e<=255||e>=9472&&e<=9599?"latin":e>=4352&&e<=4607||e>=11904&&e<=40959||e>=44032&&e<=55215||e>=63744&&e<=64255||e>=65280&&e<=65519&&!(e>=65377&&e<=65439)||e>=12352&&e<=12543?"wide":e===8230?"latin":"other",ht=(e,n)=>{const t=pt(n),i=Math.floor(e/65536),c=e%65536;let a=t.get(i);if(a||(a=new Map,t.set(i,a)),a.has(c))return a.get(c);let s;switch(te(e)){case"control":{s=n.width.control;break}case"latin":{s=n.width.regular;break}case"wide":{s=n.width.wide;break}case"zero":{s=0;break}default:switch(J(e)){case"ambiguous":{s=n.width.ambiguousIsNarrow?n.width.regular:n.width.wide;break}case"fullwidth":{s=n.width.fullWidth;break}case"wide":{s=n.width.wide;break}default:s=n.width.regular}}return a.set(c,s),s},wt=e=>e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071||e>=917760&&e<=917999||e>=65024&&e<=65039||e>=3633&&e<=3642||e>=3655&&e<=3662||e>=3761&&e<=3769||e>=3771&&e<=3772||e>=3784&&e<=3789||e>=2304&&e<=2307||e>=2362&&e<=2383||e>=2385&&e<=2391||e>=2402&&e<=2403||e>=2433&&e<=2435||e>=2492&&e<=2500||e>=2509&&e<=2509||e>=2561&&e<=2563||e>=2620&&e<=2637||e>=1611&&e<=1631||e>=1648&&e<=1648||e>=1750&&e<=1773||e>=2276&&e<=2302||e>=1425&&e<=1469||e>=1471&&e<=1471||e>=1473&&e<=1474||e>=1476&&e<=1477||e>=1479&&e<=1479||e>=3893&&e<=3893||e>=3895&&e<=3895||e>=3897&&e<=3897||e>=3953&&e<=3966||e>=3968&&e<=3972||e>=3974&&e<=3975?!0:e>=768&&e<=777||e>=803&&e<=803,C=(e,n={})=>{if(!e||e.length===0)return{ellipsed:!1,index:0,truncated:!1,width:0};const t={truncation:{countAnsiEscapeCodes:n.countAnsiEscapeCodes??!1,ellipsis:n.ellipsis??"",ellipsisWidth:n.ellipsisWidth??(n.ellipsis?C(n.ellipsis,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width:0),limit:n.limit??Number.POSITIVE_INFINITY},width:{ambiguousIsNarrow:n.ambiguousIsNarrow??!1,ansi:n.ansiWidth??0,control:n.controlWidth??0,emoji:n.emojiWidth??2,fullWidth:n.fullWidth??2,halfWidth:n.halfWidth??1,regular:n.regularWidth??1,tab:n.tabWidth??8,wide:n.wideWidth??2}},i=Math.max(0,t.truncation.limit-t.truncation.ellipsisWidth),{length:c}=e,a=c>1e4;let s=0,r=0,o=c,u=!1;const d=e.includes("\x1B")||e.includes("");for(;s<c;){if(d&&(e[s]==="\x1B"||e[s]==="")){if(e.startsWith("\x1B]8;;",s)){const h="\x1B]8;;\x07",w=h.length,W=e.indexOf("\x07",s+5);if(W!==-1){const A=e.indexOf(h,W+1);if(A!==-1){const ie=A+w,re=e.slice(W+1,A).replace(Q,""),D=C(re,{ambiguousIsNarrow:t.width.ambiguousIsNarrow,ansiWidth:t.width.ansi,controlWidth:t.width.control,countAnsiEscapeCodes:!1,ellipsis:t.truncation.ellipsis,ellipsisWidth:t.truncation.ellipsisWidth,emojiWidth:t.width.emoji,fullWidth:t.width.fullWidth,halfWidth:t.width.halfWidth,limit:Math.max(0,i-r),regularWidth:t.width.regular,tabWidth:t.width.tab,wideWidth:t.width.wide}),M=D.width;if(D.truncated)u=!0,o=Math.min(o,s);else if(r+M>i&&(o=Math.min(o,s),u=!0,r+M>t.truncation.limit))break;if(r+=M,s=ie,u&&r>=t.truncation.limit)break;continue}}}if(I.lastIndex=s,I.test(e)){const h=I.lastIndex-s,w=t.truncation.countAnsiEscapeCodes?h:t.width.ansi;if(r+w>i&&(o=Math.min(o,s),r+w>t.truncation.limit)){u=!0;break}r+=w,s=I.lastIndex;continue}}const l=e.codePointAt(s);if(l===8203||l===65279||l>=8288&&l<=8292){s+=1;continue}if(l===9){if(r+t.width.tab>i&&(o=Math.min(o,s),r+t.width.tab>t.truncation.limit)){u=!0;break}r+=t.width.tab,s+=1;continue}if(R.lastIndex=s,R.test(e)){const h=(R.lastIndex-s)*t.width.regular;if(r+h>i){const w=t.width.regular>0?Math.floor((i-r)/t.width.regular):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=R.lastIndex;continue}if((l<=31||l>=127&&l<=159)&&(T.lastIndex=s,T.test(e))){const h=(T.lastIndex-s)*t.width.control;if(r+h>i){const w=t.width.control>0?Math.floor((i-r)/t.width.control):0;if(o=Math.min(o,s+w),r+h>t.truncation.limit){u=!0;break}}r+=h,s=T.lastIndex;continue}if(_.lastIndex=s,_.test(e)){if(r+t.width.emoji>i&&(o=Math.min(o,s),r+t.width.emoji>t.truncation.limit)){u=!0;break}r+=t.width.emoji,s=_.lastIndex;continue}const g=e.codePointAt(s)??0;if(wt(g)){s+=g>65535?2:1;continue}let p;if(a)p=ht(g,t);else switch(te(g)){case"control":{p=t.width.control;break}case"latin":{p=t.width.regular;break}case"wide":{p=t.width.wide;break}case"zero":{p=0;break}default:switch(J(g)){case"ambiguous":{p=t.width.ambiguousIsNarrow?t.width.regular:t.width.wide;break}case"fullwidth":{p=t.width.fullWidth;break}case"wide":{p=t.width.wide;break}default:p=t.width.regular}}if(r+p>i&&(o=Math.min(o,s),r+p>t.truncation.limit)){u=!0;break}r+=p,s+=g>65535?2:1}let m=r,y=!1;return u&&t.truncation.limit>=t.truncation.ellipsisWidth&&(m=t.truncation.limit,y=!0),{ellipsed:y,index:u?o:c,truncated:u,width:m}},En=(e,n={})=>C(e,{...n,ellipsis:"",ellipsisWidth:0,limit:Number.POSITIVE_INFINITY}).width,F=()=>f(me(),".vis"),mt=()=>f(F(),"cache"),bn=()=>f(F(),"state"),gt=e=>we("sha256").update(e).digest("hex").slice(0,12),xn=e=>f(F(),"workspaces",gt(e)),yt=".vis",j=e=>f(e,yt),vn="node_modules/.cache/vis",kn=e=>f(j(e),"runs"),Tn=e=>f(j(e),"last-summary.json"),In=e=>f(j(e),"last-failures"),Rn=e=>{const n=ge()==="win32";for(const t of[".task-runner",".task-runner-cache"]){const i=f(e,t);if(fe(i))try{const c=n?O("cmd.exe",["/c","rmdir","/s","/q",i],{detached:!0,stdio:"ignore"}):O("rm",["-rf",i],{detached:!0,stdio:"ignore"});c.on("error",()=>{}),c.unref()}catch{}}},St="https://api.socket.dev/v0/purl?alerts=true",k=()=>f(mt(),"socket-security"),$t=3600*1e3,ne=.4,K=100,Et=e=>typeof e=="object"&&e!==null&&"id"in e&&"type"in e&&"name"in e&&"version"in e&&"alerts"in e&&"score"in e&&e.type==="npm",bt=()=>{ve(k())},se=(e,n)=>`${encodeURIComponent(e)}@${encodeURIComponent(n)}`,xt=(e,n)=>{const t=se(e,n),i=f(k(),`${t}.json`);try{const c=ye(i);if(Date.now()-c.createdAt>c.ttlMs){Y(i,{force:!0});return}return c.report}catch{return}},vt=(e,n,t,i)=>{const c=se(e,n),a={createdAt:Date.now(),report:t,ttlMs:i};he(f(k(),`${c}.json`),JSON.stringify(a),"utf8")},kt=e=>{const n=[e.license,e.maintenance,e.quality,e.supplyChain,e.vulnerability];return Number((n.reduce((t,i)=>t+i,0)/n.length).toFixed(2))},Tt=async(e,n={})=>{const{apiToken:t,cacheTtlMs:i=$t,timeoutMs:c=15e3}=n,a=new Map;if(e.length===0||!t)return a;const s=[];for(const u of e){const d=xt(u.name,u.version);d?a.set(`${u.name}@${u.version}`,d):s.push(u)}if(s.length===0)return a;const r=`Basic ${Buffer.from(`${t}:`).toString("base64")}`;bt();const o=[];for(let u=0;u<s.length;u+=K)o.push(s.slice(u,u+K));for(const u of o){const d=u.map(l=>({purl:`pkg:npm/${l.name}@${l.version}`})),m=new AbortController,y=setTimeout(()=>{m.abort()},c);try{const l=await fetch(St,{body:JSON.stringify({components:d}),headers:{Authorization:r,"Content-Type":"application/json","User-Agent":"@visulima/vis"},method:"POST",signal:m.signal});if(!l.ok)continue;const g=await l.text();It(g,u,a,i)}catch{}finally{clearTimeout(y)}}return a},It=(e,n,t,i)=>{const c=new Map;for(const s of n)c.set(`${s.name}@${s.version}`,s);const a=e.split(`}
|
|
2
2
|
`);for(const s of a){const r=s.trim();if(r)try{const o=JSON.parse(r.endsWith("}")?r:`${r}}`),d=`${o.namespace?`${o.namespace}/`:""}${o.name}`,m=`${d}@${o.version}`;if(!c.has(m))continue;const y=o.score.overall??kt(o.score),l={alerts:o.alerts,author:o.author,id:o.id,license:o.license,name:o.name,score:{...o.score,overall:y},size:o.size,type:"npm",version:o.version};o.namespace&&(l.namespace=o.namespace),Et(l)&&(t.set(m,l),vt(d,o.version,l,i))}catch{}}},Rt=e=>e.namespace?`${e.namespace}/${e.name}`:e.name,Bn=e=>e>=.8?"excellent":e>=.6?"good":e>=.4?"fair":e>=.2?"poor":"critical",Wn=e=>e>=.6?"green":e>=.4?"yellow":"red",An=e=>{const n=Rt(e),t=`score: ${String(Math.round(e.score.overall*100))}%`,i=e.alerts.length,c=i>0?`${String(i)} alert${i===1?"":"s"}`:"no alerts";return`${n}@${e.version} (${t}, ${c})`},Mn=(e,n=ne)=>{if(e.size===0)return"";let t=0,i=0,c=0,a=0,s=0,r=0;for(const u of e.values()){for(const d of u.alerts)switch(t++,d.severity){case"critical":{i++;break}case"high":{c++;break}case"medium":{a++;break}default:s++}u.score.overall<n&&r++}const o=[`Socket.dev: scanned ${String(e.size)} package${e.size===1?"":"s"}`];if(t>0){const u=[];i>0&&u.push(`${String(i)} critical`),c>0&&u.push(`${String(c)} high`),a>0&&u.push(`${String(a)} medium`),s>0&&u.push(`${String(s)} low`),o.push(` Alerts: ${String(t)} total (${u.join(", ")})`)}else o.push(" No security alerts found.");if(r>0){const u=Math.round(n*100);o.push(` ${String(r)} package${r===1?"":"s"} with low security score (<${String(u)}%)`)}return o.join(`
|
|
3
3
|
`)},Bt=()=>{const e=k();if(!B(e))return 0;const n=G(e).filter(t=>t.endsWith(".json"));for(const t of n)Y(f(e,t),{force:!0});return n.length},Wt=()=>{const e=k();if(!B(e))return{entries:0,newestEntry:void 0,oldestEntry:void 0,totalSizeBytes:0};const n=G(e).filter(a=>a.endsWith(".json"));let t=0,i,c;for(const a of n){const s=pe(f(e,a));t+=s.size;const{mtimeMs:r}=s;(i===void 0||r<i)&&(i=r),(c===void 0||r>c)&&(c=r)}return{entries:n.length,newestEntry:c,oldestEntry:i,totalSizeBytes:t}},At=(e,n)=>e?.enabled?{apiToken:e.apiToken??process.env.VIS_SOCKET_TOKEN,cacheTtlMs:e.cacheTtlMs,minimumScore:n??ne,timeoutMs:e.timeoutMs}:void 0,_n=(e,n,t,i)=>{if(!t)return;const c=Date.now(),a=r=>{if(r.expiresAt){const o=Date.parse(r.expiresAt);if(!Number.isNaN(o)&&o<c)return!1}return!(i&&r.policies&&!r.policies.includes(i))},s=`${e}@${n}`;if(t[s]&&a(t[s]))return t[s];if(t[e]&&a(t[e]))return t[e];for(const[r,o]of Object.entries(t))if(r.endsWith("*")&&e.startsWith(r.slice(0,-1))&&a(o))return o},Cn=(e,n,t,i)=>[" // Add to security.acceptedRisks in vis.config.ts:",` ${`"${e}"`}: {`,` reason: "${i}",`,` acceptedAt: "${new Date().toISOString()}",`,` acceptedScore: ${String(t)},`,' policies: ["score"],'," },"].join(`
|
|
4
4
|
`),Nn=(e,n={})=>{const t=At(e,n.minimumScore);if(t)return{clearCache:Bt,displayName:"Socket.dev",fetchReports:i=>Tt(i,t),getCacheStats:Wt,id:"socket"}},Fn=e=>{if(e===void 0)return!1;const n=e.trim().toLowerCase();return n!==""&&n!=="0"&&n!=="false"&&n!=="no"};export{fn as $,nn as A,Gt as B,Kt as C,vn as D,qt as E,tn as F,en as G,Yt as H,wn as I,mn as J,Zt as K,Ut as L,Qt as M,hn as N,Jt as O,on as P,gn as Q,ee as R,un as S,Ht as T,jt as U,yn as V,cn as W,Xt as X,dn as Y,Sn as Z,an as _,kn as a,pn as a0,Rn as a1,Vt as a2,zt as a3,Q as a4,C as a5,rt as a6,at as a7,Pt as a8,Dt as a9,Lt as aa,Ot as ab,Nn as ac,Mn as ad,Tn as ae,In as b,F as c,j as d,ne as e,Rt as f,mt as g,ve as h,_n as i,An as j,Bn as k,Cn as l,Fn as m,bn as n,kt as o,Tt as p,En as q,Bt as r,Wn as s,Wt as t,L as u,xn as v,$n as w,ln as x,rn as y,sn as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as d,z as u}from"./index-0dnGN3GP.js";import{a as l}from"./index--eV4qIz5.js";import{y as f}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as m}from"./package-version-
|
|
1
|
+
import{e as d,z as u}from"./index-0dnGN3GP.js";import{a as l}from"./index--eV4qIz5.js";import{y as f}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as m}from"./package-version-C6xroAcI.js";const v={sha1:40,sha224:56,sha256:64,sha384:96,sha512:128},p=o=>{const n=o.indexOf("+");if(n===-1)return;const t=o.slice(n+1),e=/^([a-z0-9]+)\.([0-9a-f]+)$/.exec(t),s=e?v[e[1]]:void 0;if(!(e&&s!==void 0&&e[2].length===s))return`packageManager "${o}" has a malformed integrity suffix. Expected "+<algo>.<hex>" with algo sha1, sha224, sha256, sha384 or sha512 and lowercase hex of the matching length (sha512 = 128 characters).`},k=[".nvmrc",".node-version"],y=o=>{const n=d(o,"package.json");if(!f(n))return{};try{return m(n)??{}}catch{return{}}},c=(o,n)=>{const t=[];for(const{name:e,version:s}of n){const a=typeof s=="string"&&s.trim()!==""?s.trim():"*";l.validRange(a)!==null&&t.push({name:e,range:a})}if(t.length!==0)return{entries:t,label:o,value:n.map(e=>typeof e.version=="string"&&e.version!==""?`${e.name}@${e.version}`:e.name).join(" | ")}},h=(o,n)=>{const t=Array.isArray(o)?o:[o],e=[];for(const s of t){if(typeof s!="object"||s===null)continue;const{name:a,onFail:r,version:i}=s;typeof a!="string"||n!==void 0&&a!==n||e.push({name:a,onFail:typeof r=="string"?r:void 0,version:i})}return e},E=(o,n)=>{const t=d(o,n);if(f(t))try{const e=u(t).trim();return e===""?void 0:e}catch{return}},x=(o,n)=>{const t=[];for(const r of k){const i=E(o,r);i!==void 0&&t.push(c(r,[{name:"node",version:i}]))}const e=n.engines;e&&typeof e.node=="string"&&t.push(c("engines.node",[{name:"node",version:e.node}]));const s=n.devEngines;s?.runtime!==void 0&&t.push(c("devEngines.runtime",h(s.runtime,"node")));const a=n.volta;return a&&typeof a.node=="string"&&t.push(c("volta.node",[{name:"node",version:a.node}])),t.filter(r=>r!==void 0)},$=o=>{const n=[],t=[];if(typeof o.packageManager=="string"){const s=o.packageManager,a=p(s);a&&t.push(a);const[r]=s.split("+",1),i=/^([^@]+)@(.+)$/.exec(r??"");i&&n.push(c("packageManager",[{name:i[1],version:i[2]}]))}const e=o.devEngines;if(e?.packageManager!==void 0){const s=h(e.packageManager);n.push(c("devEngines.packageManager",s))}return{declarations:n.filter(s=>s!==void 0),integrityIssues:t}},M=(o,n)=>o.entries.some(t=>n.entries.some(e=>t.name===e.name&&l.intersects(t.range,e.range))),g=(o,n)=>{const t=[];for(let e=0;e<n.length;e++)for(let s=e+1;s<n.length;s++){const a=n[e],r=n[s];M(a,r)||t.push(`Conflicting ${o} declarations: ${a.label} (${a.value}) and ${r.label} (${r.value}) have no version in common. vis does not pick one; align them.`)}return t},P=o=>{const n=y(o),t=x(o,n),{declarations:e,integrityIssues:s}=$(n),a=t.length+e.length;if(a===0&&s.length===0)return[{id:"env-declarations",message:"No Node.js or package-manager declarations to cross-check.",status:"skip"}];const r=[...g("Node.js",t),...g("package-manager",e)].map(i=>({id:"env-conflict",message:i,status:"warn"}));for(const i of s)r.push({id:"env-integrity",message:i,status:"warn"});return r.length===0?[{id:"env-declarations",message:`Node.js and package-manager declarations agree (${a} checked).`,status:"ok"}]:r};export{P as c,h as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{e as j}from"./index-0dnGN3GP.js";import{b as F}from"./env-
|
|
1
|
+
import{createRequire as p}from"node:module";import{e as j}from"./index-0dnGN3GP.js";import{b as F}from"./env-BUf_aJzW.js";let h;const m=t=>(h??=p(import.meta.url))(t),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=t=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[e,r]=s.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return s.getBuiltinModule(t)}return m(t)},{mkdirSync:f,writeFileSync:y,readdirSync:g}=c("node:fs"),{readFile:_}=c("node:fs/promises"),i=t=>F(t),a=(t,e)=>j(i(t),`${encodeURIComponent(e)}.json`);class R{#e;#t;constructor(e,r){this.#e=e,this.#t=r}printTaskTerminalOutput(e,r,o){if(r!=="failure")return;const n=i(this.#e);try{f(n,{recursive:!0})}catch{return}const u=e.overrides.command,d=e.projectRoot,l={command:u,cwd:d,exitCode:void 0,hash:e.hash,runId:this.#t,status:r,taskId:e.id,terminalOutput:o,timestamp:new Date().toISOString()};try{y(a(this.#e,e.id),`${JSON.stringify(l,void 0,2)}
|
|
2
2
|
`,"utf8")}catch{}}}const S=async(t,e)=>{const r=a(t,e);try{const o=await _(r,"utf8");return JSON.parse(o)}catch{return}},b=t=>{const e=i(t);let r;try{r=g(e)}catch{return[]}const o=[];for(const n of r)if(n.endsWith(".json"))try{o.push(decodeURIComponent(n.slice(0,-5)))}catch{}return o};export{R as F,S as a,b as l};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as t}from"./registry-B5KGXKED.js";const s=async(a,o)=>await t(a,o);export{s as l};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e}from"./vis-user-error-
|
|
1
|
+
import{b as e}from"./vis-user-error-DjdeJsEK.js";const o={filter:{alias:"F",description:"Filter packages by name pattern",multiple:!0,type:String},parallel:{defaultValue:!1,description:"Run concurrently without topological ordering",type:Boolean},recursive:{alias:"r",defaultValue:!1,description:"Run in every workspace package",type:Boolean},reverse:{defaultValue:!1,description:"Reverse topological execution order",type:Boolean},"shell-mode":{alias:"c",defaultValue:!1,description:"Execute within shell environment",type:Boolean},"workspace-root":{alias:"w",defaultValue:!1,description:"Run on workspace root only",type:Boolean}},l=e({argument:{description:"Command to execute followed by arguments",name:"command",type:String},description:"Execute a local node_modules/.bin command (no remote fallback)",examples:[["vis exec eslint .","Run local eslint"],["vis exec tsc --noEmit","Run local TypeScript check"],["vis exec -r -- eslint .","Run in all workspace packages"],["vis exec -c 'echo $PATH'","Shell mode"]],group:"Run & Execute",loader:()=>import("../packem_chunks/handler.js"),name:"exec",options:o});export{l as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as k,D as S,f as L}from"./provenance-
|
|
1
|
+
import{m as k,D as S,f as L}from"./provenance-Cv6Fj_BX.js";import{g as $}from"./packument-DZRLzoJA.js";import{i as f}from"./env-BUf_aJzW.js";import{a as E}from"./build-scripts-BtdNDGRO.js";import{n as h}from"./license-DvlYdo6T.js";import{v as A,U as P,z as x}from"./index-0dnGN3GP.js";import{S as O}from"./lockfile-DhHAaHN5.js";import{L as b}from"./dependency-scan-BmnwM6FX.js";import{a as M}from"./advisories-DzWrfMwP.js";const C=2,m=4,y={CRITICAL:0,HIGH:1,LOW:3,MODERATE:C,UNKNOWN:m},le=(e,s)=>{const n=y[(e.vulnerability.severity??"UNKNOWN").toUpperCase()]??m,t=y[(s.vulnerability.severity??"UNKNOWN").toUpperCase()]??m;return n-t||e.packageName.localeCompare(s.packageName)||e.packageVersion.localeCompare(s.packageVersion)},D=(e,s)=>{const n=y[s.toUpperCase()]??C;return(y[e.toUpperCase()]??m)<=n},R=["firstSeen","installScripts","license","malware","publisherChange","score","unexpectedDeps","vulnerability"],w=6e4,W=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},U=async(e,s)=>{const n=s.security?.policies?.firstSeen;if(n?.minutes===void 0||n.minutes<=0)return[];const{minutes:t}=n,r=n.exclude??[],c=s.security?.acceptedRisks,a=t*w,o=Date.now();return(await k(e.packages,S,async l=>{if(W(l.name,l.version,r))return;const p=await $(l.name,{workspaceRoot:e.workspaceRoot});if(p===void 0)return;const u=p.time?.[l.version];if(u===void 0)return;const d=Date.parse(u);if(Number.isNaN(d))return;const v=o-d;if(v>=a)return;const g=Math.max(0,Math.floor(v/w));return{acceptedRisk:f(l.name,l.version,c,"firstSeen"),data:{ageMinutes:g,minimumMinutes:t,publishedAt:u},packageName:l.name,policy:"firstSeen",reason:`${l.name}@${l.version} was published ${String(g)} min ago — below the ${String(t)} min firstSeen cooldown.`,severity:"block",version:l.version}})).filter(l=>l!==void 0)},_=(e,s)=>{const n=s.security?.policies?.installScripts;if(!n)return[];const t=n.allow??{},r=n.strict===!0;if(!r&&Object.keys(t).length===0)return[];const c=E(e.workspaceRoot,t,{pinVersions:s.security?.pinVersions===!0});if(c.unapproved.length===0)return[];const a=s.security?.acceptedRisks,o=r?"block":"warn";return c.unapproved.map(i=>({acceptedRisk:f(i.name,i.version??"*",a,"installScripts"),data:{hooks:i.hooks},packageName:i.name,policy:"installScripts",reason:`${i.name}${i.version?`@${i.version}`:""} declares unapproved build script(s): ${i.hooks.join(", ")}`,severity:o,version:i.version??"*"}))},I=new Set(["AND","OR"]),F=e=>{const s=e.replaceAll("("," ").replaceAll(")"," ").split(/\s+/).map(r=>r.trim()).filter(r=>r.length>0),n=[];let t=!1;for(const r of s){const c=r.toUpperCase();if(t){t=!1;continue}if(c==="WITH"){t=!0;continue}if(I.has(c))continue;const a=r.endsWith("+"),o=a?r.slice(0,-1):r,i=h(o)??o;n.push(i),a&&n.push(`${i}-or-later`)}return n},T=e=>{if(typeof e.license=="string"){const s=e.license.trim();return s.length>0?s:void 0}if(e.license&&typeof e.license=="object"&&typeof e.license.type=="string"){const s=e.license.type.trim();if(s.length>0)return s}if(Array.isArray(e.licenses)&&e.licenses.length>0){const s=e.licenses.map(n=>n&&typeof n.type=="string"?n.type.trim():"").filter(n=>n.length>0);if(s.length>0)return s.length===1?s[0]:`(${s.join(" OR ")})`}},V=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(n.has(t.toLowerCase()))return t},K=(e,s)=>{if(s.length===0)return;const n=new Set(s.map(t=>h(t)??t).map(t=>t.toLowerCase()));for(const t of e)if(!n.has(t.toLowerCase()))return t},j=(e,s)=>{const n=s.security?.policies?.license;if(!n)return[];const t=n.allow??[],r=n.deny??[];if(t.length===0&&r.length===0)return[];const c=s.security?.acceptedRisks,a=[];for(const o of e.packages){const i=e.manifestData?.get(`${o.name}@${o.version}`),l=i?T(i):void 0;if(!l){t.length>0&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:null},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} declares no license; allow-list mode requires one of: ${t.join(", ")}`,severity:"block",version:o.version});continue}const p=F(l),u=V(p,r);if(u){a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{declaredLicense:l,deniedLicense:u},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses denied license '${u}' (declared: ${l})`,severity:"block",version:o.version});continue}const d=K(p,t);d&&a.push({acceptedRisk:f(o.name,o.version,c,"license"),data:{allowList:t,declaredLicense:l,unallowedLicense:d},packageName:o.name,policy:"license",reason:`${o.name}@${o.version} uses license '${d}' which is not on the allow-list (declared: ${l})`,severity:"block",version:o.version})}return a},z=6e4,B=(e,s,n)=>{for(const t of n)if(t===e||t===`${e}@${s}`||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},Y=async(e,s)=>{const n=s.security?.policies?.publisherChange;if(n?.mode!=="no-downgrade")return[];const t=n.exclude??[],r=typeof n.ignoreAfter=="number"?n.ignoreAfter*z:void 0,c=s.security?.acceptedRisks,a=Date.now();return(await k(e.packages,S,async i=>{if(B(i.name,i.version,t))return;const l=await $(i.name,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;if(r!==void 0){const d=l.time?.[i.version],v=d===void 0?Number.NaN:Date.parse(d);if(!Number.isNaN(v)&&a-v>r)return}if(l.versions[i.version]?.dist?.attestations?.provenance!==void 0)return;const u=L(l,i.version);if(u!==void 0)return{acceptedRisk:f(i.name,i.version,c,"publisherChange"),data:{priorVersionWithProvenance:u},packageName:i.name,policy:"publisherChange",reason:`${i.name}@${i.version} dropped the provenance attestation that ${i.name}@${u} carried — publisher trust downgrade.`,severity:"block",version:i.version}})).filter(i=>i!==void 0)},H=e=>{for(const s of Object.values(b))for(const n of[s.file,...s.aliases??[]])if(e===n||e.endsWith(`/${n}`)||e.endsWith(`.${n}`))return s.type},q=(e,s,n)=>{const t=A(s)?s:P(e,s);let r;try{r=x(t)}catch{return}const c=H(t)??b[n]?.type;if(!c)return;const a=O(r,c);if(a.length===0)return;const o=new Set;for(const i of a)o.add(`${i.name}@${i.version}`);return o},G=(e,s)=>{for(const n of s)if(n===e||n.endsWith("*")&&e.startsWith(n.slice(0,-1)))return!0;return!1},X=(e,s)=>{const n=s.security?.policies?.unexpectedDeps;if(!n)return[];const t=n.allow??[],r=n.baselineLockfile;if(t.length===0&&!r)return[];const c=r?q(e.workspaceRoot,r,e.packageManager):void 0,a=s.security?.acceptedRisks,o=[];for(const i of e.packages){const l=t.length===0||G(i.name,t),p=c?c.has(`${i.name}@${i.version}`):!0;if(l&&p)continue;const u=[],d={};l||(u.push(`not on allow-list (${t.length} entr${t.length===1?"y":"ies"})`),d.allowList=t),!p&&c&&(u.push(`not present in baseline lockfile (${r})`),d.baselineLockfile=r),o.push({acceptedRisk:f(i.name,i.version,a,"unexpectedDeps"),data:d,packageName:i.name,policy:"unexpectedDeps",reason:`${i.name}@${i.version} is unexpected: ${u.join("; ")}`,severity:"block",version:i.version})}return o},J=(e,s)=>{if(!e.osvFindings||e.osvFindings.size===0)return[];const t=s.security?.policies?.vulnerability?.failOn,r=s.security?.acceptedRisks,c=[];for(const a of e.packages){const o=e.osvFindings.get(M(a.name,a.version))??e.osvFindings.get(a.name);if(!(!o||o.length===0))for(const i of o){const l=t?D(i.severity,t)?"block":"warn":"info";c.push({acceptedRisk:f(a.name,a.version,r,"vulnerability"),data:{advisoryId:i.id,aliases:i.aliases??[],cvssScore:i.cvssScore,fixedVersions:i.fixedVersions,severity:i.severity,summary:i.summary},packageName:a.name,policy:"vulnerability",reason:`${i.severity} ${i.id} affects ${a.name}@${a.version}: ${i.summary}`,severity:l,version:a.version})}}return c},N=[{evaluate:J,isConfigured:e=>e.security?.policies?.vulnerability!==void 0,name:"vulnerability",offlineSupported:!0,surfaces:["audit","doctor"]},{evaluate:j,isConfigured:e=>{const s=e.security?.policies?.license;return!!(s&&(s.allow&&s.allow.length>0||s.deny&&s.deny.length>0))},name:"license",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:_,isConfigured:e=>{const s=e.security?.policies?.installScripts;return!!(s&&(s.allow&&Object.keys(s.allow).length>0||s.strict===!0))},name:"installScripts",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:X,isConfigured:e=>{const s=e.security?.policies?.unexpectedDeps;return!!(s&&(s.allow&&s.allow.length>0||typeof s.baselineLockfile=="string"))},name:"unexpectedDeps",offlineSupported:!0,surfaces:["audit","doctor","install"]},{evaluate:U,isConfigured:e=>{const s=e.security?.policies?.firstSeen?.minutes;return typeof s=="number"&&s>0},name:"firstSeen",offlineSupported:!1,surfaces:["audit","doctor","install"]},{evaluate:Y,isConfigured:e=>e.security?.policies?.publisherChange?.mode==="no-downgrade",name:"publisherChange",offlineSupported:!1,surfaces:["audit","doctor","install"]}],Q=(e,s,n)=>N.filter(t=>t.surfaces.includes(e)?n!==void 0?n.has(t.name):t.isConfigured(s):!1),ue=async(e,s,n)=>{const t=Q(s,n.visConfig,n.enabledPolicies),r=[];for(const c of t){if(e.offline&&!c.offlineSupported){r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} skipped: requires network (--offline)`,severity:"info",version:"*"});continue}try{const a=await c.evaluate(e,n.visConfig);r.push(...a)}catch(a){const o=a instanceof Error?a.message:String(a);r.push({packageName:"*",policy:c.name,reason:`policy.${c.name} failed: ${o}`,severity:"info",version:"*"})}}return r},Z=(()=>{const e=new Map;for(const s of R)e.set(s.toLowerCase(),s);return e})(),de=()=>N.map(e=>e.name),pe=(e,s)=>{if(e===void 0)return;const n=e.trim().toLowerCase();if(n===""||n==="none")return new Set;if(n==="all")return new Set(R);const t=new Set;for(const r of e.split(",").map(c=>c.trim()).filter(c=>c.length>0)){const c=r.replace(/^_+/,"").replaceAll(/_+([a-z])/g,(o,i)=>i.toUpperCase()),a=Z.get(c.toLowerCase());a===void 0?s?.(r):t.add(a)}return t};export{le as c,ue as e,de as g,pe as p,D as s};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const N=["CRITICAL","HIGH","MODERATE","LOW","UNKNOWN"],S={CRITICAL:"error",HIGH:"error",LOW:"note",MODERATE:"warning",UNKNOWN:"none"},T={CRITICAL:"critical",HIGH:"high",LOW:"low",MODERATE:"medium",UNKNOWN:"none"},E={CRITICAL:9.5,HIGH:8,LOW:2.5,MODERATE:5.5,UNKNOWN:0},L=e=>S[e],g=e=>T[e],h=e=>E[e],O=e=>typeof e.cvssScore=="number"&&Number.isFinite(e.cvssScore)?e.cvssScore:h(e.severity),R=e=>O(e).toFixed(1),k=e=>e.startsWith("CVE-")?`https://nvd.nist.gov/vuln/detail/${e}`:e.startsWith("GHSA-")?`https://github.com/advisories/${e}`:`https://osv.dev/vulnerability/${e}`,F=e=>e.startsWith("CVE-")?"NVD":e.startsWith("GHSA-")?"GitHub Advisory Database":"OSV",C=/[\u0000-\u0008\v\f\u000E-\u001F\uFFFE\uFFFF]/g,A=e=>e.replaceAll(C,""),l=e=>A(e).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),v=e=>`<![CDATA[${A(e).replaceAll("]]>","]]]]><![CDATA[>")}]]>`,I=e=>{let s="";return e.status==="skipped"?s=` <skipped/>
|
|
2
|
+
`:e.status==="failure"?s=` <failure type="${l(e.failureType)}" message="${l(e.failureMessage)}">${v(e.failureText)}</failure>
|
|
3
|
+
`:e.systemOut!==void 0&&(s=` <system-out>${v(e.systemOut)}</system-out>
|
|
4
|
+
`),` <testcase classname="${l(e.classname)}" name="${l(e.name)}">
|
|
5
|
+
${s} </testcase>
|
|
6
|
+
`},y=(e,s,p)=>{const u=s.filter(a=>a.status==="failure").length,i=s.filter(a=>a.status==="skipped").length,c=s.length,f=s.map(a=>I(a)).join("");return` <testsuite name="${l(e)}" tests="${String(c)}" failures="${String(u)}" skipped="${String(i)}" errors="0" timestamp="${l(p)}" time="0">
|
|
7
|
+
${f} </testsuite>
|
|
8
|
+
`},H=e=>{const s=(e.now??new Date).toISOString().replace(/\.\d{3}Z$/,""),p=e.suiteName??"vis-audit",u=e.findings.map(t=>{const{acknowledged:n,packageName:m,packageVersion:$,vulnerability:r}=t,d=r.fixedVersions.length>0?` (fix: ${r.fixedVersions.join(", ")})`:"";return{classname:`${m}@${$}`,failureMessage:`${g(r.severity).toUpperCase()} ${r.id} — ${r.summary.split(`
|
|
9
|
+
`)[0]?.slice(0,200)??r.id}`,failureText:`${r.id}: ${m}@${$}
|
|
10
|
+
${r.summary||`Advisory ${r.id}`}${d}`,failureType:g(r.severity).toUpperCase(),name:r.id,status:n?"skipped":"failure"}}),i=(e.policyDecisions??[]).filter(t=>t.policy!=="vulnerability").map(t=>{let n;return t.acceptedRisk?n="skipped":t.severity==="info"?n="passing":n="failure",{classname:`${t.packageName}@${t.version}`,failureMessage:`${t.severity.toUpperCase()} vis.policy.${t.policy}`,failureText:t.reason,failureType:t.severity.toUpperCase(),name:`vis.policy.${t.policy}`,status:n,...n==="passing"?{systemOut:t.reason}:{}}}),c=u.length+i.length,f=u.filter(t=>t.status==="failure").length+i.filter(t=>t.status==="failure").length,a=u.filter(t=>t.status==="skipped").length+i.filter(t=>t.status==="skipped").length;let o=`<?xml version="1.0" encoding="UTF-8"?>
|
|
11
|
+
<testsuites name="${l(p)}" tests="${String(c)}" failures="${String(f)}" skipped="${String(a)}" errors="0" time="0">
|
|
12
|
+
`;return o+=y("vulnerabilities",u,s),i.length>0&&(o+=y("policies",i,s)),o+=`</testsuites>
|
|
13
|
+
`,o};export{N as S,k as a,O as b,v as c,F as d,l as e,g as f,R as g,H as h,L as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as K}from"node:module";import{n as E,o as z,C as S,d as X,e as h}from"./index-0dnGN3GP.js";import{u as D,v as rt}from"./env-
|
|
1
|
+
import{createRequire as K}from"node:module";import{n as E,o as z,C as S,d as X,e as h}from"./index-0dnGN3GP.js";import{u as D,v as rt}from"./env-BUf_aJzW.js";import{N as it}from"./package-version-C6xroAcI.js";import{withEnhancedPath as lt}from"@visulima/task-runner";let V;const U=t=>(V??=K(import.meta.url))(t),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,o]=f.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return f.getBuiltinModule(t)}return U(t)},{Socket:Y}=l("node:net"),{randomBytes:J}=l("node:crypto"),{readdir:Q,rm:b,unlink:$,open:Z,readFile:tt,stat:et,writeFile:ot,rename:st}=l("node:fs/promises"),{createRequire:M}=l("node:module"),{spawn:nt}=l("node:child_process"),{openSync:ct,closeSync:at}=l("node:fs");let ht;const dt=t=>(ht??=M(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,o]=u.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return u.getBuiltinModule(t)}return dt(t)},{lstat:A,mkdir:ut}=ft("node:fs/promises"),pt=async t=>{E(t);try{const e=await A(t);if(!e.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(e))}'`);return}catch(e){if(e.code!=="ENOENT")throw e}try{await ut(t,{recursive:!0})}catch(e){if(e.code!=="EEXIST")throw e;const o=await A(t);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(D(o))}'`,{cause:e})}};let wt;const yt=t=>(wt??=M(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kt=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[e,o]=p.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return p.getBuiltinModule(t)}return yt(t)},{access:mt}=kt("node:fs/promises");async function _t(t,e=z){E(t),t=S(t);try{return await mt(t,e),!0}catch{return!1}}let gt;const vt=t=>(gt??=M(import.meta.url))(t),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=t=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,o]=w.versions.node.split(".").map(Number);if(e>22||e===22&&o>=3||e===20&&o>=16)return w.getBuiltinModule(t)}return vt(t)},{readFile:bt}=x("node:fs/promises"),{unzip:Tt,brotliDecompress:Et}=x("node:zlib"),St={brotli:Et,gzip:Tt,none:(t,e)=>{e(null,t)}},Mt=async(t,e)=>{E(t),t=S(t);const{buffer:o,compression:s,encoding:r,flag:i}=e??{};let n;try{n=await bt(t,i?{flag:i}:{})}catch(c){throw X(c,t)}return await new Promise((c,g)=>{St[s??"none"](n,(k,m)=>{k?g(k):c(o?m:m.toString(r??"utf8"))})})};async function C(t,e,o){const s=await Mt(t,{buffer:!0,encoding:void 0});let r=new TextDecoder().decode(s);const{beforeParse:i,color:n}={};return typeof i=="function"&&(r=i(r)),it(r,e,S(t),{color:n})}const H=384,L=5e3,Ht=50,Rt=3e4,d=async t=>{const e=h(rt(t),"services");try{await pt(e)}catch(o){throw o.code==="ENOTDIR"?new Error(`Service registry path ${e} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:o}):o}return e},R=t=>t.replaceAll("/","_").replaceAll(":","__"),P=(t,e)=>h(t,`${R(e)}.json`),Pt=(t,e)=>h(t,`${R(e)}.lock`),_=async(t,e)=>{const o=await d(t),s=P(o,e);if(await _t(s))try{return await C(s)}catch{return}},$t=async t=>{const e=await d(t);let o;try{o=await Q(e)}catch{return[]}const s=[];for(const r of o)if(r.endsWith(".json"))try{const i=await C(h(e,r));s.push(i)}catch{}return s},Dt=async(t,e)=>{const o=await d(t),s=P(o,e.id),r=h(o,`.${J(8).toString("hex")}.tmp`);await ot(r,`${JSON.stringify(e,void 0,2)}
|
|
2
2
|
`,{mode:H});try{await It(r,s)}catch(i){throw await b(r,{force:!0}).catch(()=>{}),i}},At=new Set(["EACCES","EBUSY","EPERM"]),Lt=8,Ot=20,It=async(t,e)=>{let o=0;for(;;)try{await st(t,e);return}catch(s){const{code:r}=s;if(!(r!==void 0&&At.has(r))||o>=Lt)throw s;const n=Ot*2**o;await new Promise(c=>{setTimeout(c,n)}),o+=1}},y=async(t,e,o)=>{const s=await d(t),r=o??await _(t,e);await b(P(s,e),{force:!0}),r&&await b(r.logFile,{force:!0}).catch(()=>{})},a=t=>{try{return process.kill(t,0),!0}catch{return!1}},oe=async t=>{const e=await $t(t),o=[],s=[];for(const r of e){if(a(r.pid)){s.push(r);continue}const i=await _(t,r.id);if(i&&i.pid!==r.pid){s.push(i);continue}await y(t,r.id,r).catch(()=>{}),o.push(r.id)}return{pruned:o,surviving:s}},xt=t=>new Promise(e=>{setTimeout(e,t)}),Ct=async t=>{try{const e=await Z(t,"wx",H);try{await e.writeFile(String(process.pid))}finally{await e.close().catch(()=>{})}return!0}catch(e){if(e.code==="EEXIST")return!1;throw e}},Nt=async t=>{let e;try{const o=await tt(t,"utf8"),s=Number.parseInt(o.trim(),10);e=Number.isFinite(s)?s:void 0}catch{return!0}if(e!==void 0&&!a(e))return!0;try{const o=await et(t);return Date.now()-o.mtimeMs>Rt}catch{return!0}},N=async(t,e,o)=>{const s=await d(t),r=Pt(s,e),i=Date.now();for(;!await Ct(r);){if(await Nt(r)){await $(r).catch(()=>{});continue}if(Date.now()-i>=L)throw new Error(`Could not acquire service lock for ${e} within ${String(L)}ms — another \`vis service\` invocation appears to be holding it.`);await xt(Ht)}try{return await o()}finally{await $(r).catch(()=>{})}};function T(t,e={},o){for(const s in t){const r=t[s],i=o?`${o}:${s}`:s;typeof r=="object"&&r!==null?T(r,e,i):typeof r=="function"&&(e[i]=r)}return e}const F=(()=>{if(console.createTask)return console.createTask;const t={run:e=>e()};return()=>t})();function j(t,e,o,s){for(let r=o;r<t.length;r+=1)try{const i=s?s.run(()=>t[r](...e)):t[r](...e);if(i&&typeof i.then=="function")return Promise.resolve(i).then(()=>j(t,e,r+1,s))}catch(i){return Promise.reject(i)}}function Ft(t,e,o){if(t.length>0)return j(t,e,0,F(o))}function jt(t,e,o){if(t.length>0){const s=F(o);return Promise.all(t.map(r=>s.run(()=>r(...e))))}}function v(t,e){for(const o of[...t])o(e)}var Wt=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,o={}){if(!t||typeof e!="function")return()=>{};const s=t;let r;for(;this._deprecatedHooks[t];)r=this._deprecatedHooks[t],t=r.to;if(r&&!o.allowDeprecated){let i=r.message;i||(i=`${s} hook has been deprecated`+(r.to?`, please use ${r.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let o,s=(...r)=>(typeof o=="function"&&o(),o=void 0,s=void 0,e(...r));return o=this.hook(t,s),o}removeHook(t,e){const o=this._hooks[t];if(o){const s=o.indexOf(e);s!==-1&&o.splice(s,1),o.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const o=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of o)this.hook(t,s)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=T(t),o=Object.keys(e).map(s=>this.hook(s,e[s]));return()=>{for(const s of o)s();o.length=0}}removeHooks(t){const e=T(t);for(const o in e)this.removeHook(o,e[o])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(Ft,t,e)}callHookParallel(t,...e){return this.callHookWith(jt,t,e)}callHookWith(t,e,o){const s=this._before||this._after?{name:e,args:o,context:{}}:void 0;this._before&&v(this._before,s);const r=t(this._hooks[e]?[...this._hooks[e]]:[],o,e);return r instanceof Promise?r.finally(()=>{this._after&&s&&v(this._after,s)}):(this._after&&s&&v(this._after,s),r)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function Bt(){return new Wt}const se=()=>Bt(),re=async(t,e)=>{if(!(!e||e.length===0))for(const o of e){if(o.hooks)for(const[s,r]of Object.entries(o.hooks)){const i=Array.isArray(r)?r:[r];for(const n of i)t.hook(s,n)}o.setup&&await o.setup(t)}};class ie{#o;#e;#s=new Map;constructor(e,o){this.#o=e,this.#e=o}startTasks(e){for(const o of e)this.#s.set(o.id,o),this.#t("task:before",o)}endTasks(e){for(const o of e)this.#s.delete(o.task.id),this.#t("task:after",o.task,o),o.status==="failure"?this.#t("task:failure",o.task,o):Gt(o.status)&&this.#t("task:cacheHit",o.task,o)}printCacheMiss(e,o){this.#t("task:cacheMiss",e,o)}onTaskStdout(e,o){this.#t("task:stdout",e,o)}onTaskStderr(e,o){this.#t("task:stderr",e,o)}#t(e,...o){Promise.resolve(this.#o.callHook(e,...o)).catch(s=>{if(this.#e)try{this.#e(e,s)}catch{}})}}const Gt=t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache",qt=3e4,W=100;class Kt extends Error{constructor(e,o){super(e),this.elapsedMs=o,this.name="ServiceReadinessError"}elapsedMs}const Vt=async t=>{const e=t.host??"127.0.0.1",{port:o}=t,s=t.timeoutMs??qt,r=Date.now();for(;Date.now()-r<s;){if(await Ut(e,o))return;await zt(W)}throw new Kt(`Timed out waiting for ${e}:${String(o)} to accept TCP connections (${String(s)}ms)`,Date.now()-r)},Ut=(t,e)=>new Promise(o=>{const s=new Y,r=i=>{s.removeAllListeners(),s.destroy(),o(i)};s.once("connect",()=>{r(!0)}),s.once("error",()=>{r(!1)}),s.setTimeout(W,()=>{r(!1)});try{s.connect(e,t)}catch{r(!1)}}),zt=t=>new Promise(e=>{setTimeout(e,t)}),Xt=async(t,e)=>{const o=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});o&&await Vt({host:o.tcp.host,port:o.tcp.port,timeoutMs:e?.timeoutMs??o.tcp.timeoutMs})},O=process.platform==="win32",Yt=async t=>{const{command:e,cwd:o,env:s,logFile:r}=t,i=ct(r,"a",H);let n;const c=O?"cmd":"/bin/sh",g=O?["/d","/s","/c",e]:["-c",e];try{n=nt(c,g,{cwd:o,detached:!0,env:lt({...process.env,...s},o),stdio:["ignore",i,i],windowsHide:!0})}finally{at(i)}if(n.pid===void 0&&await new Promise((k,m)=>{n.once("spawn",()=>{k()}),n.once("error",q=>{m(q)})}),n.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${e}`);return n.unref(),{pid:n.pid}},B=5e3,ne=async t=>N(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(e&&a(e.pid))throw new Error(`Service ${t.id} is already running (pid ${String(e.pid)})`);e&&await y(t.workspaceRoot,t.id,e);const o=await d(t.workspaceRoot),s=R(t.id),r=h(o,`${s}.log`),{pid:i}=await Yt({command:t.command,cwd:t.cwd,env:t.env,logFile:r}),n={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:r,pid:i,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await Dt(t.workspaceRoot,n),t.skipReadiness!==!0)try{await Xt(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(c){throw await G(i,t.config.killGracePeriodMs??B).catch(()=>{}),await y(t.workspaceRoot,t.id,n).catch(()=>{}),c}return{entry:n}}),ce=async t=>N(t.workspaceRoot,t.id,async()=>{const e=await _(t.workspaceRoot,t.id);if(!e)return{stopped:!1};if(!a(e.pid))return await y(t.workspaceRoot,t.id,e),{stopped:!1};const o=t.graceMs??e.config.killGracePeriodMs??B;return await G(e.pid,o),await y(t.workspaceRoot,t.id,e),{stopped:!0}}),G=async(t,e)=>{I(t,"SIGTERM");const o=Date.now();for(;Date.now()-o<e;){if(!a(t))return;await new Promise(s=>{setTimeout(s,100)})}a(t)&&I(t,"SIGKILL")},I=(t,e)=>{try{process.platform==="win32"?process.kill(t,e):process.kill(-t,e)}catch(o){if(o.code==="ESRCH")return;throw o}};export{ie as H,Kt as S,ne as a,Xt as b,$t as c,se as d,re as e,y as f,_t as g,a as i,oe as p,_ as r,ce as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as j}from"node:module";import{e as d}from"./index-0dnGN3GP.js";import{y}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as P}from"./package-version-
|
|
1
|
+
import{createRequire as j}from"node:module";import{e as d}from"./index-0dnGN3GP.js";import{y}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as P}from"./package-version-C6xroAcI.js";let M;const b=o=>(M??=j(import.meta.url))(o),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,N=o=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(o)}return b(o)},{readdirSync:g,lstatSync:S}=N("node:fs"),R=/^([^<(]+?)?(?:<([^>]+)>)?\s*(?:\(([^)]+)\))?\s*$/u,T=o=>{const e=o.match(R);if(!e)return;const t=e[1]?.trim(),n=e[2]?.trim(),r=e[3]?.trim();if(!(!t&&!n&&!r))return{email:n||void 0,name:t||void 0,url:r||void 0}},k=o=>{if(!Array.isArray(o)||o.length===0)return;const e=[];for(const t of o)if(typeof t=="string"){const n=T(t);n&&e.push(n)}else if(t&&typeof t=="object"){const n=t,r=typeof n.name=="string"?n.name:void 0,i=typeof n.email=="string"?n.email:void 0,u=typeof n.url=="string"?n.url:void 0;(r||i||u)&&e.push({email:i,name:r,url:u})}return e.length>0?e:void 0},D=o=>{const e=d(o,"node_modules");if(!y(e))return new Map;const t=new Map,n=new Set,r=(i,u="")=>{if(n.has(i))return;n.add(i);let h;try{h=g(i)}catch{return}for(const a of h){const c=d(i,a);let m;try{m=S(c)}catch{continue}if(m.isSymbolicLink())continue;if(a.startsWith("@")){m.isDirectory()&&r(c,`${a}/`);continue}if(a===".pnpm"&&u===""){let s;try{s=g(c)}catch{continue}for(const p of s){const f=d(c,p,"node_modules");y(f)&&r(f)}continue}if(a.startsWith(".")||!m.isDirectory())continue;const v=u+a,_=d(c,"package.json");try{if(!y(_))continue;const s=P(_);if(typeof s.version!="string")continue;const p=`${v}@${s.version}`;t.has(p)||t.set(p,{directory:c,license:s.license,licenses:Array.isArray(s.licenses)?s.licenses:void 0,maintainers:k(s.maintainers),name:v,scripts:s.scripts&&typeof s.scripts=="object"?s.scripts:void 0,version:s.version});const f=d(c,"node_modules");y(f)&&r(f)}catch{}}};return r(e),t};export{k as n,D as r};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{e as g,z as d}from"./index-0dnGN3GP.js";import{d as A}from"../packem_chunks/cli-main.js";import{y as $}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as u}from"./env-
|
|
1
|
+
import{e as g,z as d}from"./index-0dnGN3GP.js";import{d as A}from"../packem_chunks/cli-main.js";import{y as $}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as u}from"./env-BUf_aJzW.js";const x=(k,p,h,m=[])=>{const t=[];if(h===void 0)return t.push("minimumReleaseAge not set in vis.config; skipping native sync."),t;const r=Number.isFinite(h)?Math.max(0,Math.round(h)):0;switch(k){case"bun":{const n=g(p,"bunfig.toml");let e=$(n)?d(n):"";const s=r*60,i=`minimumReleaseAge = ${String(s)}`,a=m.length>0?`minimumReleaseAgeExcludes = [${m.map(c=>`"${c.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,o=/^\[install\][ \t]*\n/m.exec(e);if(o?.index===void 0){const c=a?`${i}
|
|
2
2
|
${a}`:i;e=`${e.trimEnd()?`${e.trimEnd()}
|
|
3
3
|
|
|
4
4
|
`:""}[install]
|
package/dist/packem_shared/{missing-package-json-CNN9E7An.js → missing-package-json-BhiqxoDg.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as h,U as p}from"./index-0dnGN3GP.js";import{h as d,l as D,m as y,L as o,s as P}from"./registry-
|
|
1
|
+
import{e as h,U as p}from"./index-0dnGN3GP.js";import{h as d,l as D,m as y,L as o,s as P}from"./registry-B5KGXKED.js";import{y as c}from"./isAccessibleSync-DYKTrrvc-CBsMZhj-.js";const _=/\/+$/,l=/node_modules/,f=/\.git/,E=/\/\*\*$|\/\*\/\*$/,S=s=>{for(const r of o(s,{includeDirs:!1,includeSymlinks:!1,skip:[l,f]}))if(r.name==="package.json")return!0;return!1},m=(s,r,n)=>{for(const e of o(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[l,f]})){if(e.path===s||e.name.startsWith(".")||c(h(e.path,"package.json")))continue;const a=`${r}/${e.name}`;S(e.path)?m(e.path,a,n):n.push(a)}},g=(s,r)=>{const n=r.replace(_,"");if(n.startsWith("!"))return[];const e=[];if(n.endsWith("/*")&&!n.endsWith("/*/*")){const i=n.slice(0,-2),t=p(s,i);if(!c(t))return[];for(const u of o(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[l,f]}))u.path===t||u.name.startsWith(".")||e.push(h(i,u.name));return e}if(n.endsWith("/**")||n.endsWith("/*/*")){const i=n.replace(E,""),t=p(s,i);return c(t)&&m(t,i,e),e}if(!n.includes("/")&&n.includes("*")){const i=P(n);for(const t of o(s,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[l,f]}))t.path!==s&&i.test(t.name)&&e.push(t.name);return e}const a=p(s,n);return c(a)&&e.push(n),e},b=s=>{const n=d(s)??D(s)??[],e=new Set,a=[];for(const i of n)for(const t of g(s,i))t==="."||e.has(t)||(e.add(t),y(h(s,t))||a.push({packageDir:t}));return a};export{b as l};
|