@visulima/vis 3.0.5 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/LICENSE.md +0 -116
- package/README.md +3 -2
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +24 -4
- package/dist/packem_chunks/CONFIG_FILES.js +6 -5
- package/dist/packem_chunks/catalog.js +32 -32
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +153 -152
- package/dist/packem_chunks/handler12.js +25 -10
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler67.js +28 -25
- package/dist/packem_chunks/handler68.js +25 -153
- package/dist/packem_chunks/handler69.js +153 -10
- package/dist/packem_chunks/handler70.js +10 -22
- package/dist/packem_chunks/handler71.js +21 -22
- package/dist/packem_chunks/handler72.js +23 -322
- package/dist/packem_chunks/handler73.js +273 -659
- package/dist/packem_chunks/handler74.js +708 -48
- package/dist/packem_chunks/handler75.js +48 -27
- package/dist/packem_chunks/handler76.js +27 -3
- package/dist/packem_chunks/handler77.js +3 -189
- package/dist/packem_chunks/handler78.js +188 -39
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_shared/{affected-selection-DIgAsQTu.js → affected-selection-BmUh3_Qp.js} +1 -1
- package/dist/packem_shared/{bin-CVfNImCA.js → bin-D-Es9mva.js} +1 -1
- package/dist/packem_shared/{index-5GrALmsb.js → index-BvYJA7e5.js} +1 -1
- package/dist/packem_shared/lockfile-DVFySxTS.js +1 -0
- package/dist/packem_shared/{package-version-CIhwFJn3.js → package-version-B_KfpWKC.js} +1 -1
- package/dist/packem_shared/{project-name-filter-sYH4Zvsm.js → project-name-filter-D6uEN2ot.js} +1 -1
- package/dist/packem_shared/vis-user-error-By2ZNeEA.js +31 -0
- package/index.d.ts +204 -204
- package/index.js +26 -26
- package/package.json +13 -13
- package/schemas/project.schema.json +2 -2
- package/schemas/vis-config.schema.json +8 -9
- package/skills/vis/SKILL.md +1 -1
- package/dist/packem_shared/lockfile-35RFsJDs.js +0 -1
- package/dist/packem_shared/vis-user-error-CgyYA29v.js +0 -30
|
@@ -1,10 +1,153 @@
|
|
|
1
|
-
import{createRequire as xt}from"node:module";import{F as j,j as oe,q as ye,X as be,b as Re,J as ge}from"../packem_shared/index.server-BAjDJSEu.js";import{a8 as yt,U as bt,V as jt,W as vt,T as St,v as $t,X as Ct,Y as Fe,p as d,O as Xe,d as Rt,S as D}from"./cli-main.js";import{e as K,z as Tt,l as Et,v as At,U as qe}from"../packem_shared/index-DHD8wb6Z.js";import{i as It}from"../packem_shared/index-BjdW45xX.js";import{y as i,X as u,m as r,u as z,r as Je,c as Qe,R as Dt,l as Ot,k as Pt,a as Nt,h as Mt}from"./catalog.js";import{g as Lt,s as Le,D as et}from"../packem_shared/formatBytes-BHAzNIrn-Bkk_uRS-.js";import{y as je}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as tt}from"../packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js";import{h as Bt}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{findVisConfigFile as _t}from"./CONFIG_FILES.js";import{d as st,c as Be,r as Vt,b as Ht,a as Yt,e as Ut,f as Gt,m as Wt}from"./handler70.js";import{d as it,n as Kt}from"../packem_shared/pm-runner-d93_73O6.js";import{c as Xt}from"../packem_shared/runtime-check-BklgEMkC.js";import{s as qt}from"../packem_shared/scan-progress-5uTRdC1G.js";import{l as Jt,r as Qt,f as Zt}from"../packem_shared/dependency-scan-DBH2Qo4I.js";import{l as rt}from"../packem_shared/spinner-BM_0Bj6x.js";import{n as es,a as ts}from"../packem_shared/tabs-UDYQ3tqt.js";import{u as ss}from"../packem_shared/use-measured-height-BPQg2q_p.js";import{L as is}from"../packem_shared/index-BisalDCf.js";import{s as rs}from"../packem_shared/verify-D8wYvB85.js";let wt;const kt=e=>(wt??=xt(import.meta.url))(e),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ke=e=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[t,s]=we.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return we.getBuiltinModule(e)}return kt(e)},{rmSync:ze,writeFileSync:Ft,statSync:zt,readFileSync:Ze}=Ke("node:fs"),{spawnSync:Te}=Ke("node:child_process"),Ae=()=>K(Lt(),"doctor"),ns=1800*1e3,_e=e=>{if(!e)return"";try{return String(zt(e).mtimeMs)}catch{return""}},os=2,ls=e=>{const t=JSON.stringify({configMtime:_e(e.configPath),lockfileMtime:_e(e.lockfilePath),schema:os,sections:[...e.sections].toSorted(),socketEnabled:e.socketEnabled,workspaceRoot:e.workspaceRoot});return yt(Buffer.from(t))},cs=e=>{const t=K(Ae(),`${e}.json`);if(je(t))try{const s=tt(t);if(Date.now()-s.createdAt>s.ttlMs){ze(t,{force:!0});return}return{...s.results,sections:new Set(s.results.sections)}}catch{ze(t,{force:!0});return}},as=(e,t,s=ns)=>{Bt(Ae());const l={createdAt:Date.now(),results:{...t,sections:[...t.sections]},ttlMs:s};Ft(K(Ae(),`${e}.json`),JSON.stringify(l,void 0,2),"utf8")},Se="orphans",ds=()=>{if(process.platform!=="linux")return{id:"inotify",message:"inotify capacity check skipped (not Linux).",status:"skip"};let e;try{const t=Ze("/proc/sys/fs/inotify/max_user_watches","utf8").trim(),s=Number.parseInt(t,10);Number.isFinite(s)&&s>0&&(e=s)}catch{return{id:"inotify",message:"Could not read /proc/sys/fs/inotify/max_user_watches.",status:"warn"}}return e===void 0?{id:"inotify",message:"inotify max_user_watches reported a non-numeric value.",status:"warn"}:e<65536?{detail:{maxWatches:e},id:"inotify",message:`inotify watcher limit is ${String(e)} — large monorepos can exhaust this. Bump now with \`sudo sysctl fs.inotify.max_user_watches=524288\` and persist via \`/etc/sysctl.d/99-vis.conf\` so it survives reboot.`,status:"warn"}:{detail:{maxWatches:e},id:"inotify",message:`inotify capacity OK (${String(e)} watches).`,status:"ok"}},us=()=>{const e=!!process.stdin.isTTY,t=!!process.stdout.isTTY;return e&&t?{id:"tty",message:"Interactive TTY available — watch keybinds enabled.",status:"ok"}:!e&&!t?{id:"tty",message:"No TTY on stdin/stdout — running in CI / piped mode (keybinds disabled).",status:"skip"}:{detail:{stdin:String(e),stdout:String(t)},id:"tty",message:e?"stdin is a TTY but stdout is not — output is being captured; keybinds still work.":"stdout is a TTY but stdin is not — keybinds disabled (input is piped).",status:"skip"}},hs=()=>{const e=process.pid;try{return process.platform==="win32"?lt(e):ot(e)}catch{return[]}},ps=()=>{const e=process.pid;let t;try{t=process.platform==="win32"?lt(e):ot(e)}catch{return{id:Se,message:"Could not enumerate processes (ps/tasklist failed).",status:"warn"}}if(t.length===0)return{id:Se,message:"No orphaned vis/task-runner processes detected.",status:"ok"};if(t.length<=2)return{detail:{count:t.length,pids:t.join(",")},id:Se,message:`${String(t.length)} possibly orphaned process(es) detected (PIDs: ${t.join(", ")}). Likely benign.`,status:"skip"};const s=process.platform==="win32"?t.map(l=>`taskkill /F /PID ${String(l)}`).join(" & "):`kill ${t.join(" ")}`;return{detail:{count:t.length,pids:t.join(",")},id:"orphans",message:`${String(t.length)} possibly orphaned vis/task-runner processes — run \`vis doctor --fix\` to clean them up, or kill them manually: ${s}`,status:"warn"}},fs=(e={})=>{const t=e.enumerate??hs,l=e.force===!0?"SIGKILL":"SIGTERM",n=e.kill??ks,o=t(),a=[],h=[];for(const c of o)try{n(c,l),a.push(c)}catch(p){const x=p.code??p.message;if(x==="ESRCH"){a.push(c);continue}h.push({pid:c,reason:x})}return{failed:h,killed:a}},ms=e=>Te("taskkill",e,{encoding:"utf8",timeout:1e4}),gs=(e,t)=>{process.kill(e,t)},xs=(e,t,s=ms)=>{const l=t==="SIGKILL"?["/F","/PID",String(e)]:["/PID",String(e)],n=s(l);if(n.error)throw n.error;if(typeof n.status=="number"&&n.status!==0){const o=n.status===128?"ESRCH":`taskkill exited with code ${String(n.status)}`,a=new Error(o);throw a.code=o,a}},ws=(e,t,s=gs)=>{s(e,t)},ks=(e,t)=>{if(process.platform==="win32"){xs(e,t);return}ws(e,t)},nt=(e,t)=>{const s=Te(e,t,{encoding:"utf8",timeout:1e4});if(s.error)throw s.error;if(typeof s.status=="number"&&s.status!==0)throw new Error(`${e} exited with code ${String(s.status)}`);return typeof s.stdout=="string"?s.stdout:""},ot=e=>{const t=nt("ps",["-Ao","pid=,command="]),s=[];for(const l of t.split(`
|
|
2
|
-
`)){if(l.length===0)continue;const n=/^\s*(\d+)\s+(.+)$/.exec(l);if(!n)continue;const o=Number.parseInt(n[1]??"",10),a=(n[2]??"").toLowerCase();!Number.isFinite(o)||o===e||(/(?:^|[ /])vis-native(?:\s|$|[-.])/.test(a)||/(?:^|[ /])vis\s+run\b/.test(a)||/(?:^|[ /])task-runner(?:\s|$|[-.])/.test(a))&&s.push(o)}return s},lt=e=>{const t=nt("tasklist",["/FO","CSV","/NH"]),s=[];for(const l of t.split(/\r?\n/)){if(l.length===0)continue;const n=l.split(/","/).map(h=>h.replaceAll(/^"|"$/g,"")),o=(n[0]??"").toLowerCase(),a=Number.parseInt(n[1]??"",10);!Number.isFinite(a)||a===e||(o==="vis.exe"||o.startsWith("vis-native")||o.includes("task-runner"))&&s.push(a)}return s},ys=()=>{let e;try{const t=Te("watchman",["--version"],{encoding:"utf8",timeout:2e3});if(t.error||typeof t.status=="number"&&t.status!==0)throw t.error??new Error("watchman exited non-zero");e=typeof t.stdout=="string"?t.stdout.trim():void 0}catch{return{id:"watchman",message:"Watchman not found — `vis` uses native fs.watch (fine for small repos). Install Watchman + `fb-watchman` to scale watch mode on large monorepos.",status:"skip"}}return{detail:e?{version:e}:void 0,id:"watchman",message:e?`Watchman available (${e}) — scalable watch backend in use.`:"Watchman available — scalable watch backend in use.",status:"ok"}},bs=(e=process.cwd())=>{let t="";try{t=Ze(K(e,".gitattributes"),"utf8")}catch(s){if(s.code!=="ENOENT")return{id:"git-lfs",message:"Could not read .gitattributes.",status:"warn"}}if(!t.includes("filter=lfs"))return{id:"git-lfs",message:"No Git LFS tracking declared in .gitattributes.",status:"skip"};try{const s=Te("git",["lfs","version"],{encoding:"utf8",timeout:2e3});if(s.error||typeof s.status=="number"&&s.status!==0)throw s.error??new Error("git-lfs not available")}catch{return{id:"git-lfs",message:"Repo tracks files via Git LFS but `git-lfs` is not installed — checked-out LFS files are pointer stubs, not real content. Install git-lfs and run `git lfs pull`.",status:"warn"}}return{id:"git-lfs",message:"Git LFS tracking declared and `git-lfs` is installed.",status:"ok"}},js=e=>[ds(),us(),ys(),bs(e),ps()],me=[{id:"dependencies",label:"Deps"},{id:"security",label:"Security"},{id:"optimization",label:"Optimize"},{id:"runtime",label:"Runtime"}],Ce=["dependencies","security","optimization","runtime"],pe=e=>{const t=new Map;for(const s of Ce)t.set(s,[]);for(const s of e)t.get(s.section).push(s);for(const[s,l]of t)l.length===0&&t.delete(s);return t},fe=(e,t,s,l)=>{let n=e.filter(o=>o.section===t);if(l&&(n=n.filter(o=>o.severity===l)),s){const o=s.toLowerCase();n=n.filter(a=>a.title.toLowerCase().includes(o))}return[...n]},vs=e=>{const t={dependencies:"idle",optimization:"idle",runtime:"idle",security:"idle"};for(const s of Ce)e.has(s)&&(t[s]="idle");return t};class Ve{#e;#s=new Set;constructor(t=[]){const s=Array.isArray(t)?{findings:t}:t,l=s.findings??[],n=s.activeSections??new Set(Ce),o=Ce.find(c=>n.has(c))??"dependencies",a=fe(l,o,"",void 0),h=vs(n);if(l.length>0)for(const c of l)h[c.section]="done";this.#e={all:l,entries:a,filterActive:!1,filterText:"",filterType:o,focusedPanel:"list",grouped:pe(a),pendingAction:void 0,sectionError:{},sectionMessage:{},sectionStatus:h,selectedIndex:0,severityFilter:void 0}}getSnapshot=()=>this.#e;subscribe=t=>(this.#s.add(t),()=>{this.#s.delete(t)});setSelectedIndex(t){const s=Math.max(0,Math.min(t,this.#e.entries.length-1));s!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:s})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:t})}setFilterType(t){if(t===this.#e.filterType)return;const s=fe(this.#e.all,t,this.#e.filterText,this.#e.severityFilter);this.#t({...this.#e,entries:s,filterType:t,grouped:pe(s),selectedIndex:0})}setFilter(t){const s=fe(this.#e.all,this.#e.filterType,t,this.#e.severityFilter);this.#t({...this.#e,entries:s,filterText:t,grouped:pe(s),selectedIndex:0})}setFilterActive(t){if(t===this.#e.filterActive)return;if(t){this.#t({...this.#e,filterActive:!0});return}const s=fe(this.#e.all,this.#e.filterType,"",this.#e.severityFilter);this.#t({...this.#e,entries:s,filterActive:!1,filterText:"",grouped:pe(s),selectedIndex:0})}setPendingAction(t){this.#t({...this.#e,pendingAction:t})}setSeverityFilter(t){if(t===this.#e.severityFilter)return;const s=fe(this.#e.all,this.#e.filterType,this.#e.filterText,t);this.#t({...this.#e,entries:s,grouped:pe(s),selectedIndex:0,severityFilter:t})}startSection(t,s){this.#t({...this.#e,sectionMessage:{...this.#e.sectionMessage,[t]:s},sectionStatus:{...this.#e.sectionStatus,[t]:"running"}})}completeSection(t,s){const l=[...this.#e.all,...s],n=fe(l,this.#e.filterType,this.#e.filterText,this.#e.severityFilter),o={...this.#e.sectionMessage};delete o[t],this.#t({...this.#e,all:l,entries:n,grouped:pe(n),sectionMessage:o,sectionStatus:{...this.#e.sectionStatus,[t]:"done"}})}failSection(t,s){this.#t({...this.#e,sectionError:{...this.#e.sectionError,[t]:s},sectionStatus:{...this.#e.sectionStatus,[t]:"error"}})}#t(t){this.#e=t;for(const s of this.#s)try{s()}catch{}}}const He={error:0,warn:1},Ss=e=>!!e.acceptedRisk,ct=e=>{const t=[];if(e.sections.has("dependencies")){for(const s of e.outdated)t.push({entry:s,id:`outdated:${s.packageName}`,kind:"outdated",section:"dependencies",severity:"warn",subtitle:`${s.currentRange} → ${s.newRange} (${s.updateType})`,title:s.packageName});for(const s of e.duplicates)t.push({id:`duplicate:${s.name}`,kind:"duplicate",pkg:s,section:"dependencies",severity:"warn",subtitle:`${String(s.versions.length)} versions installed`,title:s.name})}if(e.sections.has("security"))for(const s of e.outdated){if(s.vulnerabilities&&s.vulnerabilities.length>0){const l=s.vulnerabilities[0],n=Ss(s)?"warn":"error",o=s.vulnerabilities.length;t.push({entry:s,id:`vuln:${s.packageName}`,kind:"vulnerability",packageName:s.packageName,section:"security",severity:n,subtitle:o===1?`${l.severity} · ${l.id}`:`${String(o)} advisories · top: ${l.severity} ${l.id}`,title:s.packageName})}if(s.socketReport&&s.socketReport.alerts.length>0){const l=Math.round(s.socketReport.score.overall*100);t.push({entry:s,id:`socket:${s.packageName}`,kind:"socket",packageName:s.packageName,section:"security",severity:"warn",subtitle:`${String(s.socketReport.alerts.length)} alert${s.socketReport.alerts.length===1?"":"s"} · score ${String(l)}%`,title:s.packageName})}}if(e.sections.has("optimization"))for(const s of e.optimizations)t.push({entry:s,id:`opt:${s.packageName}`,kind:"optimization",section:"optimization",severity:"warn",subtitle:`${s.category} → ${s.replacement}`,title:s.packageName});if(e.sections.has("runtime"))for(const s of e.runtime)s.status==="warn"&&t.push({diagnostic:s,id:`runtime:${s.id}`,kind:"runtime",section:"runtime",severity:"warn",title:s.message});return t.sort((s,l)=>{if(s.section!==l.section){const n=["dependencies","security","optimization","runtime"];return n.indexOf(s.section)-n.indexOf(l.section)}return He[s.severity]-He[l.severity]}),t},at={dependencies:"Dependencies",optimization:"Optimization",runtime:"Runtime",security:"Security"},$s={error:"red",warn:"yellow"},Cs={error:"✖",warn:"⚠"},Rs={error:" ERROR ",warn:" WARN "},Ts=({children:e,hint:t,message:s,severity:l,title:n})=>{const o=$s[l];return i.jsxs(u,{borderColor:o,borderStyle:"single",flexDirection:"column",flexShrink:0,paddingX:1,children:[i.jsxs(u,{gap:1,children:[i.jsx(r,{backgroundColor:o,bold:!0,color:"black",children:Rs[l]}),i.jsx(r,{bold:!0,color:o,children:Cs[l]}),i.jsx(r,{bold:!0,wrap:"truncate-end",children:n})]}),i.jsx(r,{wrap:"truncate-end",children:s}),t?i.jsx(r,{dimColor:!0,wrap:"truncate-end",children:t}):null,e]})},Es={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},As={critical:"red",high:"red",low:"gray",medium:"yellow"},Is={major:"red",minor:"yellow",patch:"green"},C=({children:e,label:t,width:s=14})=>i.jsxs(u,{children:[i.jsx(u,{width:s,children:i.jsxs(r,{dimColor:!0,children:[t,":"]})}),typeof e=="string"?i.jsx(r,{children:e}):e]}),re=({children:e})=>i.jsx(u,{marginTop:1,children:i.jsx(r,{bold:!0,color:"white",children:e})}),Ds=({finding:e})=>{const{entry:t}=e,s=Is[t.updateType]??"white";return i.jsxs(u,{flexDirection:"column",children:[i.jsx(C,{label:"Current",children:t.currentRange}),i.jsxs(C,{label:"Target",children:[i.jsx(r,{children:t.newRange}),i.jsxs(r,{bold:!0,color:s,children:[" (",t.updateType,")"]})]}),i.jsx(C,{label:"Catalog",children:t.catalogName}),t.acceptedRisk?i.jsx(C,{label:"Risk ack",children:i.jsx(r,{dimColor:!0,children:t.acceptedRisk.reason??"(no reason recorded)"})}):null,i.jsx(re,{children:"Action"}),i.jsxs(r,{dimColor:!0,children:["Run"," ",i.jsx(r,{bold:!0,color:"white",children:"vis update"})," ","to apply this change."]})]})},Os=({finding:e})=>i.jsxs(u,{flexDirection:"column",children:[i.jsx(C,{label:"Versions",children:i.jsx(r,{children:String(e.pkg.versions.length)})}),i.jsx(re,{children:"Installed versions"}),e.pkg.versions.map(t=>i.jsxs(r,{children:[" · ",t]},t)),i.jsx(re,{children:"Action"}),i.jsxs(r,{dimColor:!0,children:["Run"," ",i.jsx(r,{bold:!0,color:"white",children:"vis dedupe"})," ","to consolidate to a single resolution."]})]}),Ps=({finding:e})=>{const t=e.entry.vulnerabilities??[];return i.jsxs(u,{flexDirection:"column",children:[i.jsx(C,{label:"Package",children:e.packageName}),i.jsx(C,{label:"Current",children:e.entry.currentRange}),i.jsx(C,{label:"Advisories",children:String(t.length)}),e.entry.acceptedRisk?i.jsx(C,{label:"Risk ack",children:i.jsx(r,{dimColor:!0,children:e.entry.acceptedRisk.reason??"(no reason recorded)"})}):null,t.map(s=>{const l=Es[s.severity]??"gray";return i.jsxs(u,{flexDirection:"column",marginTop:1,children:[i.jsxs(u,{children:[i.jsx(r,{bold:!0,color:l,children:s.severity}),i.jsx(r,{children:" "}),i.jsx(r,{children:s.id}),typeof s.cvssScore=="number"?i.jsxs(r,{dimColor:!0,children:[" · CVSS ",s.cvssScore.toFixed(1)]}):null]}),i.jsx(r,{wrap:"wrap",children:s.summary}),s.fixedVersions.length>0?i.jsxs(r,{dimColor:!0,children:["Fixed in: ",s.fixedVersions.join(", ")]}):null,s.aliases&&s.aliases.length>0?i.jsxs(r,{dimColor:!0,children:["Aliases: ",s.aliases.join(", ")]}):null]},s.id)})]})},Ns=({finding:e})=>{const t=e.entry.socketReport;if(!t)return i.jsx(r,{dimColor:!0,children:"No Socket report attached."});const s=Math.round(t.score.overall*100),l=Le(t.score.overall);return i.jsxs(u,{flexDirection:"column",children:[i.jsx(C,{label:"Package",children:e.packageName}),i.jsx(C,{label:"Overall",children:i.jsxs(r,{color:l,children:[String(s),"%"]})}),i.jsx(C,{label:"Alerts",children:String(t.alerts.length)}),e.entry.acceptedRisk?i.jsx(C,{label:"Risk ack",children:i.jsx(r,{dimColor:!0,children:e.entry.acceptedRisk.reason??"(no reason recorded)"})}):null,i.jsx(re,{children:"Score breakdown"}),Object.entries(t.score).map(([n,o])=>{if(n==="overall")return null;const a=typeof o=="number"?o:0,h=Math.round(a*100),c=Le(a);return i.jsxs(u,{children:[i.jsx(u,{width:14,children:i.jsxs(r,{dimColor:!0,children:[n,":"]})}),i.jsxs(r,{color:c,children:[String(h),"%"]})]},n)}),i.jsx(re,{children:"Alerts"}),t.alerts.map((n,o)=>{const a=As[n.severity]??"gray";return i.jsxs(u,{flexDirection:"column",marginBottom:1,children:[i.jsxs(u,{children:[i.jsx(r,{bold:!0,color:a,children:n.severity}),i.jsx(r,{children:" "}),i.jsx(r,{children:n.type})]}),n.props?i.jsx(r,{dimColor:!0,wrap:"wrap",children:JSON.stringify(n.props)}):null]},`${n.type}-${String(o)}`)})]})},Ms=({finding:e})=>{const{entry:t}=e;return i.jsxs(u,{flexDirection:"column",children:[i.jsx(C,{label:"Package",children:t.packageName}),i.jsx(C,{label:"Category",children:t.category}),i.jsx(C,{label:"Replacement",children:t.replacement}),t.overrideSpec?i.jsx(C,{label:"Override",children:t.overrideSpec}):null,i.jsx(C,{label:"Codemod",children:i.jsx(r,{color:t.hasCodemod?"green":"gray",children:t.hasCodemod?"available":"not available"})}),t.docUrl?i.jsx(C,{label:"Guide",children:i.jsx(r,{color:"cyan",underline:!0,children:t.docUrl})}):null,i.jsx(re,{children:"Action"}),t.hasCodemod?i.jsxs(r,{dimColor:!0,children:["Run"," ",i.jsx(r,{bold:!0,color:"white",children:"vis optimize"})," ","to apply the codemod interactively."]}):t.overrideSpec?i.jsxs(r,{dimColor:!0,children:["Run"," ",i.jsx(r,{bold:!0,color:"white",children:"vis optimize"})," ","to install the package override."]}):t.docUrl?i.jsx(r,{dimColor:!0,children:"No automated codemod. Open the migration guide above for the recommended alternative and steps."}):i.jsx(r,{dimColor:!0,children:"No automated codemod. Consult the package's docs or the e18e module-replacements guide for an alternative."})]})},Fs=({finding:e})=>{const{diagnostic:t}=e,s=t.status==="warn"?"yellow":t.status==="ok"?"green":"gray";return i.jsxs(u,{flexDirection:"column",children:[i.jsx(C,{label:"Check",children:t.id}),i.jsx(C,{label:"Status",children:i.jsx(r,{color:s,children:t.status})}),i.jsx(re,{children:"Message"}),i.jsx(r,{wrap:"wrap",children:t.message}),t.detail&&Object.keys(t.detail).length>0?i.jsxs(i.Fragment,{children:[i.jsx(re,{children:"Details"}),Object.entries(t.detail).map(([l,n])=>i.jsxs(u,{children:[i.jsx(u,{width:20,children:i.jsxs(r,{dimColor:!0,children:[l,":"]})}),i.jsx(r,{children:String(n)})]},l))]}):null]})},zs=({finding:e,focused:t,scrollRef:s})=>{const l=t?"white":"gray";if(!e)return i.jsx(u,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:i.jsx(r,{dimColor:!0,children:"No finding selected"})});let n;switch(e.kind){case"duplicate":{n=i.jsx(Os,{finding:e});break}case"optimization":{n=i.jsx(Ms,{finding:e});break}case"outdated":{n=i.jsx(Ds,{finding:e});break}case"runtime":{n=i.jsx(Fs,{finding:e});break}case"socket":{n=i.jsx(Ns,{finding:e});break}case"vulnerability":{n=i.jsx(Ps,{finding:e});break}default:{n=i.jsx(r,{dimColor:!0,children:"Unknown finding kind."});break}}return i.jsxs(u,{borderColor:l,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[i.jsxs(u,{flexShrink:0,paddingTop:1,paddingX:2,children:[i.jsx(r,{bold:!0,color:"white",children:e.title}),i.jsxs(r,{dimColor:!0,children:[" ",at[e.section]]})]}),i.jsxs(bt,{flexGrow:1,flexShrink:1,paddingX:2,ref:s,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[i.jsx(r,{}),n]})]})},dt={error:"red",warn:"yellow"},Ls={error:"✖",warn:"⚠"},Bs=e=>e.kind==="outdated"||e.kind==="vulnerability"||e.kind==="socket"?!!e.entry.acceptedRisk:!1,_s=({finding:e,isSelected:t})=>{const s=dt[e.severity],l=Bs(e);return i.jsxs(u,{flexShrink:0,height:1,children:[i.jsx(r,{children:t?">":" "}),i.jsxs(r,{color:s,children:[" ",Ls[e.severity]," "]}),i.jsx(u,{flexGrow:1,children:i.jsx(r,{bold:t,inverse:t,wrap:"truncate",children:e.title})}),l?i.jsx(r,{color:"cyan",children:" ack"}):null,e.subtitle?i.jsxs(r,{dimColor:!0,wrap:"truncate",children:[" ",e.subtitle]}):null]})},Vs=({count:e,section:t})=>i.jsxs(u,{flexShrink:0,height:1,marginTop:1,children:[i.jsx(r,{dimColor:!0,children:"▼ "}),i.jsx(r,{bold:!0,color:"white",children:at[t].toUpperCase()}),i.jsxs(r,{dimColor:!0,children:[" (",e,")"]})]}),Hs=({count:e,label:t,status:s})=>{const l=s==="running";return i.jsxs(r,{children:[t,l?i.jsxs(r,{children:[" ",i.jsx(rt,{type:"dots"})]}):null,s==="error"?i.jsx(r,{bold:!0,color:"red",children:" ✖"}):i.jsxs(r,{dimColor:!0,children:[" (",String(e),")"]})]})},Ys=({elapsedMs:e,entries:t,filterActive:s,filterText:l,filterType:n,focused:o,fromCache:a=!1,grouped:h,onViewportHeightChange:c,scrollOffset:p,sectionCounts:x,sectionMessage:v,sectionStatus:y,selectedIndex:N,severityFilter:S,totalAll:m,viewportHeight:E})=>{const O=o?"white":"gray",{measuredHeight:M,ref:P}=ss(E,c);let R=0,F=0;for(const b of t)b.severity==="error"?R+=1:b.severity==="warn"&&(F+=1);const U=[];R>0&&U.push(`${String(R)} error${R===1?"":"s"}`),F>0&&U.push(`${String(F)} warn${F===1?"":"s"}`);const ee=U.length>0?` (${U.join(", ")})`:"",te=(e/1e3).toFixed(1),G=[];for(const[b,$]of h){G.push(i.jsx(Vs,{count:$.length,section:b},`hdr-${b}`));for(const V of $){const T=t.indexOf(V);G.push(i.jsx(_s,{finding:V,isSelected:T===N},V.id))}}let X=0;for(const[,b]of h)X+=2+b.length;const _=X>M&&M>0;return i.jsxs(u,{borderColor:O,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[i.jsxs(u,{flexShrink:0,gap:1,paddingX:1,children:[i.jsx(r,{bold:!0,inverse:!0,children:" DOCTOR "}),i.jsxs(r,{wrap:"truncate",children:[t.length,t.length===m?"":`/${String(m)}`," finding",t.length===1?"":"s",ee]}),S?i.jsx(r,{bold:!0,color:dt[S],inverse:!0,children:` ${S.toUpperCase()} ONLY `}):null,a?i.jsx(r,{bold:!0,color:"cyan",inverse:!0,children:" CACHED "}):null,i.jsxs(r,{dimColor:!0,children:[" · ",te,"s"]})]}),i.jsx(u,{flexShrink:0,paddingX:1,paddingY:1,children:i.jsx(es,{isFocused:o,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:()=>{},showIndex:!1,value:n,children:me.map(({id:b,label:$})=>i.jsx(ts,{name:b,children:i.jsx(Hs,{count:x[b],label:$,status:y[b]})},b))})}),(()=>{const b=Object.keys(y).filter($=>y[$]==="running"&&v[$]).map($=>v[$]);return b.length===0?null:i.jsx(u,{flexShrink:0,paddingX:1,children:i.jsxs(r,{dimColor:!0,wrap:"truncate",children:[i.jsx(rt,{type:"dots"})," ",b.join(" · ")]})})})(),s&&i.jsxs(u,{flexShrink:0,paddingX:1,children:[i.jsx(r,{bold:!0,color:"white",children:"/ "}),i.jsx(r,{children:l}),i.jsx(r,{inverse:!0,children:" "})]}),i.jsxs(u,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:P,children:[i.jsx(u,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:i.jsx(u,{flexDirection:"column",marginTop:-p,children:G.length>0?G:i.jsx(u,{marginTop:1,children:i.jsx(r,{dimColor:!0,children:"No findings match the current filter."})})})}),_&&i.jsx(u,{flexShrink:0,marginLeft:1,marginRight:1,children:i.jsx(jt,{contentHeight:X,placement:"inset",scrollOffset:p,style:"block",viewportHeight:M})})]},`list-${n}-${l}`)]})},Us=e=>{if(e.kind==="outdated")return{command:`vis update ${e.entry.packageName}`,description:`Update ${e.entry.packageName} to ${e.entry.newRange}`};if(e.kind==="duplicate")return{command:`vis dedupe ${e.pkg.name}`,description:`Dedupe ${e.pkg.name} (${String(e.pkg.versions.length)} versions)`}},Gs=e=>{if(e.kind==="optimization")return{command:`vis optimize ${e.entry.packageName}`,description:`Replace ${e.entry.packageName} with ${e.entry.replacement}`}},Ws=e=>{if(e.kind!=="outdated"&&e.kind!=="vulnerability"&&e.kind!=="socket")return;const t=e.kind==="outdated"?e.entry.packageName:e.packageName,s=["// Add to vis.config.ts:","security: {"," acceptedRisks: {",` "${t}": {`,' reason: "explain why this risk is acceptable",',' expiresAt: "YYYY-MM-DD",'," },"," },","},"].join(`
|
|
3
|
-
`);return{command:s,configSnippet:s,description:`Acknowledge risk for ${t}`}},Ks=100,Xs=40,qs=10,Js=({autoExitSeconds:e=0,banner:t,fromCache:s=!1,startedAt:l,store:n})=>{const{exit:o}=vt(),{columns:a,rows:h}=St(),c=z.useSyncExternalStore(n.subscribe,n.getSnapshot),[p,x]=z.useState(!1),[v,y]=z.useState(!1),[N,S]=z.useState(0),[m,E]=z.useState(()=>Date.now());z.useEffect(()=>{const w=setInterval(()=>{E(Date.now())},1e3);return()=>{clearInterval(w)}},[]);const O=m-l,M=z.useRef(null),P=z.useRef(null),R=c.entries[c.selectedIndex]??null,F=z.useMemo(()=>{const w={dependencies:0,optimization:0,runtime:0,security:0};for(const g of c.all)w[g.section]+=1;return w},[c.all]),U=t?t.hint?5:4:0,ee=z.useMemo(()=>{for(const w of Object.keys(c.sectionStatus))if(c.sectionStatus[w]==="running"&&c.sectionMessage[w])return 1;return 0},[c.sectionStatus,c.sectionMessage]),te=a>=Ks,G=te?Math.max(1,h-U-2):Math.floor(h*.55),X=Math.max(1,G-6-ee-(c.filterActive?1:0)),[_,b]=z.useState(X),$=_>0?_:X,V=z.useMemo(()=>{let w=0;for(const[,g]of c.grouped)w+=2+g.length;return w},[c.grouped]),T=Math.max(0,V-$),ne=Math.min(N,T),B=z.useCallback(w=>{let g=0,k=0;for(const[,xe]of c.grouped){g+=2;for(let he=0;he<xe.length;he++){if(k===w)return g;g+=1,k+=1}}return g},[c.grouped]),q=z.useCallback(w=>{const g=B(w);S(k=>g>k+$-2?Math.min(T,Math.max(0,g-$+2)):g<k+1?Math.max(0,g-1):k)},[B,$,T]);if(z.useEffect(()=>{P.current?.scrollToTop()},[R?.id]),$t((w,g)=>{if(w==="c"&&g.ctrl){o();return}if(!v){if(p){g.escape||w==="?"?x(!1):w==="q"?(x(!1),y(!0)):g.downArrow||w==="j"?M.current?.scrollBy(1):(g.upArrow||w==="k")&&M.current?.scrollBy(-1);return}if(w==="?"){x(!0);return}if(w==="q"){y(!0);return}if(g.tab){n.setFocusedPanel(c.focusedPanel==="list"?"detail":"list");return}if(c.filterActive){if(g.escape||g.return){n.setFilterActive(!1);return}if(g.backspace){S(0),n.setFilter(c.filterText.slice(0,-1));return}w&&!g.ctrl&&!g.meta&&(S(0),n.setFilter(c.filterText+w));return}if(c.focusedPanel==="list"&&(g.leftArrow||g.rightArrow)){const k=me.findIndex(he=>he.id===c.filterType),xe=g.rightArrow?(k+1)%me.length:(k-1+me.length)%me.length;S(0),P.current?.scrollToTop(),n.setFilterType(me[xe].id);return}if(c.focusedPanel==="list"){if(g.downArrow||w==="j"){const k=Math.min(c.selectedIndex+1,c.entries.length-1);n.setSelectedIndex(k),q(k);return}if(g.upArrow||w==="k"){const k=Math.max(c.selectedIndex-1,0);n.setSelectedIndex(k),q(k);return}if(g.pageDown){const k=Math.min(c.selectedIndex+10,c.entries.length-1);n.setSelectedIndex(k),q(k);return}if(g.pageUp){const k=Math.max(c.selectedIndex-10,0);n.setSelectedIndex(k),q(k);return}if(g.home){n.setSelectedIndex(0),S(0);return}if(g.end){const k=c.entries.length-1;n.setSelectedIndex(k),q(k);return}if(w==="/"){n.setFilterActive(!0);return}if(w==="e"){n.setSeverityFilter(c.severityFilter==="error"?void 0:"error"),S(0);return}if(w==="w"){n.setSeverityFilter(c.severityFilter==="warn"?void 0:"warn"),S(0);return}if(w==="u"&&R){const k=Us(R);k&&(n.setPendingAction(k),o());return}if(w==="o"&&R){const k=Gs(R);k&&(n.setPendingAction(k),o());return}if(w==="a"&&R){const k=Ws(R);k&&(n.setPendingAction(k),o());return}if(w==="d"){n.setFocusedPanel("detail");return}return}if(g.escape||g.leftArrow){n.setFocusedPanel("list");return}if(g.downArrow||w==="j"){P.current?.scrollBy(1);return}if(g.upArrow||w==="k"){P.current?.scrollBy(-1);return}if(g.pageDown){P.current?.scrollBy(10);return}if(g.pageUp){P.current?.scrollBy(-10);return}if(g.home){P.current?.scrollToTop();return}g.end&&P.current?.scrollToBottom()}},{isActive:!0}),a<Xs||h<qs)return i.jsx(u,{alignItems:"center",height:h,justifyContent:"center",width:a,children:i.jsxs(r,{color:"yellow",children:["Terminal too small (",a,"x",h,")"]})});const ce=c.focusedPanel==="detail",L=[i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"q"}),i.jsx(r,{dimColor:!0,children:"QUIT"})]},"q"),i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"?"}),i.jsx(r,{dimColor:!0,children:"HELP"})]},"?"),i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"↑↓"}),i.jsx(r,{dimColor:!0,children:ce?"SCROLL":"NAV"})]},"nav"),ce?i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"←/Esc"}),i.jsx(r,{dimColor:!0,children:"LIST"})]},"lr"):i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"←→"}),i.jsx(r,{dimColor:!0,children:"SECTION"})]},"lr"),i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"/"}),i.jsx(r,{dimColor:!0,children:"SEARCH"})]},"search"),i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"e/w"}),i.jsx(r,{dimColor:!0,children:"SEVERITY"})]},"sev"),i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"u/o/a"}),i.jsx(r,{dimColor:!0,children:"ACTION"})]},"actions"),i.jsxs(u,{gap:1,children:[i.jsx(r,{bold:!0,color:"white",children:"Tab"}),i.jsx(r,{dimColor:!0,children:"PANEL"})]},"tab")],H=i.jsx(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:i.jsx(u,{gap:2,overflow:"hidden",paddingX:1,children:L})}),W=i.jsxs(Ct,{footer:i.jsxs(r,{dimColor:!0,children:[i.jsx(r,{bold:!0,color:"white",children:"↑↓"})," scroll ",i.jsx(r,{bold:!0,color:"white",children:"?"}),"/",i.jsx(r,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:M,title:"DOCTOR — KEYBOARD SHORTCUTS",visible:p,width:56,children:[i.jsxs(u,{flexDirection:"column",marginBottom:1,children:[i.jsxs(u,{marginBottom:1,children:[i.jsx(r,{dimColor:!0,children:"── "}),i.jsx(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),i.jsxs(u,{children:[i.jsx(u,{width:26,children:i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" ↑/k "}),i.jsx(r,{dimColor:!0,children:"Move up"})]})}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" ↓/j "}),i.jsx(r,{dimColor:!0,children:"Move down"})]})]}),i.jsxs(u,{children:[i.jsx(u,{width:26,children:i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" PgUp"}),i.jsx(r,{dimColor:!0,children:" Jump up 10"})]})}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" PgDn"}),i.jsx(r,{dimColor:!0,children:" Jump down 10"})]})]}),i.jsxs(u,{children:[i.jsx(u,{width:26,children:i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" Home"}),i.jsx(r,{dimColor:!0,children:" Jump to top"})]})}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" End"}),i.jsx(r,{dimColor:!0,children:" Jump to bottom"})]})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" Tab"}),i.jsx(r,{dimColor:!0,children:" Switch panel"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" →/←"}),i.jsx(r,{dimColor:!0,children:" Section tabs (list) / Focus list (detail)"})]})]}),i.jsxs(u,{flexDirection:"column",marginBottom:1,children:[i.jsxs(u,{marginBottom:1,children:[i.jsx(r,{dimColor:!0,children:"── "}),i.jsx(r,{bold:!0,color:"white",children:"FILTER"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" /"}),i.jsx(r,{dimColor:!0,children:" Open text filter (Esc/Enter to close)"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" e"}),i.jsx(r,{dimColor:!0,children:" Toggle errors-only filter"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" w"}),i.jsx(r,{dimColor:!0,children:" Toggle warns-only filter"})]})]}),i.jsxs(u,{flexDirection:"column",marginBottom:1,children:[i.jsxs(u,{marginBottom:1,children:[i.jsx(r,{dimColor:!0,children:"── "}),i.jsx(r,{bold:!0,color:"white",children:"ACTIONS"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" u"}),i.jsx(r,{dimColor:!0,children:" Exit + suggest update / dedupe command"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" o"}),i.jsx(r,{dimColor:!0,children:" Exit + suggest optimize command"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" a"}),i.jsx(r,{dimColor:!0,children:" Exit + print risk-ack snippet"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" d"}),i.jsx(r,{dimColor:!0,children:" Focus detail panel"})]})]}),i.jsxs(u,{flexDirection:"column",children:[i.jsxs(u,{marginBottom:1,children:[i.jsx(r,{dimColor:!0,children:"── "}),i.jsx(r,{bold:!0,color:"white",children:"EXIT"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" q"}),i.jsx(r,{dimColor:!0,children:" Quit (with countdown)"})]}),i.jsxs(r,{children:[i.jsx(r,{bold:!0,color:"white",children:" Ctrl+C"}),i.jsx(r,{dimColor:!0,children:" Quit immediately"})]})]})]}),ae=i.jsx(Ys,{elapsedMs:O,entries:c.entries,filterActive:c.filterActive,filterText:c.filterText,filterType:c.filterType,focused:c.focusedPanel==="list",fromCache:s,grouped:c.grouped,onViewportHeightChange:b,scrollOffset:ne,sectionCounts:F,sectionMessage:c.sectionMessage,sectionStatus:c.sectionStatus,selectedIndex:c.selectedIndex,severityFilter:c.severityFilter,totalAll:c.all.length,viewportHeight:$}),de=t?i.jsx(Ts,{hint:t.hint,message:t.message,severity:t.severity,title:t.title}):null,ue=i.jsx(zs,{finding:R,focused:c.focusedPanel==="detail",scrollRef:P});if(te){const w=Math.floor(a*.4);return i.jsxs(u,{flexDirection:"column",height:h,width:a,children:[de,i.jsxs(u,{flexDirection:"row",flexGrow:1,children:[i.jsx(u,{flexGrow:1,children:ae}),i.jsx(u,{width:w,children:ue})]}),H,i.jsx(Fe,{autoExitSeconds:e||3,onCancel:()=>{y(!1)},visible:v}),W]})}return i.jsxs(u,{flexDirection:"column",height:h,width:a,children:[de,i.jsx(u,{height:G,children:ae}),i.jsx(u,{flexGrow:1,children:ue}),H,i.jsx(Fe,{autoExitSeconds:e||3,onCancel:()=>{y(!1)},visible:v}),W]})},Qs=e=>e.replaceAll(/[$()+.?[\\\]^{|}]/g,String.raw`\$&`),Zs=e=>{const t=e.split("*").map(s=>Qs(s));return new RegExp(`^${t.join(".*")}$`,"i")},ei=e=>e?e.split(",").map(t=>t.trim()).filter(t=>t.length>0).map(t=>Zs(t)):[],$e=(e,t)=>{for(const s of t)if(s.test(e))return!0;return!1},ti=(e,t,s)=>{if(t.length===0)return e;const l=e.outdated.filter(p=>$e(p.packageName,t)),n=e.duplicates.filter(p=>$e(p.name,t)),o=e.optimizations.filter(p=>$e(p.packageName,t));let a=0,h=0,c=0;for(const p of l)p.vulnerabilities&&(a+=p.vulnerabilities.length),p.socketReport&&(h+=p.socketReport.alerts.length,p.socketReport.score.overall<s&&(c+=1));return{...e,duplicates:n,optimizations:o,outdated:l,socketIssues:{alerts:h,lowScore:c},vulnCount:a}},ut=(e,t)=>t.length===0?[...e]:e.filter(s=>{if(s.kind==="runtime")return!0;const l=s.kind==="duplicate"?s.pkg.name:s.kind==="outdated"||s.kind==="optimization"?s.entry.packageName:s.packageName;return $e(l,t)}),ht=["dependencies","security","optimization","runtime"],Ye=e=>{const t=new Set;if(!e)return t;for(const s of e.split(",")){const l=s.trim().toLowerCase();ht.includes(l)&&t.add(l)}return t},si=(e,t)=>{if(e!==void 0&&e!=="")return Ye(e);const s=Ye(t);return new Set(ht.filter(l=>!s.has(l)))},pt=e=>{const t={micro:0,native:0,preferred:0,socket:0,total:e.length};for(const s of e)switch(s.category){case"micro-utility":{t.micro+=1;break}case"native":{t.native+=1;break}case"preferred":{t.preferred+=1;break}case"socket":{t.socket+=1;break}}return t},ie=(e,t)=>{if(!e.sections.has(t))return"skip";switch(t){case"dependencies":return e.outdated.length>0||e.duplicates.length>0?"warn":"ok";case"optimization":return e.optimizations.length>0?"warn":"ok";case"runtime":return e.runtime.some(s=>s.status==="warn")?"warn":"ok";case"security":return e.vulnCount>0||e.socketIssues.alerts>0?"error":e.socketIssues.lowScore>0?"warn":"ok";default:return"ok"}},ii=(e,t)=>{const s=pt(e.optimizations),l={dependencies:ie(e,"dependencies"),optimization:ie(e,"optimization"),runtime:ie(e,"runtime"),security:ie(e,"security")},n=new Set([...Object.values(l),e.supplyChain.status]),o=n.has("error")?"error":n.has("warn")?"warn":"ok";return{dependencies:{duplicates:e.duplicates.length,installed:e.installedCount,outdated:e.outdated.length,status:l.dependencies},elapsedMs:e.elapsedMs,optimizations:{microUtilities:s.micro,native:s.native,preferred:s.preferred,socket:s.socket,status:l.optimization,total:s.total},packageManager:t,runtime:e.runtime.map(a=>({detail:a.detail,id:a.id,message:a.message,status:a.status})),runtimeStatus:l.runtime,security:{alerts:e.socketIssues.alerts,lowScorePackages:e.socketIssues.lowScore,status:l.security,vulnerabilities:e.vulnCount},status:o,supplyChain:{findings:e.supplyChain.findings.map(a=>({detail:a.detail,label:a.label,severity:a.severity})),status:e.supplyChain.status},workspaces:e.workspaceCount}},Ue=(e,t)=>{const s=e.runtime.some(n=>n.status==="warn"),l=e.vulnCount>0||e.socketIssues.alerts>0;return t?l||e.outdated.length>0||e.duplicates.length>0||s:l},ri=["aube-workspace.yaml","pnpm-workspace.yaml"],ke=e=>typeof e=="boolean"?e:void 0,ni=e=>{if(e==="no-downgrade"||e==="off")return e},oi=e=>{const t={allowBuildsCount:0,blockExoticSubdeps:void 0,jailBuilds:void 0,minimumReleaseAge:void 0,minimumReleaseAgeStrict:void 0,paranoid:void 0,source:void 0,strictDepBuilds:void 0,trustPolicy:void 0};for(const s of ri){const l=K(e,s);if(!je(l))continue;let n;try{n=is(Tt(l))}catch{continue}if(typeof n!="object"||n===null)continue;const o=n;return t.source=s,t.paranoid=ke(o.paranoid),t.trustPolicy=ni(o.trustPolicy),t.blockExoticSubdeps=ke(o.blockExoticSubdeps),t.jailBuilds=ke(o.jailBuilds),t.strictDepBuilds=ke(o.strictDepBuilds),t.minimumReleaseAgeStrict=ke(o.minimumReleaseAgeStrict),typeof o.minimumReleaseAge=="number"&&Number.isFinite(o.minimumReleaseAge)&&(t.minimumReleaseAge=o.minimumReleaseAge),o.allowBuilds&&typeof o.allowBuilds=="object"&&!Array.isArray(o.allowBuilds)&&(t.allowBuildsCount=Object.keys(o.allowBuilds).length),t}return t},li=e=>e.paranoid?{...e,jailBuilds:!0,minimumReleaseAgeStrict:!0,strictDepBuilds:!0,trustPolicy:"no-downgrade"}:e,ci=/^(@[\w./-]+\/[\w./-]+|[\w.-]+)@(.+)$/,ai=e=>{const t=ci.exec(e);if(t)return{name:t[1],version:t[2]}},di=(e,t)=>{let s;try{if(t==="pnpm"){const n=K(e,"pnpm-workspace.yaml");je(n)&&(s=Et(n)?.patchedDependencies)}else if(t==="bun"){const n=K(e,"package.json");je(n)&&(s=tt(n)?.patchedDependencies)}}catch{return[]}if(!s||typeof s!="object")return[];const l=[];for(const[n,o]of Object.entries(s)){if(typeof o!="string"||o.length===0)continue;const a=ai(n);a&&l.push({name:a.name,patchFile:o,resolvedPatchFile:At(o)?o:qe(e,o),version:a.version})}return l},ui=e=>{const t=[];for(const s of e)je(s.resolvedPatchFile)||t.push({entry:s,kind:"missing-file"});return t},Ge=e=>e.some(t=>t.severity==="error")?"error":e.some(t=>t.severity==="warn")?"warn":"ok",hi=(e,t={})=>{const s=[],l=e?.security;if(!l)return s.push({detail:"Use defineConfig() from '@visulima/vis/config' to apply secure defaults.",label:"No security config — running with the PM's native defaults",severity:"warn"}),{findings:s,status:Ge(s)};const n=l.policies?.firstSeen?.minutes,o=l.policies?.publisherChange,a=l.policies?.installScripts;n===void 0?s.push({detail:"Set security.policies.firstSeen.minutes to block packages published in the last N minutes (mitigates supply-chain attacks).",label:"policies.firstSeen.minutes is not set",severity:"warn"}):n===0?s.push({detail:"New packages can be installed immediately after publishing. Consider setting a non-zero cooldown.",label:"policies.firstSeen.minutes is explicitly 0",severity:"warn"}):s.push({label:`policies.firstSeen.minutes: ${String(n)} minutes`,severity:"ok"}),o?.mode===void 0||o.mode==="off"?s.push({detail:"Packages whose trust level has decreased will not be blocked. Consider 'no-downgrade'.",label:`policies.publisherChange.mode: ${o?.mode??"not set"}`,severity:"warn"}):s.push({label:`policies.publisherChange.mode: ${o.mode}`,severity:"ok"}),l.blockExoticSubdeps===void 0||!l.blockExoticSubdeps?s.push({detail:"Transitive dependencies can pull code from git repos or tarball URLs. Set to true to block.",label:`blockExoticSubdeps: ${String(l.blockExoticSubdeps??!1)}`,severity:"warn"}):s.push({label:"blockExoticSubdeps: true",severity:"ok"});const h=a?.allow?Object.keys(a.allow).length:0;if(h===0?s.push({detail:"Lifecycle scripts are blocked by default. List trusted packages here to opt them back in (e.g. esbuild, @prisma/client).",label:"policies.installScripts.allow: not configured",severity:"warn"}):s.push({label:`policies.installScripts.allow: ${String(h)} ${h===1?"entry":"entries"}`,severity:"ok"}),a?.strict&&h===0&&s.push({detail:"All dependencies with build scripts will be blocked. Run 'vis approve-builds' to populate the allow list.",label:"policies.installScripts.strict is on but allow is empty",severity:"error"}),t.workspaceRoot){const c=rs(t.workspaceRoot);if(c.length>0){const p=[...new Set(c.map(x=>x.tool))].sort((x,v)=>x.localeCompare(v)).join(", ");s.push({detail:"Run `vis migrate verify` for the full list, then re-run `vis migrate <tool>` to clean up.",label:`${String(c.length)} leftover ${c.length===1?"reference":"references"} to ${p}`,severity:"warn"})}}if(t.workspaceRoot&&t.packageManager==="aube"){const c=oi(t.workspaceRoot),p=li(c),x=p.source?` (from ${p.source})`:"";p.paranoid===!0&&s.push({detail:"Forces jailBuilds, trustPolicy=no-downgrade, minimumReleaseAgeStrict, strictStoreIntegrity, and strictDepBuilds on.",label:`aube paranoid: true${x}`,severity:"ok"}),p.trustPolicy==="off"&&s.push({detail:"Trust downgrades between releases will not be blocked. Set trustPolicy: no-downgrade in aube-workspace.yaml.",label:`aube trustPolicy: off${x}`,severity:"warn"}),p.blockExoticSubdeps===!1&&s.push({detail:"Transitive deps from git+, file:, and tarball URLs will not be blocked. Re-enable with blockExoticSubdeps: true.",label:`aube blockExoticSubdeps: false${x}`,severity:"warn"}),p.minimumReleaseAge===0&&s.push({detail:"Newly published versions are not held in a cooling window. Restore with minimumReleaseAge: 1440 (24h) or higher.",label:`aube minimumReleaseAge: 0${x}`,severity:"warn"}),p.jailBuilds===!0&&s.push({label:`aube jailBuilds: true${x}`,severity:"ok"}),p.strictDepBuilds===!0&&s.push({label:`aube strictDepBuilds: true${x}`,severity:"ok"}),p.allowBuildsCount>0&&s.push({label:`aube allowBuilds: ${String(p.allowBuildsCount)} ${p.allowBuildsCount===1?"entry":"entries"}${x}`,severity:"ok"})}if(t.workspaceRoot&&t.packageManager){const c=di(t.workspaceRoot,t.packageManager);if(c.length>0){const p=ui(c);if(p.length===0)s.push({label:`patchedDependencies: ${String(c.length)} ${c.length===1?"entry":"entries"} resolved`,severity:"ok"});else for(const x of p)s.push({detail:`Referenced from ${t.packageManager==="pnpm"?"pnpm-workspace.yaml":"package.json"} but the file is not present at ${x.entry.patchFile}.`,label:`patchedDependencies: missing patch file for ${x.entry.name}@${x.entry.version}`,severity:"error"})}}return{findings:s,status:Ge(s)}},Y=e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${String(Math.round(e))}ms`,ve=async(e,t,s,l)=>{if(!e)return s();e.start(t);const n=Date.now();try{const o=await s(),a=Date.now()-n,{status:h,summary:c}=l(o,a);return e.finish(t,h,c),o}catch(o){const a=Date.now()-n,h=o instanceof Error?o.message:String(o);throw e.finish(t,"error",`${h} (${Y(a)})`),o}},pi=(e,t)=>{const s={duplicates:t.duplicates,optimizations:t.optimizations,outdated:t.outdated,runtime:t.runtime,sections:new Set([e])};return ct(s)},We=async e=>{const{filterPatterns:t,installed:s,progress:l,resolveCodemods:n,sections:o,store:a,visConfig:h,workspaceRoot:c}=e,p=o.has("dependencies"),x=o.has("security"),v=o.has("optimization"),y=o.has("runtime"),N=(f,A)=>ut(pi(f,A),t),S=it(c),{packageManager:m}=Xe(c),E=Be(K(c,"package.json"),!1),O=st(c),M=new Set(E);for(const f of O){const A=Be(K(qe(c,f),"package.json"),!1);for(const I of A)M.add(I)}const P=Ot(c),R=Je(c,m),F=Qe(h?.security,{minimumScore:h?.security?.policies?.score?.minimum}),U=h?.security?.policies?.score?.minimum??et,ee=h?.security?.acceptedRisks,te=Vt(c,S.name),G={exclude:[],ignore:[],include:[],includeLocked:!1,includePrerelease:!1,security:!0,target:"latest"},X=p?Zt(c,S.name):[],_=v?Ht(M):[],b=v?Yt(M,te,S,!1):[],$=new Set(_.map(f=>f.packageName)),V=b.filter(f=>!$.has(f.packageName)),T=[..._,...V],ne=y?js(c):[];a&&(p&&a.startSection("dependencies",R.size>0?"checking outdated catalog dependencies":"scanning duplicates"),x&&a.startSection("security",s.length>0?`scanning ${String(s.length)} packages for advisories`:"no installed packages to scan"),v&&a.startSection("optimization","matching e18e + socket overrides"),y&&a.startSection("runtime","running runtime diagnostics")),a&&y&&a.completeSection("runtime",N("runtime",{duplicates:[],optimizations:[],outdated:[],runtime:ne}));const q=(p||x)&&R.size>0?ve(l,"outdated",()=>Pt(R,G,P,void 0,c,F,ee),(f,A)=>{const I=f.outdated.length;return{status:I>0?"warn":"ok",summary:I>0?`${String(I)} outdated · ${Y(A)}`:`up to date · ${Y(A)}`}}):Promise.resolve({checkedCount:0,failed:[],filteredByTarget:[],ignored:[],outdated:[]}),ce=x&&s.length>0?ve(l,"vulnerabilities",()=>Nt(s.map(f=>({name:f.name,version:f.version}))),(f,A)=>{let I=0;for(const se of f.values())I+=se.length;return{status:I>0?"error":"ok",summary:I>0?`${String(I)} found · ${Y(A)}`:`none found · ${Y(A)}`}}):Promise.resolve(new Map),L=x&&F.length>0&&s.length>0?ve(l,"socket",()=>Mt(F,s.map(f=>({name:f.name,version:f.version}))),(f,A)=>{let I=0,se=0;for(const Me of f.values())I+=Me.alerts.length,Me.score.overall<U&&(se+=1);const Ne=I+se;return{status:Ne>0?"warn":"ok",summary:Ne>0?`${String(I)} alert${I===1?"":"s"}, ${String(se)} low-score · ${Y(A)}`:`clean · ${Y(A)}`}}):Promise.resolve(new Map);let H,W,ae,de;const ue=q.catch(f=>(H=f instanceof Error?f.message:String(f),a||d.warn(`Outdated scan failed: ${H}`),{failed:[],ignored:[],outdated:[]})),w=ce.catch(f=>(W=f instanceof Error?f.message:String(f),a||d.warn(`Vulnerability scan failed: ${W}`),new Map)),g=L.catch(f=>(ae=f instanceof Error?f.message:String(f),a||d.warn(`Socket scan failed: ${ae}`),new Map)),k=a&&p?ue.then(f=>{if(H){a.failSection("dependencies",H);return}a.completeSection("dependencies",N("dependencies",{duplicates:X,optimizations:[],outdated:f.outdated,runtime:[]}))}):void 0,xe=a&&x?Promise.all([ue,w,g]).then(([f])=>{const A=H??W??ae;if(A){a.failSection("security",A);return}a.completeSection("security",N("security",{duplicates:[],optimizations:[],outdated:f.outdated,runtime:[]}))}):void 0,he=(async()=>{if(n&&v&&T.length>0&&await ve(l,"codemods",async()=>(await Wt(T),T),(f,A)=>{const I=f.filter(se=>se.hasCodemod||se.category==="socket").length;return{status:"ok",summary:`${String(I)} auto-fixable · ${Y(A)}`}}).catch(f=>{de=f instanceof Error?f.message:String(f)}),a&&v){if(de){a.failSection("optimization",de);return}a.completeSection("optimization",N("optimization",{duplicates:[],optimizations:T,outdated:[],runtime:[]}))}})(),[De,mt,gt]=await Promise.all([ue,w,g]);await Promise.all([k,xe,he]);let Oe=0,Pe=0;if(x&&F.length>0)for(const f of gt.values())Oe+=f.alerts.length,f.score.overall<U&&(Pe+=1);let Ee=0;if(x){for(const f of De.outdated)f.vulnerabilities&&f.vulnerabilities.length>0&&(Ee+=f.vulnerabilities.length);for(const f of mt.values())Ee+=f.length}return{duplicates:X,installedCount:s.length,optimizations:v?T:[],outdated:p?De.outdated:[],runtime:ne,sections:o,socketIssues:{alerts:Oe,lowScore:Pe},supplyChain:hi(h,{packageManager:m,workspaceRoot:c}),vulnCount:Ee,workspaceCount:O.length}},fi=e=>{switch(e){case"error":return be(D.failure);case"skip":return j(D.dash);case"warn":return Re(D.warning);default:return ge(D.success)}},le=(e,t)=>{const s=process.stderr.columns??80,l=Math.max(20,Math.min(s-2,60)),n=D.dash.repeat(2),o=`${fi(t)} ${oe(e)}`,a=o.replaceAll(/\[[0-9;]*m/g,"").length,h=Math.max(0,l-a-n.length-2);return`${n} ${o} ${j(D.dash.repeat(h))}`},Z=e=>` ${ge(D.success)} ${e}`,J=e=>` ${Re(D.warning)} ${e}`,Ie=e=>` ${be(D.failure)} ${e}`,ft=e=>` ${j(D.dash)} ${j(e)}`,Q=(e,t,s)=>{const l=`${oe(String(e))} ${j(t)}`;return s?`${l} ${j(`(${s})`)}`:l},mi=e=>{if(e.sections.has("dependencies")){if(d.log(""),d.log(le("Dependencies",ie(e,"dependencies"))),d.log(Z(Q(e.installedCount,"packages installed"))),e.outdated.length>0){const t=e.outdated.filter(o=>o.updateType==="major").length,s=e.outdated.filter(o=>o.updateType==="minor").length,l=e.outdated.filter(o=>o.updateType==="patch").length,n=[];t>0&&n.push(`${String(t)} major`),s>0&&n.push(`${String(s)} minor`),l>0&&n.push(`${String(l)} patch`),d.log(J(Q(e.outdated.length,"outdated",n.join(", "))))}else d.log(Z("All dependencies up to date"));e.duplicates.length>0?d.log(J(Q(e.duplicates.length,"packages with duplicate versions"))):d.log(Z("No duplicate dependencies"))}},gi=e=>{e.sections.has("security")&&(d.log(""),d.log(le("Security",ie(e,"security"))),e.vulnCount>0?d.log(Ie(Q(e.vulnCount,`vulnerabilit${e.vulnCount===1?"y":"ies"} found`))):d.log(Z("No known vulnerabilities")),e.socketIssues.alerts>0&&d.log(J(Q(e.socketIssues.alerts,`Socket.dev security alert${e.socketIssues.alerts===1?"":"s"}`))),e.socketIssues.lowScore>0&&d.log(J(Q(e.socketIssues.lowScore,`package${e.socketIssues.lowScore===1?"":"s"} with low security score`))),e.socketIssues.alerts===0&&e.socketIssues.lowScore===0&&e.vulnCount===0&&d.log(Z("No security issues detected")))},xi=e=>{if(!e.sections.has("optimization"))return;d.log(""),d.log(le("Optimization",ie(e,"optimization")));const t=pt(e.optimizations);if(t.total===0){d.log(Z("No optimizations available"));return}t.native>0&&d.log(J(Q(t.native,"replaceable with native APIs"))),t.preferred>0&&d.log(J(Q(t.preferred,"with lighter alternatives"))),t.micro>0&&d.log(J(Q(t.micro,"trivial micro-utilities"))),t.socket>0&&d.log(J(Q(t.socket,"@socketregistry overrides available")))},wi=e=>{d.log(""),d.log(le("Supply Chain",e.supplyChain.status));for(const t of e.supplyChain.findings){const s=t.severity==="ok"?Z(t.label):t.severity==="error"?Ie(t.label):J(t.label);d.log(s),t.detail&&d.log(` ${j(D.arrow)} ${j(t.detail)}`)}e.supplyChain.status!=="ok"&&d.log(` ${j(D.arrow)} ${j("Configure with security.* in vis.config.ts. See `vis check --security-config` for details.")}`)},ki=e=>{if(e.sections.has("runtime")){d.log(""),d.log(le("Runtime",ie(e,"runtime")));for(const t of e.runtime)t.status==="ok"?d.log(Z(t.message)):t.status==="skip"?d.log(ft(t.message)):d.log(J(t.message))}},yi=(e,t)=>{const s=e.vulnCount,l=e.runtime.filter(o=>o.status==="warn").length,n=e.outdated.length+e.duplicates.length+e.optimizations.length+l;if(t){if(s===0&&n===0)d.success(`Everything looks good! ${j(`(${Y(e.elapsedMs)})`)}`);else{const o=[];s>0&&o.push(be(`${String(s)} security`)),n>0&&o.push(Re(`${String(n)} improvement${n===1?"":"s"}`)),d.log(`${be(D.failure)} ${o.join(", ")} ${j(`(${Y(e.elapsedMs)})`)}`)}return}d.log(""),d.log(le("Summary","ok")),s===0&&n===0?d.success(`Everything looks good! ${j(`(${Y(e.elapsedMs)})`)}`):(s>0&&d.error(`${String(s)} security issue${s===1?"":"s"}`),n>0&&d.log(` ${ye(D.arrow)} ${oe(String(n))} ${j(`improvement${n===1?"":"s"} available`)} ${j(`(${Y(e.elapsedMs)})`)}`))},bi=e=>{const t=[];if(e.outdated.length>0&&t.push("vis update — update outdated dependencies"),(e.vulnCount>0||e.socketIssues.alerts>0)&&t.push("vis audit — detailed security analysis"),e.optimizations.length>0&&t.push("vis optimize — apply optimizations interactively"),e.duplicates.length>0&&t.push("vis dedupe — reduce duplicate versions"),t.length>0){d.log(""),d.log(oe("Next steps:"));for(const s of t)d.log(` ${j(D.arrow)} ${s}`)}d.log("")},ji=(e,t)=>{t||(mi(e),gi(e),xi(e),ki(e),wi(e)),yi(e,t)},vi=(e,t,s,l,n)=>{const o=[],a=e.has("dependencies"),h=e.has("security"),c=e.has("optimization");return(a||h)&&t>0&&o.push({id:"outdated",label:"Outdated catalog dependencies"}),h&&l>0&&o.push({id:"vulnerabilities",label:"Known vulnerabilities (OSV)"}),h&&s&&l>0&&o.push({id:"socket",label:"Socket.dev supply-chain reports"}),c&&n&&o.push({id:"codemods",label:"Codemod availability"}),o},Si=e=>{if(d.log(""),d.log(`${oe(ye("vis doctor"))} ${j("— project health check")}`),d.log(Z(`Detected ${e.packageManagerName} v${e.packageManagerVersion}`)),e.runtimeFindings.length===0)d.log(Z(`Node.js ${e.nodeVersion}`));else{for(const t of e.runtimeFindings){const s=t.severity==="error"?be:Re;d.log(Ie(`Runtime: ${s(t.message)}`))}d.log(` ${j(D.arrow)} Run ${ge("vis toolchain install")} to install pinned versions, or ${ge("vis toolchain status")} for the per-tool breakdown.`)}d.log("")},Wi=async({fs:e,logger:t,options:s,visConfig:l,visConfigError:n,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root.");const a=s.format==="json"||s.json,h=si(s.only,s.skip),c=!!s.quiet,p=s.progress===!1,x=ei(s.filter);if(h.size===0){d.error("No sections selected. Check your --only / --skip values."),process.exitCode=2;return}const v=Date.now(),y=it(o),N=Xt(o),S=!!process.stdout.isTTY,m=!a&&S&&!It&&!c&&!p;!a&&!m&&Si({nodeVersion:process.versions.node,packageManagerName:y.name,packageManagerVersion:y.version,runtimeFindings:N});const E=Je(o,Xe(o).packageManager),O=Jt(o,y.name),M=O.length,P=Qe(l?.security).length>0,R=l?.security?.policies?.score?.minimum??et,F=st(o);if(!a&&!c&&!m){const L=F.length>0?j(` · ${String(F.length)} workspace package${F.length===1?"":"s"}`):"";d.log(`${j("·")} ${j("Found")} ${oe(String(M))} ${j(`installed package${M===1?"":"s"}`)}${L}`)}const U=n?{hint:n.file?`Continuing with default settings — fix or regenerate ${n.file} (vis init --force).`:"Continuing with default settings.",message:n.message,severity:"error",title:n.file?`Failed to load ${n.file}`:"Failed to load vis.config"}:void 0,ee=Qt(o,y.name)?.file,te=ee?K(o,ee):void 0,G=_t(o),_=s.cache!==!1&&!s.fix?ls({configPath:G,lockfilePath:te,sections:h,socketEnabled:P,workspaceRoot:o}):void 0,b=_?cs(_):void 0,$=b!==void 0;let V,T;if(m){const L=b?new Ve({activeSections:h,findings:ut(ct(b),x)}):new Ve({activeSections:h}),H=Rt(Dt.createElement(Js,{banner:U,fromCache:$,startedAt:v,store:L}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0});try{V=b??await We({filterPatterns:x,installed:O,resolveCodemods:!!s.fix,sections:h,store:L,visConfig:l,workspaceRoot:o})}catch(W){throw H.unmount(),W}await H.waitUntilExit(),T=L.getSnapshot().pendingAction}else if(b)V=b;else{const L=vi(h,E.size,P,M,!!s.fix),W=qt(L,{live:!a&&!c&&!p});try{V=await We({filterPatterns:x,installed:O,progress:W,resolveCodemods:!!s.fix,sections:h,visConfig:l,workspaceRoot:o})}finally{W.stop()}}const ne={...V,elapsedMs:Date.now()-v};if(_&&!$)try{as(_,ne)}catch{}const B=ti(ne,x,R);if(a){process.stdout.write(`${JSON.stringify(ii(B,y.name),void 0,2)}
|
|
4
|
-
`
|
|
5
|
-
`),process.stdout.write(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`)
|
|
9
|
-
`)
|
|
10
|
-
`
|
|
1
|
+
import{createRequire as ne}from"node:module";import{j as b,q as k,F as p}from"../packem_shared/index.server-BAjDJSEu.js";import{U as x,$ as ce,e as l,a as L,b as le,v as pe}from"../packem_shared/index-DHD8wb6Z.js";import{p as n}from"./cli-main.js";import{o as Z,d as ue,n as de}from"../packem_shared/pm-runner-d93_73O6.js";import{g as fe}from"../packem_shared/_commonjsHelpers-DTfxOvZk.js";import{y as C}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{h as v,U as u}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{d as ye}from"../packem_shared/giget-D8Kwb0kD.js";import{p as W}from"../packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js";let ae;const oe=e=>(ae??=ne(import.meta.url))(e),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=e=>{if(typeof D<"u"&&D.versions&&D.versions.node){const[t,r]=D.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return D.getBuiltinModule(e)}return oe(e)},{spawnSync:se}=O("node:child_process"),{createInterface:me}=O("node:readline"),{readdirSync:ge,chmodSync:he}=O("node:fs"),ve={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},be=["https://github.com/","https://gitlab.com/","https://bitbucket.org/","https://raw.githubusercontent.com/","https://git.sr.ht/","git@github.com:","git@gitlab.com:","git@bitbucket.org:","git@git.sr.ht:","github:","gh:","gitlab:","bitbucket:","sourcehut:","git:","http://","https://"],we=e=>{for(const t of be)if(e.startsWith(t))return!0;return!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e)},ke=new Set(["sv"]),xe=e=>{if(ke.has(e)||e.startsWith("create-")||e.startsWith("@")&&e.includes("/create-"))return e;if(e.startsWith("@")){const t=e.indexOf("/");if(t!==-1){const r=e.slice(0,t),i=e.slice(t+1);return`${r}/create-${i}`}return e}return`create-${e}`},_e=(e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),i=ve[r];return i?{args:t,source:r,type:i}:we(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:xe(e),type:"remote:npm"}},$e=e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},H=["ability","able","about","above","abroad","absence","absolute","absolutely","absorb","academic","accept","access","accompany","accomplish","according","account","accurate","achieve","achievement","acid","acknowledge","acquire","across","act","action","active","activist","activity","actor","actress","actual","actually","adapt","add","addition","additional","address","adequate","adjust","adjustment","administration","administrator","admire","admission","admit","adolescent","adopt","adult","advance","advanced","advantage","adventure","advertising","advice","advise","adviser","advocate","affair","affect","afford","after","afternoon","again","against","age","agency","agenda","agent","ago","agree","agreement","agricultural","ahead","aid","aide","aim","air","aircraft","airline","airport","album","alive","all","alliance","allow","ally","almost","alone","along","already","also","alter","alternative","although","always","amazing","among","amount","analysis","analyst","analyze","ancient","and","angle","animal","anniversary","announce","annual","another","answer","anticipate","any","anybody","anymore","anyone","anything","anyway","anywhere","apart","apartment","apparent","apparently","appeal","appear","appearance","apple","application","apply","appoint","appointment","appreciate","approach","appropriate","approval","approve","approximately","architect","area","argue","argument","arise","arm","armed","around","arrange","arrangement","arrival","arrive","art","article","artist","artistic","aside","ask","asleep","aspect","assert","assess","assessment","asset","assign","assignment","assist","assistance","assistant","associate","association","assume","assumption","assure","athlete","athletic","atmosphere","attach","attempt","attend","attention","attitude","attorney","attract","attractive","attribute","audience","author","authority","auto","available","average","avoid","award","aware","awareness","away","awesome","baby","back","background","bag","bake","balance","ball","ban","band","bank","bar","barely","barrel","base","baseball","basic","basically","basis","basket","basketball","bathroom","battery","beach","bean","bear","beat","beautiful","beauty","because","become","bed","bedroom","beer","before","begin","beginning","behavior","behind","being","belief","believe","bell","belong","below","belt","bench","bend","beneath","benefit","beside","besides","best","bet","better","between","beyond","big","bike","bill","billion","bind","biological","bird","birth","birthday","bit","bite","black","blade","blanket","blind","block","blow","blue","board","boat","body","bond","bone","book","boom","boot","border","born","borrow","boss","both","bother","bottle","bottom","boundary","bowl","box","boy","boyfriend","brain","branch","brand","bread","break","breakfast","breast","breath","breathe","brick","bridge","brief","briefly","bright","brilliant","bring","broad","brother","brown","brush","buck","budget","build","building","bullet","bunch","bury","bus","business","busy","but","butter","button","buy","buyer","cabin","cabinet","cable","cake","calculate","call","camera","camp","campaign","campus","can","candidate","cap","capability","capable","capacity","capital","captain","capture","car","carbon","card","care","career","careful","carefully","carrier","carry","case","cash","cast","cat","catch","category","cause","ceiling","celebrate","celebration","celebrity","cell","center","central","century","ceremony","certain","certainly","chain","chair","chairman","challenge","chamber","champion","championship","chance","change","changing","channel","chapter","character","characteristic","characterize","charge","charity","chart","chase","cheap","check","cheek","cheese","chef","chemical","chest","chicken","chief","child","childhood","chip","chocolate","choice","cholesterol","choose","church","cigarette","circle","circumstance","cite","citizen","city","civil","civilian","claim","class","classic","classroom","clean","clear","clearly","client","climate","climb","clinic","clinical","clock","close","closely","closer","clothes","clothing","cloud","club","clue","cluster","coach","coal","coalition","coast","coat","code","coffee","cognitive","cold","colleague","collect","collection","collective","college","colonial","color","column","combination","combine","come","comedy","comfort","comfortable","command","commander","comment","commercial","commission","commit","commitment","committee","common","communicate","communication","community","company","compare","comparison","compete","competition","competitive","competitor","complete","completely","complex","complicated","component","compose","composition","comprehensive","computer","concentrate","concentration","concept","concern","concerned","concert","conclude","conclusion","concrete","condition","conduct","conference","confidence","confident","confirm","confront","confusion","congressional","connect","connection","consciousness","consensus","consequence","conservative","consider","considerable","consideration","consist","consistent","constant","constantly","constitute","constitutional","construct","construction","consultant","consume","consumer","consumption","contact","contain","container","contemporary","content","contest","context","continue","continued","contract","contrast","contribute","contribution","control","convention","conventional","conversation","convert","conviction","convince","cook","cookie","cooking","cool","cooperation","cop","cope","copy","core","corn","corner","corporate","corporation","correct","correspondent","cost","cotton","couch","could","council","counselor","count","counter","country","county","couple","courage","course","court","cousin","cover","coverage","cow","crack","craft","cream","create","creation","creative","creature","credit","crew","criteria","crop","cross","crowd","crucial","cultural","culture","cup","curious","current","currently","curriculum","custom","customer","cut","cycle","dad","daily","dance","dare","dark","darkness","data","date","daughter","day","deal","dealer","dear","debate","decade","decide","decision","deck","declare","decrease","deep","deeply","deer","defend","defendant","defense","defensive","define","definitely","definition","degree","delay","deliver","delivery","demand","democracy","democratic","demonstrate","demonstration","deny","department","depend","dependent","depending","depict","depth","deputy","derive","describe","description","desert","deserve","design","designer","desire","desk","desperate","despite","detail","detailed","detect","determine","develop","developing","development","device","devote","dialogue","diet","differ","difference","different","differently","difficult","difficulty","dig","digital","dimension","dining","dinner","direct","direction","directly","director","disability","disagree","disappear","discipline","discourse","discover","discovery","discuss","discussion","dish","dismiss","display","distance","distant","distinct","distinction","distinguish","distribute","distribution","district","diverse","diversity","divide","division","doctor","document","dog","domestic","dominant","dominate","door","double","down","downtown","dozen","draft","drag","drama","dramatic","dramatically","draw","drawing","dream","dress","drink","drive","driver","drop","dry","due","during","dust","duty","each","eager","ear","early","earn","earnings","earth","ease","easily","east","eastern","easy","eat","economic","economics","economist","economy","edge","edition","editor","educate","education","educational","educator","effect","effective","effectively","efficiency","efficient","effort","egg","eight","either","elderly","elect","election","electric","electricity","electronic","element","elementary","eliminate","elite","else","elsewhere","embrace","emerge","emission","emotion","emotional","emphasis","emphasize","employ","employee","employer","employment","empty","enable","encounter","encourage","end","energy","enforcement","engage","engine","engineer","engineering","enhance","enjoy","enormous","enough","ensure","enter","enterprise","entertainment","entire","entirely","entrance","entry","environment","environmental","episode","equal","equally","equipment","era","escape","especially","essay","essential","essentially","establish","establishment","estate","estimate","etc","ethics","ethnic","evaluate","evaluation","even","evening","event","eventually","ever","every","everybody","everyday","everyone","everything","everywhere","evidence","evolution","evolve","exact","exactly","examination","examine","example","exceed","excellent","except","exception","exchange","exciting","executive","exercise","exhibit","exhibition","exist","existence","existing","expand","expansion","expect","expectation","expense","expensive","experience","experiment","expert","explain","explanation","explore","expose","express","expression","extend","extension","extensive","extent","external","extra","extraordinary","extreme","extremely","eye","fabric","face","facility","fact","factor","factory","faculty","fade","fair","fairly","faith","fall","false","familiar","family","famous","fan","fantasy","far","farm","farmer","fashion","fast","fate","father","favor","favorite","feature","federal","fee","feed","feel","feeling","fellow","female","fence","few","fewer","fiber","fiction","field","fifteen","fifth","fifty","figure","file","fill","film","final","finally","finance","financial","find","finding","fine","finger","finish","firm","first","fish","fishing","fit","fitness","five","fix","flag","flame","flat","flavor","flesh","flight","float","floor","flow","flower","fly","focus","folk","follow","following","food","foot","football","for","force","foreign","forest","forever","forget","form","formal","formation","former","formula","forth","fortune","forward","found","foundation","founder","four","fourth","frame","framework","free","freedom","freeze","frequency","frequent","frequently","fresh","friend","friendly","friendship","from","front","fruit","fuel","full","fully","fun","function","fund","fundamental","funding","funeral","funny","furniture","furthermore","future","gain","galaxy","gallery","game","gap","garage","garden","garlic","gas","gate","gather","gaze","gear","gender","gene","general","generally","generate","generation","genetic","gentleman","gently","gesture","get","ghost","giant","gift","gifted","girl","girlfriend","give","given","glad","glance","glass","global","glove","goal","gold","golden","golf","good","government","governor","grab","grade","gradually","graduate","grain","grand","grandfather","grandmother","grant","grass","grave","gray","great","greatest","green","grocery","ground","group","grow","growing","growth","guarantee","guard","guess","guest","guide","guideline","guy","habit","habitat","hair","half","hall","hand","handful","handle","hang","happen","happy","hard","hardly","hat","have","head","headline","headquarters","health","healthy","hear","hearing","heart","heat","heaven","heavily","heavy","heel","height","helicopter","hello","help","helpful","here","heritage","hero","herself","hey","hide","high","highlight","highly","highway","hill","himself","hip","hire","historian","historic","historical","history","hit","hold","hole","holiday","holy","home","honest","honey","honor","hope","horizon","horse","hospital","host","hot","hotel","hour","house","household","housing","how","however","huge","human","humor","hundred","hungry","hunter","hunting","husband","hypothesis","ice","idea","ideal","identification","identify","identity","ignore","illustrate","image","imagination","imagine","immediate","immediately","immigrant","immigration","impact","implement","implication","imply","importance","important","impose","impossible","impress","impression","impressive","improve","improvement","incentive","incident","include","including","income","incorporate","increase","increased","increasing","increasingly","incredible","indeed","independence","independent","index","indicate","indication","individual","industrial","industry","infant","inflation","influence","inform","information","ingredient","initial","initially","initiative","inner","innocent","inquiry","inside","insight","insist","inspire","install","instance","instead","institution","institutional","instruction","instructor","instrument","insurance","intellectual","intelligence","intend","intense","intensity","intention","interaction","interest","interested","interesting","internal","international","interpret","interpretation","intervention","interview","into","introduce","introduction","invest","investigate","investigation","investigator","investment","investor","invite","involve","involved","involvement","iron","island","issue","item","its","itself","jacket","jet","job","join","joint","joke","journal","journalist","journey","joy","judge","judgment","juice","jump","junior","jury","just","justice","justify","keep","key","kick","kid","kind","king","kiss","kitchen","knee","knife","knock","know","knowledge","lab","label","labor","laboratory","lady","lake","land","landscape","language","lap","large","largely","last","late","later","latter","laugh","launch","law","lawn","lawsuit","lawyer","lay","layer","lead","leader","leadership","leading","leaf","league","lean","learn","learning","least","leather","leave","left","leg","legacy","legal","legend","legislation","legitimate","lemon","length","less","lesson","let","letter","level","liberal","library","license","lie","life","lifestyle","lifetime","lift","light","like","likely","limit","limitation","limited","line","link","lip","list","listen","literally","literary","literature","little","live","living","load","loan","local","locate","location","lock","long","look","loose","lose","lost","lot","lots","loud","love","lovely","lover","low","lower","luck","lucky","lunch","lung","machine","magazine","mail","main","mainly","maintain","maintenance","major","majority","make","maker","makeup","male","mall","man","manage","management","manager","manner","manufacturer","manufacturing","many","map","margin","mark","market","marketing","marriage","married","marry","mask","mass","massive","master","match","material","math","matter","may","maybe","mayor","meal","mean","meaning","meanwhile","measure","measurement","meat","mechanism","media","medical","medication","medicine","medium","meet","meeting","member","membership","memory","mental","mention","menu","mere","merely","message","metal","meter","method","middle","might","military","milk","million","mind","mine","minister","minor","minority","minute","miracle","mirror","miss","missile","mission","mix","mixture","mode","model","moderate","modern","modest","mom","moment","money","monitor","month","mood","moon","moral","more","moreover","morning","mortgage","most","mostly","mother","motion","motivation","motor","mount","mountain","mouse","mouth","move","movement","movie","much","multiple","muscle","museum","music","musical","musician","must","mutual","myself","mystery","myth","naked","name","narrative","narrow","nation","national","native","natural","naturally","nature","near","nearby","nearly","necessarily","necessary","neck","need","negative","negotiate","negotiation","neighbor","neighborhood","neither","nerve","net","network","never","nevertheless","new","newly","news","newspaper","next","nice","night","nine","nobody","nod","nomination","none","nonetheless","nor","normal","normally","north","northern","nose","not","note","nothing","notice","notion","novel","now","nowhere","nuclear","number","numerous","nurse","nut","object","objective","obligation","observation","observe","observer","obtain","obvious","obviously","occasion","occasionally","occupation","occupy","occur","ocean","odd","odds","off","offer","office","officer","official","often","oil","okay","old","once","one","ongoing","onion","online","only","onto","open","opening","operate","operating","operation","operator","opinion","opponent","opportunity","oppose","opposite","opposition","option","orange","order","ordinary","organic","organization","organize","orientation","origin","original","originally","other","others","otherwise","ought","our","ourselves","out","outcome","outside","oven","over","overall","overcome","overlook","owe","own","owner","pace","pack","package","page","paint","painter","painting","pair","pale","palm","pan","panel","pant","paper","parent","park","parking","part","participant","participate","participation","particular","particularly","partly","partner","partnership","party","pass","passage","passenger","passion","past","patch","path","patient","pattern","pause","pay","payment","peace","peak","peer","people","pepper","per","perceive","percentage","perception","perfect","perfectly","perform","performance","perhaps","period","permanent","permission","permit","person","personal","personality","personally","personnel","perspective","persuade","pet","phase","phenomenon","philosophy","phone","photo","photograph","photographer","phrase","physical","physically","physician","piano","pick","picture","pie","piece","pile","pilot","pine","pink","pipe","pitch","place","plan","plane","planet","planning","plant","plastic","plate","platform","play","player","please","pleasure","plenty","plot","plus","pocket","poem","poet","poetry","point","pole","police","policy","political","politically","politician","politics","poll","pool","pop","popular","population","porch","port","portion","portrait","portray","pose","position","positive","possess","possibility","possible","possibly","post","pot","potato","potential","potentially","pound","pour","powder","power","powerful","practical","practice","pray","prayer","precisely","predict","prefer","preference","pregnancy","pregnant","preparation","prepare","prescription","presence","present","presentation","preserve","president","presidential","press","pretend","pretty","prevent","previous","previously","price","pride","priest","primarily","primary","prime","principal","principle","print","prior","priority","privacy","private","probably","procedure","proceed","process","produce","producer","product","production","profession","professional","professor","profile","profit","program","progress","project","prominent","promise","promote","prompt","proof","proper","properly","property","proportion","proposal","propose","proposed","prosecutor","prospect","protect","protection","protein","protest","proud","prove","provide","provider","province","provision","psychological","psychologist","psychology","public","publication","publicly","publish","publisher","pull","purchase","pure","purpose","pursue","push","put","qualify","quality","quarter","quarterback","question","quick","quickly","quiet","quietly","quit","quite","quote","race","racial","radical","radio","rail","rain","raise","range","rank","rapid","rapidly","rare","rarely","rate","rather","rating","ratio","raw","reach","react","reaction","read","reader","reading","ready","real","reality","realize","really","reason","reasonable","recall","receive","recent","recently","recipe","recognition","recognize","recommend","recommendation","record","recording","recover","recovery","recruit","red","reduce","reduction","refer","reference","reflect","reflection","reform","refugee","refuse","regard","regarding","regardless","regime","region","regional","register","regular","regularly","regulate","regulation","reinforce","relate","relation","relationship","relative","relatively","relax","release","relevant","relief","religion","religious","rely","remain","remaining","remarkable","remember","remind","remote","remove","repeat","repeatedly","replace","reply","report","reporter","represent","representation","representative","reputation","request","require","requirement","research","researcher","resemble","reservation","resident","resist","resolution","resolve","resort","resource","respect","respond","respondent","response","responsibility","responsible","rest","restaurant","restore","restriction","result","retain","retire","retirement","return","reveal","revenue","review","revolution","rhythm","rice","rich","rid","ride","rifle","right","ring","rise","river","road","rock","role","roll","romantic","roof","room","root","rope","rose","roughly","round","route","routine","row","rub","rule","run","running","rural","rush","sacred","safe","safety","sake","salad","salary","sale","sales","salt","same","sample","sanction","sand","satellite","satisfaction","satisfy","sauce","save","saving","say","scale","scenario","scene","schedule","scheme","scholar","scholarship","school","science","scientific","scientist","scope","score","screen","script","sea","search","season","seat","second","secret","secretary","section","sector","secure","security","see","seed","seek","seem","segment","seize","select","selection","self","sell","senator","send","senior","sense","sensitive","sentence","separate","sequence","series","serious","seriously","serve","service","session","set","setting","settle","settlement","seven","several","shade","shadow","shake","shall","shape","share","sharp","sheet","shelf","shell","shelter","shift","shine","ship","shirt","shoe","shop","shopping","shore","short","shortly","shot","should","shoulder","shout","show","shower","shrug","shut","side","sigh","sight","sign","signal","significance","significant","significantly","silence","silent","silver","similar","similarly","simple","simply","since","sing","singer","single","sink","sir","sister","sit","site","situation","six","size","ski","skill","skin","sky","sleep","slice","slide","slight","slightly","slip","slow","slowly","small","smart","smell","smile","smooth","snap","snow","soccer","social","society","soft","software","soil","solar","solid","solution","solve","some","somebody","somehow","someone","something","sometimes","somewhat","somewhere","son","song","soon","sophisticated","sorry","sort","soul","sound","soup","source","south","southern","space","speak","speaker","special","specialist","species","specific","specifically","speech","speed","spend","spending","spin","spirit","spiritual","split","spokesman","sport","spot","spread","spring","square","squeeze","stability","stable","staff","stage","stair","stake","stand","standard","standing","star","stare","start","state","statement","station","statistics","status","stay","steady","steal","steel","step","stick","still","stir","stock","stomach","stone","stop","storage","store","storm","story","straight","strange","stranger","strategic","strategy","stream","street","strength","strengthen","stretch","string","strip","strong","strongly","structure","student","studio","study","stuff","style","subject","submit","subsequent","substance","substantial","succeed","success","successful","successfully","such","sudden","suddenly","sue","sufficient","sugar","suggest","suggestion","suit","summer","summit","sun","super","supply","support","supporter","suppose","supposed","sure","surely","surface","surgery","surprise","surprised","surprising","surprisingly","surround","survey","survival","survive","survivor","sustain","swear","sweep","sweet","swim","swing","switch","symbol","system","table","tablespoon","tactic","tail","take","tale","talent","talk","tall","tank","tap","tape","target","task","taste","tax","taxpayer","tea","teach","teacher","teaching","team","tear","teaspoon","technical","technique","technology","teen","teenager","telephone","telescope","television","tell","temperature","temporary","ten","tend","tendency","tennis","tent","term","terms","territory","test","testify","testimony","testing","text","than","thank","thanks","that","the","theater","their","them","theme","themselves","then","theory","therapy","there","therefore","thick","thin","thing","think","thinking","third","thirty","though","thought","thousand","three","throat","through","throughout","throw","ticket","tie","tight","time","tiny","tip","tire","tired","tissue","title","today","toe","together","tomato","tomorrow","tone","tongue","tonight","too","tool","tooth","top","topic","toss","total","totally","touch","tough","tour","tourist","tournament","tower","town","toy","trace","track","trade","tradition","traditional","traffic","trail","train","training","transfer","transform","transformation","transition","translate","transportation","travel","treat","treatment","treaty","tree","tremendous","trend","trial","tribe","trip","troop","truck","true","truly","trust","truth","try","tube","tunnel","turn","twelve","twenty","twice","twin","two","type","typical","typically","ultimate","ultimately","unable","uncle","under","undergo","understand","understanding","unfortunately","uniform","union","unique","unit","universal","universe","university","unknown","unless","unlike","unlikely","until","unusual","upon","upper","urban","urge","use","used","useful","user","usual","usually","utility","vacation","valley","valuable","value","variable","variation","variety","various","vary","vast","vegetable","vehicle","venture","version","versus","very","vessel","veteran","via","victory","video","view","viewer","village","virtually","virtue","visible","vision","visit","visitor","visual","vital","voice","volume","volunteer","vote","voter","wage","wait","wake","walk","wall","wander","want","warm","warn","warning","wash","watch","water","wave","way","wealth","wealthy","wear","weather","wedding","week","weekend","weekly","weigh","weight","welcome","welfare","well","west","western","wet","what","whatever","wheel","when","whenever","where","whereas","whether","which","while","whisper","white","who","whole","whom","whose","why","wide","widely","widespread","wife","wild","will","willing","win","wind","window","wine","wing","winner","winter","wipe","wire","wisdom","wise","wish","with","withdraw","within","without","witness","woman","wonder","wonderful","wood","wooden","word","work","worker","working","works","workshop","world","worried","worth","would","wrap","write","writer","writing","yard","yeah","year","yell","yellow","yes","yesterday","yield","young","your","yours","yourself","youth","zone"],je=(e,t)=>Math.floor(e+Math.random()*(t-e+1));function K(){return H[je(0,H.length-1)]}const Ce=()=>`${K()}-${K()}`;var P,Y;function Ie(){return Y||(Y=1,P=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"]),P}var A,Q;function Se(){if(Q)return A;Q=1;const e=Ie();var t=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),r=["node_modules","favicon.ico"];function i(o){var s=[],c=[];if(o===null)return c.push("name cannot be null"),a(s,c);if(o===void 0)return c.push("name cannot be undefined"),a(s,c);if(typeof o!="string")return c.push("name must be a string"),a(s,c);if(o.length||c.push("name length must be greater than zero"),o.startsWith(".")&&c.push("name cannot start with a period"),o.startsWith("-")&&c.push("name cannot start with a hyphen"),o.match(/^_/)&&c.push("name cannot start with an underscore"),o.trim()!==o&&c.push("name cannot contain leading or trailing spaces"),r.forEach(function(_){o.toLowerCase()===_&&c.push(_+" is not a valid package name")}),e.includes(o.toLowerCase())&&s.push(o+" is a core module name"),o.length>214&&s.push("name can no longer contain more than 214 characters"),o.toLowerCase()!==o&&s.push("name can no longer contain capital letters"),/[~'!()*]/.test(o.split("/").slice(-1)[0])&&s.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(o)!==o){var f=o.match(t);if(f){var y=f[1],w=f[2];if(w.startsWith(".")&&c.push("name cannot start with a period"),encodeURIComponent(y)===y&&encodeURIComponent(w)===w)return a(s,c)}c.push("name can only contain URL-friendly characters")}return a(s,c)}var a=function(o,s){var c={validForNewPackages:s.length===0&&o.length===0,validForOldPackages:s.length===0,warnings:o,errors:s};return c.warnings.length||delete c.warnings,c.errors.length||delete c.errors,c};return A=i,A}var De=Se();const Ee=fe(De),ee=e=>e?Ee(e).validForNewPackages:!1,T=e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),Te=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),te=e=>C(e)?ge(e).every(r=>Te.has(r)):!0,qe=(e,t)=>{const r=x(t,e);return{packageName:T(ce(r)),targetDir:r}},Ne=e=>te(e),E=(e,t)=>new Promise(r=>{e.question(t,i=>{r(i.trim())})}),R=async(e,t,r=!0)=>{const a=await E(e,` ${t} ${p(r?"[Y/n]":"[y/N]")} `);return a===""?r:a.toLowerCase()==="y"||a.toLowerCase()==="yes"},X=async(e,t,r)=>{process.stderr.write(` ${t}
|
|
2
|
+
`);for(const[i,a]of r.entries()){const o=b(k(` ${String(i+1)}.`)),s=a.hint?p(` — ${a.hint}`):"";process.stderr.write(`${o} ${a.label}${s}
|
|
3
|
+
`)}for(;;){const i=await E(e,`
|
|
4
|
+
${p(`Enter choice (1-${String(r.length)}):`)} `),a=Number.parseInt(i,10);if(a>=1&&a<=r.length)return r[a-1].value;const o=r.find(s=>s.value===i||s.label.toLowerCase()===i.toLowerCase());if(o)return o.value;process.stderr.write(` ${p("Invalid choice. Try again.")}
|
|
5
|
+
`)}},Pe=async e=>{const t=me({input:process.stdin,output:process.stdout});try{process.stderr.write(`
|
|
6
|
+
${b(k("vis create"))} ${p("— project scaffolding")}
|
|
7
|
+
|
|
8
|
+
`);const r=e.inMonorepo?[{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}]:[{hint:"Full workspace setup",label:"Vis Monorepo",value:"vis:monorepo"},{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}];let i=await X(t,"Select a template:",r);if(i==="__custom__"&&(i=await E(t,`
|
|
9
|
+
${p("Template (npm package or GitHub URL):")} `),!i))throw new Error("No template specified.");const a=Ce(),s=await E(t,`
|
|
10
|
+
${p(`Project name (${a}):`)} `)||a;if(!ee(T(s)))throw new Error(`Invalid project name: "${s}". Must be a valid npm package name.`);const c=T(s),y=await E(t,` ${p(`Target directory (${c}):`)} `)||c;let w=!1;const _=x(e.cwd,y);if(!te(_)&&(w=await R(t,`Directory "${y}" is not empty. Overwrite?`,!1),!w))throw new Error("Aborted — directory not empty.");let m;e.inMonorepo||(e.defaultPm?(m=e.defaultPm,process.stderr.write(` ${p(`Package manager: ${m} (from config)`)}
|
|
11
|
+
`)):m=await X(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let g=!1;e.inMonorepo||(g=await R(t,"Initialize a git repository?",e.defaultGitInit??!1));const d=e.defaultEditor==="vscode",$=await R(t,"Generate VS Code configuration?",d)?"vscode":void 0;return process.stderr.write(`
|
|
12
|
+
`),{editor:$,gitInit:g,overwrite:w,pm:m,projectName:s,targetDir:y,template:i}}finally{t.close()}},Ae=(e,t)=>{n.info("Scaffolding application via create-vite...");const i=[L(t.cwd,t.targetDir)||".",...e.args];return i.includes("--no-immediate")||i.push("--no-immediate"),Z(t.pm,{additionalPackages:[],args:i,package:"create-vite",shellMode:!1,silent:!1},t.cwd,t.logger)},Re=e=>`${JSON.stringify({devDependencies:{typescript:"^5.0.0",vitest:"^3.0.0"},exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},files:["dist"],main:"./dist/index.js",name:e,scripts:{build:"tsc",dev:"tsc --watch",test:"vitest run","test:watch":"vitest"},type:"module",types:"./dist/index.d.ts",version:"0.0.1"},null,4)}
|
|
13
|
+
`,Oe=()=>`${JSON.stringify({compilerOptions:{declaration:!0,declarationMap:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,sourceMap:!0,strict:!0,target:"ES2022"},include:["src/**/*"]},null,4)}
|
|
14
|
+
`,Le=e=>`/**
|
|
15
|
+
* ${e} — library entry point.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export const greet = (name: string): string => \`Hello from ${e}, \${name}!\`;
|
|
19
|
+
`,ze=e=>`import { describe, expect, it } from "vitest";
|
|
20
|
+
|
|
21
|
+
import { greet } from "../src/index";
|
|
22
|
+
|
|
23
|
+
describe("${e}", () => {
|
|
24
|
+
it("should greet", () => {
|
|
25
|
+
expect(greet("world")).toBe("Hello from ${e}, world!");
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
`,Me=(e,t)=>{const{projectName:r,targetDir:i}=t;return n.info("Scaffolding library package..."),v(i),v(l(i,"src")),v(l(i,"__tests__")),u(l(i,"package.json"),Re(r)),n.success("Created package.json"),u(l(i,"tsconfig.json"),Oe()),n.success("Created tsconfig.json"),u(l(i,"src","index.ts"),Le(r)),n.success("Created src/index.ts"),u(l(i,"__tests__","index.test.ts"),ze(r)),n.success("Created __tests__/index.test.ts"),u(l(i,".gitignore"),`node_modules/
|
|
29
|
+
dist/
|
|
30
|
+
.env
|
|
31
|
+
.DS_Store
|
|
32
|
+
`),n.success("Created .gitignore"),0},Ue=(e,t)=>{switch(e.type){case"builtin:app":return Ae(e,t);case"builtin:library":return Me(e,t);default:throw new Error(`Unknown built-in template type: ${e.type}`)}},Ge=(e,t)=>`${JSON.stringify({bin:{[e]:"./bin/index.js"},description:t,devDependencies:{typescript:"^5.0.0"},name:e,private:!0,scripts:{build:"tsc",dev:"tsc --watch"},type:"module",version:"0.0.1"},null,4)}
|
|
33
|
+
`,Fe=e=>`#!/usr/bin/env node
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* ${e} — code generator
|
|
37
|
+
*
|
|
38
|
+
* Usage: npx ${e} [options]
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
console.log("Hello from ${e}!");
|
|
42
|
+
`,Be=()=>`${JSON.stringify({compilerOptions:{declaration:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,strict:!0,target:"ES2022"},include:["src/**/*","bin/**/*"]},null,4)}
|
|
43
|
+
`,Je=()=>`/**
|
|
44
|
+
* Generator core logic — export functions used by the CLI entry point.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export const generate = (): void => {
|
|
48
|
+
// TODO: Implement your generator logic here
|
|
49
|
+
};
|
|
50
|
+
`,Ve=(e,t="")=>{const{projectName:r,targetDir:i}=e;n.info("Scaffolding code generator..."),v(i),v(l(i,"bin")),v(l(i,"src")),u(l(i,"package.json"),Ge(r,t||`Code generator: ${r}`)),n.success("Created package.json");const a=l(i,"bin","index.js");return u(a,Fe(r)),he(a,493),n.success("Created bin/index.js (executable)"),u(l(i,"tsconfig.json"),Be()),n.success("Created tsconfig.json"),u(l(i,"src","index.ts"),Je()),n.success("Created src/index.ts"),0},We=e=>`${JSON.stringify({devDependencies:{"@visulima/vis":"latest"},name:e,packageManager:"pnpm@latest",private:!0,scripts:{build:"vis run build",dev:"vis run dev",lint:"vis run lint",test:"vis run test"},type:"module",version:"0.0.0"},null,4)}
|
|
51
|
+
`,He=()=>`packages:
|
|
52
|
+
- "apps/*"
|
|
53
|
+
- "packages/*"
|
|
54
|
+
`,Ke=()=>`# Dependencies
|
|
55
|
+
node_modules/
|
|
56
|
+
|
|
57
|
+
# Build output
|
|
58
|
+
dist/
|
|
59
|
+
.output/
|
|
60
|
+
|
|
61
|
+
# Environment
|
|
62
|
+
.env
|
|
63
|
+
.env.local
|
|
64
|
+
.env.*.local
|
|
65
|
+
|
|
66
|
+
# IDE
|
|
67
|
+
.vscode/*
|
|
68
|
+
!.vscode/settings.json
|
|
69
|
+
!.vscode/extensions.json
|
|
70
|
+
.idea/
|
|
71
|
+
|
|
72
|
+
# OS
|
|
73
|
+
.DS_Store
|
|
74
|
+
Thumbs.db
|
|
75
|
+
|
|
76
|
+
# Logs
|
|
77
|
+
*.log
|
|
78
|
+
npm-debug.log*
|
|
79
|
+
pnpm-debug.log*
|
|
80
|
+
|
|
81
|
+
# Cache
|
|
82
|
+
.turbo/
|
|
83
|
+
.cache/
|
|
84
|
+
`,Ye=()=>`root = true
|
|
85
|
+
|
|
86
|
+
[*]
|
|
87
|
+
indent_style = space
|
|
88
|
+
indent_size = 4
|
|
89
|
+
end_of_line = lf
|
|
90
|
+
charset = utf-8
|
|
91
|
+
trim_trailing_whitespace = true
|
|
92
|
+
insert_final_newline = true
|
|
93
|
+
|
|
94
|
+
[*.{yml,yaml}]
|
|
95
|
+
indent_size = 2
|
|
96
|
+
|
|
97
|
+
[*.md]
|
|
98
|
+
trim_trailing_whitespace = false
|
|
99
|
+
`,Qe=e=>`# ${e}
|
|
100
|
+
|
|
101
|
+
A monorepo powered by [vis](https://visulima.com/packages/vis).
|
|
102
|
+
|
|
103
|
+
## Getting Started
|
|
104
|
+
|
|
105
|
+
\`\`\`bash
|
|
106
|
+
# Install dependencies
|
|
107
|
+
pnpm install
|
|
108
|
+
|
|
109
|
+
# Run all apps in development mode
|
|
110
|
+
pnpm dev
|
|
111
|
+
|
|
112
|
+
# Build all packages
|
|
113
|
+
pnpm build
|
|
114
|
+
|
|
115
|
+
# Run tests
|
|
116
|
+
pnpm test
|
|
117
|
+
\`\`\`
|
|
118
|
+
|
|
119
|
+
## Structure
|
|
120
|
+
|
|
121
|
+
\`\`\`
|
|
122
|
+
├── apps/ # Applications
|
|
123
|
+
├── packages/ # Shared packages & libraries
|
|
124
|
+
├── pnpm-workspace.yaml
|
|
125
|
+
└── package.json
|
|
126
|
+
\`\`\`
|
|
127
|
+
`,Xe=e=>{const{projectName:t,targetDir:r}=e;return n.info("Scaffolding monorepo workspace..."),v(r),v(l(r,"apps")),v(l(r,"packages")),u(l(r,"package.json"),We(t)),n.success("Created package.json"),u(l(r,"pnpm-workspace.yaml"),He()),n.success("Created pnpm-workspace.yaml"),u(l(r,".gitignore"),Ke()),n.success("Created .gitignore"),u(l(r,".editorconfig"),Ye()),n.success("Created .editorconfig"),u(l(r,"README.md"),Qe(t)),n.success("Created README.md"),u(l(r,"apps",".gitkeep"),""),u(l(r,"packages",".gitkeep"),""),0},Ze={"create-nuxt":{monoArgs:["--no-gitInit"]},"create-vite":{args:["--no-immediate"]},sv:{args:["--no-install"],prependCommand:"create"}},et=(e,t,r)=>{const i=Ze[e];if(!i)return t;const a=[...t];if(i.prependCommand&&!a.includes(i.prependCommand)&&a.unshift(i.prependCommand),i.args)for(const o of i.args)a.includes(o)||a.push(o);if(r&&i.monoArgs)for(const o of i.monoArgs)a.includes(o)||a.push(o);return a},tt=(e,t)=>{const r=L(t.cwd,t.targetDir)||".",i=[...e.args];i.includes(r)||i.unshift(r);const a=et(e.source,i,t.inMonorepo);return n.info(`Running ${e.source} via ${t.pm.name} dlx...`),Z(t.pm,{additionalPackages:[],args:a,package:e.source,shellMode:!1,silent:!1},t.cwd,t.logger)},rt=async(e,t)=>{const{createConfig:r}=t;n.info(`Downloading template from ${e.source}...`);try{const i=await ye(e.source,{auth:r?.auth||process.env.GIGET_AUTH||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,dir:t.targetDir,force:!0,preferOffline:r?.preferOffline,provider:r?.defaultProvider,registry:r?.registry});return n.info(`Downloaded to ${i.dir}`),0}catch(i){const a=i instanceof Error?i.message:String(i);return n.warn(`Failed to download template: ${a}`),1}},it=async(e,t)=>{switch(e.type){case"builtin:app":case"builtin:library":return Ue(e,t);case"builtin:generator":return Ve(t);case"builtin:monorepo":return Xe(t);case"remote:git":return rt(e,t);case"remote:npm":return tt(e,t);default:throw new Error(`Unknown template type: ${e.type}`)}},nt=e=>{const t=l(e,".vscode");v(t);const r=l(t,"settings.json"),i={"editor.defaultFormatter":"oxc.oxc-vscode","editor.formatOnSave":!0};if(C(r))try{const s=W(r);u(r,`${JSON.stringify({...i,...s},null,4)}
|
|
128
|
+
`),n.success("Merged .vscode/settings.json")}catch{n.warn("Could not merge .vscode/settings.json, skipping")}else u(r,`${JSON.stringify(i,null,4)}
|
|
129
|
+
`),n.success("Created .vscode/settings.json");const a=l(t,"extensions.json"),o={recommendations:["oxc.oxc-vscode"]};if(C(a))try{const s=W(a);u(a,`${JSON.stringify({...s,recommendations:[...new Set([...s.recommendations||[],...o.recommendations])]},null,4)}
|
|
130
|
+
`),n.success("Merged .vscode/extensions.json")}catch{n.warn("Could not merge .vscode/extensions.json, skipping")}else u(a,`${JSON.stringify(o,null,4)}
|
|
131
|
+
`),n.success("Created .vscode/extensions.json")},at=(e,t)=>{const r=l(e,".ai");v(r);const i=l(r,"instructions");if(C(i))return;const a=`# Project Instructions
|
|
132
|
+
|
|
133
|
+
This project was scaffolded with vis create.
|
|
134
|
+
|
|
135
|
+
## Development
|
|
136
|
+
|
|
137
|
+
- Package manager: ${t}
|
|
138
|
+
- Build: \`${t} run build\`
|
|
139
|
+
- Test: \`${t} run test\`
|
|
140
|
+
- Lint: \`${t} run lint\`
|
|
141
|
+
|
|
142
|
+
## Conventions
|
|
143
|
+
|
|
144
|
+
- Use TypeScript strict mode
|
|
145
|
+
- ESM modules (\`"type": "module"\`)
|
|
146
|
+
- Follow Angular-style conventional commits
|
|
147
|
+
`;u(i,a),n.success("Created .ai/instructions")},ot=e=>{se("git",["init"],{cwd:e,stdio:"pipe"}).status===0?n.success("Initialized git repository"):n.warn("Failed to initialize git repository")},st=(e,t,r,i=!1)=>(n.info("Installing dependencies..."),de(t,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:!1,lockfileOnly:!1,noOptional:!1,offline:i,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},e,r)===0?(n.success("Dependencies installed"),!0):(n.warn("Dependency installation failed (you can run install manually)"),!1)),ct=e=>{const o=e.split("#")[0].split("?")[0].replace(/\/+$/,"").replace(/\.git$/,"").split("/").filter(Boolean).at(-1)??"",s=o.includes(":")?o.split(":").pop()??o:o;return T(s)||"my-project"},lt=e=>{if(n.info(""),n.info(" Built-in templates:"),n.info(` ${b(k("vis:monorepo"))} ${p("Full pnpm workspace setup")}`),n.info(` ${b(k("vis:app"))} ${p("Application scaffold via create-vite")}`),n.info(` ${b(k("vis:library"))} ${p("Reusable TypeScript library package")}`),n.info(` ${b(k("vis:generator"))} ${p("Code generator scaffold with bin entry")}`),e&&Object.keys(e).length>0){n.info(""),n.info(" Config aliases (vis.config.ts → create.templates):");for(const[t,r]of Object.entries(e))n.info(` ${b(k(t))}${" ".repeat(Math.max(1,16-t.length))}${p(r)}`)}n.info(""),n.info(" Remote templates:"),n.info(` ${p("Any npm create-* package:")} vis create vite`),n.info(` ${p("GitHub repository:")} vis create user/repo`),n.info(` ${p("GitLab / Bitbucket:")} vis create gitlab:user/repo`),n.info(` ${p("Full URL:")} vis create https://github.com/user/repo`),n.info(""),n.info(` ${p("Template args after --:")} vis create vite -- --template react-ts`),n.info("")},pt=(e,t,r,i)=>{const a=x(t)===x(e)?"":e;process.stderr.write(`
|
|
148
|
+
`),n.success("Project created successfully!"),process.stderr.write(`
|
|
149
|
+
`),n.notice("Next steps:"),a&&n.info(` cd ${a}`),i||n.info(` ${r} install`),n.info(` ${r} run dev`),process.stderr.write(`
|
|
150
|
+
`)},_t=async({argument:e,logger:t,options:r,rawUnknown:i,visConfig:a,workspaceRoot:o})=>{const s=Array.isArray(e)?e:e?[e]:[],c=a?.create;if(r.list){lt(c?.templates);return}const f=r.cwd||o||process.cwd(),y=!!o,w=!!process.stdin.isTTY,_=ue(f);let m,g,d,$=c?.defaultEditor,I=c?.gitInit??!1,z=[],S=_,M=!1;if(s.length===0&&w&&r.interactive!==!1){const h=await Pe({cwd:f,defaultEditor:c?.defaultEditor,defaultGitInit:c?.gitInit,defaultPm:c?.defaultPm,inMonorepo:y});m=h.template,g=h.projectName,d=x(f,h.targetDir),$=h.editor??$,I=h.gitInit,M=h.overwrite,h.pm&&(S={name:h.pm,version:_.version})}else{if(s.length===0)throw new Error(`No template specified. Usage: vis create <template> [name] [-- args...]
|
|
151
|
+
Use --list to see available templates, or run interactively in a terminal.`);{let h=[...i??[]];if(h.length===0){const J=process.argv.slice(2),V=J.indexOf("--");V!==-1&&(h=J.slice(V+1))}const j=s.indexOf("--"),ie=j===-1?s:s.slice(0,j);z=[...j===-1?[]:s.slice(j+1),...h],[m,g]=ie,!g&&m&&(g=ct(m)),$=r.editor==="vscode"?"vscode":$,I=!!r.gitInit||I}}if(!m)throw new Error("No template specified.");const q=c?.templates?.[m]??m,U=_e(q,z);if(!d){const h=y?$e(U.type):".",j=qe(g??"",x(f,h));d=j.targetDir,g=j.packageName}const G=T(g??"");if(!ee(G))throw new Error(`Invalid project name: "${g}". Use lowercase alphanumeric characters and hyphens.`);g=G;const re=x(d),N=L(x(f),re);if(N===".."||N.startsWith(`..${le}`)||pe(N))throw new Error(`Target directory "${d}" is outside the working directory. Use a name without "../" path segments.`);if(!M&&!Ne(d))throw new Error(`Target directory "${d}" is not empty.
|
|
152
|
+
Use a different name or clear the directory first.`);q!==m&&n.info(`Alias: ${b(k(m))} → ${p(q)}`),n.info(`Template: ${b(k(q))}`),n.info(`Project: ${b(g)}`),n.info(`Target: ${p(d)}`),process.stderr.write(`
|
|
153
|
+
`);const F=await it(U,{createConfig:c,cwd:f,inMonorepo:y,logger:t,pm:S,projectName:g,targetDir:d});if(F!==0){process.exitCode=F;return}$==="vscode"&&nt(d),C(d)&&at(d,S.name),I&&!y&&ot(d);let B=!1;c?.install!==!1&&C(l(d,"package.json"))&&(B=st(d,S,t,c?.preferOffline)),pt(d,f,S.name,B)};export{_t as default};
|