@visulima/vis 2.0.1 → 2.0.2
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 +28 -0
- package/LICENSE.md +862 -170
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +3 -3
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +68 -68
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +145 -143
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/fix.js +3 -3
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +3 -3
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +3 -3
- 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 +2 -2
- 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 +4 -4
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +5 -5
- package/dist/packem_chunks/handler51.js +2 -2
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler61.js +13 -13
- package/dist/packem_chunks/handler62.js +3 -3
- package/dist/packem_chunks/handler63.js +2 -2
- package/dist/packem_chunks/handler64.js +4 -4
- package/dist/packem_chunks/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +16 -16
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +15 -15
- 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 +23 -23
- package/dist/packem_chunks/handler73.js +5 -5
- package/dist/packem_chunks/handler74.js +22 -22
- package/dist/packem_chunks/handler75.js +2 -2
- package/dist/packem_chunks/handler76.js +5 -5
- package/dist/packem_chunks/handler77.js +18 -18
- package/dist/packem_chunks/handler78.js +25 -25
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +2 -2
- package/dist/packem_chunks/heal.js +4 -4
- package/dist/packem_chunks/help-command.js +46 -46
- package/dist/packem_chunks/index3.js +3 -3
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +2 -2
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prompts.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +6 -6
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{advisories-BGeuHJQg.js → advisories-CCBGdU8U.js} +1 -1
- package/dist/packem_shared/{affected-selection-B85ND6JV.js → affected-selection-Dj-ymxhw.js} +1 -1
- package/dist/packem_shared/{affected-shas-BWRRAB47.js → affected-shas-PwkVbPch.js} +1 -1
- package/dist/packem_shared/ai-analysis-bGCAc1jR.js +68 -0
- package/dist/packem_shared/{ai-fix-BgBU0TOz.js → ai-fix-DV5-dHBY.js} +4 -4
- package/dist/packem_shared/{augment-HVeX6LpU.js → augment-24KX2nkI.js} +1 -1
- package/dist/packem_shared/{bin-DKod8Iqo.js → bin-CtzhnYMp.js} +1 -1
- package/dist/packem_shared/{build-scripts-CM8M1xcG.js → build-scripts-w4SNeR7D.js} +1 -1
- package/dist/packem_shared/{command-runtime-BVi4lL8k.js → command-runtime-BLFPUYAT.js} +1 -1
- package/dist/packem_shared/{cyclonedx-y7VLI-1d.js → cyclonedx-C4KaVTn1.js} +3 -3
- package/dist/packem_shared/{dependency-scan-BAzKpXdW.js → dependency-scan-D_ona0Qm.js} +1 -1
- package/dist/packem_shared/{docker-D1LStSlH.js → docker-DaVs-9wK.js} +27 -27
- package/dist/packem_shared/{en-BxrK-n-J.js → en-D3CfXlO7.js} +13 -13
- package/dist/packem_shared/{failure-log-ChuFC-8f.js → failure-log-CTneNcio.js} +2 -2
- package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +1 -0
- package/dist/packem_shared/index-CTMU29dI.js +1 -0
- package/dist/packem_shared/index-uBVnF4ji.js +35 -0
- package/dist/packem_shared/index.server-CusjRLCh.js +2 -0
- package/dist/packem_shared/{lifecycle-Db0qh6vR.js → lifecycle-B8A2T3gx.js} +1 -1
- package/dist/packem_shared/{lockfile-CDQ0n4P5.js → lockfile-Bccery3L.js} +1 -1
- package/dist/packem_shared/{manifests-Da_no4ZH.js → manifests-BDkwiVbh.js} +1 -1
- package/dist/packem_shared/{min-release-age-V6L6dpiP.js → min-release-age-OaYpLwux.js} +1 -1
- package/dist/packem_shared/missing-package-json-BqS-OnKd.js +1 -0
- package/dist/packem_shared/{native-config-sync-C0pUePad.js → native-config-sync-Ds1FtcrM.js} +3 -3
- package/dist/packem_shared/{osv-bloom-DNFpvSSO.js → osv-bloom-pKp7urSB.js} +2 -2
- package/dist/packem_shared/package-version-C47v64aB.js +4 -0
- package/dist/packem_shared/packument-HBVbyf7x.js +1 -0
- package/dist/packem_shared/pm-runner-C6eTANt1.js +1 -0
- package/dist/packem_shared/{project-name-filter-u2Q7YpQH.js → project-name-filter-CJ3XX2TI.js} +1 -1
- package/dist/packem_shared/{provenance-9OT8sTqn.js → provenance-D4Cza8cp.js} +1 -1
- package/dist/packem_shared/{readJsonSync-BnWiH5-R-BpnwAB0Z.js → readJsonSync-DweZd5ZA-0eZh9sGm.js} +1 -1
- package/dist/packem_shared/{registry-keys-CYHd7qU2.js → registry-keys-C0ez2VND.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-DC3XssJa.js → resolve-explicit-BbT764KS.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-f5l4ODsH.js → resolve-runtime-D_vZovbB.js} +1 -1
- package/dist/packem_shared/{run-file-zB4ACnUy.js → run-file-DyPFFN9U.js} +1 -1
- package/dist/packem_shared/{runtime-check-CWvAfu5u.js → runtime-check-D4um-yQq.js} +1 -1
- package/dist/packem_shared/{s1ngularity-DsmC71xt.js → s1ngularity-St6dhKiq.js} +1 -1
- package/dist/packem_shared/scan-progress-q-N2JtIp.js +2 -0
- package/dist/packem_shared/{selectors-CtxnIT4X.js → selectors-Ce_6UAoY.js} +1 -1
- package/dist/packem_shared/{signatures-Dwx5fD4g.js → signatures-Dyeyg1q9.js} +1 -1
- package/dist/packem_shared/target-merge-Cfy7c__2.js +11 -0
- package/dist/packem_shared/{target-options-BO4Uxt0k.js → target-options-7XcbqGDe.js} +1 -1
- package/dist/packem_shared/{toolchain-BY8lJaSN.js → toolchain-C_pNMBM6.js} +1 -1
- package/dist/packem_shared/{typosquats-BUGgotNu.js → typosquats-xzcAGPiM.js} +1 -1
- package/dist/packem_shared/{use-measured-height-BLZt9dW2.js → use-measured-height-CBjN0fle.js} +1 -1
- package/dist/packem_shared/{verify-B0ztxKMa.js → verify-Dve9PQj3.js} +1 -1
- package/dist/packem_shared/vis-update-app-DMAC2pPf.js +1 -0
- package/dist/packem_shared/vis-user-error-xmha3L4n.js +30 -0
- package/dist/packem_shared/{watch-CGrUW_JD.js → watch-BXOOX7lx.js} +1 -1
- package/dist/packem_shared/{watch-loop-DIwSMjlA.js → watch-loop-Q7UpkVbr.js} +4 -4
- package/dist/runtime/preload.js +1 -1
- package/index.js +52 -52
- package/package.json +16 -16
- package/dist/packem_shared/ai-analysis-oNMAj1wd.js +0 -68
- package/dist/packem_shared/glob-BUjyjdE8-BSrdzgma.js +0 -1
- package/dist/packem_shared/index-BJw7gKD1.js +0 -1
- package/dist/packem_shared/index-DND6ptxQ.js +0 -35
- package/dist/packem_shared/index.server-qvZ-cy29.js +0 -2
- package/dist/packem_shared/missing-package-json-Jw8IEHct.js +0 -1
- package/dist/packem_shared/package-version-DjHDww_5.js +0 -4
- package/dist/packem_shared/packument-N3EWbZpL.js +0 -1
- package/dist/packem_shared/pm-runner-Bssje5qH.js +0 -1
- package/dist/packem_shared/scan-progress-Ch8s3Uwl.js +0 -2
- package/dist/packem_shared/target-merge-b7bE1AEx.js +0 -11
- package/dist/packem_shared/vis-update-app-D1gLJB1O.js +0 -1
- package/dist/packem_shared/vis-user-error-DjFv8uxy.js +0 -28
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{b as U,w as z,u as H,c as K,z as $}from"../packem_shared/index-uBVnF4ji.js";import{E as X}from"../packem_shared/public-api-WqUCiyIe.js";import{p as Z}from"./cli-main.js";import{k as I,W as A,j as x}from"../packem_shared/en-D3CfXlO7.js";const ee=(e,t)=>typeof e!="string"||e===""?"":e[0].toLowerCase()+e.slice(1),k=(e,t)=>typeof e!="string"||e===""?"":(t?.locale?e[0].toLocaleUpperCase(t.locale):e[0].toUpperCase())+e.slice(1),te=(e,t)=>`${e}::${t?.joiner??""}::${t?.locale??""}::${t?.knownAcronyms?.join(",")??""}::${t?.normalize?"true":"false"}::${t?.stripAnsi?"true":"false"}::${t?.stripEmoji?"true":"false"}::${t?.handleAnsi?"true":"false"}::${t?.handleEmoji?"true":"false"}`,j=(e,t)=>{const{length:r}=e;if(r===0)return"";if(r===1)return e[0];const n=[];let o="",s="";for(let i=0;i<r;i++){const l=e[i];if(I.test(l)){o?(n.push(o+s+l),o="",s=""):(n.length>0&&n.push(t),o=l);continue}o?(s&&(s+=t),s+=l):(n.length>0&&n.push(t),n.push(l))}return n.join("")},ne=/(?<![a-zß])SS(?![a-z])/g,re=e=>e.replaceAll(ne,"ß"),oe=(e,t)=>{if(typeof e!="string"||!e)return"";let r=!0;return j(A(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(o=>{const s=o,i=s.toLowerCase();return r?(r=!1,ee(i)):k(i,t)}),"")},se=new x(1e3),S=(e,t)=>{if(typeof e!="string")return"";const r=t?.cache??!1,n=t?.cacheStore??se;let o;if(r&&(o=te(e,t)),r&&o&&n.has(o))return n.get(o);const s=A(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(l=>{if(t?.handleAnsi&&I.test(l))return l;if(t?.toUpperCase)return t.locale?l.toLocaleUpperCase(t.locale):l.toUpperCase();const a=t?.locale?.startsWith("de")?re(l):l;return t?.locale?a.toLocaleLowerCase(t.locale):a.toLowerCase()}),i=j(s,t?.joiner??"-");return r&&o&&n.set(o,i),i},ie=new x(1e3),le=(e,t)=>S(e,{cacheStore:ie,...t,joiner:"_",toUpperCase:!0}),ae=(e,t)=>typeof e!="string"||!e?"":j(A(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(n=>k(n.toLowerCase(),{locale:t?.locale})),""),ce=new x(1e3),fe=(e,t)=>S(e,{cacheStore:ce,...t,joiner:"_"}),ue=(e,t)=>typeof e!="string"?"":j(A(e,{handleAnsi:t?.handleAnsi,handleEmoji:t?.handleEmoji,knownAcronyms:t?.knownAcronyms,locale:t?.locale,normalize:t?.normalize,separators:void 0,stripAnsi:t?.stripAnsi,stripEmoji:t?.stripEmoji}).map(n=>k(n,{locale:t?.locale})),"-"),m=e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),T={camel_case:e=>oe(m(e)),kebab_case:e=>S(m(e)),lower_case:e=>m(e).toLowerCase(),pascal_case:e=>ae(m(e)),path_join:(e,...t)=>{const r=[m(e),...t.map(n=>m(n))];return z(...r)},path_relative:(e,t)=>U(m(t),m(e)),snake_case:e=>fe(m(e)),upper_case:e=>m(e).toUpperCase(),upper_kebab_case:e=>ue(m(e)),upper_snake_case:e=>le(m(e))},N=(e,t,r=[])=>{const n=T[e];if(!n)throw new Error(`Unknown filter "${e}". Known filters: ${Object.keys(T).sort().join(", ")}.`);return n(t,...r)},R=e=>{const t=[];let r=0,n=0,o,s=-1;for(const i of e){if(s+=1,o){i===o&&(o=void 0);continue}if(i==='"'||i==="'"){o=i;continue}i==="("?r+=1:i===")"?r-=1:i===","&&r===0&&(t.push(e.slice(n,s)),n=s+1)}return t.push(e.slice(n)),t},pe=e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},me=/\[([^\]]+)\]/g,de=e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),o=t.slice(r+1,-1).trim();return o===""?{args:[],name:n}:{args:R(o).map(s=>{const i=s.trim();return pe(i)??i}),name:n}},he=e=>{const t=e.split("|").map(n=>n.trim()),r=t[0]??"";if(!r)throw new Error(`Empty variable name in expression "${e}"`);return{filters:t.slice(1).map(n=>de(n)),name:r}},ye=e=>e==null?"":typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"||typeof e=="bigint"?String(e):JSON.stringify(e),ge=(e,t)=>{const r=e.replaceAll(me,(n,o)=>{const{filters:s,name:i}=he(o);if(!Object.hasOwn(t,i))throw new Error(`Variable "${i}" used in filename "${e}" but not defined`);let l=t[i];for(const a of s)l=N(a.name,l,a.args);return ye(l)});return P(r)},P=e=>e.split("/").map(t=>t.endsWith(".tera")||t.endsWith(".twig")?t.slice(0,-5):t).join("/"),we=e=>e.endsWith(".raw")?e.slice(0,-4):e,$e=e=>{const t=e.split("/");return(t.at(-1)??"").startsWith("_")?!0:t.slice(0,-1).includes("partials")},be=(e,t)=>{if(!e.startsWith(`---
|
|
2
2
|
`)&&!e.startsWith(`---\r
|
|
3
3
|
`))return{body:e};const r=e.indexOf(`
|
|
4
4
|
---`,3);if(r===-1)return{body:e};let n=r+1+3;e[n]==="\r"&&(n+=1),e[n]===`
|
|
5
5
|
`&&(n+=1);const o=e.startsWith(`---\r
|
|
6
|
-
`)?5:4,s=e.slice(o,r).replaceAll("\r","");let i;try{i=t(s)}catch(l){const a=l instanceof Error?l.message:String(l);throw new Error(`Failed to parse frontmatter YAML: ${a}`,{cause:l})}if(i==null)return{body:e.slice(n)};if(typeof i!="object"||Array.isArray(i))throw new TypeError(`Frontmatter must be a YAML mapping, got ${Array.isArray(i)?"array":typeof i}`);return{body:e.slice(n),frontmatter:i}},
|
|
7
|
-
`&&(n+=1)};for(const s of e.matchAll(
|
|
6
|
+
`)?5:4,s=e.slice(o,r).replaceAll("\r","");let i;try{i=t(s)}catch(l){const a=l instanceof Error?l.message:String(l);throw new Error(`Failed to parse frontmatter YAML: ${a}`,{cause:l})}if(i==null)return{body:e.slice(n)};if(typeof i!="object"||Array.isArray(i))throw new TypeError(`Frontmatter must be a YAML mapping, got ${Array.isArray(i)?"array":typeof i}`);return{body:e.slice(n),frontmatter:i}},Ee=/\{\{-?(.+?)-?\}\}|\{%-?(.+?)-?%\}/gs,q=e=>{const t=[];let r=0,n=1;const o=s=>{for(const i of s)i===`
|
|
7
|
+
`&&(n+=1)};for(const s of e.matchAll(Ee)){const i=s.index??0;if(i>r){const c=e.slice(r,i);t.push({line:n,type:"text",value:c}),o(c)}const l=n,a=s[0];a.startsWith("{{")?t.push({line:l,type:"expr",value:(s[1]??"").trim()}):t.push({line:l,type:"stmt",value:(s[2]??"").trim()}),o(a),r=i+a.length}if(r<e.length){const s=e.slice(r);t.push({line:n,type:"text",value:s})}return t},Ae=new Set(["block","endblock","endfilter","endmacro","extends","filter","import","macro","set"]),F=(e,t)=>{let r=0;const n=(s,i)=>{throw new Error(`${t}:${s}: ${i}`)},o=s=>{const i=[];for(;r<e.length;){const l=e[r];if(l.type==="text"){i.push({type:"text",value:l.value}),r+=1;continue}if(l.type==="expr"){i.push({expression:l.value,line:l.line,type:"expr"}),r+=1;continue}const a=l.value.split(/\s+/)[0]??"";if(s.includes(a))return i;if(Ae.has(a)&&n(l.line,`Tera feature "{% ${a} %}" is not supported. Supported: if/else/endif, for/endfor, include. Rewrite the template to avoid macros, set, extends, block, and import.`),a==="if"){r+=1;const c=l.value.slice(2).trim(),p=o(["else","endif"]);let f;r<e.length&&e[r].type==="stmt"&&e[r].value.split(/\s+/)[0]==="else"&&(r+=1,f=o(["endif"])),(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endif")&&n(l.line,"Unterminated {% if %} — missing {% endif %}"),r+=1,i.push({alternate:f,condition:c,consequent:p,line:l.line,type:"if"});continue}if(a==="for"){r+=1;const c=l.value.slice(3).trim(),p=c.indexOf(" in ");p===-1&&n(l.line,"Malformed {% for %} — expected `for <name> in <collection>`");const f=c.slice(0,p).trim(),d=c.slice(p+4).trim();(!f||!d)&&n(l.line,"Malformed {% for %} — missing binding or collection");const u=o(["endfor"]);(r>=e.length||e[r].type!=="stmt"||e[r].value.split(/\s+/)[0]!=="endfor")&&n(l.line,"Unterminated {% for %} — missing {% endfor %}"),r+=1,i.push({binding:f,body:u,collection:d,line:l.line,type:"for"});continue}if(a==="include"){r+=1;const c=l.value.slice(7).trim(),p=G(c);p===void 0&&n(l.line,"Malformed {% include %} — expected a quoted partial name"),i.push({line:l.line,name:p,type:"include"});continue}n(l.line,`Unknown tag "{% ${a} %}". Supported: if, for, include.`)}return i};return o([])},G=e=>{if(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1)},je=e=>e==null?"":typeof e=="boolean"||typeof e=="number"?String(e):typeof e=="string"?e:JSON.stringify(e),ve=e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:!0,B=(e,t,r,n,o=!0)=>{const s=e.split(".");if(o&&s.length>0&&!Object.hasOwn(t,s[0]))throw new Error(`${n}:${r}: Variable "${e}" is not defined`);let i=t;for(const l of s){if(i==null)return;if(typeof i!="object")throw new TypeError(`${n}:${r}: Cannot read "${l}" on non-object value`);i=i[l]}return i},xe=e=>{const t=[];let r=0,n=0,o;for(let s=0;s<e.length;s+=1){const i=e[s];if(o){i===o&&(o=void 0);continue}if(i==='"'||i==="'"){o=i;continue}i==="("?r+=1:i===")"?r-=1:i==="|"&&r===0&&(t.push(e.slice(n,s)),n=s+1)}return t.push(e.slice(n)),t},ke=e=>{const t=e.trim(),r=t.indexOf("(");if(r===-1)return{args:[],name:t};if(!t.endsWith(")"))throw new Error(`Filter call "${e}" missing closing ")"`);const n=t.slice(0,r).trim(),o=t.slice(r+1,-1).trim();return o?{args:R(o).map(s=>s.trim()),name:n}:{args:[],name:n}},E=(e,t,r,n,o=!0)=>{const s=e.trim();if(s==="true")return!0;if(s==="false")return!1;if(s==="null"||s==="none")return null;const i=G(s);return i!==void 0?i:/^-?\d+(?:\.\d+)?$/.test(s)?Number(s):B(s,t,r,n,o)},D=(e,t,r,n,o=!0)=>{const s=xe(e),i=s[0].trim();let l=E(i,t,r,n,o);for(let a=1;a<s.length;a+=1){const c=s[a].trim(),{args:p,name:f}=ke(c),d=p.map(u=>E(u,t,r,n,o));try{l=N(f,l,d)}catch(u){const y=u instanceof Error?u.message:String(u);throw new Error(`${n}:${r}: ${y}`,{cause:u})}}return l},Y=(e,t)=>{let r,n=0;for(let o=0;o<=e.length-t.length;o+=1){const s=e[o];if(r){s===r&&(r=void 0);continue}if(s==='"'||s==="'"){r=s;continue}if(s==="("){n+=1;continue}if(s===")"){n-=1;continue}if(n===0&&e.slice(o,o+t.length)===t)return o}return-1},_=(e,t)=>{const r=[];let n=0,o=0;for(;o<=e.length-t.length;){const s=Y(e.slice(o),t);if(s===-1)break;r.push(e.slice(n,o+s)),o+=s+t.length,n=o}return r.push(e.slice(n)),r},g=(e,t,r,n)=>{const o=e.trim();if(o==="")return!1;if(o.startsWith("(")&&o.endsWith(")")&&Se(o)===o.length-1)return g(o.slice(1,-1),t,r,n);const s=_(o," or ");if(s.length>1)return s.some(l=>g(l,t,r,n));const i=_(o," and ");if(i.length>1)return i.every(l=>g(l,t,r,n));if(o.startsWith("not "))return!g(o.slice(4),t,r,n);for(const l of["==","!="]){const a=Y(o,l);if(a!==-1){const c=E(o.slice(0,a),t,n,r,!1),p=E(o.slice(a+l.length),t,n,r,!1),f=c===p;return l==="=="?f:!f}}return ve(D(o,t,n,r,!1))},Se=e=>{if(e[0]!=="(")return-1;let t=0,r,n=-1;for(const o of e){if(n+=1,r){o===r&&(r=void 0);continue}if(o==='"'||o==="'"){r=o;continue}if(o==="(")t+=1;else if(o===")"&&(t-=1,t===0))return n}return-1},b=(e,t)=>{let r="";for(const n of e){if(n.type==="text"){r+=n.value;continue}if(n.type==="expr"){r+=je(D(n.expression,t.scope,n.line,t.filename));continue}if(n.type==="if"){const o=g(n.condition,t.scope,t.filename,n.line)?n.consequent:n.alternate??[];r+=b(o,t);continue}if(n.type==="for"){const o=B(n.collection,t.scope,n.line,t.filename,!1);if(o==null)continue;if(!Array.isArray(o))throw new TypeError(`${t.filename}:${n.line}: {% for %} expected an array, got ${typeof o}`);for(const s of o){const i={...t.scope,[n.binding]:s};r+=b(n.body,{...t,scope:i})}continue}if(n.type==="include"){const o=t.partials?.get(n.name);if(!o)throw new Error(`${t.filename}:${n.line}: Partial "${n.name}" not found. Available: ${[...t.partials?.keys()??[]].join(", ")||"(none)"}`);const s=t.includeStack??new Set;if(s.has(n.name)){const i=[...s,n.name].join(" → ");throw new Error(`${t.filename}:${n.line}: Circular partial include detected: ${i}`)}s.add(n.name);try{r+=b(o,{...t,filename:`<partial:${n.name}>`,includeStack:s})}finally{s.delete(n.name)}}}return r},Ce=(e,t)=>F(q(e),t),v=(e,t)=>b(F(q(e),t.filename),t),L="template.yml",Oe=".raw",We=new Set([".cjs",".css",".env",".gitattributes",".gitignore",".graphql",".html",".ini",".js",".json",".json5",".jsonc",".jsx",".lock",".md",".mdx",".mjs",".prettierrc",".raw",".rs",".scss",".sh",".sql",".svg",".tera",".toml",".ts",".tsx",".twig",".txt",".vue",".xml",".yaml",".yml"]),Te=new Set(["Brewfile","CHANGELOG","CODEOWNERS","CONTRIBUTING","COPYING","Dockerfile","Gemfile","LICENCE","LICENSE","Makefile","NOTICE","Procfile","Rakefile","README","VERSION"]),_e=e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\")),r=t===-1?e:e.slice(t+1),n=r.lastIndexOf(".");return n===-1||n===0?"":r.slice(n).toLowerCase()},J=e=>{const t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t===-1?e:e.slice(t+1)},Le=e=>{const t=_e(e);if(t!=="")return We.has(t);const r=J(e);return Te.has(r)},Me=e=>{const t={default:e.default,internal:e.internal,order:e.order,prompt:e.prompt,required:e.required};switch(e.type){case"array":return{...t,type:"array"};case"boolean":return{...t,default:typeof t.default=="boolean"?t.default:void 0,type:"boolean"};case"enum":return{...t,multiple:e.multiple,type:"enum",values:e.values??[]};case"number":return{...t,type:"number"};case"string":return{...t,type:"string"};default:throw new Error(`Unsupported variable type "${String(e.type)}"`)}},Ue=e=>e.replaceAll("\\","/").replace(/^\.\//,"").replaceAll(/\/+/g,"/"),ze=(e,t,r)=>{const n=t.split("/").filter(Boolean);if(n.length===0)throw new Error("Empty destination path for value");let o=e;for(let s=0;s<n.length-1;s+=1){const i=n[s],l=o[i];if(l===void 0){const a={};o[i]=a,o=a}else if(typeof l=="object"&&!Buffer.isBuffer(l))o=l;else throw new TypeError(`Path conflict: "${n.slice(0,s+1).join("/")}" is both a file and a directory`)}o[n.at(-1)]=r},M=(e,t,r)=>{if(typeof e!="string")return Ie(e);const n=e.includes("{{")||e.includes("{%")?v(e,{filename:`${r}#frontmatter`,scope:t}):e;return g(n,t,`${r}#frontmatter`,1)},Ie=e=>e==null||e===!1||e===0||e===""?!1:Array.isArray(e)?e.length>0:typeof e=="string"?e!=="false"&&e!=="0":!0,Ge=(e,t)=>{const r=z(e,L),n=H(r);if(!n||typeof n!="object")throw new Error(`${r}: must contain a YAML mapping`);const o={};if(n.variables)for(const[a,c]of Object.entries(n.variables))o[a]=Me(c);const s=new Map,i=[];for(const a of K(e,{includeDirs:!1,includeSymlinks:!1})){if(a.path===r)continue;const c=U(e,a.path).replaceAll("\\","/");if(c===L)continue;if($e(c)){const f=$(a.path),d=Ce(f,c);for(const u of Ne(c))s.has(u)&&s.get(u)!==d&&Z.warn(`partial name "${u}" is declared by multiple files — last one wins. Use distinct names or fully-qualified includes.`),s.set(u,d);continue}if(c.endsWith(Oe)){const f=$(a.path);i.push({binary:null,isRaw:!0,rawText:f,relativePath:c});continue}if(Le(c)){const f=$(a.path);i.push({binary:null,isRaw:!1,rawText:f,relativePath:c});continue}const p=$(a.path,{buffer:!0});i.push({binary:p,isRaw:!1,rawText:null,relativePath:c})}const l=a=>{const c={...a.builtins,...a.options},p={},f={};for(const u of i){const y=u.relativePath;let w,C,O=!1;if(u.binary)w=u.binary;else if(u.isRaw)w=u.rawText??"";else{const Q=u.rawText??"",h=be(Q,V=>X(V));if(h.frontmatter){if(h.frontmatter.skip!==void 0&&M(h.frontmatter.skip,c,y)||h.frontmatter.if!==void 0&&!M(h.frontmatter.if,c,y))continue;typeof h.frontmatter.to=="string"&&(C=v(h.frontmatter.to,{filename:`${y}#frontmatter.to`,partials:s,scope:c})),h.frontmatter.force===!0&&(O=!0)}w=v(h.body,{filename:y,partials:s,scope:c})}const W=Ue(C??ge(we(y),c));ze(p,W,w),O&&(f[W]={force:!0})}const d={files:p};return Object.keys(f).length>0&&(d.filesMeta=f),d};return{about:{description:n.description??`Moon-format template at ${e}`,name:n.title??t},destination:n.destination,options:o,produce:l}},Ne=e=>{const t=P(e),r=J(t),n=new Set([r,t]);if(r.startsWith("_")){n.add(r.replace(/^_+/,""));const o=t.slice(0,t.length-r.length);n.add(`${o}${r.replace(/^_+/,"")}`)}return[...n]};export{Ge as loadMoonTemplate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as r}from"./cli-main.js";import{c as i,f as a}from"../packem_shared/registry-keys-
|
|
1
|
+
import{p as r}from"./cli-main.js";import{c as i,f as a}from"../packem_shared/registry-keys-C0ez2VND.js";const n=async({options:s})=>{if(s.clear){const t=i();if(s.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
|
|
2
2
|
`);return}r.success(t?"Cleared cached npm signing keys.":"No cached npm signing keys to clear.");return}const e=await a({forceRefresh:!0});if(e===void 0){if(s.json){process.stdout.write(`${JSON.stringify({cleared:!1,error:"fetch-failed",refetched:!1},void 0,2)}
|
|
3
3
|
`),process.exitCode=1;return}r.error("Failed to fetch npm signing keys (network error and no cached keys available)."),process.exitCode=1;return}if(s.json){process.stdout.write(`${JSON.stringify({cleared:!1,fromCache:e.fromCache,keyCount:e.keys.length,refetched:!e.fromCache,stale:e.stale??!1},void 0,2)}
|
|
4
4
|
`);return}if(e.fromCache&&e.stale===!0){r.warn(`Network fetch failed — falling back to expired cache (${String(e.keys.length)} keys).`);return}r.success(`Refreshed npm signing keys (${String(e.keys.length)} keys).`)};export{n as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{v as a,P as p}from"../packem_shared/index-uBVnF4ji.js";import{r as l}from"../packem_shared/resolve-runtime-D_vZovbB.js";import{r as f}from"../packem_shared/run-file-DyPFFN9U.js";const m=o=>{let t,n=!1,i;const s=[];for(let e=0;e<o.length;e+=1){const r=o[e];if(i===void 0){if(r==="--node"){n=!0;continue}if(r==="--runtime"){t=o[e+1],e+=1;continue}if(r.startsWith("--runtime=")){t=r.slice(10);continue}i=r;continue}s.push(r)}return s[0]==="--"&&s.shift(),{file:i,node:n,runtimeFlag:t,scriptArguments:s}},x=async o=>{const{file:t,node:n,runtimeFlag:i,scriptArguments:s}=m(o);if(t===void 0){process.stderr.write(`No file specified. Usage: vis x <file> [args...]
|
|
2
2
|
`),process.exitCode=1;return}const e=process.cwd(),r=a(t)?t:p(e,t);if(n){const d=await f(r,s,"node",e,{node:!0});d!==0&&(process.exitCode=d);return}let c;try{c=l(e,{flag:i})}catch(d){process.stderr.write(`${d.message}
|
|
3
3
|
`),process.exitCode=1;return}c.deferredNotice!==void 0&&process.stderr.write(`${c.deferredNotice}
|
|
4
|
-
`);const u=await f(r,s,c.runtime,e);u!==0&&(process.exitCode=u)};export{m as parseLeanXArgs,
|
|
4
|
+
`);const u=await f(r,s,c.runtime,e);u!==0&&(process.exitCode=u)};export{m as parseLeanXArgs,x as runLeanX};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as S}from"node:module";import{j as B,p as o,v as R}from"./cli-main.js";import{A as V}from"../packem_shared/pm-runner-
|
|
1
|
+
import{createRequire as S}from"node:module";import{j as B,p as o,v as R}from"./cli-main.js";import{A as V}from"../packem_shared/pm-runner-C6eTANt1.js";import{W as q}from"../packem_shared/build-scripts-w4SNeR7D.js";import{w as y,l as w}from"../packem_shared/index-uBVnF4ji.js";import{a as W}from"../packem_shared/readJsonSync-DweZd5ZA-0eZh9sGm.js";let j;const D=c=>(j??=S(import.meta.url))(c),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=c=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[r,f]=v.versions.node.split(".").map(Number);if(r>22||r===22&&f>=3||r===20&&f>=16)return v.getBuiltinModule(c)}return D(c)},{readdirSync:k,statSync:M}=x("node:fs"),A=(c,r={})=>{const f=y(c,"node_modules");if(!w(f))return[];const l=new Map,p=new Set,$=(n,s,t)=>{const e=`${s}@${t}`;if(p.has(e))return;p.add(e);const i=t.startsWith(c)?t.slice(c.length+1):t;let u=l.get(n);u||(u=[],l.set(n,u)),u.some(b=>b.name===s)||u.push({name:s,relativePath:i})},d=(n,s="")=>{let t;try{t=k(n)}catch{return}for(const e of t){const i=y(n,e);if(e.startsWith("@")){d(i,`${e}/`);continue}if(e===".pnpm"&&s===""){let a;try{a=k(i)}catch{continue}for(const m of a){const h=y(i,m,"node_modules");w(h)&&d(h)}continue}if(e.startsWith("."))continue;const u=s+e,b=y(i,"package.json");try{if(!M(i).isDirectory()||!w(b))continue;const a=W(b),m=typeof a.name=="string"?a.name:u;if(typeof a.bin=="string"){const _=m.includes("/")?m.split("/").pop():m;$(_,m,i)}else if(a.bin&&typeof a.bin=="object")for(const _ of Object.keys(a.bin))$(_,m,i);const h=y(i,"node_modules");w(h)&&d(h)}catch{}}};d(f);const g=[];for(const[n,s]of l)s.length<2||r[n]===!0||s.every(t=>r[`${t.name}#${n}`]===!0)||g.push({bin:n,packages:s});return g.sort((n,s)=>n.bin.localeCompare(s.bin))},C=new Set(["bun","npm","pnpm","yarn"]),z=({options:c,visConfig:r,workspaceRoot:f})=>{const l=f??process.cwd(),p=V(l),$=r?.security?.policies?.installScripts?.allow??{},d=r?.security?.allowBins??{},g=r?.security?.pinVersions===!0,n=q(l,$,{pinVersions:g}),s=A(l,d),t=r&&C.has(p.name)?B(r,p.name,l):void 0;if(c.json){process.stdout.write(`${JSON.stringify({binConflicts:s,drift:t,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:g,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
|
|
2
2
|
`);return}if(o.info(`Build-script status (${p.name}):
|
|
3
3
|
`),n.installed.length===0&&n.unapproved.length===0&&o.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){o.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)o.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){o.info(""),o.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)o.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);o.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){o.info(""),o.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)o.info(` ! ${e}`);o.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){o.info(""),o.warn(` Version drift (pinVersions: true) — ${String(n.versionDrift.length)} entr${n.versionDrift.length===1?"y":"ies"} point at outdated versions:`);for(const{from:e,to:i}of n.versionDrift)o.info(` ${e} → ${i}`);o.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(s.length>0){o.info(""),o.warn(` Bin conflicts (${String(s.length)}) — multiple packages expose the same bin name:`);for(const e of s)o.info(` ${e.bin} ← ${e.packages.map(i=>i.name).join(", ")}`);o.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(t?.hasDrift){o.info("");for(const e of R(t))o.warn(e)}};export{z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{A as d,j as $}from"../packem_shared/pm-runner-
|
|
1
|
+
import{createRequire as m}from"node:module";import{A as d,j as $}from"../packem_shared/pm-runner-C6eTANt1.js";let w;const _=e=>(w??=m(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,s]=o.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return o.getBuiltinModule(e)}return _(e)},{createInterface:y}=g("node:readline"),r="sigstore",h=()=>!!process.stdout.isTTY&&process.env.CI!=="true",v=e=>new Promise(t=>{const s=y({input:process.stdin,output:process.stderr});s.question(`${e} (Y/n) `,i=>{s.close();const n=i.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),I=e=>{const t=d(e),s=$(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[r],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:s})},O=()=>{try{return import.meta.resolve(r),!0}catch{return!1}},D=e=>{let t="pnpm";try{t=d(e).name}catch{}switch(t){case"bun":return`bun add -d ${r}`;case"npm":return`npm install -D ${r}`;case"yarn":return`yarn add -D ${r}`;default:return`pnpm add -D ${r}`}},R=()=>import("sigstore"),T=async(e={})=>{const t=e.interactive??h(),s=e.prompt??v,i=e.runInstall??I,n=e.importImpl??R,l=e.workspaceRoot??process.cwd(),a=D(l);try{return await n()}catch(u){const{code:p,message:f}=u;if(!(p==="ERR_MODULE_NOT_FOUND"||p==="MODULE_NOT_FOUND")||!f.includes(r))throw u}if(!t)throw new Error(`${r} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
|
|
2
2
|
${a}`);if(!await s(`${r} isn't installed. Install it now?`))throw new Error(`${r} install declined. Re-run \`vis attest\` after installing manually:
|
|
3
3
|
${a}`);const c=await i(l);if(c.exitCode!==0)throw new Error(`Install of ${r} failed (exit ${String(c.exitCode)}). Install manually and retry:
|
|
4
4
|
${a}`);return await n()};export{D as installCommandFor,O as isSigstoreInstalled,T as loadOptionalSigstore};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as l}from"node:module";import{E as n}from"../packem_shared/index.server-
|
|
1
|
+
import{createRequire as l}from"node:module";import{E as n}from"../packem_shared/index.server-CusjRLCh.js";let u;const p=o=>(u??=l(import.meta.url))(o),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=o=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[e,s]=i.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return i.getBuiltinModule(o)}return p(o)},{createInterface:c}=m("node:readline"),a=(o,e)=>new Promise(s=>{o.question(e,r=>{s(r.trim())})}),w=async(o,e=!0)=>{const s=c({input:process.stdin,output:process.stdout});try{const r=await a(s,`${o} ${n(e?"[Y/n]":"[y/N]")} `);return r===""?e:/^y(?:es)?$/i.test(r)}finally{s.close()}},y=async(o,e="")=>{const s=c({input:process.stdin,output:process.stdout});try{const r=e?` ${n(`(${e})`)}`:"",t=await a(s,`${o}${r} `);return t===""?e:t}finally{s.close()}},$=async(o,e)=>{if(e.length===0)throw new Error("selectPrompt called with no options.");const s=c({input:process.stdin,output:process.stdout});try{process.stdout.write(`${o}
|
|
2
2
|
`);for(const[r,t]of e.entries())process.stdout.write(` ${r+1}) ${t.label}
|
|
3
3
|
`);for(;;){const r=await a(s,n(` [1-${e.length}] `)),t=Number.parseInt(r,10);if(!Number.isNaN(t)&&t>=1&&t<=e.length)return e[t-1].value;process.stdout.write(n(` Please enter a number between 1 and ${e.length}.
|
|
4
4
|
`))}}finally{s.close()}},h=async(o,e)=>{if(e.length===0)throw new Error("multiSelectPrompt called with no options.");const s=c({input:process.stdin,output:process.stdout});try{process.stdout.write(`${o}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{p as o}from"./cli-main.js";import{r as d}from"../packem_shared/advisories-
|
|
1
|
+
import{p as o}from"./cli-main.js";import{r as d}from"../packem_shared/advisories-CCBGdU8U.js";const f=async({fs:c,logger:u,options:e,workspaceRoot:s})=>{if(!s)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const r=e.db??d(s),t=e.format==="json";if(!e.force){o.warn(`Prune is destructive. Will remove: ${r}`),o.info("Re-run with --force to proceed."),t&&process.stdout.write(`${JSON.stringify({dbPath:r,reason:"needs --force",removed:!1})}
|
|
2
2
|
`);return}const a=[r,`${r}-wal`,`${r}-shm`,`${r}-journal`],i=[];for(const n of a)try{await c.rm(n,{force:!0}),i.push(n)}catch{}if(t){process.stdout.write(`${JSON.stringify({dbPath:r,files:i,removed:!0})}
|
|
3
3
|
`);return}o.success(`Removed ${r}.`)},w=f;export{w as advisoriesPruneExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{s as d,E as i,I as y}from"../packem_shared/index.server-
|
|
1
|
+
import{s as d,E as i,I as y}from"../packem_shared/index.server-CusjRLCh.js";import{p as a}from"./cli-main.js";import{r as l,g as h}from"../packem_shared/advisories-CCBGdU8U.js";const p=r=>{if(r===0)return"0 B";const n=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(r)/Math.log(1024)),n.length-1),o=r/1024**t;return`${o.toFixed(o<10&&t>0?1:0)} ${n[t]}`},v=r=>{if(!r)return"never";const n=Date.parse(r);if(Number.isNaN(n))return r;const t=Date.now()-n;if(t<0)return r;const o=Math.floor(t/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const s=Math.floor(o/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`},g=async({logger:r,options:n,workspaceRoot:t})=>{if(!t)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const o=n.db??l(t),s=await h(t,o);if(n.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:o,ecosystems:s.ecosystems.map(e=>({advisoryCount:e.advisoryCount,lastSyncIso:e.lastSyncIso,manifestEtag:e.manifestEtag??null,name:e.name})),exists:s.exists,schemaVersion:s.schemaVersion,sizeBytes:s.sizeBytes},void 0,2)}
|
|
2
2
|
`);return}if(a.info(`DB: ${o}`),!s.exists){a.warn(`No advisory DB yet. Run ${d("vis advisories sync")} to populate.`);return}if(a.info(`Schema: v${s.schemaVersion} Size: ${p(s.sizeBytes)}`),s.ecosystems.length===0){a.warn("DB exists but contains no ecosystems. Run `vis advisories sync`.");return}a.info(""),a.info("Ecosystem Advisories Last sync ETag"),a.info(i("────────── ────────── ───────────────── ──────"));for(const e of s.ecosystems){const c=e.name.padEnd(10),f=e.advisoryCount.toLocaleString().padStart(10),m=`${e.lastSyncIso||"never"} (${v(e.lastSyncIso)})`.padEnd(19),u=e.manifestEtag??i("—");a.info(`${y(c)} ${f} ${m} ${u}`)}},S=g;export{S as advisoriesStatusExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as g}from"../packem_shared/index.server-
|
|
1
|
+
import{E as g}from"../packem_shared/index.server-CusjRLCh.js";import{p as c}from"./cli-main.js";import{s as $}from"../packem_shared/scan-progress-q-N2JtIp.js";import{s as w,D as v}from"../packem_shared/advisories-CCBGdU8U.js";const S=t=>t?.security?.audit?.advisories??{},D=t=>t?t.split(",").map(r=>r.trim()).filter(r=>r.length>0):["npm"],b=async({logger:t,options:r,visConfig:h,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const l=r.format==="json",u=S(h),m=r.source??u.source??v,p=D(r.ecosystem),y=p.map(s=>({id:s,label:`Sync ${s} advisories`})),n=$(y,{live:!l}),i=[];try{for(const s of p){n.start(s);const o=Date.now();try{const e=await w({allowedHosts:u.allowedHosts,dbPath:r.db,ecosystem:s,force:!!r.force,source:m,workspaceRoot:d});i.push({ecosystem:s,result:e}),e.upToDate?n.finish(s,"ok",`up to date · ${f(Date.now()-o)}`):n.finish(s,"ok",`${e.advisoriesIngested.toLocaleString()} advisories · ${f(e.durationMs)}`)}catch(e){const a=e instanceof Error?e.message:String(e);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}if(l){const s={ecosystems:i.map(o=>({advisoriesIngested:o.result?.advisoriesIngested??0,dbPath:o.result?.dbPath??null,durationMs:o.result?.durationMs??0,ecosystem:o.ecosystem,error:o.error??null,upToDate:o.result?.upToDate??!1})),source:m};process.stdout.write(`${JSON.stringify(s,void 0,2)}
|
|
2
2
|
`)}else{const s=i.filter(a=>a.error),o=i.filter(a=>a.result),e=o[0];e?.result?.dbPath&&c.info(g(`DB: ${e.result.dbPath}`)),s.length===0?c.success(`Synced ${o.length} ecosystem${o.length===1?"":"s"}.`):c.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},f=t=>t>=1e3?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`,R=b;export{R as advisoriesSyncExecute};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e}from"./cli-main.js";import{A as u}from"../packem_shared/pm-runner-
|
|
1
|
+
import{p as e}from"./cli-main.js";import{A as u}from"../packem_shared/pm-runner-C6eTANt1.js";import{O as g}from"../packem_shared/native-config-sync-Ds1FtcrM.js";import{S as l}from"../packem_shared/min-release-age-OaYpLwux.js";const y=new Set(["bun","npm","pnpm","yarn"]),k=({options:r,visConfig:c,workspaceRoot:f})=>{const s=f??process.cwd(),n=u(s);if(!y.has(n.name)){e.warn(`Package manager '${n.name}' has no native security config to sync.`);return}if(!c?.security){e.warn("vis.config has no `security` block — nothing to sync.");return}const t=c.security.policies??{},a=Object.fromEntries(Object.entries(t.installScripts?.allow??{}).filter(([,o])=>o)),m=t.firstSeen?.minutes,p=t.firstSeen?.exclude??[],i=[];if(Object.keys(a).length>0&&!r.skipAllowBuilds&&i.push(...g(n.name,s,a)),r.skipMinReleaseAge||i.push(...l(n.name,s,m,p)),i.length===0){e.success("Nothing to sync — vis.config and native PM config are aligned.");return}e.info(`Syncing vis.config security settings to ${n.name} native config…
|
|
2
2
|
`);for(const o of i)e.success(` ${o}`)};export{k as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{
|
|
1
|
+
import{createRequire as m}from"node:module";import{w as d,l as p,j as h}from"../packem_shared/index-uBVnF4ji.js";import{p as e}from"./cli-main.js";import{A as _}from"../packem_shared/pm-runner-C6eTANt1.js";import{a as u}from"../packem_shared/readJsonSync-DweZd5ZA-0eZh9sGm.js";let g;const w=i=>(g??=m(import.meta.url))(i),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=i=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[t,s]=c.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return c.getBuiltinModule(i)}return w(i)},{spawnSync:v}=y("node:child_process"),n="@lavamoat/preinstall-always-fail",l=i=>{const t=d(i,"package.json");if(!p(t))return"no-package-json";try{const s=u(t);if(s.devDependencies?.[n]||s.dependencies?.[n])return"installed"}catch{}return"missing"},$=i=>{const t=d(i,"package.json");if(!p(t))return!1;try{const s=u(t);let o=!1;const a=r=>!r||!(n in r)?r:(o=!0,Object.fromEntries(Object.entries(r).filter(([f])=>f!==n)));return s.devDependencies=a(s.devDependencies),s.dependencies=a(s.dependencies),o&&h(t,`${JSON.stringify(s,null,2)}
|
|
2
2
|
`),o}catch{return!1}},D=({options:i,workspaceRoot:t})=>{const s=t??process.cwd();if(i.status){switch(l(s)){case"installed":{e.success(`Preinstall tripwire is installed (${n}).`),e.info("Removing 'ignore-scripts=true' will cause future installs to fail loudly.");break}case"missing":{e.warn("Preinstall tripwire is not installed."),e.info(`Run 'vis security tripwire' to add ${n} as a devDependency.`);break}default:e.error("No package.json found at the workspace root."),process.exitCode=1}return}if(i.remove){$(s)?e.success(`Removed ${n} from package.json. Run your PM's install to clean node_modules.`):e.info(`${n} was not present in package.json.`);return}if(l(s)==="installed"){e.info(`${n} is already installed.`);return}const o=_(s),a={bun:["add","-d",n],npm:["install","--save-dev",n],pnpm:["add","-D","-w",n],yarn:["add","-D",n]}[o.name];if(!a){e.error(`Cannot install tripwire — unsupported package manager '${o.name}'.`),process.exitCode=1;return}e.info(`Installing ${n} via ${o.name}…`);const r=v(o.name,a,{cwd:s,stdio:"inherit"});if(r.error){e.error(`Failed to install tripwire: ${r.error.message}`),process.exitCode=1;return}if(r.signal!==null){e.error(`${o.name} was terminated by signal ${r.signal}`),process.exitCode=1;return}if(r.status!==0){e.error(`${o.name} exited with code ${String(r.status)}`),process.exitCode=r.status??1;return}e.success(`Installed ${n} as a devDependency.`),e.notice(""),e.notice("How the tripwire works:"),e.notice(` ${n} declares a preinstall script that always fails.`),e.notice(" When 'ignore-scripts=true' is set (.npmrc / bunfig.toml / .yarnrc.yml),"),e.notice(" the script is skipped and installs succeed normally. If someone deletes"),e.notice(" that setting, the next install fails — loudly — instead of silently"),e.notice(" running every dependency's lifecycle scripts.")};export{D as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`;break;case 114:
|
|
3
|
-
`),l++,p=t,i=14;switch(
|
|
1
|
+
import{createRequire as Qe}from"node:module";import{z as R,i as tt,E as ot,s as rt,L as st,e as it,P as S,J as I,b as z,h as te,w,k as Le,v as be,W as oe,y as nt,_ as ct,l as $,u as lt}from"../packem_shared/index-uBVnF4ji.js";import{parse as at}from"./index5.js";import"../packem_shared/public-api-WqUCiyIe.js";import{transformTs as _e}from"#native";let Ye;const Xe=e=>(Ye??=Qe(import.meta.url))(e),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ge=e=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[o,s]=F.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return F.getBuiltinModule(e)}return Xe(e)},{readFileSync:Oe,statSync:Ne,writeFileSync:Ze,unlinkSync:et}=ge("node:fs"),de=ge("node:module"),{createRequire:D}=de,{fileURLToPath:Y,pathToFileURL:ee}=ge("node:url");function pt(e,o,s){const{beforeParse:t,buffer:r,compression:n,encoding:i="utf8",flag:l}={},a=R(e,{buffer:r,compression:n,encoding:i,flag:l}),p=typeof t=="function"?t(a):a;return tt.parse(p,o)}let ut;const dt=e=>(ut??=D(import.meta.url))(e),U=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ft=e=>{if(typeof U<"u"&&U.versions&&U.versions.node){const[o,s]=U.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return U.getBuiltinModule(e)}return dt(e)};ft("node:fs/promises");let mt;const ht=e=>(mt??=D(import.meta.url))(e),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,gt=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[o,s]=P.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return P.getBuiltinModule(e)}return ht(e)};gt("node:fs");function Ot(e,o=!1){const s=e.length;let t=0,r="",n=0,i=16,l=0,a=0,p=0,f=0,d=0;function k(c,g){let b=0,m=0;for(;b<c;){let u=e.charCodeAt(t);if(u>=48&&u<=57)m=m*16+u-48;else if(u>=65&&u<=70)m=m*16+u-65+10;else if(u>=97&&u<=102)m=m*16+u-97+10;else break;t++,b++}return b<c&&(m=-1),m}function O(c){t=c,r="",n=0,i=16,d=0}function v(){let c=t;if(e.charCodeAt(t)===48)t++;else for(t++;t<e.length&&L(e.charCodeAt(t));)t++;if(t<e.length&&e.charCodeAt(t)===46)if(t++,t<e.length&&L(e.charCodeAt(t)))for(t++;t<e.length&&L(e.charCodeAt(t));)t++;else return d=3,e.substring(c,t);let g=t;if(t<e.length&&(e.charCodeAt(t)===69||e.charCodeAt(t)===101))if(t++,(t<e.length&&e.charCodeAt(t)===43||e.charCodeAt(t)===45)&&t++,t<e.length&&L(e.charCodeAt(t))){for(t++;t<e.length&&L(e.charCodeAt(t));)t++;g=t}else d=3;return e.substring(c,g)}function T(){let c="",g=t;for(;;){if(t>=s){c+=e.substring(g,t),d=2;break}const b=e.charCodeAt(t);if(b===34){c+=e.substring(g,t),t++;break}if(b===92){if(c+=e.substring(g,t),t++,t>=s){d=2;break}switch(e.charCodeAt(t++)){case 34:c+='"';break;case 92:c+="\\";break;case 47:c+="/";break;case 98:c+="\b";break;case 102:c+="\f";break;case 110:c+=`
|
|
2
|
+
`;break;case 114:c+="\r";break;case 116:c+=" ";break;case 117:const m=k(4);m>=0?c+=String.fromCharCode(m):d=4;break;default:d=5}g=t;continue}if(b>=0&&b<=31)if(W(b)){c+=e.substring(g,t),d=2;break}else d=6;t++}return c}function A(){if(r="",d=0,n=t,a=l,f=p,t>=s)return n=s,i=17;let c=e.charCodeAt(t);if(ne(c)){do t++,r+=String.fromCharCode(c),c=e.charCodeAt(t);while(ne(c));return i=15}if(W(c))return t++,r+=String.fromCharCode(c),c===13&&e.charCodeAt(t)===10&&(t++,r+=`
|
|
3
|
+
`),l++,p=t,i=14;switch(c){case 123:return t++,i=1;case 125:return t++,i=2;case 91:return t++,i=3;case 93:return t++,i=4;case 58:return t++,i=6;case 44:return t++,i=5;case 34:return t++,r=T(),i=10;case 47:const g=t-1;if(e.charCodeAt(t+1)===47){for(t+=2;t<s&&!W(e.charCodeAt(t));)t++;return r=e.substring(g,t),i=12}if(e.charCodeAt(t+1)===42){t+=2;const b=s-1;let m=!1;for(;t<b;){const u=e.charCodeAt(t);if(u===42&&e.charCodeAt(t+1)===47){t+=2,m=!0;break}t++,W(u)&&(u===13&&e.charCodeAt(t)===10&&t++,l++,p=t)}return m||(t++,d=1),r=e.substring(g,t),i=13}return r+=String.fromCharCode(c),t++,i=16;case 45:if(r+=String.fromCharCode(c),t++,t===s||!L(e.charCodeAt(t)))return i=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=v(),i=11;default:for(;t<s&&N(c);)t++,c=e.charCodeAt(t);if(n!==t){switch(r=e.substring(n,t),r){case"true":return i=8;case"false":return i=9;case"null":return i=7}return i=16}return r+=String.fromCharCode(c),t++,i=16}}function N(c){if(ne(c)||W(c))return!1;switch(c){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function h(){let c;do c=A();while(c>=12&&c<=15);return c}return{setPosition:O,getPosition:()=>t,scan:o?h:A,getToken:()=>i,getTokenValue:()=>r,getTokenOffset:()=>n,getTokenLength:()=>t-n,getTokenStartLine:()=>a,getTokenStartCharacter:()=>n-f,getTokenError:()=>d}}function ne(e){return e===32||e===9}function W(e){return e===10||e===13}function L(e){return e>=48&&e<=57}var ve;(function(e){e[e.lineFeed=10]="lineFeed",e[e.carriageReturn=13]="carriageReturn",e[e.space=32]="space",e[e._0=48]="_0",e[e._1=49]="_1",e[e._2=50]="_2",e[e._3=51]="_3",e[e._4=52]="_4",e[e._5=53]="_5",e[e._6=54]="_6",e[e._7=55]="_7",e[e._8=56]="_8",e[e._9=57]="_9",e[e.a=97]="a",e[e.b=98]="b",e[e.c=99]="c",e[e.d=100]="d",e[e.e=101]="e",e[e.f=102]="f",e[e.g=103]="g",e[e.h=104]="h",e[e.i=105]="i",e[e.j=106]="j",e[e.k=107]="k",e[e.l=108]="l",e[e.m=109]="m",e[e.n=110]="n",e[e.o=111]="o",e[e.p=112]="p",e[e.q=113]="q",e[e.r=114]="r",e[e.s=115]="s",e[e.t=116]="t",e[e.u=117]="u",e[e.v=118]="v",e[e.w=119]="w",e[e.x=120]="x",e[e.y=121]="y",e[e.z=122]="z",e[e.A=65]="A",e[e.B=66]="B",e[e.C=67]="C",e[e.D=68]="D",e[e.E=69]="E",e[e.F=70]="F",e[e.G=71]="G",e[e.H=72]="H",e[e.I=73]="I",e[e.J=74]="J",e[e.K=75]="K",e[e.L=76]="L",e[e.M=77]="M",e[e.N=78]="N",e[e.O=79]="O",e[e.P=80]="P",e[e.Q=81]="Q",e[e.R=82]="R",e[e.S=83]="S",e[e.T=84]="T",e[e.U=85]="U",e[e.V=86]="V",e[e.W=87]="W",e[e.X=88]="X",e[e.Y=89]="Y",e[e.Z=90]="Z",e[e.asterisk=42]="asterisk",e[e.backslash=92]="backslash",e[e.closeBrace=125]="closeBrace",e[e.closeBracket=93]="closeBracket",e[e.colon=58]="colon",e[e.comma=44]="comma",e[e.dot=46]="dot",e[e.doubleQuote=34]="doubleQuote",e[e.minus=45]="minus",e[e.openBrace=123]="openBrace",e[e.openBracket=91]="openBracket",e[e.plus=43]="plus",e[e.slash=47]="slash",e[e.formFeed=12]="formFeed",e[e.tab=9]="tab"})(ve||(ve={}));new Array(20).fill(0).map((e,o)=>" ".repeat(o));const _=200;new Array(_).fill(0).map((e,o)=>`
|
|
4
4
|
`+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>"\r"+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>`\r
|
|
5
5
|
`+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>`
|
|
6
6
|
`+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>"\r"+" ".repeat(o)),new Array(_).fill(0).map((e,o)=>`\r
|
|
7
|
-
`+" ".repeat(o));var re;(function(e){e.DEFAULT={allowTrailingComma:!1}})(re||(re={}));function ft(e,o=[],s=re.DEFAULT){let t=null,r=[];const c=[];function i(l){Array.isArray(r)?r.push(l):t!==null&&(r[t]=l)}return mt(e,{onObjectBegin:()=>{const l={};i(l),c.push(r),r=l,t=null},onObjectProperty:l=>{t=l},onObjectEnd:()=>{r=c.pop()},onArrayBegin:()=>{const l=[];i(l),c.push(r),r=l,t=null},onArrayEnd:()=>{r=c.pop()},onLiteralValue:i,onError:(l,a,p)=>{o.push({error:l,offset:a,length:p})}},s),r[0]}function mt(e,o,s=re.DEFAULT){const t=dt(e,!1),r=[];let c=0;function i(y){return y?()=>c===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function l(y){return y?C=>c===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function a(y){return y?C=>c===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice()):()=>!0}function p(y){return y?()=>{c>0?c++:y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice())===!1&&(c=1)}:()=>!0}function f(y){return y?()=>{c>0&&c--,c===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter())}:()=>!0}const d=p(o.onObjectBegin),v=a(o.onObjectProperty),O=f(o.onObjectEnd),k=p(o.onArrayBegin),T=f(o.onArrayEnd),A=a(o.onLiteralValue),I=l(o.onSeparator),h=i(o.onComment),n=l(o.onError),g=s&&s.disallowComments,b=s&&s.allowTrailingComma;function m(){for(;;){const y=t.scan();switch(t.getTokenError()){case 4:u(14);break;case 5:u(15);break;case 3:u(13);break;case 1:g||u(11);break;case 2:u(12);break;case 6:u(16);break}switch(y){case 12:case 13:g?u(10):h();break;case 16:u(1);break;case 15:case 14:break;default:return y}}}function u(y,C=[],ye=[]){if(n(y),C.length+ye.length>0){let Q=t.getToken();for(;Q!==17;){if(C.indexOf(Q)!==-1){m();break}else if(ye.indexOf(Q)!==-1)break;Q=m()}}}function E(y){const C=t.getTokenValue();return y?A(C):(v(C),r.push(C)),m(),!0}function R(){switch(t.getToken()){case 11:const y=t.getTokenValue();let C=Number(y);isNaN(C)&&(u(2),C=0),A(C);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return m(),!0}function z(){return t.getToken()!==10?(u(3,[],[2,5]),!1):(E(!1),t.getToken()===6?(I(":"),m(),ie()||u(4,[],[2,5])):u(5,[],[2,5]),r.pop(),!0)}function Ve(){d(),m();let y=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(y||u(4,[],[]),I(","),m(),t.getToken()===2&&b)break}else y&&u(6,[],[]);z()||u(4,[],[2,5]),y=!0}return O(),t.getToken()!==2?u(7,[2],[]):m(),!0}function Je(){k(),m();let y=!0,C=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(C||u(4,[],[]),I(","),m(),t.getToken()===4&&b)break}else C&&u(6,[],[]);y?(r.push(0),y=!1):r[r.length-1]++,ie()||u(4,[],[4,5]),C=!0}return T(),y||r.pop(),t.getToken()!==4?u(8,[4],[]):m(),!0}function ie(){switch(t.getToken()){case 3:return Je();case 1:return Ve();case 10:return E(!0);default:return R()}}return m(),t.getToken()===17?s.allowEmptyContent?!0:(u(4,[],[]),!1):ie()?(t.getToken()!==17&&u(9,[],[]),!0):(u(4,[],[]),!1)}var ve;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ve||(ve={}));var Ce;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Ce||(Ce={}));const se=ft;var we;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(we||(we={}));function ht(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}const gt=(e,o,s,t)=>{if(e.length===0)return;const r=e[0],c=Ye(o,r.offset),i=new Xe(`${ht(r.error)} at offset ${r.offset}`);throw i.fileName=s,i.codeFrame=Ze(o,{start:c},{tabWidth:!1,...t}),i},Ot=(e,o)=>{const{allowEmptyContent:s,allowTrailingComma:t=!0,beforeParse:r,buffer:c,color:i,compression:l,disallowComments:a,encoding:p="utf8",flag:f}=o??{},d=F(e,{buffer:c,compression:l,encoding:p,flag:f}),v=typeof r=="function"?r(d):d,O=[],k=se(v,O,{allowEmptyContent:s,allowTrailingComma:t,disallowComments:a});return gt(O,v,et(e),{color:i}),k};let bt;const yt=e=>(bt??=D(import.meta.url))(e),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,kt=e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[o,s]=M.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return M.getBuiltinModule(e)}return yt(e)};kt("node:fs/promises");let vt;const Ct=e=>(vt??=D(import.meta.url))(e),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wt=e=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[o,s]=V.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return V.getBuiltinModule(e)}return Ct(e)};wt("node:fs");const Tt=(e,o)=>{const s=F(e,{encoding:"utf8",...o});return st(s)};var J={},Te;function xt(){if(Te)return J;Te=1,Object.defineProperty(J,"__esModule",{value:!0});const e=h=>h!==null&&typeof h=="object",o=(h,n)=>Object.assign(new Error(`[${h}]: ${n}`),{code:h}),s="ERR_INVALID_PACKAGE_CONFIG",t="ERR_INVALID_PACKAGE_TARGET",r="ERR_PACKAGE_PATH_NOT_EXPORTED",c="ERR_PACKAGE_IMPORT_NOT_DEFINED",i=/^\d+$/,l=/^(\.{1,2}|node_modules)$/i,a=/\/|\\/;var p=(h=>(h.Export="exports",h.Import="imports",h))(p||{});const f=(h,n,g,b,m)=>{if(n==null)return[];if(typeof n=="string"){const[u,...E]=n.split(a);if(u===".."||E.some(R=>l.test(R)))throw o(t,`Invalid "${h}" target "${n}" defined in the package config`);return[m?n.replace(/\*/g,m):n]}if(Array.isArray(n))return n.flatMap(u=>f(h,u,g,b,m));if(e(n)){for(const u of Object.keys(n)){if(i.test(u))throw o(s,"Cannot contain numeric property keys");if(u==="default"||b.includes(u))return f(h,n[u],g,b,m)}return[]}throw o(t,`Invalid "${h}" target "${n}"`)},d="*",v=(h,n)=>{const g=h.indexOf(d),b=n.indexOf(d);return g===b?n.length>h.length:b>g};function O(h,n){if(!n.includes(d)&&h.hasOwnProperty(n))return[n];let g,b;for(const m of Object.keys(h))if(m.includes(d)){const[u,E,R]=m.split(d);if(R===void 0&&n.startsWith(u)&&n.endsWith(E)){const z=n.slice(u.length,-E.length||void 0);z&&(!g||v(g,m))&&(g=m,b=z)}}return[g,b]}const k=h=>Object.keys(h).reduce((n,g)=>{const b=g===""||g[0]!==".";if(n===void 0||n===b)return b;throw o(s,'"exports" cannot contain some keys starting with "." and some not')},void 0),T=/^\w+:/,A=(h,n,g)=>{if(!h)throw new Error('"exports" is required');n=n===""?".":`./${n}`,(typeof h=="string"||Array.isArray(h)||e(h)&&k(h))&&(h={".":h});const[b,m]=O(h,n),u=f(p.Export,h[b],n,g,m);if(u.length===0)throw o(r,n==="."?'No "exports" main defined':`Package subpath '${n}' is not defined by "exports"`);for(const E of u)if(!E.startsWith("./")&&!T.test(E))throw o(t,`Invalid "exports" target "${E}" defined in the package config`);return u},I=(h,n,g)=>{if(!h)throw new Error('"imports" is required');const[b,m]=O(h,n),u=f(p.Import,h[b],n,g,m);if(u.length===0)throw o(c,`Package import specifier "${n}" is not defined in package`);return u};return J.resolveExports=A,J.resolveImports=I,J}var Et=xt();let $t;const St=e=>($t??=D(import.meta.url))(e),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_e=e=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[o,s]=q.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return q.getBuiltinModule(e)}return St(e)},{statSync:X}=_e("node:fs"),At=_e("node:module"),Le=(e=process.cwd())=>{const{findPnpApi:o}=At;return o?o(e):void 0},It=e=>se(F(e,{buffer:!1})),ce=(e,o,s,t)=>{const r=`resolveFromPackageJsonPath:${e}:${o}:${s?"yes":"no"}`;if(t?.has(r))return t.get(r);const c=It(e);if(!c)return;let i=o||"tsconfig.json";if(!s&&c.exports)try{const[l]=Et.resolveExports(c.exports,o,["require","types"]);i=l}catch{return!1}else!o&&c.tsconfig&&(i=c.tsconfig);return i=w(e,"..",i),t?.set(r,i),i},le="package.json",ae="tsconfig.json",Nt=(e,o,s)=>{let t=e;if(e===".."&&(t=w(t,ae)),e.startsWith(".")&&(t=S(o,t)),be(t)){if($(t)){if(X(t).isFile())return t}else if(!t.endsWith(".json")){const O=`${t}.json`;if($(O))return O}return}const[r="",...c]=e.split("/"),i=r.startsWith("@")?`${r}/${String(c.shift())}`:r,l=c.join("/"),a=Le(o);if(a){const{resolveRequest:O}=a;try{if(i===e){const k=O(w(i,le),o);if(k){const T=ce(k,l,!1,s);if(T&&$(T))return T}}else{let k;try{k=O(e,o,{extensions:[".json"]})}catch{k=O(w(e,ae),o)}if(k)return k}}catch{}}const p=oe(O=>{const k=w(S(O),"node_modules",i);if($(k))return w("node_modules",i)},{cwd:o,type:"directory"});if(!p||!X(p).isDirectory())return;const f=w(p,le);if($(f)){const O=ce(f,l,!1,s);if(O===!1)return;if(O&&$(O)&&X(O).isFile())return O}const d=w(p,l),v=d.endsWith(".json");if(!v){const O=`${d}.json`;if($(O))return O}if($(d)){if(X(d).isDirectory()){const O=w(d,le);if($(O)){const T=ce(O,"",!0,s);if(T&&$(T))return T}const k=w(d,ae);if($(k))return k}else if(v)return d}},jt=e=>{const o=S(e);let s;const t=Le(o);if(t)try{s=t.resolveRequest("typescript/package.json",o)??void 0}catch{}if(s??=oe(r=>w(r,"node_modules","typescript","package.json"),{cwd:o,type:"file"}),!!s)try{const r=se(F(s,{buffer:!1}));if(typeof r?.version=="string")return r.version}catch{}},_t=new Set(["node16","node18","node20","nodenext"]),De=e=>e!==void 0&&_t.has(e),Lt=(e,o)=>{!o.has("target")&&!De(e.module)&&(e.target="es3")},Dt=(e,o)=>{!o.has("target")&&!De(e.module)&&(e.target="es5")},Ft=(e,o)=>{o.has("strict")||(e.strict=!0),o.has("target")||(e.target="es2025"),o.has("module")||(e.module="es2022"),o.has("moduleResolution")||(e.moduleResolution="bundler"),o.has("rootDir")||(e.rootDir="."),o.has("types")||(e.types=[]),o.has("noUncheckedSideEffectImports")||(e.noUncheckedSideEffectImports=!0),o.has("libReplacement")||(e.libReplacement=!1),o.has("alwaysStrict")||(e.alwaysStrict=!0)},Rt=(e,o)=>{o.has("module")||(e.module="esnext"),o.has("moduleResolution")||(e.moduleResolution="bundler"),o.has("stableTypeOrdering")||(e.stableTypeOrdering=!0)},Bt=[[4,Lt],[5,Dt],[6,Ft],[7,Rt]],Ut=/^v?(\d+)/,Pt=e=>{const o=Ut.exec(e);return o?Number(o[1]):void 0},Wt=(e,o)=>{const s=Pt(o);if(s===void 0)return;const t=new Set(Object.keys(e));for(const[r,c]of Bt)r<=s&&c(e,t)},Mt=e=>se(F(e,{buffer:!1})),Vt=e=>e.replaceAll("\\","/"),G=e=>{const o=tt(e);return ot(o)?o:`./${o}`},me=["files","include","exclude"],xe=(e,o,s)=>{const t=w(o,s),r=H(e,t);return te(r)||"./"},Jt=(e,o,s)=>{const t=H(e,o);if(!t)return s;const r=s.startsWith("./")?s.slice(2):s;return`${t}/${r}`},qt=(e,o,s,t,r)=>{if(s.has(e))throw new Error(`Circularity detected while resolving configuration: ${e}`);s.add(e);const c=N(e),i=Fe(e,t,s,r);delete i.references;const{compilerOptions:l}=i;if(l){const{baseUrl:a}=l;a&&!a.startsWith(x)&&(l.baseUrl=xe(o,c,a));const{outDir:p}=l;p&&!p.startsWith(x)&&(l.outDir=xe(o,c,p))}for(const a of me){const p=i[a];p&&(i[a]=p.map(f=>f.startsWith(x)||be(f)?f:Jt(o,c,f)))}return i},Fe=(e,o,s=new Set,t=new Map)=>{let r;try{r=Mt(e)??{}}catch(i){throw new Error(`Cannot resolve tsconfig at path: ${e}`,{cause:i})}if(typeof r!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const c=N(e);if(r.compilerOptions){const{compilerOptions:i}=r;i.paths&&!i.baseUrl&&(i[Re]=c)}if(r.extends){const i=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;const l=i.toReversed();for(let a=0;a<l.length;a++){const p=l[a],f=Nt(p,c,t);if(!f)throw new Ne(`No such file or directory, for '${p}' found.`);const d=qt(f,c,new Set(s),o,t);d.compilerOptions?.rootDir!==void 0&&!d.compilerOptions.rootDir.startsWith(x)&&(d.compilerOptions.rootDir=w(N(f),d.compilerOptions.rootDir));const v={...d,...r,compilerOptions:{...d.compilerOptions,...r.compilerOptions}};d.watchOptions&&(v.watchOptions={...d.watchOptions,...r.watchOptions}),r=v}}if(r.compilerOptions){const{compilerOptions:i}=r;for(const l of["baseUrl","rootDir"]){const a=i[l];if(a&&!a.startsWith(x)){const p=S(c,a);i[l]=G(H(c,p))}}for(const l of["outDir","declarationDir"]){let a=i[l];a&&(Array.isArray(r.exclude)||(r.exclude=["outDir","declarationDir"].map(p=>{const f=i[p];if(f)return f.startsWith(x)||be(f)?f:w(c,f)}).filter(Boolean)),a.startsWith(x)||(a=G(a)),i[l]=a)}}else r.compilerOptions={};if(r.include&&(r.include=r.include.map(i=>Vt(i))),r.files&&(r.files=r.files.map(i=>i.startsWith(x)?i:G(i))),r.watchOptions){const{watchOptions:i}=r;i.excludeDirectories&&(i.excludeDirectories=i.excludeDirectories.map(l=>te(S(c,l)))),i.excludeFiles&&(i.excludeFiles=i.excludeFiles.map(l=>te(S(c,l)))),i.watchFile&&(i.watchFile=i.watchFile.toLowerCase()),i.watchDirectory&&(i.watchDirectory=i.watchDirectory.toLowerCase()),i.fallbackPolling&&(i.fallbackPolling=i.fallbackPolling.toLowerCase())}if(r.compilerOptions.lib&&(r.compilerOptions.lib=r.compilerOptions.lib.map(i=>i.toLowerCase())),r.compilerOptions.module){let i=r.compilerOptions.module.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.module=i}if(r.compilerOptions.target){let i=r.compilerOptions.target.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.target=i}if(r.compilerOptions.moduleResolution){let i=r.compilerOptions.moduleResolution.toLowerCase();i==="node"&&(i="node10"),r.compilerOptions.moduleResolution=i}return r.compilerOptions.jsx&&(r.compilerOptions.jsx=r.compilerOptions.jsx.toLowerCase()),r.compilerOptions.moduleDetection&&(r.compilerOptions.moduleDetection=r.compilerOptions.moduleDetection.toLowerCase()),r.compilerOptions.importsNotUsedAsValues&&(r.compilerOptions.importsNotUsedAsValues=r.compilerOptions.importsNotUsedAsValues.toLowerCase()),r.compilerOptions.newLine&&(r.compilerOptions.newLine=r.compilerOptions.newLine.toLowerCase()),r},Z=(e,o)=>{if(e.startsWith(x))return te(w(o,e.slice(x.length)))},Kt=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],pe=e=>e==="es2022"||e==="es2023"||e==="es2024"||e==="es2025"||e==="esnext",Gt=(e,o)=>{if(e.compilerOptions===void 0)return e;if(e.compilerOptions.rewriteRelativeImportExtensions&&(e.compilerOptions.allowImportingTsExtensions??=!0),e.compilerOptions.composite&&(e.compilerOptions.declaration??=!0,e.compilerOptions.incremental??=!0),e.compilerOptions.checkJs&&(e.compilerOptions.allowJs??=!0),e.compilerOptions.verbatimModuleSyntax&&(e.compilerOptions.isolatedModules??=!0,e.compilerOptions.preserveConstEnums??=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))){if(e.compilerOptions.esModuleInterop===void 0&&(e.compilerOptions.module==="node16"||e.compilerOptions.module==="node18"||e.compilerOptions.module==="node20"||e.compilerOptions.module==="nodenext"||e.compilerOptions.module==="preserve")&&(e.compilerOptions.esModuleInterop=!0),e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0){let s="classic";if(e.compilerOptions.module!==void 0)switch(e.compilerOptions.module.toLocaleLowerCase()){case"commonjs":{s="node10";break}case"node16":case"node18":{s="node16";break}case"node20":{s="node16";break}case"nodenext":{s="nodenext";break}case"preserve":{s="bundler";break}}s!=="classic"&&(e.compilerOptions.moduleResolution=s)}if(e.compilerOptions.moduleResolution==="bundler"&&(e.compilerOptions.resolveJsonModule??=!0),e.compilerOptions.module&&["node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.resolveJsonModule??=!0),(e.compilerOptions.esModuleInterop||e.compilerOptions.module==="system"||e.compilerOptions.moduleResolution==="bundler")&&e.compilerOptions.allowSyntheticDefaultImports===void 0&&(e.compilerOptions.allowSyntheticDefaultImports=!0),["5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.moduleResolution){let s=!1;["bundler","node16","nodenext"].includes(e.compilerOptions.moduleResolution.toLocaleLowerCase())&&(s=!0),e.compilerOptions.resolvePackageJsonExports===void 0&&s&&(e.compilerOptions.resolvePackageJsonExports=!0),e.compilerOptions.resolvePackageJsonImports===void 0&&s&&(e.compilerOptions.resolvePackageJsonImports=!0)}if(e.compilerOptions.target===void 0){let s="es5";switch(e.compilerOptions.module){case"node16":case"node18":{s="es2022";break}case"node20":{s="es2023";break}case"nodenext":{s="esnext";break}}s!=="es5"&&(e.compilerOptions.target=s)}e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.target&&pe(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!0)}if(["5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.strict&&e.compilerOptions.strictBuiltinIteratorReturn===void 0&&(e.compilerOptions.strictBuiltinIteratorReturn=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&(e.compilerOptions.strict&&(e.compilerOptions.noImplicitAny=e.compilerOptions.noImplicitAny??!0,e.compilerOptions.noImplicitThis=e.compilerOptions.noImplicitThis??!0,e.compilerOptions.strictNullChecks=e.compilerOptions.strictNullChecks??!0,e.compilerOptions.strictFunctionTypes=e.compilerOptions.strictFunctionTypes??!0,e.compilerOptions.strictBindCallApply=e.compilerOptions.strictBindCallApply??!0,e.compilerOptions.strictPropertyInitialization=e.compilerOptions.strictPropertyInitialization??!0,e.compilerOptions.alwaysStrict=e.compilerOptions.alwaysStrict??!0),e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.target&&pe(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!0),e.compilerOptions.strict&&e.compilerOptions.useUnknownInCatchVariables===void 0&&(e.compilerOptions.useUnknownInCatchVariables=!0),e.compilerOptions.isolatedModules&&(e.compilerOptions.preserveConstEnums=e.compilerOptions.preserveConstEnums??!0)),["6.0","7.0","true"].includes(String(o?.tscCompatible))){if(e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0&&e.compilerOptions.module){const s=e.compilerOptions.module.toLocaleLowerCase();s==="node16"||s==="node18"||s==="node20"?e.compilerOptions.moduleResolution="node16":s==="nodenext"&&(e.compilerOptions.moduleResolution="nodenext")}if(e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&e.compilerOptions.target&&!pe(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!1),e.compilerOptions.isolatedModules&&e.compilerOptions.preserveConstEnums===void 0&&(e.compilerOptions.preserveConstEnums=!0),e.compilerOptions.resolveJsonModule===void 0){const s=e.compilerOptions.module,t=e.compilerOptions.moduleResolution?.toLocaleLowerCase();!(s!==void 0&&["node20","nodenext"].includes(s)||t==="bundler")&&t&&(e.compilerOptions.resolveJsonModule=!1)}if(e.compilerOptions.moduleResolution){const s=e.compilerOptions.moduleResolution.toLocaleLowerCase();["bundler","node16","nodenext"].includes(s)||(e.compilerOptions.resolvePackageJsonExports??=!1,e.compilerOptions.resolvePackageJsonImports??=!1)}}return e.compileOnSave===!1&&delete e.compileOnSave,e},Ht=(e,o)=>{const s=e?.typescriptVersion;if(!(s===!1||s===void 0))return s==="auto"?jt(o):s},x="${configDir}",Re=Symbol("implicitBaseUrl"),zt=(e,o)=>{const s=S(e),t=Fe(s,o),r=N(s),c=Ht(o,r);c&&t.compilerOptions&&Wt(t.compilerOptions,c);const{compilerOptions:i}=t;if(i){for(const a of Kt){const p=i[a];if(p){const f=Z(p,r);i[a]=f?G(H(r,f)):p}}for(const a of["rootDirs","typeRoots"]){const p=i[a];p&&(i[a]=p.map(f=>{const d=Z(f,r);return d?G(H(r,d)):f}))}const{paths:l}=i;if(l){const a=Object.keys(l);for(let p=0;p<a.length;p++){const f=a[p];l[f]=l[f].map(d=>Z(d,r)??d)}}}for(let l=0;l<me.length;l++){const a=me[l],p=t[a];p&&(t[a]=p.map(f=>Z(f,r)??f))}return Gt(t,o)};let Qt;const Yt=e=>(Qt??=D(import.meta.url))(e),K=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xt=e=>{if(typeof K<"u"&&K.versions&&K.versions.node){const[o,s]=K.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return K.getBuiltinModule(e)}return Yt(e)},{statSync:Zt}=Xt("node:fs"),eo=new Map,to="tsconfig.json",oo=(e,o)=>{let s=0;try{s=Zt(e).mtimeMs}catch{}return`${e}::${String(o.tscCompatible)}::${String(o.typescriptVersion)}::${String(s)}`},ro=(e,o={})=>{const s=o.configFileName??to,t=o.configFileName===void 0;let r=oe(s,{...e&&{cwd:e},type:"file"});if(!r&&t&&(r=oe("jsconfig.json",{...e&&{cwd:e},type:"file"})),!r)throw new Ne(t?`No such file or directory, for '${s}' or 'jsconfig.json' found.`:`No such file or directory, for '${s}' found.`);const c=o.cache&&typeof o.cache!="boolean"?o.cache:eo,i=oo(r,o);if(o.cache&&c.has(i))return c.get(i);const l={config:zt(r,{tscCompatible:o.tscCompatible,typescriptVersion:o.typescriptVersion}),path:r};return o.cache&&c.set(i,l),l},so=/\.[cm]?tsx?$/,io=[".yaml",".yml",".toml",".jsonc",".json5",".txt"],Be=/\.(?:ya?ml|toml|jsonc|json5|txt)$/,no=e=>e.endsWith(".yaml")||e.endsWith(".yml")?rt(e):e.endsWith(".toml")?Tt(e):e.endsWith(".jsonc")?Ot(e,{allowTrailingComma:!0}):e.endsWith(".json5")?it(e):Oe(e,"utf8"),he=e=>e===void 0?"undefined":e===null?"null":typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":String(e):typeof e=="bigint"?`${e}n`:typeof e=="boolean"?String(e):typeof e=="string"?JSON.stringify(e):e instanceof Date?`new Date(${JSON.stringify(e.toISOString())})`:Array.isArray(e)?`[${e.map(o=>he(o)).join(",")}]`:typeof e=="object"?`{${Object.entries(e).map(([o,s])=>`${JSON.stringify(o)}:${he(s)}`).join(",")}}`:"null",ue=new Map,co=(e,o)=>e.startsWith(x)?w(o,e.slice(x.length)):e,lo=e=>{if(ue.has(e))return ue.get(e);let o;try{const{config:s,path:t}=ro(e,{cache:!1}),r=N(t),c=s.compilerOptions,i=c?.paths??{};if(c!==void 0){const{baseUrl:l}=c;let a,p=!1;if(l===void 0){const f=c[Re];a=typeof f=="string"?f:r}else p=!0,a=S(r,co(l,r));o={hasBaseUrl:p,paths:i,pathsBase:a}}}catch{o=void 0}return ue.set(e,o),o},Ue=(e,o)=>{const s=lo(o);if(s===void 0)return;const{hasBaseUrl:t,pathsBase:r}=s,c=i=>Pe(i)??We(i);for(const[i,l]of Object.entries(s.paths)){const a=i.indexOf("*");if(a===-1){if(i===e)for(const d of l){const v=c(S(r,d));if(v!==void 0)return v}continue}const p=i.slice(0,a),f=i.slice(a+1);if(e.startsWith(p)&&e.endsWith(f)&&e.length>=p.length+f.length){const d=e.slice(p.length,e.length-f.length);for(const v of l){const O=v.replace("*",d),k=c(S(r,O));if(k!==void 0)return k}}}if(t){const i=c(S(r,e));if(i!==void 0)return i}};let Ee=!1,de=0,$e=!1,Se=!1;const ao=()=>{Se||(Se=!0,process.setSourceMapsEnabled?.(!0))},po=e=>{const o=e.indexOf("?");return o===-1?e:e.slice(0,o)},uo=e=>e.endsWith(".cts")?"commonjs":"module",Ae=[".ts",".tsx",".mts",".cts",".js",".mjs",".cjs",".json"],L=e=>{try{return Ie(e).isFile()}catch{return!1}},fo=e=>{try{return Ie(e).isDirectory()}catch{return!1}},mo=e=>{if(e.endsWith(".js"))return`${e.slice(0,-3)}.ts`;if(e.endsWith(".mjs"))return`${e.slice(0,-4)}.mts`;if(e.endsWith(".cjs"))return`${e.slice(0,-4)}.cts`},Pe=e=>{if(L(e))return e;const o=mo(e);if(o!==void 0&&L(o))return o;for(const s of Ae)if(L(e+s))return e+s;if(fo(e))for(const s of Ae){const t=`${e}/index${s}`;if(L(t))return t}},We=e=>{if(L(e)&&Be.test(e))return e;for(const o of io)if(L(e+o))return e+o},Me=()=>{ao();const{registerHooks:e}=fe;return typeof e!="function"?!1:(Ee||(e({load(o,s,t){const r=po(o);if(r.startsWith("file:")&&so.test(r)){const c=Y(r),{code:i}=je(c,Oe(c,"utf8"));return{format:uo(c),shortCircuit:!0,source:i}}if(r.startsWith("file:")&&Be.test(r)){const c=Y(r),i=no(c);return{format:"module",shortCircuit:!0,source:`export default ${he(i)};
|
|
8
|
-
`}}return t(o,s)},resolve(o,s,t){if((o.startsWith(".")||o.startsWith("/"))&&s.parentURL!==void 0){let r;try{r=new URL(o,s.parentURL)}catch{r=void 0}if(r?.protocol==="file:"){const
|
|
9
|
-
`));const{code:o}=
|
|
7
|
+
`+" ".repeat(o));var re;(function(e){e.DEFAULT={allowTrailingComma:!1}})(re||(re={}));function bt(e,o=[],s=re.DEFAULT){let t=null,r=[];const n=[];function i(l){Array.isArray(r)?r.push(l):t!==null&&(r[t]=l)}return yt(e,{onObjectBegin:()=>{const l={};i(l),n.push(r),r=l,t=null},onObjectProperty:l=>{t=l},onObjectEnd:()=>{r=n.pop()},onArrayBegin:()=>{const l=[];i(l),n.push(r),r=l,t=null},onArrayEnd:()=>{r=n.pop()},onLiteralValue:i,onError:(l,a,p)=>{o.push({error:l,offset:a,length:p})}},s),r[0]}function yt(e,o,s=re.DEFAULT){const t=Ot(e,!1),r=[];let n=0;function i(y){return y?()=>n===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function l(y){return y?C=>n===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter()):()=>!0}function a(y){return y?C=>n===0&&y(C,t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice()):()=>!0}function p(y){return y?()=>{n>0?n++:y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter(),()=>r.slice())===!1&&(n=1)}:()=>!0}function f(y){return y?()=>{n>0&&n--,n===0&&y(t.getTokenOffset(),t.getTokenLength(),t.getTokenStartLine(),t.getTokenStartCharacter())}:()=>!0}const d=p(o.onObjectBegin),k=a(o.onObjectProperty),O=f(o.onObjectEnd),v=p(o.onArrayBegin),T=f(o.onArrayEnd),A=a(o.onLiteralValue),N=l(o.onSeparator),h=i(o.onComment),c=l(o.onError),g=s&&s.disallowComments,b=s&&s.allowTrailingComma;function m(){for(;;){const y=t.scan();switch(t.getTokenError()){case 4:u(14);break;case 5:u(15);break;case 3:u(13);break;case 1:g||u(11);break;case 2:u(12);break;case 6:u(16);break}switch(y){case 12:case 13:g?u(10):h();break;case 16:u(1);break;case 15:case 14:break;default:return y}}}function u(y,C=[],ye=[]){if(c(y),C.length+ye.length>0){let Q=t.getToken();for(;Q!==17;){if(C.indexOf(Q)!==-1){m();break}else if(ye.indexOf(Q)!==-1)break;Q=m()}}}function E(y){const C=t.getTokenValue();return y?A(C):(k(C),r.push(C)),m(),!0}function B(){switch(t.getToken()){case 11:const y=t.getTokenValue();let C=Number(y);isNaN(C)&&(u(2),C=0),A(C);break;case 7:A(null);break;case 8:A(!0);break;case 9:A(!1);break;default:return!1}return m(),!0}function H(){return t.getToken()!==10?(u(3,[],[2,5]),!1):(E(!1),t.getToken()===6?(N(":"),m(),ie()||u(4,[],[2,5])):u(5,[],[2,5]),r.pop(),!0)}function ze(){d(),m();let y=!1;for(;t.getToken()!==2&&t.getToken()!==17;){if(t.getToken()===5){if(y||u(4,[],[]),N(","),m(),t.getToken()===2&&b)break}else y&&u(6,[],[]);H()||u(4,[],[2,5]),y=!0}return O(),t.getToken()!==2?u(7,[2],[]):m(),!0}function He(){v(),m();let y=!0,C=!1;for(;t.getToken()!==4&&t.getToken()!==17;){if(t.getToken()===5){if(C||u(4,[],[]),N(","),m(),t.getToken()===4&&b)break}else C&&u(6,[],[]);y?(r.push(0),y=!1):r[r.length-1]++,ie()||u(4,[],[4,5]),C=!0}return T(),y||r.pop(),t.getToken()!==4?u(8,[4],[]):m(),!0}function ie(){switch(t.getToken()){case 3:return He();case 1:return ze();case 10:return E(!0);default:return B()}}return m(),t.getToken()===17?s.allowEmptyContent?!0:(u(4,[],[]),!1):ie()?(t.getToken()!==17&&u(9,[],[]),!0):(u(4,[],[]),!1)}var ke;(function(e){e[e.None=0]="None",e[e.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=2]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",e[e.InvalidUnicode=4]="InvalidUnicode",e[e.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",e[e.InvalidCharacter=6]="InvalidCharacter"})(ke||(ke={}));var Ce;(function(e){e[e.OpenBraceToken=1]="OpenBraceToken",e[e.CloseBraceToken=2]="CloseBraceToken",e[e.OpenBracketToken=3]="OpenBracketToken",e[e.CloseBracketToken=4]="CloseBracketToken",e[e.CommaToken=5]="CommaToken",e[e.ColonToken=6]="ColonToken",e[e.NullKeyword=7]="NullKeyword",e[e.TrueKeyword=8]="TrueKeyword",e[e.FalseKeyword=9]="FalseKeyword",e[e.StringLiteral=10]="StringLiteral",e[e.NumericLiteral=11]="NumericLiteral",e[e.LineCommentTrivia=12]="LineCommentTrivia",e[e.BlockCommentTrivia=13]="BlockCommentTrivia",e[e.LineBreakTrivia=14]="LineBreakTrivia",e[e.Trivia=15]="Trivia",e[e.Unknown=16]="Unknown",e[e.EOF=17]="EOF"})(Ce||(Ce={}));const se=bt;var we;(function(e){e[e.InvalidSymbol=1]="InvalidSymbol",e[e.InvalidNumberFormat=2]="InvalidNumberFormat",e[e.PropertyNameExpected=3]="PropertyNameExpected",e[e.ValueExpected=4]="ValueExpected",e[e.ColonExpected=5]="ColonExpected",e[e.CommaExpected=6]="CommaExpected",e[e.CloseBraceExpected=7]="CloseBraceExpected",e[e.CloseBracketExpected=8]="CloseBracketExpected",e[e.EndOfFileExpected=9]="EndOfFileExpected",e[e.InvalidCommentToken=10]="InvalidCommentToken",e[e.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",e[e.UnexpectedEndOfString=12]="UnexpectedEndOfString",e[e.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",e[e.InvalidUnicode=14]="InvalidUnicode",e[e.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",e[e.InvalidCharacter=16]="InvalidCharacter"})(we||(we={}));function vt(e){switch(e){case 1:return"InvalidSymbol";case 2:return"InvalidNumberFormat";case 3:return"PropertyNameExpected";case 4:return"ValueExpected";case 5:return"ColonExpected";case 6:return"CommaExpected";case 7:return"CloseBraceExpected";case 8:return"CloseBracketExpected";case 9:return"EndOfFileExpected";case 10:return"InvalidCommentToken";case 11:return"UnexpectedEndOfComment";case 12:return"UnexpectedEndOfString";case 13:return"UnexpectedEndOfNumber";case 14:return"InvalidUnicode";case 15:return"InvalidEscapeCharacter";case 16:return"InvalidCharacter"}return"<unknown ParseErrorCode>"}const kt=(e,o,s,t)=>{if(e.length===0)return;const r=e[0],n=ot(o,r.offset),i=new rt(`${vt(r.error)} at offset ${r.offset}`);throw i.fileName=s,i.codeFrame=st(o,{start:n},{tabWidth:!1,...t}),i},Ct=(e,o)=>{const{allowEmptyContent:s,allowTrailingComma:t=!0,beforeParse:r,buffer:n,color:i,compression:l,disallowComments:a,encoding:p="utf8",flag:f}=o??{},d=R(e,{buffer:n,compression:l,encoding:p,flag:f}),k=typeof r=="function"?r(d):d,O=[],v=se(k,O,{allowEmptyContent:s,allowTrailingComma:t,disallowComments:a});return kt(O,k,it(e),{color:i}),v};let wt;const Tt=e=>(wt??=D(import.meta.url))(e),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xt=e=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[o,s]=M.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return M.getBuiltinModule(e)}return Tt(e)};xt("node:fs/promises");let Et;const $t=e=>(Et??=D(import.meta.url))(e),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,St=e=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[o,s]=V.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return V.getBuiltinModule(e)}return $t(e)};St("node:fs");const At=(e,o)=>{const s=R(e,{encoding:"utf8",...o});return at(s)};var J={},Te;function It(){if(Te)return J;Te=1,Object.defineProperty(J,"__esModule",{value:!0});const e=h=>h!==null&&typeof h=="object",o=(h,c)=>Object.assign(new Error(`[${h}]: ${c}`),{code:h}),s="ERR_INVALID_PACKAGE_CONFIG",t="ERR_INVALID_PACKAGE_TARGET",r="ERR_PACKAGE_PATH_NOT_EXPORTED",n="ERR_PACKAGE_IMPORT_NOT_DEFINED",i=/^\d+$/,l=/^(\.{1,2}|node_modules)$/i,a=/\/|\\/;var p=(h=>(h.Export="exports",h.Import="imports",h))(p||{});const f=(h,c,g,b,m)=>{if(c==null)return[];if(typeof c=="string"){const[u,...E]=c.split(a);if(u===".."||E.some(B=>l.test(B)))throw o(t,`Invalid "${h}" target "${c}" defined in the package config`);return[m?c.replace(/\*/g,m):c]}if(Array.isArray(c))return c.flatMap(u=>f(h,u,g,b,m));if(e(c)){for(const u of Object.keys(c)){if(i.test(u))throw o(s,"Cannot contain numeric property keys");if(u==="default"||b.includes(u))return f(h,c[u],g,b,m)}return[]}throw o(t,`Invalid "${h}" target "${c}"`)},d="*",k=(h,c)=>{const g=h.indexOf(d),b=c.indexOf(d);return g===b?c.length>h.length:b>g};function O(h,c){if(!c.includes(d)&&h.hasOwnProperty(c))return[c];let g,b;for(const m of Object.keys(h))if(m.includes(d)){const[u,E,B]=m.split(d);if(B===void 0&&c.startsWith(u)&&c.endsWith(E)){const H=c.slice(u.length,-E.length||void 0);H&&(!g||k(g,m))&&(g=m,b=H)}}return[g,b]}const v=h=>Object.keys(h).reduce((c,g)=>{const b=g===""||g[0]!==".";if(c===void 0||c===b)return b;throw o(s,'"exports" cannot contain some keys starting with "." and some not')},void 0),T=/^\w+:/,A=(h,c,g)=>{if(!h)throw new Error('"exports" is required');c=c===""?".":`./${c}`,(typeof h=="string"||Array.isArray(h)||e(h)&&v(h))&&(h={".":h});const[b,m]=O(h,c),u=f(p.Export,h[b],c,g,m);if(u.length===0)throw o(r,c==="."?'No "exports" main defined':`Package subpath '${c}' is not defined by "exports"`);for(const E of u)if(!E.startsWith("./")&&!T.test(E))throw o(t,`Invalid "exports" target "${E}" defined in the package config`);return u},N=(h,c,g)=>{if(!h)throw new Error('"imports" is required');const[b,m]=O(h,c),u=f(p.Import,h[b],c,g,m);if(u.length===0)throw o(n,`Package import specifier "${c}" is not defined in package`);return u};return J.resolveExports=A,J.resolveImports=N,J}var Nt=It();let Lt;const _t=e=>(Lt??=D(import.meta.url))(e),q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,je=e=>{if(typeof q<"u"&&q.versions&&q.versions.node){const[o,s]=q.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return q.getBuiltinModule(e)}return _t(e)},{statSync:X}=je("node:fs"),jt=je("node:module"),De=(e=process.cwd())=>{const{findPnpApi:o}=jt;return o?o(e):void 0},Dt=e=>se(R(e,{buffer:!1})),ce=(e,o,s,t)=>{const r=`resolveFromPackageJsonPath:${e}:${o}:${s?"yes":"no"}`;if(t?.has(r))return t.get(r);const n=Dt(e);if(!n)return;let i=o||"tsconfig.json";if(!s&&n.exports)try{const[l]=Nt.resolveExports(n.exports,o,["require","types"]);i=l}catch{return!1}else!o&&n.tsconfig&&(i=n.tsconfig);return i=w(e,"..",i),t?.set(r,i),i},le="package.json",ae="tsconfig.json",Rt=(e,o,s)=>{let t=e;if(e===".."&&(t=w(t,ae)),e.startsWith(".")&&(t=S(o,t)),be(t)){if($(t)){if(X(t).isFile())return t}else if(!t.endsWith(".json")){const O=`${t}.json`;if($(O))return O}return}const[r="",...n]=e.split("/"),i=r.startsWith("@")?`${r}/${String(n.shift())}`:r,l=n.join("/"),a=De(o);if(a){const{resolveRequest:O}=a;try{if(i===e){const v=O(w(i,le),o);if(v){const T=ce(v,l,!1,s);if(T&&$(T))return T}}else{let v;try{v=O(e,o,{extensions:[".json"]})}catch{v=O(w(e,ae),o)}if(v)return v}}catch{}}const p=te(O=>{const v=w(S(O),"node_modules",i);if($(v))return w("node_modules",i)},{cwd:o,type:"directory"});if(!p||!X(p).isDirectory())return;const f=w(p,le);if($(f)){const O=ce(f,l,!1,s);if(O===!1)return;if(O&&$(O)&&X(O).isFile())return O}const d=w(p,l),k=d.endsWith(".json");if(!k){const O=`${d}.json`;if($(O))return O}if($(d)){if(X(d).isDirectory()){const O=w(d,le);if($(O)){const T=ce(O,"",!0,s);if(T&&$(T))return T}const v=w(d,ae);if($(v))return v}else if(k)return d}},Re=e=>{const o=S(e);let s;const t=De(o);if(t)try{s=t.resolveRequest("typescript/package.json",o)??void 0}catch{}if(s??=te(r=>w(r,"node_modules","typescript","package.json"),{cwd:o,type:"file"}),!!s)try{const r=se(R(s,{buffer:!1}));if(typeof r?.version=="string")return r.version}catch{}},Be=new Set(["node16","node18","node20","nodenext"]),Fe=e=>e!==void 0&&Be.has(e),Bt=e=>{switch(e){case"node20":return"es2023";case"nodenext":return"esnext";default:return"es2022"}},Ft=e=>e==="nodenext"?"nodenext":"node16",Ut=e=>{if(e==="nodenext")return"nodenext";if(e==="node16")return"node16"},Ue=(e,o,s)=>{const t=o.has("module")?e.module:void 0,r=o.has("moduleResolution")?e.moduleResolution:void 0;let n;t!==void 0&&Be.has(t)?n=t:r!==void 0&&(n=Ut(r)),s.target!==void 0&&!o.has("target")&&(e.target=n?Bt(n):s.target),o.has("module")||(e.module=n??s.module),o.has("moduleResolution")||(e.moduleResolution=n?Ft(n):"bundler")},Pt=(e,o)=>{!o.has("target")&&!Fe(e.module)&&(e.target="es3")},Wt=(e,o)=>{!o.has("target")&&!Fe(e.module)&&(e.target="es5")},Mt=(e,o)=>{o.has("strict")||(e.strict=!0),Ue(e,o,{module:"es2022",target:"es2025"}),o.has("rootDir")||(e.rootDir="."),o.has("types")||(e.types=[]),o.has("noUncheckedSideEffectImports")||(e.noUncheckedSideEffectImports=!0),o.has("libReplacement")||(e.libReplacement=!1),o.has("alwaysStrict")||(e.alwaysStrict=!0)},Vt=(e,o)=>{Ue(e,o,{module:"esnext"}),o.has("stableTypeOrdering")||(e.stableTypeOrdering=!0)},Jt=[[4,Pt],[5,Wt],[6,Mt],[7,Vt]],qt=/^v?(\d+)/,Kt=e=>{const o=qt.exec(e);return o?Number(o[1]):void 0},Gt=(e,o)=>{const s=Kt(o);if(s===void 0)return;const t=new Set(Object.keys(e));for(const[r,n]of Jt)r<=s&&n(e,t)},zt=e=>se(R(e,{buffer:!1})),Ht=e=>e.replaceAll("\\","/"),G=e=>{const o=nt(e);return ct(o)?o:`./${o}`},fe=["files","include","exclude"],xe=(e,o,s)=>{const t=w(o,s),r=z(e,t);return oe(r)||"./"},Qt=(e,o,s)=>{const t=z(e,o);if(!t)return s;const r=s.startsWith("./")?s.slice(2):s;return`${t}/${r}`},Yt=(e,o,s,t,r)=>{if(s.has(e))throw new Error(`Circularity detected while resolving configuration: ${e}`);s.add(e);const n=I(e),i=Pe(e,t,s,r);delete i.references;const{compilerOptions:l}=i;if(l){const{baseUrl:a}=l;a&&!a.startsWith(x)&&(l.baseUrl=xe(o,n,a));const{outDir:p}=l;p&&!p.startsWith(x)&&(l.outDir=xe(o,n,p))}for(const a of fe){const p=i[a];p&&(i[a]=p.map(f=>f.startsWith(x)||be(f)?f:Qt(o,n,f)))}return i},Pe=(e,o,s=new Set,t=new Map)=>{let r;try{r=zt(e)??{}}catch(i){throw new Error(`Cannot resolve tsconfig at path: ${e}`,{cause:i})}if(typeof r!="object")throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);const n=I(e);if(r.compilerOptions){const{compilerOptions:i}=r;i.paths&&!i.baseUrl&&(i[We]=n)}if(r.extends){const i=Array.isArray(r.extends)?r.extends:[r.extends];delete r.extends;const l=i.toReversed();for(let a=0;a<l.length;a++){const p=l[a],f=Rt(p,n,t);if(!f)throw new Le(`No such file or directory, for '${p}' found.`);const d=Yt(f,n,new Set(s),o,t);d.compilerOptions?.rootDir!==void 0&&!d.compilerOptions.rootDir.startsWith(x)&&(d.compilerOptions.rootDir=w(I(f),d.compilerOptions.rootDir));const k={...d,...r,compilerOptions:{...d.compilerOptions,...r.compilerOptions}};d.watchOptions&&(k.watchOptions={...d.watchOptions,...r.watchOptions}),r=k}}if(r.compilerOptions){const{compilerOptions:i}=r;for(const l of["baseUrl","rootDir"]){const a=i[l];if(a&&!a.startsWith(x)){const p=S(n,a);i[l]=G(z(n,p))}}for(const l of["outDir","declarationDir"]){let a=i[l];a&&(Array.isArray(r.exclude)||(r.exclude=["outDir","declarationDir"].map(p=>{const f=i[p];if(f)return f.startsWith(x)||be(f)?f:w(n,f)}).filter(Boolean)),a.startsWith(x)||(a=G(a)),i[l]=a)}}else r.compilerOptions={};if(r.include&&(r.include=r.include.map(i=>Ht(i))),r.files&&(r.files=r.files.map(i=>i.startsWith(x)?i:G(i))),r.watchOptions){const{watchOptions:i}=r;i.excludeDirectories&&(i.excludeDirectories=i.excludeDirectories.map(l=>oe(S(n,l)))),i.excludeFiles&&(i.excludeFiles=i.excludeFiles.map(l=>oe(S(n,l)))),i.watchFile&&(i.watchFile=i.watchFile.toLowerCase()),i.watchDirectory&&(i.watchDirectory=i.watchDirectory.toLowerCase()),i.fallbackPolling&&(i.fallbackPolling=i.fallbackPolling.toLowerCase())}if(r.compilerOptions.lib&&(r.compilerOptions.lib=r.compilerOptions.lib.map(i=>i.toLowerCase())),r.compilerOptions.module){let i=r.compilerOptions.module.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.module=i}if(r.compilerOptions.target){let i=r.compilerOptions.target.toLowerCase();i==="es2015"&&(i="es6"),r.compilerOptions.target=i}if(r.compilerOptions.moduleResolution){let i=r.compilerOptions.moduleResolution.toLowerCase();i==="node"&&(i="node10"),r.compilerOptions.moduleResolution=i}return r.compilerOptions.jsx&&(r.compilerOptions.jsx=r.compilerOptions.jsx.toLowerCase()),r.compilerOptions.moduleDetection&&(r.compilerOptions.moduleDetection=r.compilerOptions.moduleDetection.toLowerCase()),r.compilerOptions.importsNotUsedAsValues&&(r.compilerOptions.importsNotUsedAsValues=r.compilerOptions.importsNotUsedAsValues.toLowerCase()),r.compilerOptions.newLine&&(r.compilerOptions.newLine=r.compilerOptions.newLine.toLowerCase()),r},Z=(e,o)=>{if(e.startsWith(x))return oe(w(o,e.slice(x.length)))},Xt=["outDir","declarationDir","outFile","rootDir","baseUrl","tsBuildInfoFile"],Ee=e=>e==="es2022"||e==="es2023"||e==="es2024"||e==="es2025"||e==="esnext",Zt=(e,o)=>{if(e.compilerOptions===void 0)return e;if(e.compilerOptions.rewriteRelativeImportExtensions&&(e.compilerOptions.allowImportingTsExtensions??=!0),e.compilerOptions.composite&&(e.compilerOptions.declaration??=!0,e.compilerOptions.incremental??=!0),e.compilerOptions.checkJs&&(e.compilerOptions.allowJs??=!0),e.compilerOptions.verbatimModuleSyntax&&(e.compilerOptions.isolatedModules??=!0,e.compilerOptions.preserveConstEnums??=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))){if(e.compilerOptions.esModuleInterop===void 0&&(e.compilerOptions.module==="node16"||e.compilerOptions.module==="node18"||e.compilerOptions.module==="node20"||e.compilerOptions.module==="nodenext"||e.compilerOptions.module==="preserve")&&(e.compilerOptions.esModuleInterop=!0),e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0){let s="classic";if(e.compilerOptions.module!==void 0)switch(e.compilerOptions.module.toLocaleLowerCase()){case"commonjs":{s="node10";break}case"node16":case"node18":{s="node16";break}case"node20":{s="node16";break}case"nodenext":{s="nodenext";break}case"preserve":{s="bundler";break}}s!=="classic"&&(e.compilerOptions.moduleResolution=s)}if(e.compilerOptions.moduleResolution==="bundler"&&(e.compilerOptions.resolveJsonModule??=!0),e.compilerOptions.module&&["node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.resolveJsonModule??=!0),(e.compilerOptions.esModuleInterop||e.compilerOptions.module==="system"||e.compilerOptions.moduleResolution==="bundler")&&e.compilerOptions.allowSyntheticDefaultImports===void 0&&(e.compilerOptions.allowSyntheticDefaultImports=!0),["5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.moduleResolution){let s=!1;["bundler","node16","nodenext"].includes(e.compilerOptions.moduleResolution.toLocaleLowerCase())&&(s=!0),e.compilerOptions.resolvePackageJsonExports===void 0&&s&&(e.compilerOptions.resolvePackageJsonExports=!0),e.compilerOptions.resolvePackageJsonImports===void 0&&s&&(e.compilerOptions.resolvePackageJsonImports=!0)}if(e.compilerOptions.target===void 0){let s="es5";switch(e.compilerOptions.module){case"node16":case"node18":{s="es2022";break}case"node20":{s="es2023";break}case"nodenext":{s="esnext";break}}s!=="es5"&&(e.compilerOptions.target=s)}e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.target&&Ee(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!0)}if(["5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&e.compilerOptions.strict&&e.compilerOptions.strictBuiltinIteratorReturn===void 0&&(e.compilerOptions.strictBuiltinIteratorReturn=!0),["5.4","5.5","5.6","5.7","5.8","5.9"].includes(String(o?.tscCompatible))&&(e.compilerOptions.strict&&(e.compilerOptions.noImplicitAny=e.compilerOptions.noImplicitAny??!0,e.compilerOptions.noImplicitThis=e.compilerOptions.noImplicitThis??!0,e.compilerOptions.strictNullChecks=e.compilerOptions.strictNullChecks??!0,e.compilerOptions.strictFunctionTypes=e.compilerOptions.strictFunctionTypes??!0,e.compilerOptions.strictBindCallApply=e.compilerOptions.strictBindCallApply??!0,e.compilerOptions.strictPropertyInitialization=e.compilerOptions.strictPropertyInitialization??!0,e.compilerOptions.alwaysStrict=e.compilerOptions.alwaysStrict??!0),e.compilerOptions.strict&&e.compilerOptions.useUnknownInCatchVariables===void 0&&(e.compilerOptions.useUnknownInCatchVariables=!0),e.compilerOptions.isolatedModules&&(e.compilerOptions.preserveConstEnums=e.compilerOptions.preserveConstEnums??!0)),["6.0","7.0","true"].includes(String(o?.tscCompatible))){if(e.compilerOptions.moduleDetection===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&(e.compilerOptions.moduleDetection="force"),e.compilerOptions.moduleResolution===void 0&&e.compilerOptions.module){const s=e.compilerOptions.module.toLocaleLowerCase();s==="node16"||s==="node18"||s==="node20"?e.compilerOptions.moduleResolution="node16":s==="nodenext"&&(e.compilerOptions.moduleResolution="nodenext")}if(e.compilerOptions.useDefineForClassFields===void 0&&e.compilerOptions.module&&["node16","node18","node20","nodenext"].includes(e.compilerOptions.module)&&e.compilerOptions.target&&!Ee(e.compilerOptions.target)&&(e.compilerOptions.useDefineForClassFields=!1),e.compilerOptions.isolatedModules&&e.compilerOptions.preserveConstEnums===void 0&&(e.compilerOptions.preserveConstEnums=!0),e.compilerOptions.resolveJsonModule===void 0){const s=e.compilerOptions.module,t=e.compilerOptions.moduleResolution?.toLocaleLowerCase();!(s!==void 0&&["node20","nodenext"].includes(s)||t==="bundler")&&t&&(e.compilerOptions.resolveJsonModule=!1)}if(e.compilerOptions.moduleResolution){const s=e.compilerOptions.moduleResolution.toLocaleLowerCase();["bundler","node16","nodenext"].includes(s)||(e.compilerOptions.resolvePackageJsonExports??=!1,e.compilerOptions.resolvePackageJsonImports??=!1)}}return e.compileOnSave===!1&&delete e.compileOnSave,e},eo=(e,o)=>{const s=e?.typescriptVersion;if(!(s===!1||s===void 0))return s==="auto"?Re(o):s},x="${configDir}",We=Symbol("implicitBaseUrl"),to=(e,o)=>{const s=S(e),t=Pe(s,o),r=I(s),n=eo(o,r);n&&t.compilerOptions&&Gt(t.compilerOptions,n);const{compilerOptions:i}=t;if(i){for(const a of Xt){const p=i[a];if(p){const f=Z(p,r);i[a]=f?G(z(r,f)):p}}for(const a of["rootDirs","typeRoots"]){const p=i[a];p&&(i[a]=p.map(f=>{const d=Z(f,r);return d?G(z(r,d)):f}))}const{paths:l}=i;if(l){const a=Object.keys(l);for(let p=0;p<a.length;p++){const f=a[p];l[f]=l[f].map(d=>Z(d,r)??d)}}}for(let l=0;l<fe.length;l++){const a=fe[l],p=t[a];p&&(t[a]=p.map(f=>Z(f,r)??f))}return Zt(t,o)};let oo;const ro=e=>(oo??=D(import.meta.url))(e),K=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,so=e=>{if(typeof K<"u"&&K.versions&&K.versions.node){const[o,s]=K.versions.node.split(".").map(Number);if(o>22||o===22&&s>=3||o===20&&s>=16)return K.getBuiltinModule(e)}return ro(e)},{statSync:io}=so("node:fs"),no=new Map,me=new WeakMap,co="tsconfig.json",Me=e=>{try{return io(e).mtimeMs}catch{return 0}},lo=(e,o)=>{let s=String(o.typescriptVersion);return o.typescriptVersion==="auto"&&(s=`auto:${String(Re(I(e)))}`),`${e}::${String(o.tscCompatible)}::${s}`},ao=(e,o,s)=>{if(e.has(o)&&me.get(e)?.get(o)===Me(s))return e.get(o)},po=(e,o,s,t)=>{e.set(o,t);let r=me.get(e);r||(r=new Map,me.set(e,r)),r.set(o,Me(s))},uo=(e,o={})=>{const s=o.configFileName??co,t=o.configFileName===void 0;let r=te(s,{...e&&{cwd:e},type:"file"});if(!r&&t&&(r=te("jsconfig.json",{...e&&{cwd:e},type:"file"})),!r)throw new Le(t?`No such file or directory, for '${s}' or 'jsconfig.json' found.`:`No such file or directory, for '${s}' found.`);const n=o.cache&&typeof o.cache!="boolean"?o.cache:no,i=lo(r,o);if(o.cache){const a=ao(n,i,r);if(a)return a}const l={config:to(r,{tscCompatible:o.tscCompatible,typescriptVersion:o.typescriptVersion}),path:r};return o.cache&&po(n,i,r,l),l},fo=/\.[cm]?tsx?$/,mo=[".yaml",".yml",".toml",".jsonc",".json5",".txt"],Ve=/\.(?:ya?ml|toml|jsonc|json5|txt)$/,ho=e=>e.endsWith(".yaml")||e.endsWith(".yml")?lt(e):e.endsWith(".toml")?At(e):e.endsWith(".jsonc")?Ct(e,{allowTrailingComma:!0}):e.endsWith(".json5")?pt(e):Oe(e,"utf8"),he=e=>e===void 0?"undefined":e===null?"null":typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":String(e):typeof e=="bigint"?`${e}n`:typeof e=="boolean"?String(e):typeof e=="string"?JSON.stringify(e):e instanceof Date?`new Date(${JSON.stringify(e.toISOString())})`:Array.isArray(e)?`[${e.map(o=>he(o)).join(",")}]`:typeof e=="object"?`{${Object.entries(e).map(([o,s])=>`${JSON.stringify(o)}:${he(s)}`).join(",")}}`:"null",pe=new Map,go=(e,o)=>e.startsWith(x)?w(o,e.slice(x.length)):e,Oo=e=>{if(pe.has(e))return pe.get(e);let o;try{const{config:s,path:t}=uo(e,{cache:!1}),r=I(t),n=s.compilerOptions,i=n?.paths??{};if(n!==void 0){const{baseUrl:l}=n;let a,p=!1;if(l===void 0){const f=n[We];a=typeof f=="string"?f:r}else p=!0,a=S(r,go(l,r));o={hasBaseUrl:p,paths:i,pathsBase:a}}}catch{o=void 0}return pe.set(e,o),o},Je=(e,o)=>{const s=Oo(o);if(s===void 0)return;const{hasBaseUrl:t,pathsBase:r}=s,n=i=>qe(i)??Ke(i);for(const[i,l]of Object.entries(s.paths)){const a=i.indexOf("*");if(a===-1){if(i===e)for(const d of l){const k=n(S(r,d));if(k!==void 0)return k}continue}const p=i.slice(0,a),f=i.slice(a+1);if(e.startsWith(p)&&e.endsWith(f)&&e.length>=p.length+f.length){const d=e.slice(p.length,e.length-f.length);for(const k of l){const O=k.replace("*",d),v=n(S(r,O));if(v!==void 0)return v}}}if(t){const i=n(S(r,e));if(i!==void 0)return i}};let $e=!1,ue=0,Se=!1,Ae=!1;const bo=()=>{Ae||(Ae=!0,process.setSourceMapsEnabled?.(!0))},yo=e=>{const o=e.indexOf("?");return o===-1?e:e.slice(0,o)},vo=e=>e.endsWith(".cts")?"commonjs":"module",Ie=[".ts",".tsx",".mts",".cts",".js",".mjs",".cjs",".json"],j=e=>{try{return Ne(e).isFile()}catch{return!1}},ko=e=>{try{return Ne(e).isDirectory()}catch{return!1}},Co=e=>{if(e.endsWith(".js"))return`${e.slice(0,-3)}.ts`;if(e.endsWith(".mjs"))return`${e.slice(0,-4)}.mts`;if(e.endsWith(".cjs"))return`${e.slice(0,-4)}.cts`},qe=e=>{if(j(e))return e;const o=Co(e);if(o!==void 0&&j(o))return o;for(const s of Ie)if(j(e+s))return e+s;if(ko(e))for(const s of Ie){const t=`${e}/index${s}`;if(j(t))return t}},Ke=e=>{if(j(e)&&Ve.test(e))return e;for(const o of mo)if(j(e+o))return e+o},Ge=()=>{bo();const{registerHooks:e}=de;return typeof e!="function"?!1:($e||(e({load(o,s,t){const r=yo(o);if(r.startsWith("file:")&&fo.test(r)){const n=Y(r),{code:i}=_e(n,Oe(n,"utf8"));return{format:vo(n),shortCircuit:!0,source:i}}if(r.startsWith("file:")&&Ve.test(r)){const n=Y(r),i=ho(n);return{format:"module",shortCircuit:!0,source:`export default ${he(i)};
|
|
8
|
+
`}}return t(o,s)},resolve(o,s,t){if((o.startsWith(".")||o.startsWith("/"))&&s.parentURL!==void 0){let r;try{r=new URL(o,s.parentURL)}catch{r=void 0}if(r?.protocol==="file:"){const n=Y(r),i=qe(n)??Ke(n);if(i!==void 0)return{shortCircuit:!0,url:ee(i).href}}}if(s.parentURL!==void 0&&!o.startsWith(".")&&!o.startsWith("/")&&!o.startsWith("#")&&!o.startsWith("node:")&&!de.isBuiltin?.(o)){let r;try{r=I(Y(s.parentURL))}catch{r=void 0}if(r!==void 0){const n=Je(o,r);if(n!==void 0)return{shortCircuit:!0,url:ee(n).href}}}return t(o,s)}}),$e=!0),!0)},wo=()=>Ge(),To=async e=>{if(ue+=1,Ge())return await import(`${ee(e).href}?v=${String(ue)}`);Se||(Se=!0,process.stderr.write(`vis: Node < 22.15 has no module.registerHooks — only the entry file is transpiled; local TypeScript imports won't load. Upgrade to Node >= 22.15 for full support.
|
|
9
|
+
`));const{code:o}=_e(e,Oe(e,"utf8")),s=w(I(e),`.vis-ts-${String(ue)}-${String(process.pid)}.mjs`);Ze(s,o);try{return await import(ee(s).href)}finally{try{et(s)}catch{}}},Io=Object.defineProperty({__proto__:null,importTs:To,registerTsHooks:wo,resolveTsConfigPaths:Je},Symbol.toStringTag,{value:"Module"});export{To as i,At as m,wo as r,Io as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p}from"./cli-main.js";import{A as b}from"../packem_shared/pm-runner-
|
|
1
|
+
import{p}from"./cli-main.js";import{A as b}from"../packem_shared/pm-runner-C6eTANt1.js";import{r as y,l as w,L as $}from"../packem_shared/dependency-scan-D_ona0Qm.js";import{z as v,w as m,l as C}from"../packem_shared/index-uBVnF4ji.js";import{D as S}from"../packem_shared/package-version-C47v64aB.js";import"../packem_shared/public-api-WqUCiyIe.js";import{e as x}from"../packem_shared/index-CTMU29dI.js";const M=e=>{const s=e.trim();return s===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(s)||/^(?:github|gitlab|bitbucket|gist):/i.test(s)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(s)&&!s.includes("@")?!0:/^https?:\/\//i.test(s)},L=(e,s)=>{for(const t of s)if(t===e||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},D=(e,s,t={})=>{const o=y(e,s);if(!o)return[];let i;try{i=v(m(e,o.file))}catch{return[]}const n=S(i,o.type);if(n.length===0)return[];const c=t.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const d of[r.dependencies,r.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!L(u,c))for(const k of h){if(!M(k))continue;const g=`${a}->${u}@${k}`;f.has(g)||(f.add(g),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},E=new Set(["firstSeen","publisherChange"]),N=e=>e.severity==="block"&&e.acceptedRisk===void 0,R=e=>{const s=e.security?.policies?.firstSeen?.minutes,t=typeof s=="number"&&s>0,o=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return t||o||i},V=async e=>{const{offline:s=!1,packageManager:t,visConfig:o,workspaceRoot:i}=e,n=Date.now();if(!R(o))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=y(i,t);if(!c||!C(m(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=w(i,t,{includeDev:!0}),f=l.length,r=await x({offline:s,packageManager:t,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(E),visConfig:o}),a=o.security?.blockExoticSubdeps===!0?D(i,t,{allow:o.security.exoticSubdepsAllow}):[],d=r.some(u=>N(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},B=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,P=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const s=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${B(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${s}`];const t=[`✗ Lockfile failed supply-chain policy check ${s}`];for(const o of e.decisions)o.severity==="block"&&o.acceptedRisk===void 0&&t.push(` [${o.policy}] ${o.reason}`);for(const o of e.exoticViolations)t.push(` [blockExoticSubdeps] ${o.packageName} pulled from exotic source by ${o.declaredBy}: ${o.source}`);return t},J=async({options:e,visConfig:s,workspaceRoot:t})=>{const o=t??process.cwd(),i=b(o);if(!$[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await V({offline:!!e.offline,packageManager:i.name,visConfig:s??{},workspaceRoot:o});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
2
|
`),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=P(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1};export{J as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as R}from"node:module";import{
|
|
1
|
+
import{createRequire as R}from"node:module";import{F as M}from"./target-merge-Cfy7c__2.js";import{advisoriesQuery as j,advisoriesIngest as q,advisoriesStatus as _,NATIVE_BINDING_VERSION as f}from"#native";let D;const I=s=>(D??=R(import.meta.url))(s),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,c=s=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(s)}return I(s)},{randomUUID:$}=c("node:crypto"),{existsSync:T,createWriteStream:O}=c("node:fs"),{mkdir:P,unlink:U,stat:k}=c("node:fs/promises"),{join:g,dirname:x}=c("node:path"),{Readable:C}=c("node:stream"),{pipeline:L}=c("node:stream/promises"),w=6;if(f!==w)throw new Error(`vis native binding ABI mismatch in advisories: expected ${w}, got ${f}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const J="https://osv-vulnerabilities.storage.googleapis.com",W=new Set(["osv-vulnerabilities.storage.googleapis.com"]);class B extends Error{cause="DB_NOT_FOUND";constructor(e){super(`No local advisory DB at ${e}. Run 'vis advisories sync' first.`),this.name="AdvisoryDbNotFoundError"}}class p extends Error{cause="SOURCE_NOT_ALLOWED";constructor(e){super(`Advisory source host '${e}' is not in the built-in allowlist. Add it to \`security.audit.advisories.allowedHosts\` if intentional.`),this.name="AdvisorySourceNotAllowedError"}}class A extends Error{cause="SYNC_NETWORK";constructor(e,t){super(`Advisory sync failed for ${e}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="AdvisorySyncNetworkError"}}const y=s=>{const e=M("vis",{create:!0,cwd:s})??g(s,"node_modules",".cache","vis");return g(e,"advisories","db.sqlite")},F=(s,e)=>{let t;try{t=new URL(s)}catch{throw new p(s)}if(t.protocol!=="https:")throw new p(`${t.protocol}//${t.host}`);if(!new Set([...W,...e??[]]).has(t.host))throw new p(t.host);return t},X=async s=>{const e=s.dbPath??y(s.workspaceRoot);await P(x(e),{recursive:!0});const t=F(s.source,s.allowedHosts),d=new URL(`${s.ecosystem}/all.zip`,G(t.toString())),u=await V(e,s.ecosystem);let r=null;if(!s.force){const i=await b(d,{method:"HEAD"});if(i.ok&&(r=i.headers.get("etag"),r&&u&&r===u))return{advisoriesIngested:0,dbPath:e,durationMs:0,upToDate:!0}}const n=`${e}.${s.ecosystem}.${process.pid}.${$()}.zip.tmp`,o=await b(d,{method:"GET"});if(!o.ok||!o.body)throw new A(d.toString(),o.status);r||(r=o.headers.get("etag"));const v=o.headers.get("content-length"),a=v?Number.parseInt(v,10):null;let m=0;const E=O(n),h=C.fromWeb(o.body);s.onProgress&&a&&h.on("data",i=>{m+=i.byteLength,s.onProgress?.(m,a,"download")}),await L(h,E);try{const i=await q({dbPath:e,ecosystem:s.ecosystem,manifestEtag:r??void 0,zipPath:n},(S,N)=>s.onProgress?.(S,N,"ingest"));return{advisoriesIngested:i.advisoriesIngested,dbPath:e,durationMs:i.durationMs,upToDate:!1}}finally{await U(n).catch(()=>{})}},Z=(s,e)=>{if(s.length===0)return new Map;const t=e.dbPath??y(e.workspaceRoot),d=e.ecosystem??"npm";if(!T(t))throw new B(t);const u=s.map(o=>({ecosystem:d,name:o.name,version:o.version})),r=j(t,u),n=new Map;for(const[o,v]of s.entries()){const a=r[o];!a||a.vulnerabilities.length===0||n.set(v.name,a.vulnerabilities.map(m=>H(m)))}return n},ss=async(s,e)=>{const t=e??y(s);return _(t)},V=async(s,e)=>{try{await k(s)}catch{return null}return _(s).ecosystems.find(t=>t.name===e)?.manifestEtag??null},H=s=>({aliases:s.aliases.length>0?s.aliases:void 0,cvssScore:s.cvssScore??void 0,fixedVersions:s.fixedVersions,id:s.id,severity:z(s.severity),summary:s.summary}),z=s=>{const e=s.toUpperCase();return e==="CRITICAL"||e==="HIGH"||e==="MODERATE"||e==="LOW"?e:"UNKNOWN"},G=s=>s.endsWith("/")?s:`${s}/`,b=async(s,e)=>{try{return await fetch(s,e)}catch(t){throw new A(s.toString(),t instanceof Error?t.message:String(t))}};export{B as A,J as D,ss as g,Z as q,y as r,X as s};
|
package/dist/packem_shared/{affected-selection-B85ND6JV.js → affected-selection-Dj-ymxhw.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as k}from"node:module";import{getAffectedProjects as P}from"@visulima/task-runner";import{I as S}from"./index-BWl4DbMp.js";import{a as w}from"./vis-user-error-
|
|
1
|
+
import{createRequire as k}from"node:module";import{getAffectedProjects as P}from"@visulima/task-runner";import{I as S}from"./index-BWl4DbMp.js";import{a as w}from"./vis-user-error-xmha3L4n.js";import{r as q}from"./affected-shas-PwkVbPch.js";let y;const R=e=>(y??=k(import.meta.url))(e),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,C=e=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[t,o]=p.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return p.getBuiltinModule(e)}return R(e)},{spawnSync:A}=C("node:child_process"),_=new Set(["deep","direct","none"]),B=e=>{const t=[],o=e.split("\0");for(let s=0;s<o.length;s++){const r=o[s];if(!r||r.length<4)continue;const f=r.slice(0,2),u=r.slice(3);if(u&&t.push(u),f.includes("R")||f.includes("C")){s+=1;const a=o[s];a&&t.push(a)}}return t},I=e=>{const t=A("git",["status","--porcelain","-z"],{cwd:e,encoding:"utf8"});return t.error||t.status!==0||typeof t.stdout!="string"?[]:B(t.stdout)},W=async(e,t,o={})=>{const s=e.downstream??"deep",r=e.upstream??"none";if(!_.has(s))throw new w(`Invalid --downstream value: "${s}". Must be "none", "direct", or "deep".`);if(!_.has(r))throw new w(`Invalid --upstream value: "${r}". Must be "none", "direct", or "deep".`);const{projectGraph:f,projects:u,workspaceRoot:a}=t,l=[];let{base:m}=e,{head:n}=e;if(!m||!n){const i=q({defaultBase:o.defaultBase,workspaceRoot:a});m=m||i.base,n=n||i.head,l.push(`Resolved affected refs from ${i.provider} (${i.notes.join("; ")})`)}const v=o.runningInCi??S,h=n==="HEAD"||n==="",b=e.uncommitted??(!v&&h);let d=[];if(b)if(h){const i=(o.readWorkingTreeChanges??I)(a),$=Object.values(u).map(c=>c.root?.replace(/\/$/,"")).filter(c=>!!c&&c!==".");d=i.filter(c=>$.some(j=>c===j||c.startsWith(`${j}/`)));const g=i.length-d.length;d.length>0&&l.push(`including ${d.length} uncommitted working-tree file(s)`),g>0&&l.push(`ignoring ${g} uncommitted path(s) outside any project (untracked scratch would otherwise mark every project affected)`)}else l.push(`ignoring --uncommitted: --head=${n} pins the comparison to a commit, not the working tree`);return{...await P({additionalChangedFiles:d,base:m,downstream:s,head:n,projectGraph:f,projects:u,upstream:r,workspaceRoot:a}),notes:l,uncommittedFileCount:d.length}};export{W as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as l}from"node:module";import{l as h,z as b}from"./index-
|
|
1
|
+
import{createRequire as l}from"node:module";import{l as h,z as b}from"./index-uBVnF4ji.js";let E;const d=e=>(E??=l(import.meta.url))(e),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[s,r]=_.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return _.getBuiltinModule(e)}return d(e)},{spawnSync:g}=p("node:child_process"),A="0000000000000000000000000000000000000000",I=e=>{if(h(e))try{const s=b(e);return JSON.parse(s)}catch{return}},f=(e,s)=>{const r=g("git",e,{cwd:s,encoding:"utf8"});if(!(r.error||typeof r.status!="number"||r.status!==0))return typeof r.stdout=="string"?r.stdout.trim():void 0},c=e=>typeof e=="string"&&e.length>0&&e!==A,R=(e,s,r)=>{const t=[],o=e.GITHUB_BASE_REF,i=e.GITHUB_SHA??"HEAD";if(o&&o.length>0)return t.push(`pull_request: $GITHUB_BASE_REF=${o}`),{base:`origin/${o}`,head:i,notes:t,provider:"github"};const a=e.GITHUB_EVENT_PATH,n=a?r(a):void 0;if(n){const u=typeof n.before=="string"?n.before:void 0;if(c(u))return t.push(`push: event.before=${u}`),{base:u,head:i,notes:t,provider:"github"}}return t.push(`fallback: origin/${s}`),{base:`origin/${s}`,head:i,notes:t,provider:"github"}},C=(e,s)=>{const r=[],t=e.CI_COMMIT_SHA??"HEAD";if(e.CI_PIPELINE_SOURCE==="merge_request_event"){const a=e.CI_MERGE_REQUEST_DIFF_BASE_SHA;if(c(a))return r.push(`merge_request: $CI_MERGE_REQUEST_DIFF_BASE_SHA=${a}`),{base:a,head:t,notes:r,provider:"gitlab"};const n=e.CI_MERGE_REQUEST_TARGET_BRANCH_NAME;if(n&&n.length>0)return r.push(`merge_request: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME=${n}`),{base:`origin/${n}`,head:t,notes:r,provider:"gitlab"}}const o=e.CI_COMMIT_BEFORE_SHA;if(c(o))return r.push(`push: $CI_COMMIT_BEFORE_SHA=${o}`),{base:o,head:t,notes:r,provider:"gitlab"};const i=e.CI_DEFAULT_BRANCH??s;return r.push(`fallback: origin/${i}`),{base:`origin/${i}`,head:t,notes:r,provider:"gitlab"}},T=(e,s)=>{const r=[],t=e.BUILDKITE_COMMIT??"HEAD",o=e.BUILDKITE_PULL_REQUEST_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $BUILDKITE_PULL_REQUEST_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:t,notes:r,provider:"buildkite"}):(r.push(`fallback: origin/${s} (buildkite has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:t,notes:r,provider:"buildkite"})},v=(e,s)=>{const r=[],t=e.CIRCLE_SHA1??"HEAD",o=e.CIRCLE_PR_BASE_BRANCH;return o&&o.length>0?(r.push(`pull_request: $CIRCLE_PR_BASE_BRANCH=${o}`),{base:`origin/${o}`,head:t,notes:r,provider:"circleci"}):(r.push(`fallback: origin/${s} (circleci has no canonical previous-build SHA env)`),{base:`origin/${s}`,head:t,notes:r,provider:"circleci"})},B=(e,s,r)=>{const t=[],o=s(["merge-base","HEAD",`origin/${e}`],r);return o&&o.length>0?(t.push(`local: git merge-base HEAD origin/${e}=${o}`),{base:o,head:"HEAD",notes:t,provider:"local"}):(t.push(`local fallback: origin/${e} (no merge-base available)`),{base:`origin/${e}`,head:"HEAD",notes:t,provider:"local"})},S=e=>{const s=e?.env??process.env,r=e?.defaultBase??"main",t=e?.readEventPayload??I,o=e?.runGit??f,i=e?.workspaceRoot??process.cwd();return s.GITHUB_ACTIONS==="true"?R(s,r,t):s.GITLAB_CI==="true"?C(s,r):s.BUILDKITE==="true"?T(s,r):s.CIRCLECI==="true"?v(s,r):B(r,o,i)};export{S as r};
|