@visulima/vis 2.0.2 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/LICENSE.md +95 -65
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +2 -2
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +47 -47
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +141 -141
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler4.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/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +1 -1
- package/dist/packem_chunks/handler55.js +1 -1
- 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/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +13 -13
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +5 -5
- package/dist/packem_chunks/handler71.js +1 -1
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler74.js +15 -15
- package/dist/packem_chunks/handler75.js +1 -1
- 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/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index2.js +6 -4
- package/dist/packem_chunks/index3.js +1 -1
- package/dist/packem_chunks/index4.js +49 -49
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/orchestrator.js +2 -2
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/registry.js +10 -10
- 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/ts-loader.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{advisories-CCBGdU8U.js → advisories-DsXRmIA5.js} +1 -1
- package/dist/packem_shared/{affected-selection-Dj-ymxhw.js → affected-selection-BE6VFCDV.js} +1 -1
- package/dist/packem_shared/{affected-shas-PwkVbPch.js → affected-shas-BKEu4RZc.js} +1 -1
- package/dist/packem_shared/{ai-analysis-bGCAc1jR.js → ai-analysis-DikAj6rX.js} +1 -1
- package/dist/packem_shared/{ai-fix-DV5-dHBY.js → ai-fix-bfWo0cZX.js} +1 -1
- package/dist/packem_shared/{augment-24KX2nkI.js → augment-BkJxi_GW.js} +1 -1
- package/dist/packem_shared/{bin-CtzhnYMp.js → bin-B-TytgzW.js} +1 -1
- package/dist/packem_shared/{build-scripts-w4SNeR7D.js → build-scripts-DWypBQ--.js} +1 -1
- package/dist/packem_shared/{command-runtime-BLFPUYAT.js → command-runtime-DQ7ZpLYL.js} +1 -1
- package/dist/packem_shared/{cyclonedx-C4KaVTn1.js → cyclonedx-DLBi65MV.js} +1 -1
- package/dist/packem_shared/dependency-scan-ZLOuLkGN.js +1 -0
- package/dist/packem_shared/{docker-DaVs-9wK.js → docker-B4zAZCZG.js} +15 -15
- package/dist/packem_shared/{en-D3CfXlO7.js → en-BDYMmM2_.js} +1 -1
- package/dist/packem_shared/{failure-log-CTneNcio.js → failure-log-DyhWPqno.js} +1 -1
- package/dist/packem_shared/glob-BUjyjdE8-Dp_QcayW.js +1 -0
- package/dist/packem_shared/index-BLtnel38.js +35 -0
- package/dist/packem_shared/index-CuKDxOCI.js +1 -0
- package/dist/packem_shared/index-tNFGWxc0.js +39 -0
- package/dist/packem_shared/{lifecycle-B8A2T3gx.js → lifecycle-KY9umOg6.js} +1 -1
- package/dist/packem_shared/{lockfile-Bccery3L.js → lockfile-YAuZf1gh.js} +1 -1
- package/dist/packem_shared/{manifests-BDkwiVbh.js → manifests-BwTn_1ad.js} +1 -1
- package/dist/packem_shared/{min-release-age-OaYpLwux.js → min-release-age-6avfn81h.js} +1 -1
- package/dist/packem_shared/{missing-package-json-BqS-OnKd.js → missing-package-json-Cl0vdz6K.js} +1 -1
- package/dist/packem_shared/{native-config-sync-Ds1FtcrM.js → native-config-sync-CHMCJx7H.js} +7 -7
- package/dist/packem_shared/{osv-bloom-pKp7urSB.js → osv-bloom-DdqDnLCt.js} +2 -2
- package/dist/packem_shared/package-version-BNRJ3o9C.js +4 -0
- package/dist/packem_shared/{packument-HBVbyf7x.js → packument-B9-WqReu.js} +1 -1
- package/dist/packem_shared/{pm-runner-C6eTANt1.js → pm-runner-DRybtzOV.js} +1 -1
- package/dist/packem_shared/{project-name-filter-CJ3XX2TI.js → project-name-filter-Dw0fC6IO.js} +1 -1
- package/dist/packem_shared/{provenance-D4Cza8cp.js → provenance-CLxuqCfL.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DweZd5ZA-0eZh9sGm.js → readJsonSync-DweZd5ZA-CtrDlqpb.js} +1 -1
- package/dist/packem_shared/{registry-keys-C0ez2VND.js → registry-keys-cTN24144.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-BbT764KS.js → resolve-explicit-Uw6WQl9R.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-D_vZovbB.js → resolve-runtime-DztanwkZ.js} +1 -1
- package/dist/packem_shared/{run-file-DyPFFN9U.js → run-file-CaE5_xBY.js} +1 -1
- package/dist/packem_shared/{runtime-check-D4um-yQq.js → runtime-check-C32yE57I.js} +1 -1
- package/dist/packem_shared/{s1ngularity-St6dhKiq.js → s1ngularity-BIYhg82u.js} +1 -1
- package/dist/packem_shared/{scan-progress-q-N2JtIp.js → scan-progress-DWfY4zkp.js} +1 -1
- package/dist/packem_shared/{selectors-Ce_6UAoY.js → selectors-D2j4M9Ul.js} +1 -1
- package/dist/packem_shared/{signatures-Dyeyg1q9.js → signatures-C8iQ5fUq.js} +1 -1
- package/dist/packem_shared/target-merge-DLxJTcxn.js +11 -0
- package/dist/packem_shared/{target-options-7XcbqGDe.js → target-options-3t4-2F-F.js} +1 -1
- package/dist/packem_shared/{toolchain-C_pNMBM6.js → toolchain-BPzbahcQ.js} +1 -1
- package/dist/packem_shared/{typosquats-xzcAGPiM.js → typosquats-BWrmhh36.js} +1 -1
- package/dist/packem_shared/{use-measured-height-CBjN0fle.js → use-measured-height-BwAwGHjw.js} +1 -1
- package/dist/packem_shared/verify-CzUPT6Uk.js +1 -0
- package/dist/packem_shared/{vis-update-app-DMAC2pPf.js → vis-update-app-D6Wq8ZHM.js} +1 -1
- package/dist/packem_shared/{vis-user-error-xmha3L4n.js → vis-user-error-CfM4_ORo.js} +1 -1
- package/dist/packem_shared/{watch-BXOOX7lx.js → watch-D_oAxW_Z.js} +1 -1
- package/dist/packem_shared/{watch-loop-Q7UpkVbr.js → watch-loop-BrjblOz5.js} +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +26 -26
- package/package.json +13 -13
- package/dist/packem_shared/dependency-scan-D_ona0Qm.js +0 -1
- package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +0 -1
- package/dist/packem_shared/index-CTMU29dI.js +0 -1
- package/dist/packem_shared/index-uBVnF4ji.js +0 -35
- package/dist/packem_shared/package-version-C47v64aB.js +0 -4
- package/dist/packem_shared/public-api-WqUCiyIe.js +0 -131
- package/dist/packem_shared/target-merge-Cfy7c__2.js +0 -11
- package/dist/packem_shared/verify-Dve9PQj3.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as K}from"node:module";import{V,s as R}from"./index.server-CusjRLCh.js";import{l as _,d as j,w as $}from"./index-uBVnF4ji.js";import{g as x}from"./en-D3CfXlO7.js";import{m as p,D as g}from"./provenance-D4Cza8cp.js";import{g as b}from"./packument-HBVbyf7x.js";import{i as w}from"../packem_chunks/cli-main.js";import{a as O}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";import{s as v}from"./index-BAe6e0XE.js";let X;const Y=r=>(X??=K(import.meta.url))(r),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=r=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,t]=M.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return M.getBuiltinModule(r)}return Y(r)},{rmSync:k,writeFileSync:E}=T("node:fs"),{createHash:Q}=T("node:crypto"),{Resolver:Z}=T("node:dns/promises");class Qe{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const Ze=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(V(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${V("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${R("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(R(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${R("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${R("→")} ${s.suggestedAction}`)}return e},er=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),ee=1440*60*1e3,re=15e3,te="https://api.github.com/repos",B=()=>$(x(),"archived-repo"),q=(r,e)=>$(B(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),ne=(r,e)=>{const t=q(r,e);if(_(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){k(t,{force:!0});return}return n}catch{k(t,{force:!0});return}},W=(r,e,t,n)=>{j(B());const s={createdAt:Date.now(),ttlMs:n,...t};E(q(r,e),JSON.stringify(s),"utf8")},se=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},ie=async(r,e,t,n)=>{const s=`${te}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,c=new AbortController,o=setTimeout(()=>{c.abort()},re),i=()=>{c.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const d=await fetch(s,{headers:a,signal:c.signal});if(d.status===404)return{kind:"missing"};if(!d.ok)return{kind:"transient-error"};const l=await d.json(),u=l.archived===!0,f=typeof l.archived_at=="string"?l.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},oe=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),rr=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??ee,s=e.githubToken??process.env.GITHUB_TOKEN,c=e.concurrency??g,o=new Map,i=async(a,d)=>{const l=`${a}/${d}`;let u=o.get(l);return u===void 0&&(u=(async()=>{const f=ne(a,d);if(f!==void 0)return f.missing===!0?{archived:!1,kind:"missing"}:{archived:f.archived,archivedAt:f.archivedAt,kind:"ok"};const m=await ie(a,d,s,e.signal);return m.kind==="missing"?W(a,d,{archived:!1,missing:!0},n):m.kind==="ok"&&W(a,d,{archived:m.archived===!0,archivedAt:m.archivedAt},n),m})(),o.set(l,u)),u};return(await p(r,c,async({name:a,version:d})=>{if(t.has(a))return;const l=await b(a,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;const u=l.versions[d]??l.versions[oe(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return;const f=se(u.repository?.url);if(f===void 0)return;const m=await i(f.owner,f.repo);if(m.kind!=="transient-error"){if(m.kind==="missing")return{kind:"missing-repo",owner:f.owner,packageName:a,repo:f.repo};if(m.archived===!0)return{...m.archivedAt===void 0?{}:{archivedAt:m.archivedAt},kind:"archived",owner:f.owner,packageName:a,repo:f.repo}}})).filter(a=>a!==void 0)},ae={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},ce=1440*60*1e3,U=(r,e)=>(r-e)/ce,A=r=>{if(r!==void 0)return r.email??r.name},de=(r,e,t,n,s)=>{const c=r.time?.[t];if(c===void 0)return;const o=new Date(c).getTime();if(!Number.isFinite(o))return;const i=U(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},le=(r,e,t,n,s)=>{const c=r.versions[t],o=A(c?._npmUser);if(o===void 0)return;const i=Object.keys(r.versions).filter(u=>v.valid(u)!==null).filter(u=>v.lt(u,t));if(i.length===0||i.some(u=>A(r.versions[u]?._npmUser)===o))return;const a=r.time?.[i[0]??""];if(a===void 0)return;const d=new Date(a).getTime();if(!Number.isFinite(d))return;const l=U(n,d);if(!(l<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${l.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},ue=(r,e,t,n,s)=>{const c=r.versions[t],o=A(c?._npmUser);if(o===void 0)return;const i=[];for(const[l,u]of Object.entries(r.versions)){if(l===t||A(u._npmUser)!==o)continue;const f=r.time?.[l];if(f===void 0)continue;const m=new Date(f).getTime();Number.isFinite(m)&&i.push(m)}if(i.length===0)return;const a=Math.max(...i),d=U(n,a);if(d>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(d>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},tr=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...ae,...e.thresholds},s=e.now??(()=>Date.now()),c=e.concurrency??g;return(await p(r,c,async({name:o,version:i})=>{if(t.has(o))return[];const a=await b(o,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(a===void 0)return[];const d=s(),l=[],u=de(a,o,i,d,n);u!==void 0&&l.push(u);const f=le(a,o,i,d,n);f!==void 0&&l.push(f);const m=ue(a,o,i,d,n);return m!==void 0&&l.push(m),l})).flat()},fe=1440*60*1e3,me=15e3,he=20,ve=1e4,pe="https://api.npmjs.org/downloads/point/last-month",H=()=>$(x(),"downloads"),J=r=>$(H(),`${encodeURIComponent(r)}.json`),ge=r=>{const e=J(r);if(_(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){k(e,{force:!0});return}return t.downloads}catch{k(e,{force:!0});return}},we=(r,e,t)=>{j(H());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};E(J(r),JSON.stringify(n),"utf8")},ye=async(r,e)=>{const t=`${pe}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},me),c=()=>{n.abort()};e?.addEventListener("abort",c,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",c)}},nr=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??he,s=e.warnThreshold??ve,c=e.cacheTtlMs??fe,o=e.concurrency??g;return(await p(r,o,async i=>{if(t.has(i))return;let a=ge(i);if(a===void 0){const d=await ye(i,e.signal);if(d.kind==="no-data"||d.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:i,severity:"warning"};a=d.downloads??0,we(i,a,c)}if(a<n)return{downloadsLastMonth:a,kind:"below-error",packageName:i,severity:"error"};if(a<s)return{downloadsLastMonth:a,kind:"below-warning",packageName:i,severity:"warning"}})).filter(i=>i!==void 0)},ke=1440*60*1e3,$e=4e3,be=["1.1.1.1","8.8.8.8"],z=()=>$(x(),"expired-domains"),G=r=>{const e=Q("sha256").update(r).digest("hex").slice(0,12);return $(z(),`${e}.json`)},Me=r=>{const e=G(r);if(_(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){k(e,{force:!0});return}return t}catch{k(e,{force:!0});return}},De=(r,e,t)=>{j(z());const n={createdAt:Date.now(),outcome:e,ttlMs:t};E(G(r),JSON.stringify(n),"utf8")},Re=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},Ae=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Ne=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Se=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},Te=async(r,e,t)=>{try{const n=await Ne(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Se(n)?{kind:"expired"}:{kind:"transient-error"}}},Ee=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),sr=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(u=>u.toLowerCase())),s=e.cacheTtlMs??ke,c=e.perDomainTimeoutMs??$e,o=e.dnsServers??be,i=e.concurrency??g,a=e.createResolver===void 0?new Z:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const d=new Map,l=async u=>{let f=d.get(u);return f===void 0&&(f=(async()=>{const m=Me(u);if(m!==void 0)return{kind:m.outcome==="ok"?"ok":"expired"};const h=await Te(a,u,c);return h.kind!=="transient-error"&&De(u,h.kind,s),h})(),d.set(u,f)),f};return(await p(r,i,async({name:u,version:f})=>{if(t.has(u))return[];const m=await b(u,{workspaceRoot:e.workspaceRoot});if(m===void 0)return[];const h=m.versions[f]??m.versions[Ee(Object.keys(m.versions),m["dist-tags"]?.latest)??""];if(h===void 0)return[];const N=Ae(h.maintainers,h._npmUser),C=new Set,S=[];for(const D of N){const y=Re(D.email);if(y===void 0||n.has(y))continue;const F=`${y}:${D.email??""}`;if(C.has(F))continue;C.add(F);const L=await l(y);L.kind==="expired"?S.push({domain:y,kind:"expired",maintainer:D.email??"",packageName:u,severity:"error"}):L.kind==="transient-error"&&S.push({domain:y,kind:"unresolved",maintainer:D.email??"",packageName:u,severity:"warning"})}return S})).flat()},_e=["readme","license","repo"],je=["ERROR: No README data found!","# Security holding package"],xe=r=>{const e=r.trim();return e===""?!0:je.some(t=>e.startsWith(t))},Oe=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Ue=(r,e)=>{const t=Oe(r,e);if(t===void 0)return"missing-readme";if(xe(t))return"placeholder-readme"},Ce=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Fe=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},Le=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},ir=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??_e),s=e.concurrency??g;return(await p(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await b(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o]??i.versions[Le(i)??""];if(a===void 0||a.private===!0)return;const d=[];if(n.has("readme")){const l=Ue(i,a);l!==void 0&&d.push(l)}if(n.has("license")){const l=Ce(a);l!==void 0&&d.push(l)}if(n.has("repo")){const l=Fe(a);l!==void 0&&d.push(l)}if(d.length!==0)return{issues:d,packageName:c,version:o}})).filter(c=>c!==void 0)},I=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},Ve=(r,e)=>v.valid(e)?Object.keys(r.versions).filter(t=>v.valid(t)!==null&&v.lt(t,e)).sort((t,n)=>v.lt(t,n)?1:-1)[0]:void 0,or=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??g;return(await p(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await b(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o];if(a===void 0)return;const d=Ve(i,o);if(d===void 0)return;const l=i.versions[d];if(l===void 0)return;const u=I(a.bin,c),f=I(l.bin,c),m=Object.entries(u).filter(([h])=>!(h in f)).filter(([h])=>!n.has(h)).map(([h,N])=>({command:N,name:h}));if(m.length!==0)return{fromVersion:d,newBins:m,packageName:c,toVersion:o}})).filter(c=>c!==void 0)},We=["preinstall","install","postinstall"],P=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,Ie=(r,e)=>{if(v.valid(e)!==null)return Object.keys(r.versions).filter(t=>v.valid(t)!==null&&v.prerelease(t)===null&&v.lt(t,e)).sort((t,n)=>v.lt(t,n)?1:-1)[0]},Pe=(r,e)=>{const t=r??{},n=e??{},s=[];for(const c of We){const o=t[c];if(o===void 0||o==="")continue;const i=n[c];i===void 0||i===""?s.push({command:o,hook:c,kind:"introduced"}):i!==o&&s.push({command:o,hook:c,kind:"changed"})}return s},ar=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??g;return(await p(r,n,async({name:s,version:c})=>{if(t.has(s))return;const o=await b(s,{workspaceRoot:e.workspaceRoot});if(o?.versions[c]===void 0)return;const i=Ie(o,c);if(i===void 0||!P(o,i)||P(o,c))return;const a=Pe(o.versions[c]?.scripts,o.versions[i]?.scripts);if(a.length!==0)return{hookChanges:a,packageName:s,priorVersion:i,trustSignal:"provenance-dropped",version:c}})).filter(s=>s!==void 0)};export{Qe as M,ar as a,or as b,ir as c,nr as d,sr as e,rr as f,er as g,Ze as h,tr as r};
|
|
1
|
+
import{createRequire as K}from"node:module";import{V,s as R}from"./index.server-CusjRLCh.js";import{l as _,d as j,w as $}from"./index-BLtnel38.js";import{g as x}from"./en-BDYMmM2_.js";import{m as p,D as g}from"./provenance-CLxuqCfL.js";import{g as b}from"./packument-B9-WqReu.js";import{i as w}from"../packem_chunks/cli-main.js";import{a as O}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";import{s as v}from"./index-BAe6e0XE.js";let X;const Y=r=>(X??=K(import.meta.url))(r),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=r=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,t]=M.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return M.getBuiltinModule(r)}return Y(r)},{rmSync:k,writeFileSync:E}=T("node:fs"),{createHash:Q}=T("node:crypto"),{Resolver:Z}=T("node:dns/promises");class Qe{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const Ze=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(V(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${V("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${R("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(R(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${R("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${R("→")} ${s.suggestedAction}`)}return e},er=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),ee=1440*60*1e3,re=15e3,te="https://api.github.com/repos",B=()=>$(x(),"archived-repo"),q=(r,e)=>$(B(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),ne=(r,e)=>{const t=q(r,e);if(_(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){k(t,{force:!0});return}return n}catch{k(t,{force:!0});return}},W=(r,e,t,n)=>{j(B());const s={createdAt:Date.now(),ttlMs:n,...t};E(q(r,e),JSON.stringify(s),"utf8")},se=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},ie=async(r,e,t,n)=>{const s=`${te}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,c=new AbortController,o=setTimeout(()=>{c.abort()},re),i=()=>{c.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const d=await fetch(s,{headers:a,signal:c.signal});if(d.status===404)return{kind:"missing"};if(!d.ok)return{kind:"transient-error"};const l=await d.json(),u=l.archived===!0,f=typeof l.archived_at=="string"?l.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},oe=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),rr=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??ee,s=e.githubToken??process.env.GITHUB_TOKEN,c=e.concurrency??g,o=new Map,i=async(a,d)=>{const l=`${a}/${d}`;let u=o.get(l);return u===void 0&&(u=(async()=>{const f=ne(a,d);if(f!==void 0)return f.missing===!0?{archived:!1,kind:"missing"}:{archived:f.archived,archivedAt:f.archivedAt,kind:"ok"};const m=await ie(a,d,s,e.signal);return m.kind==="missing"?W(a,d,{archived:!1,missing:!0},n):m.kind==="ok"&&W(a,d,{archived:m.archived===!0,archivedAt:m.archivedAt},n),m})(),o.set(l,u)),u};return(await p(r,c,async({name:a,version:d})=>{if(t.has(a))return;const l=await b(a,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;const u=l.versions[d]??l.versions[oe(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return;const f=se(u.repository?.url);if(f===void 0)return;const m=await i(f.owner,f.repo);if(m.kind!=="transient-error"){if(m.kind==="missing")return{kind:"missing-repo",owner:f.owner,packageName:a,repo:f.repo};if(m.archived===!0)return{...m.archivedAt===void 0?{}:{archivedAt:m.archivedAt},kind:"archived",owner:f.owner,packageName:a,repo:f.repo}}})).filter(a=>a!==void 0)},ae={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},ce=1440*60*1e3,U=(r,e)=>(r-e)/ce,A=r=>{if(r!==void 0)return r.email??r.name},de=(r,e,t,n,s)=>{const c=r.time?.[t];if(c===void 0)return;const o=new Date(c).getTime();if(!Number.isFinite(o))return;const i=U(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},le=(r,e,t,n,s)=>{const c=r.versions[t],o=A(c?._npmUser);if(o===void 0)return;const i=Object.keys(r.versions).filter(u=>v.valid(u)!==null).filter(u=>v.lt(u,t));if(i.length===0||i.some(u=>A(r.versions[u]?._npmUser)===o))return;const a=r.time?.[i[0]??""];if(a===void 0)return;const d=new Date(a).getTime();if(!Number.isFinite(d))return;const l=U(n,d);if(!(l<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${l.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},ue=(r,e,t,n,s)=>{const c=r.versions[t],o=A(c?._npmUser);if(o===void 0)return;const i=[];for(const[l,u]of Object.entries(r.versions)){if(l===t||A(u._npmUser)!==o)continue;const f=r.time?.[l];if(f===void 0)continue;const m=new Date(f).getTime();Number.isFinite(m)&&i.push(m)}if(i.length===0)return;const a=Math.max(...i),d=U(n,a);if(d>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(d>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},tr=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...ae,...e.thresholds},s=e.now??(()=>Date.now()),c=e.concurrency??g;return(await p(r,c,async({name:o,version:i})=>{if(t.has(o))return[];const a=await b(o,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(a===void 0)return[];const d=s(),l=[],u=de(a,o,i,d,n);u!==void 0&&l.push(u);const f=le(a,o,i,d,n);f!==void 0&&l.push(f);const m=ue(a,o,i,d,n);return m!==void 0&&l.push(m),l})).flat()},fe=1440*60*1e3,me=15e3,he=20,ve=1e4,pe="https://api.npmjs.org/downloads/point/last-month",H=()=>$(x(),"downloads"),J=r=>$(H(),`${encodeURIComponent(r)}.json`),ge=r=>{const e=J(r);if(_(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){k(e,{force:!0});return}return t.downloads}catch{k(e,{force:!0});return}},we=(r,e,t)=>{j(H());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};E(J(r),JSON.stringify(n),"utf8")},ye=async(r,e)=>{const t=`${pe}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},me),c=()=>{n.abort()};e?.addEventListener("abort",c,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",c)}},nr=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??he,s=e.warnThreshold??ve,c=e.cacheTtlMs??fe,o=e.concurrency??g;return(await p(r,o,async i=>{if(t.has(i))return;let a=ge(i);if(a===void 0){const d=await ye(i,e.signal);if(d.kind==="no-data"||d.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:i,severity:"warning"};a=d.downloads??0,we(i,a,c)}if(a<n)return{downloadsLastMonth:a,kind:"below-error",packageName:i,severity:"error"};if(a<s)return{downloadsLastMonth:a,kind:"below-warning",packageName:i,severity:"warning"}})).filter(i=>i!==void 0)},ke=1440*60*1e3,$e=4e3,be=["1.1.1.1","8.8.8.8"],z=()=>$(x(),"expired-domains"),G=r=>{const e=Q("sha256").update(r).digest("hex").slice(0,12);return $(z(),`${e}.json`)},Me=r=>{const e=G(r);if(_(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){k(e,{force:!0});return}return t}catch{k(e,{force:!0});return}},De=(r,e,t)=>{j(z());const n={createdAt:Date.now(),outcome:e,ttlMs:t};E(G(r),JSON.stringify(n),"utf8")},Re=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},Ae=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Ne=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Se=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},Te=async(r,e,t)=>{try{const n=await Ne(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Se(n)?{kind:"expired"}:{kind:"transient-error"}}},Ee=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),sr=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(u=>u.toLowerCase())),s=e.cacheTtlMs??ke,c=e.perDomainTimeoutMs??$e,o=e.dnsServers??be,i=e.concurrency??g,a=e.createResolver===void 0?new Z:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const d=new Map,l=async u=>{let f=d.get(u);return f===void 0&&(f=(async()=>{const m=Me(u);if(m!==void 0)return{kind:m.outcome==="ok"?"ok":"expired"};const h=await Te(a,u,c);return h.kind!=="transient-error"&&De(u,h.kind,s),h})(),d.set(u,f)),f};return(await p(r,i,async({name:u,version:f})=>{if(t.has(u))return[];const m=await b(u,{workspaceRoot:e.workspaceRoot});if(m===void 0)return[];const h=m.versions[f]??m.versions[Ee(Object.keys(m.versions),m["dist-tags"]?.latest)??""];if(h===void 0)return[];const N=Ae(h.maintainers,h._npmUser),C=new Set,S=[];for(const D of N){const y=Re(D.email);if(y===void 0||n.has(y))continue;const F=`${y}:${D.email??""}`;if(C.has(F))continue;C.add(F);const L=await l(y);L.kind==="expired"?S.push({domain:y,kind:"expired",maintainer:D.email??"",packageName:u,severity:"error"}):L.kind==="transient-error"&&S.push({domain:y,kind:"unresolved",maintainer:D.email??"",packageName:u,severity:"warning"})}return S})).flat()},_e=["readme","license","repo"],je=["ERROR: No README data found!","# Security holding package"],xe=r=>{const e=r.trim();return e===""?!0:je.some(t=>e.startsWith(t))},Oe=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Ue=(r,e)=>{const t=Oe(r,e);if(t===void 0)return"missing-readme";if(xe(t))return"placeholder-readme"},Ce=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Fe=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},Le=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},ir=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??_e),s=e.concurrency??g;return(await p(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await b(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o]??i.versions[Le(i)??""];if(a===void 0||a.private===!0)return;const d=[];if(n.has("readme")){const l=Ue(i,a);l!==void 0&&d.push(l)}if(n.has("license")){const l=Ce(a);l!==void 0&&d.push(l)}if(n.has("repo")){const l=Fe(a);l!==void 0&&d.push(l)}if(d.length!==0)return{issues:d,packageName:c,version:o}})).filter(c=>c!==void 0)},I=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},Ve=(r,e)=>v.valid(e)?Object.keys(r.versions).filter(t=>v.valid(t)!==null&&v.lt(t,e)).sort((t,n)=>v.lt(t,n)?1:-1)[0]:void 0,or=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??g;return(await p(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await b(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o];if(a===void 0)return;const d=Ve(i,o);if(d===void 0)return;const l=i.versions[d];if(l===void 0)return;const u=I(a.bin,c),f=I(l.bin,c),m=Object.entries(u).filter(([h])=>!(h in f)).filter(([h])=>!n.has(h)).map(([h,N])=>({command:N,name:h}));if(m.length!==0)return{fromVersion:d,newBins:m,packageName:c,toVersion:o}})).filter(c=>c!==void 0)},We=["preinstall","install","postinstall"],P=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,Ie=(r,e)=>{if(v.valid(e)!==null)return Object.keys(r.versions).filter(t=>v.valid(t)!==null&&v.prerelease(t)===null&&v.lt(t,e)).sort((t,n)=>v.lt(t,n)?1:-1)[0]},Pe=(r,e)=>{const t=r??{},n=e??{},s=[];for(const c of We){const o=t[c];if(o===void 0||o==="")continue;const i=n[c];i===void 0||i===""?s.push({command:o,hook:c,kind:"introduced"}):i!==o&&s.push({command:o,hook:c,kind:"changed"})}return s},ar=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??g;return(await p(r,n,async({name:s,version:c})=>{if(t.has(s))return;const o=await b(s,{workspaceRoot:e.workspaceRoot});if(o?.versions[c]===void 0)return;const i=Ie(o,c);if(i===void 0||!P(o,i)||P(o,c))return;const a=Pe(o.versions[c]?.scripts,o.versions[i]?.scripts);if(a.length!==0)return{hookChanges:a,packageName:s,priorVersion:i,trustSignal:"provenance-dropped",version:c}})).filter(s=>s!==void 0)};export{Qe as M,ar as a,or as b,ir as c,nr as d,sr as e,rr as f,er as g,Ze as h,tr as r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as x,s as k,I as y,V as S}from"./index.server-CusjRLCh.js";import{l as e,m as c,i,X as $,R as g}from"../packem_chunks/catalog.js";import"./en-
|
|
1
|
+
import{E as x,s as k,I as y,V as S}from"./index.server-CusjRLCh.js";import{l as e,m as c,i,X as $,R as g}from"../packem_chunks/catalog.js";import"./en-BDYMmM2_.js";import{I as C}from"./index-BWl4DbMp.js";import{S as m}from"../packem_chunks/cli-main.js";import{Spinner as T}from"@visulima/tui-kit/spinner";import{D as j,W as I,T as E,C as R}from"./symbols-DPTlrJ3B.js";const w=({rows:a})=>e.jsx(c,{flexDirection:"column",children:a.map(t=>{let r;switch(t.status){case"error":{r=e.jsx(i,{color:"red",children:R});break}case"ok":{r=e.jsx(i,{color:"green",children:E});break}case"running":{r=e.jsx(i,{color:"white",children:e.jsx(T,{type:"dots"})});break}case"warn":{r=e.jsx(i,{color:"yellow",children:I});break}default:{r=e.jsx(i,{dimColor:!0,children:j});break}}return e.jsxs(c,{children:[e.jsx(c,{width:3,children:r}),e.jsx(c,{flexGrow:1,children:e.jsx(i,{children:t.label})}),t.summary?e.jsx(c,{children:e.jsxs(i,{dimColor:!0,children:[j," ",t.summary]})}):null]},t.id)})}),v={error:S(m.failure),ok:y(m.success),pending:x(m.dash),skip:x(m.dash),warn:k(m.warning)},D=(a,t,r)=>{const h=r?`${a} ${x(`— ${r}`)}`:a;return` ${v[t]} ${h}
|
|
2
2
|
`},W=(a,t={})=>{const r=t.stream??process.stderr,h=typeof r.isTTY=="boolean"&&r.isTTY&&!C,b=t.live??h,o=new Map;for(const s of a)o.set(s.id,{id:s.id,label:s.label,status:"pending"});if(!b||a.length===0)return{finish:(s,n,u)=>{const l=o.get(s);l&&(o.set(s,{...l,status:n,summary:u}),r.write(D(l.label,n,u)))},start:s=>{const n=o.get(s);n&&o.set(s,{...n,status:"running"})},stop:()=>{}};const f=()=>a.map(s=>o.get(s.id));let d=$(g.createElement(w,{rows:f()}),{interactive:!0,patchConsole:!1});const p=()=>{d?.rerender(g.createElement(w,{rows:f()}))};return{finish:(s,n,u)=>{const l=o.get(s);l&&(o.set(s,{...l,status:n,summary:u}),p())},start:s=>{const n=o.get(s);n&&(o.set(s,{...n,status:"running"}),p())},stop:()=>{d&&(p(),d.unmount(),d=void 0)}}};export{W as s};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as y}from"node:module";import{b as v}from"./index-
|
|
1
|
+
import{createRequire as y}from"node:module";import{b as v}from"./index-BLtnel38.js";let h;const w=t=>(h??=y(import.meta.url))(t),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[r,e]=d.versions.node.split(".").map(Number);if(r>22||r===22&&e>=3||r===20&&e>=16)return d.getBuiltinModule(t)}return w(t)},{createInterface:k}=_("node:readline"),$=/^#([\w\-/]+):(.+)$/,b=/^([@\w\-/]+):(.+)$/,T=t=>{if(t==="")return;if(t.startsWith(":"))return{kind:"all",target:t.slice(1)};if(t.startsWith("~:"))return{kind:"closest",target:t.slice(2)};const r=$.exec(t);if(r?.[1]&&r[2])return{kind:"tag",tag:r[1],target:r[2]};const e=b.exec(t);return e?.[1]&&e[2]&&(e[1].startsWith("@")||e[1].includes("/")||e[1].includes("-"))?{kind:"project",projects:[e[1]],target:e[2]}:{kind:"all",target:t}},E=async(t,r,e,a)=>{const s=T(t);if(!s)throw new Error(`Invalid target selector: "${t}"`);const o=Object.keys(r.projects);if(s.kind==="all")return{projects:o,target:s.target};if(s.kind==="project")return{projects:s.projects??[],target:s.target};if(s.kind==="tag"){const c=s.tag;return{projects:o.filter(i=>r.projects[i]?.tags?.includes(c)??!1),target:s.target}}const n=v(a,e)||".";let l,u=-1;for(const[c,i]of Object.entries(r.projects)){const p=i.root;p&&(n===p||n.startsWith(`${p}/`))&&p.length>u&&(u=p.length,l=c)}if(!l){if(process.stdout.isTTY){const c=k({input:process.stdin,output:process.stderr}),i=Object.keys(r.projects).sort();process.stderr.write(`No project found at ${n}. Pick one:
|
|
2
2
|
`);for(const[g,m]of i.entries())process.stderr.write(` ${String(g+1)}) ${m}
|
|
3
3
|
`);const p=await new Promise(g=>{c.question("> ",g)});c.close();const f=Number.parseInt(p,10)-1;if(f>=0&&f<i.length)return{projects:[i[f]],target:s.target}}throw new Error(`No project found at or above ${n} for selector "${t}".`)}return{projects:[l],target:s.target}},q=/^(\w+)\s*(!?=)\s*(.+)$/,x=t=>{const r=t.trim();if(r==="")return;const e=r.split("&&").map(c=>c.trim()),a=r.split("||").map(c=>c.trim()),s=e.length>1,o=a.length>1;if(s&&o)throw new Error("Query language does not support mixed && / || — split into multiple --query flags or simplify.");const n=o?a:e,l=o?"||":"&&",u=[];for(const c of n){const i=q.exec(c);if(!i)throw new Error(`Invalid query clause: "${c}". Expected <field>=<value> or <field>!=<value>.`);const[,p,f,g]=i;u.push({field:p,op:f==="!="?"!=":"=",value:g.trim().replaceAll(/^["']|["']$/g,"")})}return{clauses:u,op:l}},j=(t,r,e)=>{const{field:a,op:s,value:o}=t,n=u=>{const c=u===o;return s==="="?c:!c},l=u=>{const c=(u??[]).includes(o);return s==="="?c:!c};switch(a){case"id":case"project":return n(r);case"language":return n(e.language);case"layer":return n(e.layer);case"projectType":case"type":return n(e.projectType);case"stack":return n(e.stack);case"tag":case"tags":return l(e.tags);default:return!1}},I=(t,r,e)=>{const a=(e??[]).flatMap(o=>o.split(",")).map(o=>o.trim()).filter(Boolean);if(a.length===0)return t;const s=new Set(a);return t.filter(o=>{const n=r.projects[o]?.tags;return Array.isArray(n)&&n.some(l=>s.has(l))})},N=(t,r,e)=>{if(!e||e.trim()==="")return t;const a=x(e);return a?t.filter(s=>{const o=r.projects[s];return o?a.op==="&&"?a.clauses.every(n=>j(n,s,o)):a.clauses.some(n=>j(n,s,o)):!1}):t};export{I as a,N as f,T as p,E as r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as h}from"node:module";import{m as N,D as b}from"./provenance-
|
|
1
|
+
import{createRequire as h}from"node:module";import{m as N,D as b}from"./provenance-CLxuqCfL.js";import{g as B}from"./packument-B9-WqReu.js";import{i as P}from"../packem_chunks/cli-main.js";import{f as x}from"./registry-keys-cTN24144.js";let w;const _=s=>(w??=h(import.meta.url))(s),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=s=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[e,r]=g.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return g.getBuiltinModule(s)}return _(s)},{createPublicKey:M,createVerify:R}=$("node:crypto"),j=s=>{const e=["-----BEGIN PUBLIC KEY-----"],r=s.replaceAll(/\s+/g,"");for(let a=0;a<r.length;a+=64)e.push(r.slice(a,a+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
|
|
2
2
|
`)},E=({keyBase64:s,message:e,signatureBase64:r})=>{try{const a=M({format:"pem",key:j(s)}),o=R("SHA256");return o.update(e),o.end(),o.verify(a,Buffer.from(r,"base64"))}catch{return!1}},C=(s,e)=>{if(s.expires===void 0||s.expires==="")return!1;const r=Date.parse(s.expires);return Number.isNaN(r)?!1:r<=e},A=(s,e,r)=>`${s}@${e}:${r}`,D=(s,e)=>e!==void 0&&s.includes(e)?e:s.at(-1),K=async(s,e={})=>{if(P("signatures"))return[];const r=new Set(e.allowlist),a=e.treatExpiredAs??"warning",o=e.concurrency??b,l=await x({keysUrl:e.keysUrl,signal:e.signal,ttlMs:e.keysTtlMs});if(l===void 0)return s.filter(({name:i})=>!r.has(i)).map(({name:i,version:t})=>({code:"fetch-failed",message:"Could not fetch registry signing keys.",packageName:i,severity:"warning",version:t}));const m=new Map;for(const i of l.keys)m.set(i.keyid,i);const k=Date.now();return(await N(s,o,async({name:i,version:t})=>{if(r.has(i))return[];const c=await B(i,{workspaceRoot:e.workspaceRoot});if(c===void 0)return[];const y=c.versions[t]??c.versions[D(Object.keys(c.versions),c["dist-tags"]?.latest)??""];if(y===void 0)return[];const f=y.dist?.signatures,p=y.dist?.integrity;if(f===void 0||f.length===0)return[{code:"missing-signature",message:`Package ${i}@${t} has no dist.signatures from the registry.`,packageName:i,severity:"warning",version:t}];if(typeof p!="string"||p==="")return[{code:"missing-signature",message:`Package ${i}@${t} has signatures but no dist.integrity to verify against.`,packageName:i,severity:"warning",version:t}];const v=A(i,t,p),u=[];for(const n of f){const d=m.get(n.keyid);if(d===void 0){u.push({code:"unknown-keyid",keyid:n.keyid,message:`Package ${i}@${t} was signed with an unrecognized keyid (${n.keyid}).`,packageName:i,severity:"error",version:t});continue}if(C(d,k)){u.push({code:"expired-key",keyid:n.keyid,message:`Package ${i}@${t} was signed with an expired key (${n.keyid}, expired ${d.expires??"unknown"}).`,packageName:i,severity:a,version:t});continue}E({keyBase64:d.key,message:v,signatureBase64:n.sig})||u.push({code:"invalid-signature",keyid:n.keyid,message:`Package ${i}@${t} signature did not verify against ${n.keyid}.`,packageName:i,severity:"error",version:t})}return u})).flat()};export{K as r};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{createRequire as to}from"node:module";let oo;const ro=e=>(oo??=to(import.meta.url))(e),ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,so=e=>{if(typeof ve<"u"&&ve.versions&&ve.versions.node){const[t,o]=ve.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ve.getBuiltinModule(e)}return ro(e)},{createRequire:no}=so("node:module");let uo;const io=e=>(uo??=no(import.meta.url))(e),ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jt=e=>{if(typeof ye<"u"&&ye.versions&&ye.versions.node){const[t,o]=ye.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ye.getBuiltinModule(e)}return io(e)},{homedir:lo,tmpdir:at}=jt("node:os"),{env:et,cwd:ao,platform:Tt}=ye,{createRequire:w}=jt("node:module"),po=0,Kt=2,co=Symbol("findUpStop"),fo=/^[A-Z]:\//i,be=(e="")=>e&&e.replaceAll("\\","/").replace(fo,t=>t.toUpperCase()),go=/^[/\\]{2}/,ho=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,At=/^[A-Z]:$/i,bo=/[^/](\.[^./]+)$/,yo=/^[/\\]|^[a-z]:[/\\]/i,mo=/\/$/,vo=()=>{if(typeof process.cwd=="function")try{const e=process.cwd();if(typeof e=="string")return be(e)}catch{}return"/"},pt="/",Xt=(e,t)=>{let o="",g=0,p=-1,r=0,l;for(let a=0;a<=e.length;++a){if(a<e.length)l=e[a];else{if(l==="/")break;l="/"}if(l==="/"){if(!(p===a-1||r===1))if(r===2){if(o.length<2||g!==2||!o.endsWith(".")||o.at(-2)!=="."){if(o.length>2){const c=o.lastIndexOf("/");c===-1?(o="",g=0):(o=o.slice(0,c),g=o.length-1-o.lastIndexOf("/")),p=a,r=0;continue}else if(o.length>0){o="",g=0,p=a,r=0;continue}}t&&(o+=o.length>0?"/..":"..",g=2)}else o.length>0?o+=`/${e.slice(p+1,a)}`:o=e.slice(p+1,a),g=a-p-1;p=a,r=0}else l==="."&&r!==-1?++r:r=-1}return o},de=e=>ho.test(e),Ao=function(e){if(e.length===0)return".";e=be(e);const t=go.exec(e),o=de(e),g=e.at(-1)==="/";return e=Xt(e,!o),e.length===0?o?"/":g?"./":".":(g&&(e+="/"),At.test(e)&&(e+="/"),t?o?`//${e}`:`//./${e}`:o&&!de(e)?`/${e}`:e)},se=(...e)=>{let t="";for(const o of e)if(o)if(t.length>0){const g=t.at(-1)==="/",p=o[0]==="/";g&&p?t+=o.slice(1):t+=g||p?o:`/${o}`}else t+=o;return Ao(t)},nt=function(...e){e=e.map(g=>be(g));let t="",o=!1;for(let g=e.length-1;g>=-1&&!o;g--){const p=g>=0?e[g]:vo();!p||p.length===0||(t=`${p}/${t}`,o=de(p))}return t=Xt(t,!o),At.test(t)?`${t}/`:o&&!de(t)?`/${t}`:t.length>0?t:"."},_o=function(e){return bo.exec(be(e))?.[1]??""},_t=e=>{const t=be(e).replace(mo,""),o=t.lastIndexOf("/");if(o===-1)return de(e)?"/":".";const g=t.slice(0,o);return At.test(g)?`${g}/`:g||(de(e)?"/":".")},Ro=(e,t)=>{const o=be(e);return o.slice(o.lastIndexOf("/")+1)},xo=function(e){const t=yo.exec(e)?.[0]?.replaceAll("\\","/")??"",o=Ro(e),g=_o(o);return{base:o,dir:_t(e),ext:g,name:o.slice(0,o.length-g.length),root:t}};let To;const Eo=e=>(To??=w(import.meta.url))(e),Ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Co=e=>{if(typeof Ae<"u"&&Ae.versions&&Ae.versions.node){const[t,o]=Ae.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ae.getBuiltinModule(e)}return Eo(e)},{fileURLToPath:So}=Co("node:url");function $o(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Et,Ct;function Oo(){return Ct||(Ct=1,Et=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Et}var wo=Oo();const ko=$o(wo);new Set(ko);const me=e=>be(e instanceof URL?So(e):e),zt=e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")};let No;const Ho=e=>(No??=w(import.meta.url))(e),_e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lo=e=>{if(typeof _e<"u"&&_e.versions&&_e.versions.node){const[t,o]=_e.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return _e.getBuiltinModule(e)}return Ho(e)};Lo("node:fs/promises");let Bo;const Io=e=>(Bo??=w(import.meta.url))(e),Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mo=e=>{if(typeof Re<"u"&&Re.versions&&Re.versions.node){const[t,o]=Re.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Re.getBuiltinModule(e)}return Io(e)};Mo("node:fs");const St=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"};let Do;const Go=e=>(Do??=w(import.meta.url))(e),xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Po=e=>{if(typeof xe<"u"&&xe.versions&&xe.versions.node){const[t,o]=xe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return xe.getBuiltinModule(e)}return Go(e)};Po("node:fs/promises");let Uo;const Fo=e=>(Uo??=w(import.meta.url))(e),Te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jo=e=>{if(typeof Te<"u"&&Te.versions&&Te.versions.node){const[t,o]=Te.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Te.getBuiltinModule(e)}return Fo(e)},{lstatSync:$t,mkdirSync:Ko}=jo("node:fs"),Ee=e=>{zt(e);try{const t=$t(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(St(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Ko(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const o=$t(e);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(St(o))}'`,{cause:t})}};let Xo;const zo=e=>(Xo??=w(import.meta.url))(e),Ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wo=e=>{if(typeof Ce<"u"&&Ce.versions&&Ce.versions.node){const[t,o]=Ce.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ce.getBuiltinModule(e)}return zo(e)};Wo("node:fs/promises");let Qo;const qo=e=>(Qo??=w(import.meta.url))(e),Se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zo=e=>{if(typeof Se<"u"&&Se.versions&&Se.versions.node){const[t,o]=Se.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Se.getBuiltinModule(e)}return qo(e)};Zo("node:fs");let Yo;const Vo=e=>(Yo??=w(import.meta.url))(e),$e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jo=e=>{if(typeof $e<"u"&&$e.versions&&$e.versions.node){const[t,o]=$e.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return $e.getBuiltinModule(e)}return Vo(e)};Jo("node:fs/promises");let er;const tr=e=>(er??=w(import.meta.url))(e),Oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,or=e=>{if(typeof Oe<"u"&&Oe.versions&&Oe.versions.node){const[t,o]=Oe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Oe.getBuiltinModule(e)}return tr(e)};or("node:fs");let rr;const sr=e=>(rr??=w(import.meta.url))(e),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nr=e=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[t,o]=we.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return we.getBuiltinModule(e)}return sr(e)};nr("node:fs/promises");let ur;const ir=e=>(ur??=w(import.meta.url))(e),ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,lr=e=>{if(typeof ke<"u"&&ke.versions&&ke.versions.node){const[t,o]=ke.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ke.getBuiltinModule(e)}return ir(e)};lr("node:fs");let ar;const pr=e=>(ar??=w(import.meta.url))(e),Ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cr=e=>{if(typeof Ne<"u"&&Ne.versions&&Ne.versions.node){const[t,o]=Ne.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ne.getBuiltinModule(e)}return pr(e)};cr("node:fs/promises");let fr;const gr=e=>(fr??=w(import.meta.url))(e),He=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hr=e=>{if(typeof He<"u"&&He.versions&&He.versions.node){const[t,o]=He.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return He.getBuiltinModule(e)}return gr(e)};hr("node:fs");let dr;const br=e=>(dr??=w(import.meta.url))(e),Le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yr=e=>{if(typeof Le<"u"&&Le.versions&&Le.versions.node){const[t,o]=Le.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Le.getBuiltinModule(e)}return br(e)};yr("node:fs/promises");let mr;const vr=e=>(mr??=w(import.meta.url))(e),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ar=e=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[t,o]=Be.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Be.getBuiltinModule(e)}return vr(e)},{statSync:_r,lstatSync:Rr}=Ar("node:fs"),xr=(e,t={})=>{const o=t.cwd?me(t.cwd):process.cwd();let g=nt(o);const{root:p}=xo(g),r=me(t.stopAt??p),l=nt(g,r),a=t.type??"file",c=function(h){return[e]};t.allowSymlinks??=!0;const A=t.allowSymlinks?_r:Rr;for(;g;){for(let h of c()){if(h===co)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=me(h));const T=de(h)?h:nt(g,h);try{const C=A(T);if(a==="file"&&C.isFile()||a==="directory"&&C.isDirectory())return T}catch{}}if(g===l||g===p)break;g=_t(g)}};function Rt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ot={},ct,wt;function it(){if(wt)return ct;wt=1;const e="[^\\\\/]",t=Symbol("unignore"),o="\\.",g="\\+",p="\\?",r="\\/",l="(?=.)",a="[^/]",c=`(?:${r}|$)`,A=`(?:^|${r})`,h=`${o}{1,2}${c}`,T=`(?!${o})`,C=`(?!${A}${h})`,E=`(?!${o}{0,1}${c})`,L=`(?!${h})`,te=`[^.${r}]`,q=`${a}*?`,Z="/",B={DOT_LITERAL:o,PLUS_LITERAL:g,QMARK_LITERAL:p,SLASH_LITERAL:r,ONE_CHAR:l,QMARK:a,END_ANCHOR:c,DOTS_SLASH:h,NO_DOT:T,NO_DOTS:C,NO_DOT_SLASH:E,NO_DOTS_SLASH:L,QMARK_NO_DOT:te,STAR:q,START_ANCHOR:A,SEP:Z},b={...B,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${o}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[\\\\/])${o}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},y={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return ct={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:y,UNIGNORE:t,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(s){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${s.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(s){return s===!0?b:B}},ct}var kt;function lt(){return kt||(kt=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:g,REGEX_SPECIAL_CHARS_GLOBAL:p}=it();e.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),e.hasRegexChars=r=>g.test(r),e.isRegexChar=r=>r.length===1&&e.hasRegexChars(r),e.escapeRegex=r=>r.replace(p,"\\$1"),e.toPosixSlashes=r=>r.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const r=navigator.platform.toLowerCase();return r==="win32"||r==="windows"}return process.platform?process.platform==="win32":!1},e.removeBackslashes=r=>r.replace(o,l=>l==="\\"?"":l),e.escapeLast=(r,l,a)=>{const c=r.lastIndexOf(l,a);return c===-1?r:r[c-1]==="\\"?e.escapeLast(r,l,c-1):`${r.slice(0,c)}\\${r.slice(c)}`},e.removePrefix=(r,l={})=>{let a=r;return a.startsWith("./")&&(a=a.slice(2),l.prefix="./"),a},e.wrapOutput=(r,l={},a={})=>{const c=a.contains?"":"^",A=a.contains?"":"$";let h=`${c}(?:${r})${A}`;return l.negated===!0&&(h=`(?:^(?!${h}).*$)`),h},e.basename=(r,{windows:l}={})=>{const a=r.split(l?/[\\/]/:"/"),c=a[a.length-1];return c===""?a[a.length-2]:c}})(Ot)),Ot}var ft,Nt;function Tr(){if(Nt)return ft;Nt=1;const e=lt(),{CHAR_ASTERISK:t,CHAR_AT:o,CHAR_BACKWARD_SLASH:g,CHAR_COMMA:p,CHAR_DOT:r,CHAR_EXCLAMATION_MARK:l,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:c,CHAR_LEFT_PARENTHESES:A,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:T,CHAR_QUESTION_MARK:C,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:L,CHAR_RIGHT_SQUARE_BRACKET:te}=it(),q=B=>B===a||B===g,Z=B=>{B.isPrefix!==!0&&(B.depth=B.isGlobstar?1/0:1)};return ft=(B,b)=>{const y=b||{},s=B.length-1,R=y.parts===!0||y.scanToEnd===!0,O=[],m=[],x=[];let v=B,K=-1,U=0,V=0,pe=!1,J=!1,F=!1,ee=!1,ce=!1,ne=!1,oe=!1,G=!1,ue=!1,z=!1,fe=0,W,_,N={value:"",depth:0,isGlob:!1};const X=()=>K>=s,i=()=>v.charCodeAt(K+1),M=()=>(W=_,v.charCodeAt(++K));for(;K<s;){_=M();let Q;if(_===g){oe=N.backslashes=!0,_=M(),_===c&&(ne=!0);continue}if(ne===!0||_===c){for(fe++;X()!==!0&&(_=M());){if(_===g){oe=N.backslashes=!0,M();continue}if(_===c){fe++;continue}if(ne!==!0&&_===r&&(_=M())===r){if(pe=N.isBrace=!0,F=N.isGlob=!0,z=!0,R===!0)continue;break}if(ne!==!0&&_===p){if(pe=N.isBrace=!0,F=N.isGlob=!0,z=!0,R===!0)continue;break}if(_===E&&(fe--,fe===0)){ne=!1,pe=N.isBrace=!0,z=!0;break}}if(R===!0)continue;break}if(_===a){if(O.push(K),m.push(N),N={value:"",depth:0,isGlob:!1},z===!0)continue;if(W===r&&K===U+1){U+=2;continue}V=K+1;continue}if(y.noext!==!0&&(_===T||_===o||_===t||_===C||_===l)&&i()===A){if(F=N.isGlob=!0,ee=N.isExtglob=!0,z=!0,_===l&&K===U&&(ue=!0),R===!0){for(;X()!==!0&&(_=M());){if(_===g){oe=N.backslashes=!0,_=M();continue}if(_===L){F=N.isGlob=!0,z=!0;break}}continue}break}if(_===t){if(W===t&&(ce=N.isGlobstar=!0),F=N.isGlob=!0,z=!0,R===!0)continue;break}if(_===C){if(F=N.isGlob=!0,z=!0,R===!0)continue;break}if(_===h){for(;X()!==!0&&(Q=M());){if(Q===g){oe=N.backslashes=!0,M();continue}if(Q===te){J=N.isBracket=!0,F=N.isGlob=!0,z=!0;break}}if(R===!0)continue;break}if(y.nonegate!==!0&&_===l&&K===U){G=N.negated=!0,U++;continue}if(y.noparen!==!0&&_===A){if(F=N.isGlob=!0,R===!0){for(;X()!==!0&&(_=M());){if(_===A){oe=N.backslashes=!0,_=M();continue}if(_===L){z=!0;break}}continue}break}if(F===!0){if(z=!0,R===!0)continue;break}}y.noext===!0&&(ee=!1,F=!1);let I=v,ge="",n="";U>0&&(ge=v.slice(0,U),v=v.slice(U),V-=U),I&&F===!0&&V>0?(I=v.slice(0,V),n=v.slice(V)):F===!0?(I="",n=v):I=v,I&&I!==""&&I!=="/"&&I!==v&&q(I.charCodeAt(I.length-1))&&(I=I.slice(0,-1)),y.unescape===!0&&(n&&(n=e.removeBackslashes(n)),I&&oe===!0&&(I=e.removeBackslashes(I)));const u={prefix:ge,input:B,start:U,base:I,glob:n,isBrace:pe,isBracket:J,isGlob:F,isExtglob:ee,isGlobstar:ce,negated:G,negatedExtglob:ue};if(y.tokens===!0&&(u.maxDepth=0,q(_)||m.push(N),u.tokens=m),y.parts===!0||y.tokens===!0){let Q;for(let k=0;k<O.length;k++){const re=Q?Q+1:U,ie=O[k],Y=B.slice(re,ie);y.tokens&&(k===0&&U!==0?(m[k].isPrefix=!0,m[k].value=ge):m[k].value=Y,Z(m[k]),u.maxDepth+=m[k].depth),(k!==0||Y!=="")&&x.push(Y),Q=ie}if(Q&&Q+1<B.length){const k=B.slice(Q+1);x.push(k),y.tokens&&(m[m.length-1].value=k,Z(m[m.length-1]),u.maxDepth+=m[m.length-1].depth)}u.slashes=O,u.parts=x}return u},ft}var gt,Ht;function Er(){if(Ht)return gt;Ht=1;const e=it(),t=lt(),{MAX_LENGTH:o,POSIX_REGEX_SOURCE:g,REGEX_NON_SPECIAL_CHARS:p,REGEX_SPECIAL_CHARS_BACKREF:r,REPLACEMENTS:l}=e,a=(b,y)=>typeof y.expandRange=="function"?y.expandRange(...b,y):(b.sort(),`[${b.join("-")}]`),c=(b,y)=>`Missing ${b}: "${y}" - use "\\\\${y}" to match literal characters`,A=b=>{const y=[];let s=0,R=0,O=0,m="",x=!1;for(const v of b){if(x===!0){m+=v,x=!1;continue}if(v==="\\"){m+=v,x=!0;continue}if(v==='"'){O=O===1?0:1,m+=v;continue}if(O===0){if(v==="[")s++;else if(v==="]"&&s>0)s--;else if(s===0){if(v==="(")R++;else if(v===")"&&R>0)R--;else if(v==="|"&&R===0){y.push(m),m="";continue}}}m+=v}return y.push(m),y},h=b=>{let y=!1;for(const s of b){if(y===!0){y=!1;continue}if(s==="\\"){y=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},T=b=>{let y=b.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(y)&&(y=y.slice(2,-1),s=!0);if(h(y))return y.replace(/\\(.)/g,"$1")},C=b=>{const y=b.map(T).filter(Boolean);for(let s=0;s<y.length;s++)for(let R=s+1;R<y.length;R++){const O=y[s],m=y[R],x=O[0];if(!(!x||O!==x.repeat(O.length)||m!==x.repeat(m.length))&&(O===m||O.startsWith(m)||m.startsWith(O)))return!0}return!1},E=(b,y=!0)=>{if(b[0]!=="+"&&b[0]!=="*"||b[1]!=="(")return;let s=0,R=0,O=0,m=!1;for(let x=1;x<b.length;x++){const v=b[x];if(m===!0){m=!1;continue}if(v==="\\"){m=!0;continue}if(v==='"'){O=O===1?0:1;continue}if(O!==1){if(v==="["){s++;continue}if(v==="]"&&s>0){s--;continue}if(!(s>0)){if(v==="("){R++;continue}if(v===")"&&(R--,R===0))return y===!0&&x!==b.length-1?void 0:{type:b[0],body:b.slice(2,x),end:x}}}}},L=b=>`${b.length===1?t.escapeRegex(b[0]):`[${b.map(y=>t.escapeRegex(y)).join("")}]`}*`,te=b=>{let y=0;const s=[];for(;y<b.length;){const R=E(b.slice(y),!1);if(!R||R.type!=="*")return;const O=A(R.body).map(x=>x.trim());if(O.length!==1)return;const m=T(O[0]);if(!m||m.length!==1)return;s.push(m),y+=R.end+1}if(!(s.length<1))return s},q=b=>{let y=0,s=b.trim(),R=E(s);for(;R;)y++,s=R.body.trim(),R=E(s);return y},Z=(b,y)=>{if(y.maxExtglobRecursion===!1)return{risky:!1};const s=typeof y.maxExtglobRecursion=="number"?y.maxExtglobRecursion:e.DEFAULT_MAX_EXTGLOB_RECURSION,R=A(b).map(v=>v.trim());if(R.length>1&&(R.some(v=>v==="")||R.some(v=>/^[*?]+$/.test(v))||C(R)))return{risky:!0};const O=[];let m=!1,x=!0;for(const v of R){const K=te(v);if(K){m=!0,O.push(...K);continue}const U=T(v);if(U&&U.length===1){O.push(U);continue}if(x=!1,q(v)>s)return{risky:!0}}return m?x?{risky:!0,safeOutput:L([...new Set(O)])}:{risky:!0}:{risky:!1}},B=(b,y)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=l[b]||b;const s={...y},R=typeof s.maxLength=="number"?Math.min(o,s.maxLength):o;let O=b.length;if(O>R)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${R}`);const m={type:"bos",value:"",output:s.prepend||""},x=[m],v=s.capture?"":"?:",K=e.globChars(s.windows),U=e.extglobChars(K),{DOT_LITERAL:V,PLUS_LITERAL:pe,SLASH_LITERAL:J,ONE_CHAR:F,DOTS_SLASH:ee,NO_DOT:ce,NO_DOT_SLASH:ne,NO_DOTS_SLASH:oe,QMARK:G,QMARK_NO_DOT:ue,STAR:z,START_ANCHOR:fe}=K,W=d=>`(${v}(?:(?!${fe}${d.dot?ee:V}).)*?)`,_=s.dot?"":ce,N=s.dot?G:ue;let X=s.bash===!0?W(s):z;s.capture&&(X=`(${X})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const i={input:b,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:x};b=t.removePrefix(b,i),O=b.length;const M=[],I=[],ge=[];let n=m,u;const Q=()=>i.index===O-1,k=i.peek=(d=1)=>b[i.index+d],re=i.advance=()=>b[++i.index]||"",ie=()=>b.slice(i.index+1),Y=(d="",D=0)=>{i.consumed+=d,i.index+=D},ot=d=>{i.output+=d.output!=null?d.output:d.value,Y(d.value)},Jt=()=>{let d=1;for(;k()==="!"&&(k(2)!=="("||k(3)==="?");)re(),i.start++,d++;return d%2===0?!1:(i.negated=!0,i.start++,!0)},rt=d=>{i[d]++,ge.push(d)},he=d=>{i[d]--,ge.pop()},S=d=>{if(n.type==="globstar"){const D=i.braces>0&&(d.type==="comma"||d.type==="brace"),f=d.extglob===!0||M.length&&(d.type==="pipe"||d.type==="paren");d.type!=="slash"&&d.type!=="paren"&&!D&&!f&&(i.output=i.output.slice(0,-n.output.length),n.type="star",n.value="*",n.output=X,i.output+=n.output)}if(M.length&&d.type!=="paren"&&(M[M.length-1].inner+=d.value),(d.value||d.output)&&ot(d),n&&n.type==="text"&&d.type==="text"){n.output=(n.output||n.value)+d.value,n.value+=d.value;return}d.prev=n,x.push(d),n=d},st=(d,D)=>{const f={...U[D],conditions:1,inner:""};f.prev=n,f.parens=i.parens,f.output=i.output,f.startIndex=i.index,f.tokensIndex=x.length;const $=(s.capture?"(":"")+f.open;rt("parens"),S({type:d,value:D,output:i.output?"":F}),S({type:"paren",extglob:!0,value:re(),output:$}),M.push(f)},eo=d=>{const D=b.slice(d.startIndex,i.index+1),f=b.slice(d.startIndex+2,i.index),$=Z(f,s);if((d.type==="plus"||d.type==="star")&&$.risky){const H=$.safeOutput?(d.output?"":F)+(s.capture?`(${$.safeOutput})`:$.safeOutput):void 0,le=x[d.tokensIndex];le.type="text",le.value=D,le.output=H||t.escapeRegex(D);for(let ae=d.tokensIndex+1;ae<x.length;ae++)x[ae].value="",x[ae].output="",delete x[ae].suffix;i.output=d.output+le.output,i.backtrack=!0,S({type:"paren",extglob:!0,value:u,output:""}),he("parens");return}let P=d.close+(s.capture?")":""),j;if(d.type==="negate"){let H=X;if(d.inner&&d.inner.length>1&&d.inner.includes("/")&&(H=W(s)),(H!==X||Q()||/^\)+$/.test(ie()))&&(P=d.close=`)$))${H}`),d.inner.includes("*")&&(j=ie())&&/^\.[^\\/.]+$/.test(j)){const le=B(j,{...y,fastpaths:!1}).output;P=d.close=`)${le})${H})`}d.prev.type==="bos"&&(i.negatedExtglob=!0)}S({type:"paren",extglob:!0,value:u,output:P}),he("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let d=!1,D=b.replace(r,(f,$,P,j,H,le)=>j==="\\"?(d=!0,f):j==="?"?$?$+j+(H?G.repeat(H.length):""):le===0?N+(H?G.repeat(H.length):""):G.repeat(P.length):j==="."?V.repeat(P.length):j==="*"?$?$+j+(H?X:""):X:$?f:`\\${f}`);return d===!0&&(s.unescape===!0?D=D.replace(/\\/g,""):D=D.replace(/\\+/g,f=>f.length%2===0?"\\\\":f?"\\":"")),D===b&&s.contains===!0?(i.output=b,i):(i.output=t.wrapOutput(D,i,y),i)}for(;!Q();){if(u=re(),u==="\0")continue;if(u==="\\"){const f=k();if(f==="/"&&s.bash!==!0||f==="."||f===";")continue;if(!f){u+="\\",S({type:"text",value:u});continue}const $=/^\\+/.exec(ie());let P=0;if($&&$[0].length>2&&(P=$[0].length,i.index+=P,P%2!==0&&(u+="\\")),s.unescape===!0?u=re():u+=re(),i.brackets===0){S({type:"text",value:u});continue}}if(i.brackets>0&&(u!=="]"||n.value==="["||n.value==="[^")){if(s.posix!==!1&&u===":"){const f=n.value.slice(1);if(f.includes("[")&&(n.posix=!0,f.includes(":"))){const $=n.value.lastIndexOf("["),P=n.value.slice(0,$),j=n.value.slice($+2),H=g[j];if(H){n.value=P+H,i.backtrack=!0,re(),!m.output&&x.indexOf(n)===1&&(m.output=F);continue}}}(u==="["&&k()!==":"||u==="-"&&k()==="]")&&(u=`\\${u}`),u==="]"&&(n.value==="["||n.value==="[^")&&(u=`\\${u}`),s.posix===!0&&u==="!"&&n.value==="["&&(u="^"),n.value+=u,ot({value:u});continue}if(i.quotes===1&&u!=='"'){u=t.escapeRegex(u),n.value+=u,ot({value:u});continue}if(u==='"'){i.quotes=i.quotes===1?0:1,s.keepQuotes===!0&&S({type:"text",value:u});continue}if(u==="("){rt("parens"),S({type:"paren",value:u});continue}if(u===")"){if(i.parens===0&&s.strictBrackets===!0)throw new SyntaxError(c("opening","("));const f=M[M.length-1];if(f&&i.parens===f.parens+1){eo(M.pop());continue}S({type:"paren",value:u,output:i.parens?")":"\\)"}),he("parens");continue}if(u==="["){if(s.nobracket===!0||!ie().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(c("closing","]"));u=`\\${u}`}else rt("brackets");S({type:"bracket",value:u});continue}if(u==="]"){if(s.nobracket===!0||n&&n.type==="bracket"&&n.value.length===1){S({type:"text",value:u,output:`\\${u}`});continue}if(i.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(c("opening","["));S({type:"text",value:u,output:`\\${u}`});continue}he("brackets");const f=n.value.slice(1);if(n.posix!==!0&&f[0]==="^"&&!f.includes("/")&&(u=`/${u}`),n.value+=u,ot({value:u}),s.literalBrackets===!1||t.hasRegexChars(f))continue;const $=t.escapeRegex(n.value);if(i.output=i.output.slice(0,-n.value.length),s.literalBrackets===!0){i.output+=$,n.value=$;continue}n.value=`(${v}${$}|${n.value})`,i.output+=n.value;continue}if(u==="{"&&s.nobrace!==!0){rt("braces");const f={type:"brace",value:u,output:"(",outputIndex:i.output.length,tokensIndex:i.tokens.length};I.push(f),S(f);continue}if(u==="}"){const f=I[I.length-1];if(s.nobrace===!0||!f){S({type:"text",value:u,output:u});continue}let $=")";if(f.dots===!0){const P=x.slice(),j=[];for(let H=P.length-1;H>=0&&(x.pop(),P[H].type!=="brace");H--)P[H].type!=="dots"&&j.unshift(P[H].value);$=a(j,s),i.backtrack=!0}if(f.comma!==!0&&f.dots!==!0){const P=i.output.slice(0,f.outputIndex),j=i.tokens.slice(f.tokensIndex);f.value=f.output="\\{",u=$="\\}",i.output=P;for(const H of j)i.output+=H.output||H.value}S({type:"brace",value:u,output:$}),he("braces"),I.pop();continue}if(u==="|"){M.length>0&&M[M.length-1].conditions++,S({type:"text",value:u});continue}if(u===","){let f=u;const $=I[I.length-1];$&&ge[ge.length-1]==="braces"&&($.comma=!0,f="|"),S({type:"comma",value:u,output:f});continue}if(u==="/"){if(n.type==="dot"&&i.index===i.start+1){i.start=i.index+1,i.consumed="",i.output="",x.pop(),n=m;continue}S({type:"slash",value:u,output:J});continue}if(u==="."){if(i.braces>0&&n.type==="dot"){n.value==="."&&(n.output=V);const f=I[I.length-1];n.type="dots",n.output+=u,n.value+=u,f.dots=!0;continue}if(i.braces+i.parens===0&&n.type!=="bos"&&n.type!=="slash"){S({type:"text",value:u,output:V});continue}S({type:"dot",value:u,output:V});continue}if(u==="?"){if(!(n&&n.value==="(")&&s.noextglob!==!0&&k()==="("&&k(2)!=="?"){st("qmark",u);continue}if(n&&n.type==="paren"){const f=k();let $=u;(n.value==="("&&!/[!=<:]/.test(f)||f==="<"&&!/<([!=]|\w+>)/.test(ie()))&&($=`\\${u}`),S({type:"text",value:u,output:$});continue}if(s.dot!==!0&&(n.type==="slash"||n.type==="bos")){S({type:"qmark",value:u,output:ue});continue}S({type:"qmark",value:u,output:G});continue}if(u==="!"){if(s.noextglob!==!0&&k()==="("&&(k(2)!=="?"||!/[!=<:]/.test(k(3)))){st("negate",u);continue}if(s.nonegate!==!0&&i.index===0){Jt();continue}}if(u==="+"){if(s.noextglob!==!0&&k()==="("&&k(2)!=="?"){st("plus",u);continue}if(n&&n.value==="("||s.regex===!1){S({type:"plus",value:u,output:pe});continue}if(n&&(n.type==="bracket"||n.type==="paren"||n.type==="brace")||i.parens>0){S({type:"plus",value:u});continue}S({type:"plus",value:pe});continue}if(u==="@"){if(s.noextglob!==!0&&k()==="("&&k(2)!=="?"){S({type:"at",extglob:!0,value:u,output:""});continue}S({type:"text",value:u});continue}if(u!=="*"){(u==="$"||u==="^")&&(u=`\\${u}`);const f=p.exec(ie());f&&(u+=f[0],i.index+=f[0].length),S({type:"text",value:u});continue}if(n&&(n.type==="globstar"||n.star===!0)){n.type="star",n.star=!0,n.value+=u,n.output=X,i.backtrack=!0,i.globstar=!0,Y(u);continue}let d=ie();if(s.noextglob!==!0&&/^\([^?]/.test(d)){st("star",u);continue}if(n.type==="star"){if(s.noglobstar===!0){Y(u);continue}const f=n.prev,$=f.prev,P=f.type==="slash"||f.type==="bos",j=$&&($.type==="star"||$.type==="globstar");if(s.bash===!0&&(!P||d[0]&&d[0]!=="/")){S({type:"star",value:u,output:""});continue}const H=i.braces>0&&(f.type==="comma"||f.type==="brace"),le=M.length&&(f.type==="pipe"||f.type==="paren");if(!P&&f.type!=="paren"&&!H&&!le){S({type:"star",value:u,output:""});continue}for(;d.slice(0,3)==="/**";){const ae=b[i.index+4];if(ae&&ae!=="/")break;d=d.slice(3),Y("/**",3)}if(f.type==="bos"&&Q()){n.type="globstar",n.value+=u,n.output=W(s),i.output=n.output,i.globstar=!0,Y(u);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&!j&&Q()){i.output=i.output.slice(0,-(f.output+n.output).length),f.output=`(?:${f.output}`,n.type="globstar",n.output=W(s)+(s.strictSlashes?")":"|$)"),n.value+=u,i.globstar=!0,i.output+=f.output+n.output,Y(u);continue}if(f.type==="slash"&&f.prev.type!=="bos"&&d[0]==="/"){const ae=d[1]!==void 0?"|$":"";i.output=i.output.slice(0,-(f.output+n.output).length),f.output=`(?:${f.output}`,n.type="globstar",n.output=`${W(s)}${J}|${J}${ae})`,n.value+=u,i.output+=f.output+n.output,i.globstar=!0,Y(u+re()),S({type:"slash",value:"/",output:""});continue}if(f.type==="bos"&&d[0]==="/"){n.type="globstar",n.value+=u,n.output=`(?:^|${J}|${W(s)}${J})`,i.output=n.output,i.globstar=!0,Y(u+re()),S({type:"slash",value:"/",output:""});continue}if(H&&d[0]==="/"){n.type="globstar",n.value+=u,n.output=`(?:^|${J}|${W(s)}${J})`,i.output+=n.output,i.globstar=!0,Y(u+re()),S({type:"slash",value:"/",output:""});continue}i.output=i.output.slice(0,-n.output.length),n.type="globstar",n.output=W(s),n.value+=u,i.output+=n.output,i.globstar=!0,Y(u);continue}const D={type:"star",value:u,output:X};if(s.bash===!0){D.output=".*?",(n.type==="bos"||n.type==="slash")&&(D.output=_+D.output),S(D);continue}if(n&&(n.type==="bracket"||n.type==="paren")&&s.regex===!0){D.output=u,S(D);continue}(i.index===i.start||n.type==="slash"||n.type==="dot")&&(n.type==="dot"?(i.output+=ne,n.output+=ne):s.dot===!0?(i.output+=oe,n.output+=oe):(i.output+=_,n.output+=_),k()!=="*"&&(i.output+=F,n.output+=F)),S(D)}for(;i.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(c("closing","]"));i.output=t.escapeLast(i.output,"["),he("brackets")}for(;i.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(c("closing",")"));i.output=t.escapeLast(i.output,"("),he("parens")}for(;i.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(c("closing","}"));i.output=t.escapeLast(i.output,"{"),he("braces")}if(s.strictSlashes!==!0&&(n.type==="star"||n.type==="bracket")&&S({type:"maybe_slash",value:"",output:`${J}?`}),i.backtrack===!0){i.output="";for(const d of i.tokens)i.output+=d.output!=null?d.output:d.value,d.suffix&&(i.output+=d.suffix)}return i};return B.fastpaths=(b,y)=>{const s={...y},R=typeof s.maxLength=="number"?Math.min(o,s.maxLength):o,O=b.length;if(O>R)throw new SyntaxError(`Input length: ${O}, exceeds maximum allowed length: ${R}`);b=l[b]||b;const{DOT_LITERAL:m,SLASH_LITERAL:x,ONE_CHAR:v,DOTS_SLASH:K,NO_DOT:U,NO_DOTS:V,NO_DOTS_SLASH:pe,STAR:J,START_ANCHOR:F}=e.globChars(s.windows),ee=s.dot?V:U,ce=s.dot?pe:U,ne=s.capture?"":"?:",oe={negated:!1,prefix:""};let G=s.bash===!0?".*?":J;s.capture&&(G=`(${G})`);const ue=_=>_.noglobstar===!0?G:`(${ne}(?:(?!${F}${_.dot?K:m}).)*?)`,z=_=>{switch(_){case"*":return`${ee}${v}${G}`;case".*":return`${m}${v}${G}`;case"*.*":return`${ee}${G}${m}${v}${G}`;case"*/*":return`${ee}${G}${x}${v}${ce}${G}`;case"**":return ee+ue(s);case"**/*":return`(?:${ee}${ue(s)}${x})?${ce}${v}${G}`;case"**/*.*":return`(?:${ee}${ue(s)}${x})?${ce}${G}${m}${v}${G}`;case"**/.*":return`(?:${ee}${ue(s)}${x})?${m}${v}${G}`;default:{const N=/^(.*?)\.(\w+)$/.exec(_);if(!N)return;const X=z(N[1]);return X?X+m+N[2]:void 0}}},fe=t.removePrefix(b,oe);let W=z(fe);return W&&s.strictSlashes!==!0&&(W+=`${x}?`),W},gt=B,gt}var ht,Lt;function Cr(){if(Lt)return ht;Lt=1;const e=Tr(),t=Er(),o=lt(),g=it(),p=l=>l&&typeof l=="object"&&!Array.isArray(l),r=(l,a,c=!1)=>{if(Array.isArray(l)){const q=l.map(Z=>r(Z,a,c));return Z=>{for(const B of q){const b=B(Z);if(b)return b}return!1}}const A=p(l)&&l.tokens&&l.input;if(l===""||typeof l!="string"&&!A)throw new TypeError("Expected pattern to be a non-empty string");const h=a||{},T=h.windows,C=A?r.compileRe(l,a):r.makeRe(l,a,!1,!0),E=C.state;delete C.state;let L=()=>!1;if(h.ignore){const q={...a,ignore:null,onMatch:null,onResult:null};L=r(h.ignore,q,c)}const te=(q,Z=!1)=>{const{isMatch:B,match:b,output:y}=r.test(q,C,a,{glob:l,posix:T}),s={glob:l,state:E,regex:C,posix:T,input:q,output:y,match:b,isMatch:B};if(typeof h.onResult=="function"&&h.onResult(s),B===!1)return s.isMatch=!1,Z?s:!1;e:if(L(q)){if(typeof h.onIgnore=="function"&&h.onIgnore(s)===g.UNIGNORE){s.isMatch=!0;break e}return s.isMatch=!1,Z?s:!1}return typeof h.onMatch=="function"&&h.onMatch(s),Z?s:!0};return c&&(te.state=E),te};return r.test=(l,a,c,{glob:A,posix:h}={})=>{if(typeof l!="string")throw new TypeError("Expected input to be a string");if(l==="")return{isMatch:!1,output:""};const T=c||{},C=T.format||(h?o.toPosixSlashes:null);let E=l===A,L=E&&C?C(l):l;return E===!1&&(L=C?C(l):l,E=L===A),(E===!1||T.capture===!0)&&(T.matchBase===!0||T.basename===!0?E=r.matchBase(l,a,c,h):E=a.exec(L)),{isMatch:!!E,match:E,output:L}},r.matchBase=(l,a,c,A=c&&c.windows)=>(a instanceof RegExp?a:r.makeRe(a,c)).test(o.basename(l,{windows:A})),r.isMatch=(l,a,c)=>r(a,c)(l),r.parse=(l,a)=>Array.isArray(l)?l.map(c=>r.parse(c,a)):t(l,{...a,fastpaths:!1}),r.scan=(l,a)=>e(l,a),r.compileRe=(l,a,c=!1,A=!1)=>{if(c===!0)return l.output;const h=a||{},T=h.contains?"":"^",C=h.contains?"":"$";let E=`${T}(?:${l.output})${C}`;l&&l.negated===!0&&(E=`^(?!${E}).*$`);const L=r.toRegex(E,a);return A===!0&&(L.state=l),L},r.makeRe=(l,a={},c=!1,A=!1)=>{if(!l||typeof l!="string")throw new TypeError("Expected a non-empty string");let h={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(l[0]==="."||l[0]==="*")&&(h.output=t.fastpaths(l,a)),h.output||(h=t(l,a)),r.compileRe(h,a,c,A)},r.toRegex=(l,a)=>{try{const c=a||{};return new RegExp(l,c.flags||(c.nocase?"i":""))}catch(c){if(a&&a.debug===!0)throw c;return/$^/}},r.constants=g,ht=r,ht}var dt,Bt;function Sr(){if(Bt)return dt;Bt=1;const e=Cr(),t=lt();function o(g,p,r=!1){return p&&(p.windows===null||p.windows===void 0)&&(p={...p,windows:t.isWindows()}),e(g,p,r)}return Object.assign(o,e),dt=o,dt}var $r=Sr();Rt($r);let Or;const wr=e=>(Or??=w(import.meta.url))(e),Ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tt=e=>{if(typeof Ie<"u"&&Ie.versions&&Ie.versions.node){const[t,o]=Ie.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ie.getBuiltinModule(e)}return wr(e)};tt("fs");tt("fs");tt("path");tt("url");const{createRequire:kr}=tt("module");var It=kr(import.meta.url);try{It.resolve("picomatch"),It("picomatch")}catch{}var bt,Mt;function Nr(){if(Mt)return bt;Mt=1;/*!
|
|
2
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/return bt=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},bt}var yt,Dt;function Wt(){if(Dt)return yt;Dt=1;/*!
|
|
7
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
8
|
+
*
|
|
9
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
10
|
+
* Released under the MIT License.
|
|
11
|
+
*/var e=Nr(),t={"{":"}","(":")","[":"]"},o=function(p){if(p[0]==="!")return!0;for(var r=0,l=-2,a=-2,c=-2,A=-2,h=-2;r<p.length;){if(p[r]==="*"||p[r+1]==="?"&&/[\].+)]/.test(p[r])||a!==-1&&p[r]==="["&&p[r+1]!=="]"&&(a<r&&(a=p.indexOf("]",r)),a>r&&(h===-1||h>a||(h=p.indexOf("\\",r),h===-1||h>a)))||c!==-1&&p[r]==="{"&&p[r+1]!=="}"&&(c=p.indexOf("}",r),c>r&&(h=p.indexOf("\\",r),h===-1||h>c))||A!==-1&&p[r]==="("&&p[r+1]==="?"&&/[:!=]/.test(p[r+2])&&p[r+3]!==")"&&(A=p.indexOf(")",r),A>r&&(h=p.indexOf("\\",r),h===-1||h>A))||l!==-1&&p[r]==="("&&p[r+1]!=="|"&&(l<r&&(l=p.indexOf("|",r)),l!==-1&&p[l+1]!==")"&&(A=p.indexOf(")",l),A>l&&(h=p.indexOf("\\",l),h===-1||h>A))))return!0;if(p[r]==="\\"){var T=p[r+1];r+=2;var C=t[T];if(C){var E=p.indexOf(C,r);E!==-1&&(r=E+1)}if(p[r]==="!")return!0}else r++}return!1},g=function(p){if(p[0]==="!")return!0;for(var r=0;r<p.length;){if(/[*?{}()[\]]/.test(p[r]))return!0;if(p[r]==="\\"){var l=p[r+1];r+=2;var a=t[l];if(a){var c=p.indexOf(a,r);c!==-1&&(r=c+1)}if(p[r]==="!")return!0}else r++}return!1};return yt=function(p,r){if(typeof p!="string"||p==="")return!1;if(e(p))return!0;var l=o;return r&&r.strict===!1&&(l=g),l(p)},yt}let Hr;const Lr=e=>(Hr??=w(import.meta.url))(e),Me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qt=e=>{if(typeof Me<"u"&&Me.versions&&Me.versions.node){const[t,o]=Me.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Me.getBuiltinModule(e)}return Lr(e)},Br=Qt("path"),Ir=Qt("os");var mt,Gt;function Mr(){if(Gt)return mt;Gt=1;var e=Wt(),t=Br.posix.dirname,o=Ir.platform()==="win32",g="/",p=/\\/g,r=/\\([!*?|[\](){}])/g;mt=function(c,A){var h=Object.assign({flipBackslashes:!0},A);h.flipBackslashes&&o&&c.indexOf(g)<0&&(c=c.replace(p,g)),l(c)&&(c+=g),c+="a";do c=t(c);while(a(c));return c.replace(r,"$1")};function l(c){var A=c.slice(-1),h;switch(A){case"}":h="{";break;case"]":h="[";break;default:return!1}var T=c.indexOf(h);return T<0?!1:c.slice(T+1,-1).includes(g)}function a(c){return/\([^()]+$/.test(c)||c[0]==="{"||c[0]==="["||/[^\\][{[]/.test(c)?!0:e(c)}return mt}var Dr=Mr();Rt(Dr);let Gr;const Pr=e=>(Gr??=w(import.meta.url))(e),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ur=e=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[t,o]=De.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return De.getBuiltinModule(e)}return Pr(e)};Ur("node:fs/promises");let Fr;const jr=e=>(Fr??=w(import.meta.url))(e),Ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Kr=e=>{if(typeof Ge<"u"&&Ge.versions&&Ge.versions.node){const[t,o]=Ge.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ge.getBuiltinModule(e)}return jr(e)},{accessSync:Xr}=Kr("node:fs");function ut(e,t=po){zt(e),e=me(e);try{return Xr(e,t),!0}catch{return!1}}var zr=Wt();Rt(zr);let Wr;const Qr=e=>(Wr??=w(import.meta.url))(e),Pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qt=e=>{if(typeof Pe<"u"&&Pe.versions&&Pe.versions.node){const[t,o]=Pe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Pe.getBuiltinModule(e)}return Qr(e)};qt("node:fs/promises");qt("node:fs");let qr=class extends Error{constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}},Zr;const Yr=e=>(Zr??=w(import.meta.url))(e),Ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zt=e=>{if(typeof Ue<"u"&&Ue.versions&&Ue.versions.node){const[t,o]=Ue.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ue.getBuiltinModule(e)}return Yr(e)};Zt("node:fs/promises");Zt("node:zlib");let Vr;const Jr=e=>(Vr??=w(import.meta.url))(e),Fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yt=e=>{if(typeof Fe<"u"&&Fe.versions&&Fe.versions.node){const[t,o]=Fe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Fe.getBuiltinModule(e)}return Jr(e)};Yt("node:fs");Yt("node:zlib");let es;const ts=e=>(es??=w(import.meta.url))(e),je=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vt=e=>{if(typeof je<"u"&&je.versions&&je.versions.node){const[t,o]=je.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return je.getBuiltinModule(e)}return ts(e)};Vt("node:fs");Vt("node:fs/promises");let os;const rs=e=>(os??=w(import.meta.url))(e),Ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ss=e=>{if(typeof Ke<"u"&&Ke.versions&&Ke.versions.node){const[t,o]=Ke.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ke.getBuiltinModule(e)}return rs(e)};ss("node:fs");let ns;const us=e=>(ns??=w(import.meta.url))(e),Xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,is=e=>{if(typeof Xe<"u"&&Xe.versions&&Xe.versions.node){const[t,o]=Xe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Xe.getBuiltinModule(e)}return us(e)};is("node:fs/promises");let ls;const as=e=>(ls??=w(import.meta.url))(e),ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ps=e=>{if(typeof ze<"u"&&ze.versions&&ze.versions.node){const[t,o]=ze.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ze.getBuiltinModule(e)}return as(e)};ps("node:fs");let cs;const fs=e=>(cs??=w(import.meta.url))(e),We=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gs=e=>{if(typeof We<"u"&&We.versions&&We.versions.node){const[t,o]=We.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return We.getBuiltinModule(e)}return fs(e)};gs("node:crypto");new TextEncoder;let hs;const ds=e=>(hs??=w(import.meta.url))(e),Qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,bs=e=>{if(typeof Qe<"u"&&Qe.versions&&Qe.versions.node){const[t,o]=Qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Qe.getBuiltinModule(e)}return ds(e)};bs("node:fs/promises");let ys;const ms=e=>(ys??=w(import.meta.url))(e),qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vs=e=>{if(typeof qe<"u"&&qe.versions&&qe.versions.node){const[t,o]=qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return qe.getBuiltinModule(e)}return ms(e)};vs("node:fs");let As;const _s=e=>(As??=w(import.meta.url))(e),Ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Rs=e=>{if(typeof Ze<"u"&&Ze.versions&&Ze.versions.node){const[t,o]=Ze.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ze.getBuiltinModule(e)}return _s(e)};Rs("node:fs/promises");let xs;const Ts=e=>(xs??=w(import.meta.url))(e),Ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Es=e=>{if(typeof Ye<"u"&&Ye.versions&&Ye.versions.node){const[t,o]=Ye.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ye.getBuiltinModule(e)}return Ts(e)};Es("node:fs");let Cs;const Ss=e=>(Cs??=w(import.meta.url))(e),Ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xt=e=>{if(typeof Ve<"u"&&Ve.versions&&Ve.versions.node){const[t,o]=Ve.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ve.getBuiltinModule(e)}return Ss(e)},$s=xt("fs"),Os=xt("os"),ws=xt("path");var vt={},Pt;function ks(){if(Pt)return vt;Pt=1;var e=Object.defineProperty,t=(h,T)=>e(h,"name",{value:T,configurable:!0}),o=$s,g=Os,p=ws;const r=t(h=>{let T="";for(let C=0;C<h.length;C+=1){const E=h[C],L=E.toUpperCase();T+=E===L?E.toLowerCase():L}return T},"invertCase"),l=new Map,a=t((h,T)=>{const C=p.join(h,`.is-fs-case-sensitive-test-${process.pid}`);try{return T.writeFileSync(C,""),!T.existsSync(r(C))}finally{try{T.unlinkSync(C)}catch{}}},"checkDirectoryCaseWithWrite"),c=t((h,T,C)=>{try{return a(h,C)}catch(E){if(T===void 0)return a(g.tmpdir(),C);throw E}},"checkDirectoryCaseWithFallback"),A=t((h,T=o,C=!0)=>{const E=h??process.cwd();if(C&&l.has(E))return l.get(E);let L;const te=r(E);return te!==E&&T.existsSync(E)?L=!T.existsSync(te):L=c(E,h,T),C&&l.set(E,L),L},"isFsCaseSensitive");return vt.isFsCaseSensitive=A,vt}ks();const Ut=e=>{const t=lo();if(Tt==="win32"){const r=et.LOCALAPPDATA,l=t?se(t,"AppData","Local"):at(),a=r&&r.length>0?r:l;return se(a,e,"Cache")}if(Tt==="darwin"){const r=t?se(t,"Library","Caches"):at();return se(r,e)}const o=et.XDG_CACHE_HOME,g=t?se(t,".cache"):at(),p=o&&o.length>0?o:g;return se(p,e)},Ns=e=>{if(e.length===0)return;const t=e.map(r=>nt(me(r)).split(pt));let o=Number.POSITIVE_INFINITY;for(const r of t)r.length<o&&(o=r.length);const g=[];for(let r=0;r<o;r+=1){const l=t[0][r];if(t.every(a=>a[r]===l))g.push(l);else break}const p=g.join(pt);return p===""?pt:p},Je=(e,t)=>{if(e!==void 0)return t?(...o)=>se(e,...o):e},Hs=e=>{if(e?.files&&e.files.length>0){const t=Ns(e.files);if(t!==void 0)return t}return e?.cwd??ao()},Ls=e=>new qr(`No package.json found searching upwards from '${me(e)}'.`),Bs=e=>!ut(e,Kt)&&ut(e),Is=(e,t)=>{if(et.CACHE_DIR&&!["0","1","false","true"].includes(et.CACHE_DIR)){const A=se(et.CACHE_DIR,e);return t?.create&&Ee(A),Je(A,t?.thunk)}const o=Hs(t),g=xr("package.json",{cwd:o,type:"file"});if(!g){if(t?.useGlobalCacheFallback){const A=Ut(e);return t.create&&Ee(A),Je(A,t.thunk)}if(t?.throwError)throw Ls(o);return}const p=_t(g),r=se(p,"node_modules"),l=se(r,".cache"),a=se(l,e);if(ut(a,Kt))return t?.create&&Ee(a),Je(a,t?.thunk);const c=[a,l,r];if(ut(r)||c.push(p),c.some(A=>Bs(A))){if(t?.useGlobalCacheFallback){const A=Ut(e);return t.create&&Ee(A),Je(A,t.thunk)}return}return t?.create&&Ee(a),Je(a,t?.thunk)},Ps=Is,Ft="@inherit",Ms=["aliases","dependsOn","inputs","outputs"],Ds=(e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(Ft))return[...t];const o=[];for(const g of t){if(g===Ft){e!==void 0&&o.push(...e);continue}o.push(g)}return o},Us=(e,t)=>{const o={...e,...t};for(const g of Ms){const p=e?.[g],r=t?.[g],l=Ds(p,r);l===void 0?delete o[g]:o[g]=l}return o};export{Ps as K,Us as m};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{v as m,w as v,l as I,z as j}from"./index-
|
|
1
|
+
import{createRequire as _}from"node:module";import{v as m,w as v,l as I,z as j}from"./index-BLtnel38.js";let y;const b=e=>(y??=_(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[s,r]=h.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return h.getBuiltinModule(e)}return b(e)},{platform:C}=T("node:os"),x={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},q=e=>{const s=e.preset??e.options?.preset;if(!s)return e;const r=x[s];if(!r)return e;const{cache:n,...t}=r;return{...e,cache:e.cache??n,options:{...t,...e.options}}},$=()=>{const e=C();return e==="darwin"?"macos":e==="win32"?"windows":"linux"},k=(e,s)=>{if(!s||s.size===0)return!0;const r=e?.runnerTags;return!r||r.length===0?!0:r.some(n=>s.has(n))},A=(e,s,r=!0)=>{const n=e?.runInCI??!0;return n===!0||n==="always"?!0:n===!1?!s:n==="affected"?!s||r:!0},z=(e,s,r)=>r||!s?e:m(s)?s:v(e,s),B=(e,s)=>{if(s===!1)return{};const r=s===!0?O("production"):Array.isArray(s)?s:[s],n={};for(const t of r)Object.assign(n,R(e,t,n));return n},g=(e,s)=>{const r=t=>{const c=s[t];return c!==void 0?c:process.env[t]??""};let n="";for(let t=0;t<e.length;t+=1){const c=e[t];if(c==="\\"&&e[t+1]==="$"){n+="$",t+=1;continue}if(c!=="$"){n+=c;continue}const a=e[t+1];if(a==="{"){let o=1,l=t+2;for(;l<e.length;){const d=e[l];if(d==="}"){if(o-=1,o===0)break}else d==="{"&&e[l-1]==="$"&&(o+=1);l+=1}if(o!==0){n+=e.slice(t);break}const f=l,i=e.slice(t+2,f),u=i.indexOf(":-");if(u===-1)n+=r(i);else{const d=i.slice(0,u),w=i.slice(u+2),p=s[d]??process.env[d];n+=p!==void 0&&p!==""?p:g(w,s)}t=f;continue}if(a!==void 0&&/[A-Z_]/i.test(a)){let o=t+1;for(;o<e.length&&/\w/.test(e[o]);)o+=1;n+=r(e.slice(t+1,o)),t=o-1;continue}n+=c}return n},O=e=>{const s=[".env"];return e&&s.push(`.env.${e}`),e!=="test"&&s.push(".env.local"),e&&e!=="test"&&s.push(`.env.${e}.local`),s},R=(e,s,r={})=>{const n=m(s)?s:v(e,s);if(!I(n))return{};let t;try{t=j(n)}catch{return{}}const c={};for(const a of t.split(/\r?\n/)){const o=a.trim();if(o===""||o.startsWith("#"))continue;const l=o.indexOf("=");if(l===-1)continue;const f=o.slice(0,l).trim();if(f==="")continue;let i=o.slice(l+1).trim();const u=i.length>=2&&i.startsWith("'")&&i.endsWith("'");(i.startsWith('"')&&i.endsWith('"')||u)&&(i=i.slice(1,-1)),u||(i=g(i,{...r,...c})),c[f]=i}return c},F=(e,s=$())=>{if(e)return s==="windows"&&e.windowsShell?e.windowsShell:(s==="linux"||s==="macos")&&e.unixShell?e.unixShell:e.shell},M=e=>{if(e==="run")return!1;if(e==="build"||e==="test")return!0};export{F as a,M as b,q as c,$ as d,B as l,k as m,z as r,A as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as F}from"node:module";import{w as v,l as m,a as J,z as y}from"./index-uBVnF4ji.js";import{a as W}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";let D;const q=o=>(D??=F(import.meta.url))(o),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=o=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,n]=w.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return w.getBuiltinModule(o)}return q(o)},{execFileSync:x}=M("node:child_process"),{randomBytes:B}=M("node:crypto"),{writeFileSync:I,renameSync:R,unlinkSync:U}=M("node:fs"),{delimiter:z}=M("node:path"),H=["proto","mise","fnm","volta","asdf","nvm","corepack"],Z={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["aube","bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},X=["proto","mise","fnm","volta","asdf","nvm","corepack"],A={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},b=new Map,h=o=>{const e=b.get(o);if(e!==void 0||b.has(o))return e;const n=process.env.PATH;if(!n){b.set(o,void 0);return}const t=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const r of n.split(z)){const i=r.replaceAll(/^["']|["']$/g,"").trim();if(i!=="")for(const l of t){const s=`${i}${J}${o}${l}`;if(m(s))return b.set(o,s),s}}b.set(o,void 0)},S=(o,e=["--version"])=>{try{const n=x(o,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),t=/\d+\.\d+(?:\.\d+)?/.exec(n);return t?t[0]:n.trim()||void 0}catch{return}},T=(o,e)=>{const n=v(o,"package.json");if(!m(n))return[];try{const t=W(n)[e];if(e==="volta"&&typeof t=="object"&&t!==null&&Object.keys(t).length>0)return["package.json"];if(e==="packageManager"&&typeof t=="string"&&t.length>0)return["package.json"]}catch{}return[]},G=(o,e)=>o==="volta"?T(e,"volta"):o==="corepack"?T(e,"packageManager"):A[o].filter(n=>m(v(e,n))),_=new Map,L=()=>{_.clear(),b.clear()},O=(o,e)=>{{const i=_.get(o);if(i)return i}const n=[],t=!!h("pnpm")||!!h("yarn");for(const i of X){const l=i==="nvm"?void 0:h(i),s=i==="nvm"&&!!process.env.NVM_DIR,c=G(i,o),a=!!l||s;i==="corepack"&&!a&&(!(c.length>0)||t)||!a&&c.length===0||n.push({binPath:l,configFiles:c,installed:a,name:i,version:l?S(l):void 0})}const r=Object.freeze(n);return _.set(o,r),r},de=(o,e,n)=>{const t=O(o);return e?.preferredManager&&e.preferredManager!=="none"?t.find(r=>r.name===e.preferredManager)??{configFiles:[],installed:!1,name:e.preferredManager}:t.find(r=>r.installed&&r.configFiles.length>0)??t.find(r=>r.installed)??t.find(r=>r.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},V=(o,e)=>{for(const n of e){const t=v(o,n);if(m(t))try{const r=y(t).trim();if(r!=="")return{name:n,value:r.replace(/^v/,"")}}catch{}}},K=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,Y=o=>{const e=v(o,".prototools");if(!m(e))return[];const n=y(e),t=[];let r=!1;for(const i of n.split(/\r?\n/)){const l=i.trim();if(l===""||l.startsWith("#"))continue;if(l.startsWith("[")){r=!0;continue}if(r)continue;const s=K.exec(l);if(!s)continue;const[,c,a]=s,p=g(c);p&&t.push({source:".prototools",tool:p,version:a.trim()})}return t},Q=/^\[tools\]\s*$/i,ee=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,oe=o=>{for(const e of A.mise){const n=v(o,e);if(!m(n))continue;const t=[],r=y(n);let i=!1;for(const l of r.split(/\r?\n/)){const s=l.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=Q.test(s);continue}if(!i)continue;const c=ee.exec(s);if(!c)continue;const[,a,p]=c,d=g(a);d&&t.push({source:".mise.toml",tool:d,version:p.trim()})}if(t.length>0)return t}return[]},ne=o=>{const e=v(o,".tool-versions");if(!m(e))return[];const n=y(e),t=[];for(const r of n.split(/\r?\n/)){const i=r.trim();if(i===""||i.startsWith("#"))continue;const l=i.split(/\s+/);if(l.length<2)continue;const[s,...c]=l,a=g(s);a&&c[0]&&t.push({source:".tool-versions",tool:a,version:c[0]})}return t},g=o=>{switch(o.toLowerCase()){case"aube":return"aube";case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},te=o=>{const[e]=o.split("+",1),n=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(e??"");if(!n)return;const t=g(n[1]);if(t)return{source:"packageManager",tool:t,version:n[2]}},re=(o,e)=>{const n=new Map,t=s=>{n.set(s.tool,s)},r=v(o,"package.json");let i={};try{m(r)&&(i=W(r))}catch{}if(i.engines)for(const[s,c]of Object.entries(i.engines)){const a=g(s);a&&typeof c=="string"&&t({source:"engines",tool:a,version:c})}if(i.packageManager){const s=te(i.packageManager);s&&t(s)}if(i.volta)for(const[s,c]of Object.entries(i.volta)){const a=g(s);a&&typeof c=="string"&&t({source:"volta",tool:a,version:c})}const l=V(o,[".nvmrc",".node-version"]);l&&t({source:l.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:l.value});for(const s of ne(o))t(s);for(const s of oe(o))t(s);for(const s of Y(o))t(s);if(e?.tools)for(const[s,c]of Object.entries(e.tools)){const a=g(s);a&&typeof c=="string"&&t({source:"vis.config.ts",tool:a,version:c})}return[...n.values()]},P={aube:{args:["--version"],binaries:["aube"]},bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},E=o=>{const e=P[o];for(const n of e.binaries){const t=h(n);if(t)return S(t,e.args)}if(o==="node")return process.versions.node},N=(o,e)=>{const n=e.trim();if(n===""||n==="*"||n==="latest")return!0;if(/^\d[\d.]*$/.test(n))return o===n||o.startsWith(`${n}.`);const t=s=>s.split(/[.\-+]/).map(c=>Number.parseInt(c,10)||0),r=(s,c)=>{const a=t(s),p=t(c),d=Math.max(a.length,p.length);for(let f=0;f<d;f++){const $=a[f]??0,u=p[f]??0;if($!==u)return $-u}return 0},i=s=>{for(const c of s)if(c.startsWith(">=")){if(r(o,c.slice(2).trim())<0)return!1}else if(c.startsWith("<=")){if(r(o,c.slice(2).trim())>0)return!1}else if(c.startsWith(">")){if(r(o,c.slice(1).trim())<=0)return!1}else if(c.startsWith("<")){if(r(o,c.slice(1).trim())>=0)return!1}else if(c.startsWith("^")||c.startsWith("~")){const a=c.slice(1).trim(),[p,d]=t(a),[f,$]=t(o);if(f!==p||c.startsWith("~")&&$!==d||r(o,a)<0)return!1}return!0},l=n.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return l.length===0?!0:l.some(s=>i(s))},se=(o,e)=>{switch(o){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return e==="pnpm"||e==="yarn"?["self-activate","volta","proto","mise","corepack"]:e==="npm"?["volta","proto","mise","asdf","corepack"]:e==="aube"?["mise"]:e==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},ie=(o,e,n)=>{if(n?.preferredManager&&n.preferredManager!=="none"&&j(n.preferredManager,o.tool)){const r=e.find(i=>i.name===n.preferredManager);return r?{installed:r.installed,name:r.name}:{installed:!1,name:n.preferredManager,note:`${n.preferredManager} is the preferred manager but isn't on PATH`}}const t=se(o.source,o.tool);for(const r of t){if(r==="self-activate"){if((o.tool==="pnpm"||o.tool==="yarn")&&h(o.tool))return{installed:!0,name:"self-activate",note:`${o.tool} will activate ${o.version} from the packageManager field on next invocation`};continue}if(j(r,o.tool)&&e.find(i=>i.name===r)?.installed)return{installed:!0,name:r}}for(const r of t)if(!(r==="self-activate"||!j(r,o.tool)))return{installed:!1,name:r,note:`${r} can install ${o.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},j=(o,e)=>o==="none"?!1:o==="self-activate"?e==="pnpm"||e==="yarn":Z[o].includes(e),ae=(o,e)=>{const n=O(o),t=re(o,e).map(r=>{const i=E(r.tool),l=i!==void 0&&N(i,r.version),s=ie(r,n,e);return{actual:i,expected:r,manager:s,matches:l}});return{detected:n,tools:t}},ce=(o,e)=>{switch(o){case"asdf":return e?{args:["install",e.tool,e.version],bin:"asdf"}:void 0;case"corepack":return e?{args:["prepare",`${e.tool}@${e.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return e?.tool!=="node"?void 0:{args:["install",e.version],bin:"fnm"};case"mise":return e?{args:["install",`${e.tool}@${e.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return e?{args:["install",e.tool,e.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:e?.tool??"pnpm",hint:`${e?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return e?{args:["install",`${e.tool}@${e.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},ge=(o,e)=>{switch(o){case"asdf":return{args:["local",e.tool,e.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${e.tool} ${e.version}`}};case"corepack":return e.tool!=="npm"&&e.tool!=="pnpm"&&e.tool!=="yarn"?void 0:{args:["use",`${e.tool}@${e.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${e.tool}@${e.version}"`}};case"fnm":return e.tool==="node"?{args:["use",e.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${e.tool}@${e.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${e.tool} ${e.version}`}};case"none":return;case"nvm":return e.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",e.tool,e.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${e.tool} ${e.version}`}};case"self-activate":return{args:[],bin:e.tool,configChange:{file:"package.json",hint:`Set packageManager: "${e.tool}@${e.version}" — ${e.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${e.tool}@${e.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${e.tool}`}};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},he=o=>{for(const e of P[o].binaries){const n=h(e);if(n)return n}},$e=(o,e)=>{const n=P[e].binaries;if(o.installed&&o.binPath&&(o.name==="proto"||o.name==="mise"||o.name==="asdf"||o.name==="volta"||o.name==="fnm"))for(const t of n)try{const r=x(o.binPath,["which",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(r)return r}catch{}for(const t of n){const r=h(t);if(r)return r}},C=(o,e)=>{const n=`${o}.${process.pid}.${B(6).toString("hex")}.tmp`;I(n,e);try{R(n,o)}catch(t){try{U(n)}catch{}throw t}},le=(o,e)=>{if("packageManager"in o)return o.packageManager=e,o;const n={};let t=!1;for(const[r,i]of Object.entries(o))!t&&(r==="dependencies"||r==="devDependencies"||r==="peerDependencies"||r==="optionalDependencies")&&(n.packageManager=e,t=!0),n[r]=i;return t||(n.packageManager=e),n},be=(o,e)=>{if(e.tool!=="pnpm"&&e.tool!=="yarn"&&e.tool!=="npm"&&e.tool!=="bun")return;const n=v(o,"package.json");if(!m(n))throw new Error(`Cannot pin ${e.tool}: ${n} does not exist.`);const t=y(n),r=/\n([ \t]+)/.exec(t)?.[1]??" ";let i;try{i=JSON.parse(t)}catch(a){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}const l=`${e.tool}@${e.version}`,s=le(i,l),c=t.endsWith(`
|
|
1
|
+
import{createRequire as F}from"node:module";import{w as v,l as m,c as J,z as y}from"./index-BLtnel38.js";import{a as W}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";let D;const q=o=>(D??=F(import.meta.url))(o),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=o=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,n]=w.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return w.getBuiltinModule(o)}return q(o)},{execFileSync:x}=M("node:child_process"),{randomBytes:B}=M("node:crypto"),{writeFileSync:I,renameSync:R,unlinkSync:U}=M("node:fs"),{delimiter:z}=M("node:path"),H=["proto","mise","fnm","volta","asdf","nvm","corepack"],Z={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["aube","bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},X=["proto","mise","fnm","volta","asdf","nvm","corepack"],A={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},b=new Map,h=o=>{const e=b.get(o);if(e!==void 0||b.has(o))return e;const n=process.env.PATH;if(!n){b.set(o,void 0);return}const t=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const r of n.split(z)){const i=r.replaceAll(/^["']|["']$/g,"").trim();if(i!=="")for(const l of t){const s=`${i}${J}${o}${l}`;if(m(s))return b.set(o,s),s}}b.set(o,void 0)},S=(o,e=["--version"])=>{try{const n=x(o,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),t=/\d+\.\d+(?:\.\d+)?/.exec(n);return t?t[0]:n.trim()||void 0}catch{return}},T=(o,e)=>{const n=v(o,"package.json");if(!m(n))return[];try{const t=W(n)[e];if(e==="volta"&&typeof t=="object"&&t!==null&&Object.keys(t).length>0)return["package.json"];if(e==="packageManager"&&typeof t=="string"&&t.length>0)return["package.json"]}catch{}return[]},G=(o,e)=>o==="volta"?T(e,"volta"):o==="corepack"?T(e,"packageManager"):A[o].filter(n=>m(v(e,n))),_=new Map,L=()=>{_.clear(),b.clear()},O=(o,e)=>{{const i=_.get(o);if(i)return i}const n=[],t=!!h("pnpm")||!!h("yarn");for(const i of X){const l=i==="nvm"?void 0:h(i),s=i==="nvm"&&!!process.env.NVM_DIR,c=G(i,o),a=!!l||s;i==="corepack"&&!a&&(!(c.length>0)||t)||!a&&c.length===0||n.push({binPath:l,configFiles:c,installed:a,name:i,version:l?S(l):void 0})}const r=Object.freeze(n);return _.set(o,r),r},de=(o,e,n)=>{const t=O(o);return e?.preferredManager&&e.preferredManager!=="none"?t.find(r=>r.name===e.preferredManager)??{configFiles:[],installed:!1,name:e.preferredManager}:t.find(r=>r.installed&&r.configFiles.length>0)??t.find(r=>r.installed)??t.find(r=>r.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},V=(o,e)=>{for(const n of e){const t=v(o,n);if(m(t))try{const r=y(t).trim();if(r!=="")return{name:n,value:r.replace(/^v/,"")}}catch{}}},K=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,Y=o=>{const e=v(o,".prototools");if(!m(e))return[];const n=y(e),t=[];let r=!1;for(const i of n.split(/\r?\n/)){const l=i.trim();if(l===""||l.startsWith("#"))continue;if(l.startsWith("[")){r=!0;continue}if(r)continue;const s=K.exec(l);if(!s)continue;const[,c,a]=s,p=g(c);p&&t.push({source:".prototools",tool:p,version:a.trim()})}return t},Q=/^\[tools\]\s*$/i,ee=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,oe=o=>{for(const e of A.mise){const n=v(o,e);if(!m(n))continue;const t=[],r=y(n);let i=!1;for(const l of r.split(/\r?\n/)){const s=l.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=Q.test(s);continue}if(!i)continue;const c=ee.exec(s);if(!c)continue;const[,a,p]=c,d=g(a);d&&t.push({source:".mise.toml",tool:d,version:p.trim()})}if(t.length>0)return t}return[]},ne=o=>{const e=v(o,".tool-versions");if(!m(e))return[];const n=y(e),t=[];for(const r of n.split(/\r?\n/)){const i=r.trim();if(i===""||i.startsWith("#"))continue;const l=i.split(/\s+/);if(l.length<2)continue;const[s,...c]=l,a=g(s);a&&c[0]&&t.push({source:".tool-versions",tool:a,version:c[0]})}return t},g=o=>{switch(o.toLowerCase()){case"aube":return"aube";case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},te=o=>{const[e]=o.split("+",1),n=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(e??"");if(!n)return;const t=g(n[1]);if(t)return{source:"packageManager",tool:t,version:n[2]}},re=(o,e)=>{const n=new Map,t=s=>{n.set(s.tool,s)},r=v(o,"package.json");let i={};try{m(r)&&(i=W(r))}catch{}if(i.engines)for(const[s,c]of Object.entries(i.engines)){const a=g(s);a&&typeof c=="string"&&t({source:"engines",tool:a,version:c})}if(i.packageManager){const s=te(i.packageManager);s&&t(s)}if(i.volta)for(const[s,c]of Object.entries(i.volta)){const a=g(s);a&&typeof c=="string"&&t({source:"volta",tool:a,version:c})}const l=V(o,[".nvmrc",".node-version"]);l&&t({source:l.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:l.value});for(const s of ne(o))t(s);for(const s of oe(o))t(s);for(const s of Y(o))t(s);if(e?.tools)for(const[s,c]of Object.entries(e.tools)){const a=g(s);a&&typeof c=="string"&&t({source:"vis.config.ts",tool:a,version:c})}return[...n.values()]},P={aube:{args:["--version"],binaries:["aube"]},bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},E=o=>{const e=P[o];for(const n of e.binaries){const t=h(n);if(t)return S(t,e.args)}if(o==="node")return process.versions.node},N=(o,e)=>{const n=e.trim();if(n===""||n==="*"||n==="latest")return!0;if(/^\d[\d.]*$/.test(n))return o===n||o.startsWith(`${n}.`);const t=s=>s.split(/[.\-+]/).map(c=>Number.parseInt(c,10)||0),r=(s,c)=>{const a=t(s),p=t(c),d=Math.max(a.length,p.length);for(let f=0;f<d;f++){const $=a[f]??0,u=p[f]??0;if($!==u)return $-u}return 0},i=s=>{for(const c of s)if(c.startsWith(">=")){if(r(o,c.slice(2).trim())<0)return!1}else if(c.startsWith("<=")){if(r(o,c.slice(2).trim())>0)return!1}else if(c.startsWith(">")){if(r(o,c.slice(1).trim())<=0)return!1}else if(c.startsWith("<")){if(r(o,c.slice(1).trim())>=0)return!1}else if(c.startsWith("^")||c.startsWith("~")){const a=c.slice(1).trim(),[p,d]=t(a),[f,$]=t(o);if(f!==p||c.startsWith("~")&&$!==d||r(o,a)<0)return!1}return!0},l=n.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return l.length===0?!0:l.some(s=>i(s))},se=(o,e)=>{switch(o){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return e==="pnpm"||e==="yarn"?["self-activate","volta","proto","mise","corepack"]:e==="npm"?["volta","proto","mise","asdf","corepack"]:e==="aube"?["mise"]:e==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},ie=(o,e,n)=>{if(n?.preferredManager&&n.preferredManager!=="none"&&j(n.preferredManager,o.tool)){const r=e.find(i=>i.name===n.preferredManager);return r?{installed:r.installed,name:r.name}:{installed:!1,name:n.preferredManager,note:`${n.preferredManager} is the preferred manager but isn't on PATH`}}const t=se(o.source,o.tool);for(const r of t){if(r==="self-activate"){if((o.tool==="pnpm"||o.tool==="yarn")&&h(o.tool))return{installed:!0,name:"self-activate",note:`${o.tool} will activate ${o.version} from the packageManager field on next invocation`};continue}if(j(r,o.tool)&&e.find(i=>i.name===r)?.installed)return{installed:!0,name:r}}for(const r of t)if(!(r==="self-activate"||!j(r,o.tool)))return{installed:!1,name:r,note:`${r} can install ${o.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},j=(o,e)=>o==="none"?!1:o==="self-activate"?e==="pnpm"||e==="yarn":Z[o].includes(e),ae=(o,e)=>{const n=O(o),t=re(o,e).map(r=>{const i=E(r.tool),l=i!==void 0&&N(i,r.version),s=ie(r,n,e);return{actual:i,expected:r,manager:s,matches:l}});return{detected:n,tools:t}},ce=(o,e)=>{switch(o){case"asdf":return e?{args:["install",e.tool,e.version],bin:"asdf"}:void 0;case"corepack":return e?{args:["prepare",`${e.tool}@${e.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return e?.tool!=="node"?void 0:{args:["install",e.version],bin:"fnm"};case"mise":return e?{args:["install",`${e.tool}@${e.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return e?{args:["install",e.tool,e.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:e?.tool??"pnpm",hint:`${e?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return e?{args:["install",`${e.tool}@${e.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},ge=(o,e)=>{switch(o){case"asdf":return{args:["local",e.tool,e.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${e.tool} ${e.version}`}};case"corepack":return e.tool!=="npm"&&e.tool!=="pnpm"&&e.tool!=="yarn"?void 0:{args:["use",`${e.tool}@${e.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${e.tool}@${e.version}"`}};case"fnm":return e.tool==="node"?{args:["use",e.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${e.tool}@${e.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${e.tool} ${e.version}`}};case"none":return;case"nvm":return e.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",e.tool,e.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${e.tool} ${e.version}`}};case"self-activate":return{args:[],bin:e.tool,configChange:{file:"package.json",hint:`Set packageManager: "${e.tool}@${e.version}" — ${e.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${e.tool}@${e.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${e.tool}`}};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},he=o=>{for(const e of P[o].binaries){const n=h(e);if(n)return n}},$e=(o,e)=>{const n=P[e].binaries;if(o.installed&&o.binPath&&(o.name==="proto"||o.name==="mise"||o.name==="asdf"||o.name==="volta"||o.name==="fnm"))for(const t of n)try{const r=x(o.binPath,["which",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(r)return r}catch{}for(const t of n){const r=h(t);if(r)return r}},C=(o,e)=>{const n=`${o}.${process.pid}.${B(6).toString("hex")}.tmp`;I(n,e);try{R(n,o)}catch(t){try{U(n)}catch{}throw t}},le=(o,e)=>{if("packageManager"in o)return o.packageManager=e,o;const n={};let t=!1;for(const[r,i]of Object.entries(o))!t&&(r==="dependencies"||r==="devDependencies"||r==="peerDependencies"||r==="optionalDependencies")&&(n.packageManager=e,t=!0),n[r]=i;return t||(n.packageManager=e),n},be=(o,e)=>{if(e.tool!=="pnpm"&&e.tool!=="yarn"&&e.tool!=="npm"&&e.tool!=="bun")return;const n=v(o,"package.json");if(!m(n))throw new Error(`Cannot pin ${e.tool}: ${n} does not exist.`);const t=y(n),r=/\n([ \t]+)/.exec(t)?.[1]??" ";let i;try{i=JSON.parse(t)}catch(a){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}const l=`${e.tool}@${e.version}`,s=le(i,l),c=t.endsWith(`
|
|
2
2
|
`)?`
|
|
3
3
|
`:"";return C(n,`${JSON.stringify(s,void 0,r)}${c}`),l},ye=(o,e)=>{const n=v(o,"package.json");if(!m(n))return;const t=y(n);let r;try{r=JSON.parse(t)}catch(s){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${s.message}`,{cause:s})}if(r.engines?.[e.tool]===void 0||r.engines[e.tool]===e.version)return;r.engines[e.tool]=e.version;const i=/\n([ \t]+)/.exec(t)?.[1]??" ",l=t.endsWith(`
|
|
4
4
|
`)?`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as q}from"node:module";import{V as j,s as b}from"./index.server-CusjRLCh.js";import{w as T,l as A}from"./index-uBVnF4ji.js";import{g as C}from"./_commonjsHelpers-B5Y90VFO.js";import{i as g,p as c}from"../packem_chunks/cli-main.js";import{a as D}from"./readJsonSync-DweZd5ZA-0eZh9sGm.js";let $;const _=e=>($??=q(import.meta.url))(e),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,z=e=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[s,r]=d.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return d.getBuiltinModule(e)}return _(e)},{createInterface:M}=z("node:readline");var O=["aj","aju","av","avj","ejv","jav","jv"],R=["angula","angular-node","angularjs"],N=["auto-prefixer"],S=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],B=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],F=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],P=["bcryptjs-node","dcryptjs"],W=["bunan","bunya","bunyan-node","buynan"],E=["cai","cha","chaijs","chal","chi","chia","hai"],L=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],U=["cheero","cherio"],V=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],I=["ccolors","colors-node","colorss","colorz","colrs","coolors"],Y=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],G=["cor","corss","cos","cosr","cros","crs","ors"],H=["days"],J=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],K=["dot-env","dotenv-node","dotenvjs","dotevn"],Q=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],X=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],Z=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],ee=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],oe=["astify"],se=["firebasejs"],re=["form1dable"],ae=["glb","glo","glob-js","globjs","gob","golb","lob"],te=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ne=["helmetjs","helnet"],ce=["homo","hon","hoo","hoon","ohno","ono"],ie=["inquire","inquirer-js","nquirer"],de=["iredis"],me=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],le=["imp","jim","jip","jmp"],pe=["ji","jio","jo","joii","jol","oi","oji"],ue=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],ve=["jsonwebtoken-js","jsonwebtoken-node"],he=["ka","kao","ko","koaa","koajs","koe","oa","oka"],je=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],be=["luca","luci","lucie"],ke=["luon","luxo","luxon-js"],ge=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],fe=["minimath"],ye=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],xe=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],we=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],qe=["moran","organ"],$e=["muler","multer-js","muter"],_e=["mysql"],ze=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Me=["node-mailer","nodemailer-js"],Te=["nodemo","nodemonjs","nodmeon"],Ae=["oar","or","ora-node","ore","ra","roa"],Ce=["arcel","parce","parceljs"],De=["passport-js"],Oe=["phase","phaser-node"],Re=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Ne=["playright","playwright-js"],Se=["postcss-js","postcss-node","potscss"],Be=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Fe=["prima","prism","prisma-js","prismajs","prizma"],Pe=["pupeteer"],We=["rada","rama","ramd","randa"],Ee=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],Le=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ue=["resen","rsend"],Ve=["ollup","rollup-js","rollup-node"],Ie=["ass","asss","sas","sass-node","sess","ssas","sss"],Ye=["emver","seemver","semver-node","semvre","senver","sever"],Ge=["sequelize-js","sequelize-node"],He=["harp","shap","shar","sharp-js","sharpjs"],Je=["stipe","strip","stripe-node","tripe"],Ke=["supabase-js"],Qe=["suelte","svelt3","svelte-js","sveltejs","velte"],Xe=["tailwindcss-js"],Ze=["auri","taui"],eo=["hree","htree","thee","there","three-js","three-node","tree"],oo=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],so=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],ro=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],ao=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],to=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],no=["itest","uitest","vitestjs","vitezt","vittest","vtest"],co=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],io=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],mo=["winson","winston-js","winstoon"],lo=["up","uyp","yp","yu","yupjs","yupp"],po=["od","zd","zdo","zo","zob","zod-js","zodjs"];const uo={ajv:O,angular:R,autoprefixer:N,"aws-sdk":["awssdk","ews-sdk"],axios:S,babel:B,bcrypt:F,bcryptjs:P,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:W,chai:E,chalk:L,cheerio:U,color:V,colors:I,commander:Y,"cookie-parser":["cookie-parse","cookieparser"],cors:G,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:H,debug:J,dotenv:K,electron:Q,esbuild:X,eslint:Z,express:ee,fastify:oe,firebase:se,formidable:re,glob:ae,got:te,helmet:ne,hono:ce,inquirer:ie,ioredis:de,jest:me,jimp:le,joi:pe,jsdom:ue,jsonwebtoken:ve,koa:he,lodash:je,lucia:be,luxon:ke,micromatch:ge,minimatch:fe,mocha:ye,moment:xe,mongoose:we,morgan:qe,multer:$e,mysql2:_e,next:ze,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Me,nodemon:Te,ora:Ae,parcel:Ce,passport:De,phaser:Oe,pino:Re,playwright:Ne,postcss:Se,prettier:Be,prisma:Fe,puppeteer:Pe,ramda:We,react:Ee,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:Le,resend:Ue,rollup:Ve,sass:Ie,semver:Ye,sequelize:Ge,sharp:He,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:Je,supabase:Ke,svelte:Qe,tailwindcss:Xe,tauri:Ze,three:eo,"ts-node":["tts-node"],tsx:oo,typescript:so,underscore:ro,uuid:ao,vite:to,vitest:no,vue:co,webpack:io,winston:mo,yup:lo,zod:po};var u,k;function vo(){return k||(k=1,u={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),u}var ho=vo();const jo=C(ho),bo={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},ko=["app","cli","core","kit","lib","pkg","sdk"],go=e=>{const s=new Set;if(e.length<3)return s;for(let o=0;o<e.length;o++){const a=e[o],t=a==="-"||a==="."||a==="_";if(t||s.add(e.slice(0,o)+e.slice(o+1)),t||s.add(e.slice(0,o)+a+e.slice(o)),o<e.length-1&&e[o]!==e[o+1]){const p=e[o+1]==="-"||e[o+1]==="."||e[o+1]==="_";if(!t&&!p){const i=[...e];[i[o],i[o+1]]=[i[o+1],i[o]],s.add(i.join(""))}}const n=e[o].toLowerCase(),h=bo[n];if(h)for(const p of h)s.add(e.slice(0,o)+p+e.slice(o+1))}const r=/[-._]/g;if(r.test(e))s.add(e.replaceAll(r,"")),s.add(e.replaceAll(r,"-")),s.add(e.replaceAll(r,".")),s.add(e.replaceAll(r,"_"));else if(e.length>5)for(let o=2;o<e.length-2;o++)s.add(`${e.slice(0,o)}-${e.slice(o)}`),s.add(`${e.slice(0,o)}.${e.slice(o)}`),s.add(`${e.slice(0,o)}_${e.slice(o)}`);if(e.startsWith("@")||(s.add(`${e}-js`),s.add(`${e}js`),s.add(`${e}-node`)),e.startsWith("@")){const o=e.indexOf("/");if(o>1&&o<e.length-1){const a=e.slice(1,o),t=e.slice(o+1);a.length>=3&&s.add(a);for(const n of["","-",".","_"])s.add(`${a}${n}${t}`),s.add(`${t}${n}${a}`);for(const n of ko)s.add(`${a}-${n}`),s.add(`${t}-${a}-${n}`),s.add(`${n}-${a}-${t}`)}}return s.delete(e),s};let v,l,m;const f=()=>{if(!v){const e={};for(const s of[uo,jo])for(const[r,o]of Object.entries(s)){const a=e[r]??(e[r]=[]);for(const t of o)a.includes(t)||a.push(t)}v=e}return v},fo=()=>{if(!l){l=new Map;for(const[e,s]of Object.entries(f()))for(const r of s)l.set(r,e)}return l},yo=()=>{if(!m){m=new Map;for(const e of Object.keys(f()))for(const s of go(e))m.has(s)||m.set(s,e)}return m},xo=e=>e.startsWith("@")?e.split("/")[1]??e:e,wo=e=>{const s=xo(e),r=fo().get(s);if(r)return{input:e,legitimate:r,method:"blocklist"};const o=yo().get(s);if(o)return{input:e,legitimate:o,method:"heuristic"}},y=(e,s)=>{const r=s?new Set(s):void 0,o=[];for(const a of e){if(r?.has(a))continue;const t=wo(a);t&&o.push(t)}return o},x=(e,s)=>{c.warn(""),c.warn(j(`Possible typosquat${e.length===1?"":"s"} ${s}:`));for(const r of e){const o=r.method==="blocklist"?"known typosquat":"similar name";c.warn(` ${b("⚠")} ${j(r.input)} — did you mean ${b(r.legitimate)}? (${o})`)}c.warn("")},w=async e=>{if(!process.stdin.isTTY){c.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const s=M({input:process.stdin,output:process.stdout}),r=await new Promise(o=>{s.question(e,a=>{o(a.trim().toLowerCase())})});return s.close(),r},Oo=async(e,s)=>{if(g("typosquats"))return{ok:!0,packages:e};const r=y(e,s);if(r.length===0)return{ok:!0,packages:e};x(r,"detected");const o=await w(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(o===void 0)return{ok:!1,packages:e};if(o==="s"||o==="suggested"){const a=new Map(r.map(t=>[t.input,t.legitimate]));return{ok:!0,packages:e.map(t=>a.get(t)??t)}}return o==="y"||o==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},qo=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,$o=e=>qo.exec(e)?.[1],_o=e=>{if(!A(e))return[];const s=D(e),r={...s.dependencies,...s.devDependencies,...s.optionalDependencies,...s.peerDependencies},o=new Set;for(const[a,t]of Object.entries(r)){o.add(a);const n=$o(t);n&&o.add(n)}return[...o]},Ro=async(e,s)=>{if(g("typosquats"))return!0;const r=T(e,"package.json"),o=_o(r);if(o.length===0)return!0;const a=y(o,s);if(a.length===0)return!0;x(a,"in package.json dependencies"),c.warn("Fix the package name in package.json before proceeding.");const t=await w("Continue anyway? [y/N] ");return t==="y"||t==="yes"};export{Oo as r,Ro as s};
|
|
1
|
+
import{createRequire as q}from"node:module";import{V as j,s as b}from"./index.server-CusjRLCh.js";import{w as T,l as A}from"./index-BLtnel38.js";import{g as C}from"./_commonjsHelpers-B5Y90VFO.js";import{i as g,p as c}from"../packem_chunks/cli-main.js";import{a as D}from"./readJsonSync-DweZd5ZA-CtrDlqpb.js";let $;const _=e=>($??=q(import.meta.url))(e),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,z=e=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[s,r]=d.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return d.getBuiltinModule(e)}return _(e)},{createInterface:M}=z("node:readline");var O=["aj","aju","av","avj","ejv","jav","jv"],R=["angula","angular-node","angularjs"],N=["auto-prefixer"],S=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],B=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],F=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],P=["bcryptjs-node","dcryptjs"],W=["bunan","bunya","bunyan-node","buynan"],E=["cai","cha","chaijs","chal","chi","chia","hai"],L=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],U=["cheero","cherio"],V=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],I=["ccolors","colors-node","colorss","colorz","colrs","coolors"],Y=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],G=["cor","corss","cos","cosr","cros","crs","ors"],H=["days"],J=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],K=["dot-env","dotenv-node","dotenvjs","dotevn"],Q=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],X=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],Z=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],ee=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],oe=["astify"],se=["firebasejs"],re=["form1dable"],ae=["glb","glo","glob-js","globjs","gob","golb","lob"],te=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],ne=["helmetjs","helnet"],ce=["homo","hon","hoo","hoon","ohno","ono"],ie=["inquire","inquirer-js","nquirer"],de=["iredis"],me=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],le=["imp","jim","jip","jmp"],pe=["ji","jio","jo","joii","jol","oi","oji"],ue=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],ve=["jsonwebtoken-js","jsonwebtoken-node"],he=["ka","kao","ko","koaa","koajs","koe","oa","oka"],je=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],be=["luca","luci","lucie"],ke=["luon","luxo","luxon-js"],ge=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],fe=["minimath"],ye=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],xe=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],we=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],qe=["moran","organ"],$e=["muler","multer-js","muter"],_e=["mysql"],ze=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],Me=["node-mailer","nodemailer-js"],Te=["nodemo","nodemonjs","nodmeon"],Ae=["oar","or","ora-node","ore","ra","roa"],Ce=["arcel","parce","parceljs"],De=["passport-js"],Oe=["phase","phaser-node"],Re=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Ne=["playright","playwright-js"],Se=["postcss-js","postcss-node","potscss"],Be=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Fe=["prima","prism","prisma-js","prismajs","prizma"],Pe=["pupeteer"],We=["rada","rama","ramd","randa"],Ee=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],Le=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Ue=["resen","rsend"],Ve=["ollup","rollup-js","rollup-node"],Ie=["ass","asss","sas","sass-node","sess","ssas","sss"],Ye=["emver","seemver","semver-node","semvre","senver","sever"],Ge=["sequelize-js","sequelize-node"],He=["harp","shap","shar","sharp-js","sharpjs"],Je=["stipe","strip","stripe-node","tripe"],Ke=["supabase-js"],Qe=["suelte","svelt3","svelte-js","sveltejs","velte"],Xe=["tailwindcss-js"],Ze=["auri","taui"],eo=["hree","htree","thee","there","three-js","three-node","tree"],oo=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],so=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],ro=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],ao=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],to=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],no=["itest","uitest","vitestjs","vitezt","vittest","vtest"],co=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],io=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],mo=["winson","winston-js","winstoon"],lo=["up","uyp","yp","yu","yupjs","yupp"],po=["od","zd","zdo","zo","zob","zod-js","zodjs"];const uo={ajv:O,angular:R,autoprefixer:N,"aws-sdk":["awssdk","ews-sdk"],axios:S,babel:B,bcrypt:F,bcryptjs:P,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:W,chai:E,chalk:L,cheerio:U,color:V,colors:I,commander:Y,"cookie-parser":["cookie-parse","cookieparser"],cors:G,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:H,debug:J,dotenv:K,electron:Q,esbuild:X,eslint:Z,express:ee,fastify:oe,firebase:se,formidable:re,glob:ae,got:te,helmet:ne,hono:ce,inquirer:ie,ioredis:de,jest:me,jimp:le,joi:pe,jsdom:ue,jsonwebtoken:ve,koa:he,lodash:je,lucia:be,luxon:ke,micromatch:ge,minimatch:fe,mocha:ye,moment:xe,mongoose:we,morgan:qe,multer:$e,mysql2:_e,next:ze,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:Me,nodemon:Te,ora:Ae,parcel:Ce,passport:De,phaser:Oe,pino:Re,playwright:Ne,postcss:Se,prettier:Be,prisma:Fe,puppeteer:Pe,ramda:We,react:Ee,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:Le,resend:Ue,rollup:Ve,sass:Ie,semver:Ye,sequelize:Ge,sharp:He,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:Je,supabase:Ke,svelte:Qe,tailwindcss:Xe,tauri:Ze,three:eo,"ts-node":["tts-node"],tsx:oo,typescript:so,underscore:ro,uuid:ao,vite:to,vitest:no,vue:co,webpack:io,winston:mo,yup:lo,zod:po};var u,k;function vo(){return k||(k=1,u={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),u}var ho=vo();const jo=C(ho),bo={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},ko=["app","cli","core","kit","lib","pkg","sdk"],go=e=>{const s=new Set;if(e.length<3)return s;for(let o=0;o<e.length;o++){const a=e[o],t=a==="-"||a==="."||a==="_";if(t||s.add(e.slice(0,o)+e.slice(o+1)),t||s.add(e.slice(0,o)+a+e.slice(o)),o<e.length-1&&e[o]!==e[o+1]){const p=e[o+1]==="-"||e[o+1]==="."||e[o+1]==="_";if(!t&&!p){const i=[...e];[i[o],i[o+1]]=[i[o+1],i[o]],s.add(i.join(""))}}const n=e[o].toLowerCase(),h=bo[n];if(h)for(const p of h)s.add(e.slice(0,o)+p+e.slice(o+1))}const r=/[-._]/g;if(r.test(e))s.add(e.replaceAll(r,"")),s.add(e.replaceAll(r,"-")),s.add(e.replaceAll(r,".")),s.add(e.replaceAll(r,"_"));else if(e.length>5)for(let o=2;o<e.length-2;o++)s.add(`${e.slice(0,o)}-${e.slice(o)}`),s.add(`${e.slice(0,o)}.${e.slice(o)}`),s.add(`${e.slice(0,o)}_${e.slice(o)}`);if(e.startsWith("@")||(s.add(`${e}-js`),s.add(`${e}js`),s.add(`${e}-node`)),e.startsWith("@")){const o=e.indexOf("/");if(o>1&&o<e.length-1){const a=e.slice(1,o),t=e.slice(o+1);a.length>=3&&s.add(a);for(const n of["","-",".","_"])s.add(`${a}${n}${t}`),s.add(`${t}${n}${a}`);for(const n of ko)s.add(`${a}-${n}`),s.add(`${t}-${a}-${n}`),s.add(`${n}-${a}-${t}`)}}return s.delete(e),s};let v,l,m;const f=()=>{if(!v){const e={};for(const s of[uo,jo])for(const[r,o]of Object.entries(s)){const a=e[r]??(e[r]=[]);for(const t of o)a.includes(t)||a.push(t)}v=e}return v},fo=()=>{if(!l){l=new Map;for(const[e,s]of Object.entries(f()))for(const r of s)l.set(r,e)}return l},yo=()=>{if(!m){m=new Map;for(const e of Object.keys(f()))for(const s of go(e))m.has(s)||m.set(s,e)}return m},xo=e=>e.startsWith("@")?e.split("/")[1]??e:e,wo=e=>{const s=xo(e),r=fo().get(s);if(r)return{input:e,legitimate:r,method:"blocklist"};const o=yo().get(s);if(o)return{input:e,legitimate:o,method:"heuristic"}},y=(e,s)=>{const r=s?new Set(s):void 0,o=[];for(const a of e){if(r?.has(a))continue;const t=wo(a);t&&o.push(t)}return o},x=(e,s)=>{c.warn(""),c.warn(j(`Possible typosquat${e.length===1?"":"s"} ${s}:`));for(const r of e){const o=r.method==="blocklist"?"known typosquat":"similar name";c.warn(` ${b("⚠")} ${j(r.input)} — did you mean ${b(r.legitimate)}? (${o})`)}c.warn("")},w=async e=>{if(!process.stdin.isTTY){c.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const s=M({input:process.stdin,output:process.stdout}),r=await new Promise(o=>{s.question(e,a=>{o(a.trim().toLowerCase())})});return s.close(),r},Oo=async(e,s)=>{if(g("typosquats"))return{ok:!0,packages:e};const r=y(e,s);if(r.length===0)return{ok:!0,packages:e};x(r,"detected");const o=await w(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(o===void 0)return{ok:!1,packages:e};if(o==="s"||o==="suggested"){const a=new Map(r.map(t=>[t.input,t.legitimate]));return{ok:!0,packages:e.map(t=>a.get(t)??t)}}return o==="y"||o==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},qo=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,$o=e=>qo.exec(e)?.[1],_o=e=>{if(!A(e))return[];const s=D(e),r={...s.dependencies,...s.devDependencies,...s.optionalDependencies,...s.peerDependencies},o=new Set;for(const[a,t]of Object.entries(r)){o.add(a);const n=$o(t);n&&o.add(n)}return[...o]},Ro=async(e,s)=>{if(g("typosquats"))return!0;const r=T(e,"package.json"),o=_o(r);if(o.length===0)return!0;const a=y(o,s);if(a.length===0)return!0;x(a,"in package.json dependencies"),c.warn("Fix the package name in package.json before proceeding.");const t=await w("Continue anyway? [y/N] ");return t==="y"||t==="yes"};export{Oo as r,Ro as s};
|
package/dist/packem_shared/{use-measured-height-CBjN0fle.js → use-measured-height-BwAwGHjw.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,Y as a}from"../packem_chunks/catalog.js";import"./en-
|
|
1
|
+
import{r,Y as a}from"../packem_chunks/catalog.js";import"./en-BDYMmM2_.js";const f=(s,o)=>{const t=r.useRef(null),[u,n]=r.useState(s);return r.useLayoutEffect(()=>{if(!t.current)return;const{height:e}=a(t.current);e>0&&e!==u&&(n(e),o?.(e))}),{measuredHeight:u,ref:t}};export{f as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as g}from"node:module";import{w as i,l as a,z as d,a as b}from"./index-BLtnel38.js";import"./index-tNFGWxc0.js";let h;const u=n=>(h??=g(import.meta.url))(n),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=n=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[s,e]=p.versions.node.split(".").map(Number);if(s>22||s===22&&e>=3||s===20&&e>=16)return p.getBuiltinModule(n)}return u(n)},{readdirSync:j}=m("node:fs"),v=[".husky/pre-commit",".vis/hooks/pre-commit",".git/hooks/pre-commit"],w=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],$=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],_=n=>{const s=i(n,"package.json");if(!a(s))return[];let e;try{e=JSON.parse(d(s))}catch{return[]}const o=[];if(e.scripts)for(const[t,c]of Object.entries(e.scripts))typeof c=="string"&&(/\bgitleaks\b/.test(c)&&o.push({detail:`Script "${t}" still invokes gitleaks: ${c}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(c)&&o.push({detail:`Script "${t}" still invokes secretlint: ${c}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(c)&&o.push({detail:`Script "${t}" still invokes syncpack: ${c}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(c)&&o.push({detail:`Script "${t}" still invokes sherif: ${c}`,kind:"script",location:"package.json",tool:"sherif"}));if(e.devDependencies)for(const t of Object.keys(e.devDependencies))(t==="gitleaks"||t==="@gitleaks/cli")&&o.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(t==="secretlint"||t.startsWith("@secretlint/"))&&o.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),t==="syncpack"&&o.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),t==="sherif"&&o.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return e.sherif&&o.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),o},D=n=>{const s=[];for(const e of v){const o=i(n,e);if(!a(o))continue;const t=d(o);/\bgitleaks\b/.test(t)&&s.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:e,tool:"gitleaks"}),/\bsecretlint\b/.test(t)&&s.push({detail:"secretlint invocation still present in hook",kind:"hook",location:e,tool:"secretlint"}),/\bsyncpack\b/.test(t)&&s.push({detail:"syncpack invocation still present in hook",kind:"hook",location:e,tool:"syncpack"}),/\bsherif\b/.test(t)&&s.push({detail:"sherif invocation still present in hook",kind:"hook",location:e,tool:"sherif"})}return s},S=n=>{const s=[];for(const e of w)a(i(n,e))&&s.push({detail:"secretlint config should be removed after migration",kind:"config",location:e,tool:"secretlint"});for(const e of $)a(i(n,e))&&s.push({detail:"syncpack config should be removed after migration",kind:"config",location:e,tool:"syncpack"});return s},O=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],q=n=>{const s=[],e=o=>{const t=i(n,o);if(!a(t))return;const c=d(t);/\bsyncpack\b/.test(c)&&s.push({detail:"syncpack invocation still present in CI",kind:"ci",location:o,tool:"syncpack"}),/\bsherif\b/.test(c)&&s.push({detail:"sherif invocation still present in CI",kind:"ci",location:o,tool:"sherif"})};for(const o of O){const t=i(n,o);if(a(t)){if(o===".github/workflows"){try{for(const c of j(t))(c.endsWith(".yml")||c.endsWith(".yaml"))&&e(`.github/workflows/${c}`)}catch{}continue}e(o)}}return s},M=n=>{const s=[],e=i(n,"pnpm-workspace.yaml");if(a(e)){let t;try{t=b(e)}catch{t=void 0}if(t&&typeof t=="object"){const c=t.catalog;c&&typeof c.syncpack=="string"&&s.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const l=t.catalogs;if(l&&typeof l=="object")for(const[k,r]of Object.entries(l))r&&typeof r.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${k}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const o=i(n,"package.json");if(a(o)){let t;try{t=JSON.parse(d(o))}catch{return s}const c=t.workspaces;if(c&&typeof c=="object"&&!Array.isArray(c)){const k=c.catalog;k&&typeof k.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const r=c.catalogs;if(r&&typeof r=="object")for(const[y,f]of Object.entries(r))f&&typeof f.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${y}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const l=t.catalog;l&&typeof l.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return s},N=n=>[..._(n),...D(n),...S(n),...q(n),...M(n)],W=(n,s)=>{const e=N(n);if(e.length===0)return s.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];s.warn(`Found ${String(e.length)} unmigrated reference(s):`);for(const o of e)s.warn(` [${o.kind}] ${o.location} — ${o.detail}`);return e};export{N as s,W as v};
|