@visulima/vis 1.0.0-alpha.22 → 1.0.0-alpha.23
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 +50 -0
- package/LICENSE.md +132 -2
- package/README.md +1 -1
- package/dashboard/dist/index.html +152 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +3 -0
- package/dist/config/index.d.ts +20 -33
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/bin.js +373 -367
- package/dist/packem_chunks/bloom-status.js +2 -2
- package/dist/packem_chunks/bloom-sync.js +2 -2
- package/dist/packem_chunks/config.js +12 -12
- package/dist/packem_chunks/doctor-probe.js +2 -2
- package/dist/packem_chunks/fix.js +3 -3
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +3 -3
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +10 -10
- package/dist/packem_chunks/handler15.js +2 -2
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +2 -2
- package/dist/packem_chunks/handler24.js +1 -18
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -1
- package/dist/packem_chunks/handler27.js +1 -5
- package/dist/packem_chunks/handler28.js +3 -1
- package/dist/packem_chunks/handler29.js +1 -3
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +7 -1
- package/dist/packem_chunks/handler31.js +32 -6
- package/dist/packem_chunks/handler32.js +3 -33
- package/dist/packem_chunks/handler33.js +1 -3
- package/dist/packem_chunks/handler34.js +26 -1
- package/dist/packem_chunks/handler35.js +5 -26
- package/dist/packem_chunks/handler36.js +22 -5
- package/dist/packem_chunks/handler37.js +60 -21
- package/dist/packem_chunks/handler38.js +6 -428
- package/dist/packem_chunks/handler39.js +708 -61
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +24 -6
- package/dist/packem_chunks/handler41.js +237 -166
- package/dist/packem_chunks/handler42.js +153 -24
- package/dist/packem_chunks/handler43.js +10 -153
- package/dist/packem_chunks/handler44.js +25 -10
- package/dist/packem_chunks/handler45.js +24 -25
- package/dist/packem_chunks/handler46.js +3 -24
- package/dist/packem_chunks/handler47.js +27 -3
- package/dist/packem_chunks/handler48.js +168 -21
- package/dist/packem_chunks/handler49.js +33 -173
- package/dist/packem_chunks/handler5.js +6 -6
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +4 -4
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +2 -2
- package/dist/packem_chunks/index.js +2 -2
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +2 -2
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/status.js +2 -2
- package/dist/packem_chunks/sync.js +2 -2
- package/dist/packem_chunks/sync2.js +2 -2
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_shared/{advisories-DS8JEB_g.js → advisories-U1QKY_tg.js} +1 -1
- package/dist/packem_shared/{ai-analysis-DGBZYlxF.js → ai-analysis-B8pDCOuT.js} +2 -2
- package/dist/packem_shared/ai-fix-DiGSrGKv.js +43 -0
- package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
- package/dist/packem_shared/applyDefaults-KxZkvlp3.js +1 -0
- package/dist/packem_shared/build-scripts-3E2pmscY.js +1 -0
- package/dist/packem_shared/{cyclonedx-CO7-Y1B1.js → cyclonedx-B293T7R0.js} +3 -3
- package/dist/packem_shared/dependency-scan-BbtivycX.js +1 -0
- package/dist/packem_shared/docker-BhBBfWfc.js +60 -0
- package/dist/packem_shared/failure-log-B0Uh-65U.js +2 -0
- package/dist/packem_shared/index-C1w1GXdS.js +1 -0
- package/dist/packem_shared/index-CZX_II5N.js +29 -0
- package/dist/packem_shared/index.server-B7ETiT4C.js +2 -0
- package/dist/packem_shared/{lifecycle-boYwVQSE.js → lifecycle-wRE7ymVc.js} +2 -2
- package/dist/packem_shared/{lockfile-C5DYMHVq.js → lockfile-CQLFNyVa.js} +1 -1
- package/dist/packem_shared/manifests-Z3spBpxv.js +1 -0
- package/dist/packem_shared/{min-release-age-D462DvYM.js → min-release-age-Cz6HbF-I.js} +2 -2
- package/dist/packem_shared/native-config-sync-BOeuyrBj.js +21 -0
- package/dist/packem_shared/{osv-bloom-QSAn2Dcw.js → osv-bloom-CyCDpXBl.js} +2 -2
- package/dist/packem_shared/pm-runner-CVliR6Ie.js +1 -0
- package/dist/packem_shared/provenance-BcldGs02.js +1 -0
- package/dist/packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js +1 -0
- package/dist/packem_shared/registry-keys-pemEkRM9.js +1 -0
- package/dist/packem_shared/{resolve-explicit-BgFQHUEP.js → resolve-explicit-2G-2HWtR.js} +3 -3
- package/dist/packem_shared/runtime-check-DgXsKCsv.js +1 -0
- package/dist/packem_shared/s1ngularity-Boxkax0D.js +1 -0
- package/dist/packem_shared/scan-progress-EbvmIh4i.js +2 -0
- package/dist/packem_shared/{selectors-B2ISH581.js → selectors-BE2BCnTR.js} +1 -1
- package/dist/packem_shared/{signatures-b-jJYoZd.js → signatures-SO-fyExV.js} +1 -1
- package/dist/packem_shared/toolchain-Jx2lkAYy.js +5 -0
- package/dist/packem_shared/typosquats-CioMnpnb.js +1 -0
- package/dist/packem_shared/verify-C8EAHql6.js +1 -0
- package/dist/packem_shared/{vis-update-app-Bnu1EIgE.js → vis-update-app-BWA1kA1q.js} +1 -1
- package/index.js +26 -26
- package/package.json +23 -12
- package/schemas/vis-config.schema.json +61 -12
- package/dist/packem_chunks/handler50.js +0 -34
- package/dist/packem_shared/ai-cache-BjlXWJtl.js +0 -1
- package/dist/packem_shared/ai-fix-BhcTrkuW.js +0 -43
- package/dist/packem_shared/applyDefaults-BOVDw1jD.js +0 -1
- package/dist/packem_shared/build-scripts-DsWMSWDs.js +0 -1
- package/dist/packem_shared/cache-directory-DQak1Vjc.js +0 -1
- package/dist/packem_shared/dependency-scan-DPHTzA5r.js +0 -1
- package/dist/packem_shared/docker-lk0-5Z-i.js +0 -60
- package/dist/packem_shared/failure-log-DF7nrFIs.js +0 -2
- package/dist/packem_shared/flakiness-DKCOYwN7.js +0 -1
- package/dist/packem_shared/index-B4gpNmrG.js +0 -1
- package/dist/packem_shared/manifests-B0fMp872.js +0 -1
- package/dist/packem_shared/native-config-sync-B0_ef78M.js +0 -21
- package/dist/packem_shared/provenance-smHa8efI.js +0 -1
- package/dist/packem_shared/registry-keys-3qaVog76.js +0 -1
- package/dist/packem_shared/run-summary-utils-DIJV_dUD.js +0 -1
- package/dist/packem_shared/runtime-check-DrMx4Q9L.js +0 -1
- package/dist/packem_shared/s1ngularity-CwSBPB3I.js +0 -1
- package/dist/packem_shared/scan-progress-CMynp3eA.js +0 -2
- package/dist/packem_shared/toolchain-OH1PXwbZ.js +0 -5
- package/dist/packem_shared/typosquats-CJ4o1l7U.js +0 -1
- package/dist/packem_shared/verify-CQbzknur.js +0 -1
- package/dist/packem_shared/xxh3-DrAUNq4n.js +0 -1
|
@@ -1,153 +1,10 @@
|
|
|
1
|
-
var ge=Object.defineProperty;var g=(e,t)=>ge(e,"name",{value:t,configurable:!0});import{createRequire as he}from"node:module";import{aC as ve,E as d,j as k,q as x,p as a,h as ce,Q as be,A as we}from"./bin.js";import{i as O,C as _,Q as ke,z as W,b,M as c,B as m,n as ie,f as xe,O as $e}from"./config.js";import{f as Se}from"../packem_shared/giget-CcEy_Elm.js";const fe=he(import.meta.url),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=g(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 fe(e)},"__cjs_getBuiltinModule"),{spawnSync:ye}=J("node:child_process"),{createInterface:_e}=J("node:readline"),{readdirSync:je,chmodSync:Ce}=J("node:fs");var Oe=Object.defineProperty,L=g((e,t)=>Oe(e,"name",{value:t,configurable:!0}),"e");const Pe={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Ne=["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://"],qe=L(e=>{for(const t of Ne)if(e.startsWith(t))return!0;return!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e)},"isGitUrl"),De=new Set(["sv"]),Ee=L(e=>{if(De.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}`},"expandCreateShorthand"),Te=L((e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),i=Pe[r];return i?{args:t,source:r,type:i}:qe(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:Ee(e),type:"remote:npm"}},"discoverTemplate"),Ie=L(e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},"inferParentDir");var Re=Object.defineProperty,le=g((e,t)=>Re(e,"name",{value:t,configurable:!0}),"i$1");const ae=["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"],Me=le((e,t)=>Math.floor(e+Math.random()*(t-e+1)),"random");function F(){return ae[Me(0,ae.length-1)]}g(F,"getRandomWord");le(F,"getRandomWord");var ze=Object.defineProperty,Le=g((e,t)=>ze(e,"name",{value:t,configurable:!0}),"o$1");const Ae=Le(()=>`${F()}-${F()}`,"randomName");var U,ne;function Ge(){return ne||(ne=1,U=["_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"]),U}g(Ge,"requireBuiltinModules");var B,oe;function Ue(){if(oe)return B;oe=1;var e=Object.defineProperty,t=g((o,l)=>e(o,"name",{value:l,configurable:!0}),"i");const r=Ge();var i=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),n=["node_modules","favicon.ico"];function u(o){var l=[],s=[];if(o===null)return s.push("name cannot be null"),p(l,s);if(o===void 0)return s.push("name cannot be undefined"),p(l,s);if(typeof o!="string")return s.push("name must be a string"),p(l,s);if(o.length||s.push("name length must be greater than zero"),o.startsWith(".")&&s.push("name cannot start with a period"),o.startsWith("-")&&s.push("name cannot start with a hyphen"),o.match(/^_/)&&s.push("name cannot start with an underscore"),o.trim()!==o&&s.push("name cannot contain leading or trailing spaces"),n.forEach(function(h){o.toLowerCase()===h&&s.push(h+" is not a valid package name")}),r.includes(o.toLowerCase())&&l.push(o+" is a core module name"),o.length>214&&l.push("name can no longer contain more than 214 characters"),o.toLowerCase()!==o&&l.push("name can no longer contain capital letters"),/[~'!()*]/.test(o.split("/").slice(-1)[0])&&l.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(o)!==o){var w=o.match(i);if(w){var $=w[1],y=w[2];if(y.startsWith(".")&&s.push("name cannot start with a period"),encodeURIComponent($)===$&&encodeURIComponent(y)===y)return p(l,s)}s.push("name can only contain URL-friendly characters")}return p(l,s)}g(u,"validate"),t(u,"validate");var p=t(function(o,l){var s={validForNewPackages:l.length===0&&o.length===0,validForOldPackages:l.length===0,warnings:o,errors:l};return s.warnings.length||delete s.warnings,s.errors.length||delete s.errors,s},"done");return B=u,B}g(Ue,"requireLib");var Be=Ue();const Ve=ve(Be);var Fe=Object.defineProperty,I=g((e,t)=>Fe(e,"name",{value:t,configurable:!0}),"r$2");const pe=I(e=>e?Ve(e).validForNewPackages:!1,"isValidPackageName"),T=I(e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),"toValidPackageName"),Je=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),ue=I(e=>O(e)?je(e).every(t=>Je.has(t)):!0,"isEmptyDir"),We=I((e,t)=>{const r=_(t,e);return{packageName:T(ke(r)),targetDir:r}},"resolveTargetDir"),He=I(e=>ue(e),"canSafelyOverwrite");var Ye=Object.defineProperty,A=g((e,t)=>Ye(e,"name",{value:t,configurable:!0}),"l$4");const E=A((e,t)=>new Promise(r=>{e.question(t,i=>{r(i.trim())})}),"ask"),V=A(async(e,t,r=!0)=>{const i=await E(e,` ${t} ${d(r?"[Y/n]":"[y/N]")} `);return i===""?r:i.toLowerCase()==="y"||i.toLowerCase()==="yes"},"confirm"),se=A(async(e,t,r)=>{process.stderr.write(` ${t}
|
|
2
|
-
`);for(const[i,n]of r.entries()){const u=k(x(` ${String(i+1)}.`)),p=n.hint?d(` — ${n.hint}`):"";process.stderr.write(`${u} ${n.label}${p}
|
|
3
|
-
`)}for(;;){const i=await E(e,`
|
|
4
|
-
|
|
5
|
-
`)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`)
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
`)):w=await se(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let $=!1;e.inMonorepo||($=await V(t,"Initialize a git repository?",e.defaultGitInit??!1));const y=e.defaultEditor==="vscode",h=await V(t,"Generate VS Code configuration?",y)?"vscode":void 0;return process.stderr.write(`
|
|
12
|
-
`),{editor:h,gitInit:$,overwrite:l,pm:w,projectName:u,targetDir:o,template:i}}finally{t.close()}},"runInteractivePrompts");var Qe=Object.defineProperty,S=g((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"i");const Xe=S((e,t)=>{a.info("Scaffolding application via create-vite...");const r=[W(t.cwd,t.targetDir)||".",...e.args];return r.includes("--no-immediate")||r.push("--no-immediate"),ce(t.pm,{additionalPackages:[],args:r,package:"create-vite",shellMode:!1,silent:!1},t.cwd,t.logger)},"executeApp"),Ze=S(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
|
-
`,"libraryPackageJson"),et=S(()=>`${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
|
-
`,"libraryTsconfig"),tt=S(e=>`/**
|
|
15
|
-
* ${e} — library entry point.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
export const greet = (name: string): string => \`Hello from ${e}, \${name}!\`;
|
|
19
|
-
`,"librarySrcIndex"),rt=S(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
|
-
`,"libraryTestIndex"),it=S((e,t)=>{const{projectName:r,targetDir:i}=t;return a.info("Scaffolding library package..."),b(i),b(c(i,"src")),b(c(i,"__tests__")),m(c(i,"package.json"),Ze(r)),a.success("Created package.json"),m(c(i,"tsconfig.json"),et()),a.success("Created tsconfig.json"),m(c(i,"src","index.ts"),tt(r)),a.success("Created src/index.ts"),m(c(i,"__tests__","index.test.ts"),rt(r)),a.success("Created __tests__/index.test.ts"),m(c(i,".gitignore"),`node_modules/
|
|
29
|
-
dist/
|
|
30
|
-
.env
|
|
31
|
-
.DS_Store
|
|
32
|
-
`),a.success("Created .gitignore"),0},"executeLibrary"),at=S((e,t)=>{switch(e.type){case"builtin:app":return Xe(e,t);case"builtin:library":return it(e,t);default:throw new Error(`Unknown built-in template type: ${e.type}`)}},"executeBuiltin");var nt=Object.defineProperty,R=g((e,t)=>nt(e,"name",{value:t,configurable:!0}),"n$1");const ot=R((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
|
-
`,"packageJson"),st=R(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
|
-
`,"binIndex"),ct=R(()=>`${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
|
-
`,"tsconfigJson"),lt=R(()=>`/**
|
|
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
|
-
`,"srcIndex"),pt=R((e,t="")=>{const{projectName:r,targetDir:i}=e;a.info("Scaffolding code generator..."),b(i),b(c(i,"bin")),b(c(i,"src")),m(c(i,"package.json"),ot(r,t||`Code generator: ${r}`)),a.success("Created package.json");const n=c(i,"bin","index.js");return m(n,st(r)),Ce(n,493),a.success("Created bin/index.js (executable)"),m(c(i,"tsconfig.json"),ct()),a.success("Created tsconfig.json"),m(c(i,"src","index.ts"),lt()),a.success("Created src/index.ts"),0},"executeGeneratorTemplate");var ut=Object.defineProperty,P=g((e,t)=>ut(e,"name",{value:t,configurable:!0}),"n");const dt=P(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
|
-
`,"rootPackageJson"),mt=P(()=>`packages:
|
|
52
|
-
- "apps/*"
|
|
53
|
-
- "packages/*"
|
|
54
|
-
`,"pnpmWorkspaceYaml"),gt=P(()=>`# 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
|
-
`,"gitignore"),ht=P(()=>`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
|
-
`,"editorconfig"),ft=P(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
|
-
`,"readmeMd"),yt=P(e=>{const{projectName:t,targetDir:r}=e;return a.info("Scaffolding monorepo workspace..."),b(r),b(c(r,"apps")),b(c(r,"packages")),m(c(r,"package.json"),dt(t)),a.success("Created package.json"),m(c(r,"pnpm-workspace.yaml"),mt()),a.success("Created pnpm-workspace.yaml"),m(c(r,".gitignore"),gt()),a.success("Created .gitignore"),m(c(r,".editorconfig"),ht()),a.success("Created .editorconfig"),m(c(r,"README.md"),ft(t)),a.success("Created README.md"),m(c(r,"apps",".gitkeep"),""),m(c(r,"packages",".gitkeep"),""),0},"executeMonorepoTemplate");var vt=Object.defineProperty,H=g((e,t)=>vt(e,"name",{value:t,configurable:!0}),"s");const bt={"create-nuxt":{monoArgs:["--no-gitInit"]},"create-vite":{args:["--no-immediate"]},sv:{args:["--no-install"],prependCommand:"create"}},wt=H((e,t,r)=>{const i=bt[e];if(!i)return t;const n=[...t];if(i.prependCommand&&!n.includes(i.prependCommand)&&n.unshift(i.prependCommand),i.args)for(const u of i.args)n.includes(u)||n.push(u);if(r&&i.monoArgs)for(const u of i.monoArgs)n.includes(u)||n.push(u);return n},"applyAutoFixes"),kt=H((e,t)=>{const r=W(t.cwd,t.targetDir)||".",i=[...e.args];i.includes(r)||i.unshift(r);const n=wt(e.source,i,t.inMonorepo);return a.info(`Running ${e.source} via ${t.pm.name} dlx...`),ce(t.pm,{additionalPackages:[],args:n,package:e.source,shellMode:!1,silent:!1},t.cwd,t.logger)},"executeRemoteNpm"),xt=H(async(e,t)=>{const{createConfig:r}=t;a.info(`Downloading template from ${e.source}...`);try{const i=await Se(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 a.info(`Downloaded to ${i.dir}`),0}catch(i){const n=i instanceof Error?i.message:String(i);return a.warn(`Failed to download template: ${n}`),1}},"executeRemoteGit");var $t=Object.defineProperty,_t=g((e,t)=>$t(e,"name",{value:t,configurable:!0}),"r");const jt=_t(async(e,t)=>{switch(e.type){case"builtin:app":case"builtin:library":return at(e,t);case"builtin:generator":return pt(t);case"builtin:monorepo":return yt(t);case"remote:git":return xt(e,t);case"remote:npm":return kt(e,t);default:throw new Error(`Unknown template type: ${e.type}`)}},"executeTemplate");var Ct=Object.defineProperty,j=g((e,t)=>Ct(e,"name",{value:t,configurable:!0}),"g");const St=j(e=>{const t=c(e,".vscode");b(t);const r=c(t,"settings.json"),i={"editor.defaultFormatter":"oxc.oxc-vscode","editor.formatOnSave":!0};if(O(r))try{const p=ie(r);m(r,`${JSON.stringify({...i,...p},null,4)}
|
|
128
|
-
`),a.success("Merged .vscode/settings.json")}catch{a.warn("Could not merge .vscode/settings.json, skipping")}else m(r,`${JSON.stringify(i,null,4)}
|
|
129
|
-
`),a.success("Created .vscode/settings.json");const n=c(t,"extensions.json"),u={recommendations:["oxc.oxc-vscode"]};if(O(n))try{const p=ie(n);m(n,`${JSON.stringify({...p,recommendations:[...new Set([...p.recommendations||[],...u.recommendations])]},null,4)}
|
|
130
|
-
`),a.success("Merged .vscode/extensions.json")}catch{a.warn("Could not merge .vscode/extensions.json, skipping")}else m(n,`${JSON.stringify(u,null,4)}
|
|
131
|
-
`),a.success("Created .vscode/extensions.json")},"generateVscodeConfig"),Ot=j((e,t)=>{const r=c(e,".ai");b(r);const i=c(r,"instructions");if(O(i))return;const n=`# 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
|
-
`;m(i,n),a.success("Created .ai/instructions")},"generateAiInstructions"),Pt=j(e=>{ye("git",["init"],{cwd:e,stdio:"pipe"}).status===0?a.success("Initialized git repository"):a.warn("Failed to initialize git repository")},"initGitRepo"),Nt=j((e,t,r,i=!1)=>(a.info("Installing dependencies..."),be(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?(a.success("Dependencies installed"),!0):(a.warn("Dependency installation failed (you can run install manually)"),!1)),"installDependencies"),qt=j(e=>{const t=e.split("#")[0].split("?")[0].replace(/\/+$/,"").replace(/\.git$/,"").split("/").filter(Boolean).at(-1)??"",r=t.includes(":")?t.split(":").pop()??t:t;return T(r)||"my-project"},"extractRepoName"),Dt=j(e=>{if(a.info(""),a.info(" Built-in templates:"),a.info(` ${k(x("vis:monorepo"))} ${d("Full pnpm workspace setup")}`),a.info(` ${k(x("vis:app"))} ${d("Application scaffold via create-vite")}`),a.info(` ${k(x("vis:library"))} ${d("Reusable TypeScript library package")}`),a.info(` ${k(x("vis:generator"))} ${d("Code generator scaffold with bin entry")}`),e&&Object.keys(e).length>0){a.info(""),a.info(" Config aliases (vis.config.ts → create.templates):");for(const[t,r]of Object.entries(e))a.info(` ${k(x(t))}${" ".repeat(Math.max(1,16-t.length))}${d(r)}`)}a.info(""),a.info(" Remote templates:"),a.info(` ${d("Any npm create-* package:")} vis create vite`),a.info(` ${d("GitHub repository:")} vis create user/repo`),a.info(` ${d("GitLab / Bitbucket:")} vis create gitlab:user/repo`),a.info(` ${d("Full URL:")} vis create https://github.com/user/repo`),a.info(""),a.info(` ${d("Template args after --:")} vis create vite -- --template react-ts`),a.info("")},"listTemplates"),Et=j((e,t,r,i)=>{const n=_(t)===_(e)?"":e;process.stderr.write(`
|
|
148
|
-
`),a.success("Project created successfully!"),process.stderr.write(`
|
|
149
|
-
`),a.notice("Next steps:"),n&&a.info(` cd ${n}`),i||a.info(` ${r} install`),a.info(` ${r} run dev`),process.stderr.write(`
|
|
150
|
-
`)},"printNextSteps"),Lt=j(async({argument:e,logger:t,options:r,rawUnknown:i,visConfig:n,workspaceRoot:u})=>{const p=Array.isArray(e)?e:e?[e]:[],o=n?.create;if(r.list){Dt(o?.templates);return}const l=r.cwd||u||process.cwd(),s=!!u,w=!!process.stdin.isTTY,$=we(l);let y,h,f,N=o?.defaultEditor,M=o?.gitInit??!1,Y=[],q=$,K=!1;if(p.length===0&&w&&r.interactive!==!1){const v=await Ke({cwd:l,defaultEditor:o?.defaultEditor,defaultGitInit:o?.gitInit,defaultPm:o?.defaultPm,inMonorepo:s});y=v.template,h=v.projectName,f=_(l,v.targetDir),N=v.editor??N,M=v.gitInit,K=v.overwrite,v.pm&&(q={name:v.pm,version:$.version})}else{if(p.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 v=[...i??[]];if(v.length===0){const te=process.argv.slice(2),re=te.indexOf("--");re!==-1&&(v=te.slice(re+1))}const C=p.indexOf("--"),me=C===-1?p:p.slice(0,C);Y=[...C===-1?[]:p.slice(C+1),...v],[y,h]=me,!h&&y&&(h=qt(y)),N=r.editor==="vscode"?"vscode":N,M=!!r.gitInit||M}}if(!y)throw new Error("No template specified.");const z=o?.templates?.[y]??y,Q=Te(z,Y);if(!f){const v=s?Ie(Q.type):".",C=We(h??"",_(l,v));f=C.targetDir,h=C.packageName}const X=T(h??"");if(!pe(X))throw new Error(`Invalid project name: "${h}". Use lowercase alphanumeric characters and hyphens.`);h=X;const de=_(f),G=W(_(l),de);if(G===".."||G.startsWith(`..${xe}`)||$e(G))throw new Error(`Target directory "${f}" is outside the working directory. Use a name without "../" path segments.`);if(!K&&!He(f))throw new Error(`Target directory "${f}" is not empty.
|
|
152
|
-
Use a different name or clear the directory first.`);z!==y&&a.info(`Alias: ${k(x(y))} → ${d(z)}`),a.info(`Template: ${k(x(z))}`),a.info(`Project: ${k(h)}`),a.info(`Target: ${d(f)}`),process.stderr.write(`
|
|
153
|
-
`);const Z=await jt(Q,{createConfig:o,cwd:l,inMonorepo:s,logger:t,pm:q,projectName:h,targetDir:f});if(Z!==0){process.exitCode=Z;return}N==="vscode"&&St(f),O(f)&&Ot(f,q.name),M&&!s&&Pt(f);let ee=!1;o?.install!==!1&&O(c(f,"package.json"))&&(ee=Nt(f,q,t,o?.preferOffline)),Et(f,l,q.name,ee)},"execute");export{Lt as default};
|
|
1
|
+
var Mt=Object.defineProperty;var P=(e,t)=>Mt(e,"name",{value:t,configurable:!0});import{createRequire as jt}from"node:module";import{I as be,e as Ee,E as $,T as Ae,j as ce,q as Pe}from"../packem_shared/index.server-B7ETiT4C.js";import{g as zt,aP as Bt,K as Je,aE as Xe,aO as Lt,o as Vt,U as ut,c as Ut,R as pt,b as ht,V as _t,T as Gt,f as Ht,p as u,Z as M,Y as gt,s as Yt}from"./bin.js";import{M as q,i as Ie,$ as Kt,a as Wt,C as ft}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{render as qt}from"@visulima/tui";import Jt,{useSyncExternalStore as Xt,useState as Re,useEffect as Qe,useRef as Ze,useMemo as Ue,useCallback as et}from"react";import{n as yt,b as ei,j as ti}from"./config.js";import{x as it,A as wt,L as ii,F as ri,T as ni,U as oi,a as si,I as li}from"./handler40.js";import{A as kt,R as ai}from"../packem_shared/pm-runner-CVliR6Ie.js";import{c as ci}from"../packem_shared/runtime-check-DgXsKCsv.js";import{s as di}from"../packem_shared/scan-progress-EbvmIh4i.js";import{f as ui,l as pi,r as hi}from"../packem_shared/dependency-scan-BbtivycX.js";import{jsxs as c,jsx as r,Fragment as gi}from"react/jsx-runtime";import{Box as p}from"@visulima/tui/components/box";import{Dialog as fi}from"@visulima/tui/components/dialog";import{Text as n}from"@visulima/tui/components/text";import{useApp as mi}from"@visulima/tui/hooks/use-app";import{useInput as yi}from"@visulima/tui/hooks/use-input";import{useWindowSize as wi}from"@visulima/tui/hooks/use-window-size";import{ScrollView as ki}from"@visulima/tui/components/scroll-view";import{ScrollBar as bi}from"@visulima/tui/components/scroll-bar";import{Spinner as bt}from"@visulima/tui/components/spinner";import{Tab as vi}from"@visulima/tui/components/tab";import{Tabs as $i}from"@visulima/tui/components/tabs";import{u as Si}from"../packem_shared/use-measured-height-DjYgUOKk.js";import{s as Ci}from"../packem_shared/verify-C8EAHql6.js";const Et=jt(import.meta.url),xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dt=P(e=>{if(typeof xe<"u"&&xe.versions&&xe.versions.node){const[t,i]=xe.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return xe.getBuiltinModule(e)}return Et(e)},"__cjs_getBuiltinModule"),{statSync:Qt,rmSync:tt,writeFileSync:Zt,readFileSync:mt}=dt("node:fs"),{spawnSync:ze}=dt("node:child_process");var xi=Object.defineProperty,De=P((e,t)=>xi(e,"name",{value:t,configurable:!0}),"r$2");const _e=De(()=>q(zt(),"doctor"),"getCacheDirectory"),Ri=1800*1e3,rt=De(e=>{if(!e)return"";try{return String(Qt(e).mtimeMs)}catch{return""}},"safeMtime"),Ti=2,Ai=De(e=>{const t=JSON.stringify({configMtime:rt(e.configPath),lockfileMtime:rt(e.lockfilePath),schema:Ti,sections:[...e.sections].toSorted(),socketEnabled:e.socketEnabled,workspaceRoot:e.workspaceRoot});return Bt(Buffer.from(t))},"buildDoctorCacheKey"),Pi=De(e=>{const t=q(_e(),`${e}.json`);if(Ie(t))try{const i=yt(t);if(Date.now()-i.createdAt>i.ttlMs){tt(t,{force:!0});return}return{...i.results,sections:new Set(i.results.sections)}}catch{tt(t,{force:!0});return}},"readDoctorCache"),Ii=De((e,t,i=Ri)=>{ei(_e());const s={createdAt:Date.now(),results:{...t,sections:[...t.sections]},ttlMs:i};Zt(q(_e(),`${e}.json`),JSON.stringify(s,void 0,2),"utf8")},"writeDoctorCache");var Di=Object.defineProperty,E=P((e,t)=>Di(e,"name",{value:t,configurable:!0}),"n$1");const Fe="orphans",Oi=E(()=>{if(process.platform!=="linux")return{id:"inotify",message:"inotify capacity check skipped (not Linux).",status:"skip"};let e;try{const t=mt("/proc/sys/fs/inotify/max_user_watches","utf8").trim(),i=Number.parseInt(t,10);Number.isFinite(i)&&i>0&&(e=i)}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"}},"checkInotifyCapacity"),Ni=E(()=>{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"}},"checkTtyAvailability"),Fi=E(()=>{const e=process.pid;try{return process.platform==="win32"?St(e):$t(e)}catch{return[]}},"listOrphanPids"),Mi=E(()=>{const e=process.pid;let t;try{t=process.platform==="win32"?St(e):$t(e)}catch{return{id:Fe,message:"Could not enumerate processes (ps/tasklist failed).",status:"warn"}}if(t.length===0)return{id:Fe,message:"No orphaned vis/task-runner processes detected.",status:"ok"};if(t.length<=2)return{detail:{count:t.length,pids:t.join(",")},id:Fe,message:`${String(t.length)} possibly orphaned process(es) detected (PIDs: ${t.join(", ")}). Likely benign.`,status:"skip"};const i=process.platform==="win32"?t.map(s=>`taskkill /F /PID ${String(s)}`).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: ${i}`,status:"warn"}},"checkOrphanedRunners"),ji=E((e={})=>{const t=e.enumerate??Fi,i=e.force===!0?"SIGKILL":"SIGTERM",s=e.kill??Vi,o=t(),l=[],d=[];for(const h of o)try{s(h,i),l.push(h)}catch(a){const f=a.code??a.message;if(f==="ESRCH"){l.push(h);continue}d.push({pid:h,reason:f})}return{failed:d,killed:l}},"killOrphanedRunners"),Ei=E(e=>ze("taskkill",e,{encoding:"utf8"}),"defaultTaskkillRunner"),zi=E((e,t)=>{process.kill(e,t)},"defaultProcessKill"),Bi=E((e,t,i=Ei)=>{const s=t==="SIGKILL"?["/F","/PID",String(e)]:["/PID",String(e)],o=i(s);if(o.error)throw o.error;if(typeof o.status=="number"&&o.status!==0){const l=o.status===128?"ESRCH":`taskkill exited with code ${String(o.status)}`,d=new Error(l);throw d.code=l,d}},"killViaTaskkill"),Li=E((e,t,i=zi)=>{i(e,t)},"killViaSignal"),Vi=E((e,t)=>{if(process.platform==="win32"){Bi(e,t);return}Li(e,t)},"defaultKill"),vt=E((e,t)=>{const i=ze(e,t,{encoding:"utf8"});if(i.error)throw i.error;if(typeof i.status=="number"&&i.status!==0)throw new Error(`${e} exited with code ${String(i.status)}`);return typeof i.stdout=="string"?i.stdout:""},"runProcessListing"),$t=E(e=>{const t=vt("ps",["-Ao","pid=,command="]),i=[];for(const s of t.split(`
|
|
2
|
+
`)){if(s.length===0)continue;const o=/^\s*(\d+)\s+(.+)$/.exec(s);if(!o)continue;const l=Number.parseInt(o[1]??"",10),d=(o[2]??"").toLowerCase();!Number.isFinite(l)||l===e||(/(?:^|[ /])vis-native(?:\s|$|[-.])/.test(d)||/(?:^|[ /])vis\s+run\b/.test(d)||/(?:^|[ /])task-runner(?:\s|$|[-.])/.test(d))&&i.push(l)}return i},"listOrphansUnix"),St=E(e=>{const t=vt("tasklist",["/FO","CSV","/NH"]),i=[];for(const s of t.split(/\r?\n/)){if(s.length===0)continue;const o=s.split(/","/).map(h=>h.replaceAll(/^"|"$/g,"")),l=(o[0]??"").toLowerCase(),d=Number.parseInt(o[1]??"",10);!Number.isFinite(d)||d===e||(l==="vis.exe"||l.startsWith("vis-native")||l.includes("task-runner"))&&i.push(d)}return i},"listOrphansWindows"),Ui=E(()=>{let e;try{const t=ze("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"}},"checkWatchmanAvailability"),_i=E((e=process.cwd())=>{let t="";try{t=mt(q(e,".gitattributes"),"utf8")}catch(i){if(i.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 i=ze("git",["lfs","version"],{encoding:"utf8",timeout:2e3});if(i.error||typeof i.status=="number"&&i.status!==0)throw i.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"}},"checkGitLfsTracking"),Gi=E(e=>[Oi(),Ni(),Ui(),_i(e),Mi()],"runRuntimeDiagnostics");var Hi=Object.defineProperty,ke=P((e,t)=>Hi(e,"name",{value:t,configurable:!0}),"s$2");const we=[{id:"dependencies",label:"Deps"},{id:"security",label:"Security"},{id:"optimization",label:"Optimize"},{id:"runtime",label:"Runtime"}],je=["dependencies","security","optimization","runtime"],me=ke(e=>{const t=new Map;for(const i of je)t.set(i,[]);for(const i of e)t.get(i.section).push(i);for(const[i,s]of t)s.length===0&&t.delete(i);return t},"groupBySection"),ye=ke((e,t,i,s)=>{let o=e.filter(l=>l.section===t);if(s&&(o=o.filter(l=>l.severity===s)),i){const l=i.toLowerCase();o=o.filter(d=>d.title.toLowerCase().includes(l))}return[...o]},"filterFindings"),Yi=ke(e=>{const t={dependencies:"idle",optimization:"idle",runtime:"idle",security:"idle"};for(const i of je)e.has(i)&&(t[i]="idle");return t},"initialStatus");class nt{static{P(this,"DoctorStore")}static{ke(this,"DoctorStore")}#e;#i=new Set;constructor(t=[]){const i=Array.isArray(t)?{findings:t}:t,s=i.findings??[],o=i.activeSections??new Set(je),l=je.find(a=>o.has(a))??"dependencies",d=ye(s,l,"",void 0),h=Yi(o);if(s.length>0)for(const a of s)h[a.section]="done";this.#e={all:s,entries:d,filterActive:!1,filterText:"",filterType:l,focusedPanel:"list",grouped:me(d),pendingAction:void 0,sectionError:{},sectionMessage:{},sectionStatus:h,selectedIndex:0,severityFilter:void 0}}getSnapshot=ke(()=>this.#e,"getSnapshot");subscribe=ke(t=>(this.#i.add(t),()=>{this.#i.delete(t)}),"subscribe");setSelectedIndex(t){const i=Math.max(0,Math.min(t,this.#e.entries.length-1));i!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:i})}setFocusedPanel(t){t!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:t})}setFilterType(t){if(t===this.#e.filterType)return;const i=ye(this.#e.all,t,this.#e.filterText,this.#e.severityFilter);this.#t({...this.#e,entries:i,filterType:t,grouped:me(i),selectedIndex:0})}setFilter(t){const i=ye(this.#e.all,this.#e.filterType,t,this.#e.severityFilter);this.#t({...this.#e,entries:i,filterText:t,grouped:me(i),selectedIndex:0})}setFilterActive(t){if(t===this.#e.filterActive)return;if(t){this.#t({...this.#e,filterActive:!0});return}const i=ye(this.#e.all,this.#e.filterType,"",this.#e.severityFilter);this.#t({...this.#e,entries:i,filterActive:!1,filterText:"",grouped:me(i),selectedIndex:0})}setPendingAction(t){this.#t({...this.#e,pendingAction:t})}setSeverityFilter(t){if(t===this.#e.severityFilter)return;const i=ye(this.#e.all,this.#e.filterType,this.#e.filterText,t);this.#t({...this.#e,entries:i,grouped:me(i),selectedIndex:0,severityFilter:t})}startSection(t,i){this.#t({...this.#e,sectionMessage:{...this.#e.sectionMessage,[t]:i},sectionStatus:{...this.#e.sectionStatus,[t]:"running"}})}completeSection(t,i){const s=[...this.#e.all,...i],o=ye(s,this.#e.filterType,this.#e.filterText,this.#e.severityFilter),l={...this.#e.sectionMessage};delete l[t],this.#t({...this.#e,all:s,entries:o,grouped:me(o),sectionMessage:l,sectionStatus:{...this.#e.sectionStatus,[t]:"done"}})}failSection(t,i){this.#t({...this.#e,sectionError:{...this.#e.sectionError,[t]:i},sectionStatus:{...this.#e.sectionStatus,[t]:"error"}})}#t(t){this.#e=t;for(const i of this.#i)try{i()}catch{}}}var Ki=Object.defineProperty,Ct=P((e,t)=>Ki(e,"name",{value:t,configurable:!0}),"r$1");const ot={error:0,warn:1},Wi=Ct(e=>!!e.acceptedRisk,"isAcknowledged"),xt=Ct(e=>{const t=[];if(e.sections.has("dependencies")){for(const i of e.outdated)t.push({entry:i,id:`outdated:${i.packageName}`,kind:"outdated",section:"dependencies",severity:"warn",subtitle:`${i.currentRange} → ${i.newRange} (${i.updateType})`,title:i.packageName});for(const i of e.duplicates)t.push({id:`duplicate:${i.name}`,kind:"duplicate",pkg:i,section:"dependencies",severity:"warn",subtitle:`${String(i.versions.length)} versions installed`,title:i.name})}if(e.sections.has("security"))for(const i of e.outdated){if(i.vulnerabilities&&i.vulnerabilities.length>0){const s=i.vulnerabilities[0],o=Wi(i)?"warn":"error",l=i.vulnerabilities.length;t.push({entry:i,id:`vuln:${i.packageName}`,kind:"vulnerability",packageName:i.packageName,section:"security",severity:o,subtitle:l===1?`${s.severity} · ${s.id}`:`${String(l)} advisories · top: ${s.severity} ${s.id}`,title:i.packageName})}if(i.socketReport&&i.socketReport.alerts.length>0){const s=Math.round(i.socketReport.score.overall*100);t.push({entry:i,id:`socket:${i.packageName}`,kind:"socket",packageName:i.packageName,section:"security",severity:"warn",subtitle:`${String(i.socketReport.alerts.length)} alert${i.socketReport.alerts.length===1?"":"s"} · score ${String(s)}%`,title:i.packageName})}}if(e.sections.has("optimization"))for(const i of e.optimizations)t.push({entry:i,id:`opt:${i.packageName}`,kind:"optimization",section:"optimization",severity:"warn",subtitle:`${i.category} → ${i.replacement}`,title:i.packageName});if(e.sections.has("runtime"))for(const i of e.runtime)i.status==="warn"&&t.push({diagnostic:i,id:`runtime:${i.id}`,kind:"runtime",section:"runtime",severity:"warn",title:i.message});return t.sort((i,s)=>{if(i.section!==s.section){const o=["dependencies","security","optimization","runtime"];return o.indexOf(i.section)-o.indexOf(s.section)}return ot[i.severity]-ot[s.severity]}),t},"flattenFindings"),Rt={dependencies:"Dependencies",optimization:"Optimization",runtime:"Runtime",security:"Security"};var qi=Object.defineProperty,Ji=P((e,t)=>qi(e,"name",{value:t,configurable:!0}),"a$2");const Xi={error:"red",warn:"yellow"},Qi={error:"✖",warn:"⚠"},Zi={error:" ERROR ",warn:" WARN "},er=Ji(({children:e,hint:t,message:i,severity:s,title:o})=>{const l=Xi[s];return c(p,{borderColor:l,borderStyle:"single",flexDirection:"column",flexShrink:0,paddingX:1,children:[c(p,{gap:1,children:[r(n,{backgroundColor:l,bold:!0,color:"black",children:Zi[s]}),r(n,{bold:!0,color:l,children:Qi[s]}),r(n,{bold:!0,wrap:"truncate-end",children:o})]}),r(n,{wrap:"truncate-end",children:i}),t?r(n,{dimColor:!0,wrap:"truncate-end",children:t}):null,e]})},"ConfigBanner");var tr=Object.defineProperty,te=P((e,t)=>tr(e,"name",{value:t,configurable:!0}),"d$2");const ir={CRITICAL:"red",HIGH:"red",LOW:"gray",MODERATE:"yellow",UNKNOWN:"gray"},rr={critical:"red",high:"red",low:"gray",medium:"yellow"},nr={major:"red",minor:"yellow",patch:"green"},A=te(({children:e,label:t,width:i=14})=>c(p,{children:[r(p,{width:i,children:c(n,{dimColor:!0,children:[t,":"]})}),typeof e=="string"?r(n,{children:e}):e]}),"FieldRow"),oe=te(({children:e})=>r(p,{marginTop:1,children:r(n,{bold:!0,color:"white",children:e})}),"SectionTitle"),or=te(({finding:e})=>{const{entry:t}=e,i=nr[t.updateType]??"white";return c(p,{flexDirection:"column",children:[r(A,{label:"Current",children:t.currentRange}),c(A,{label:"Target",children:[r(n,{children:t.newRange}),c(n,{bold:!0,color:i,children:[" (",t.updateType,")"]})]}),r(A,{label:"Catalog",children:t.catalogName}),t.acceptedRisk?r(A,{label:"Risk ack",children:r(n,{dimColor:!0,children:t.acceptedRisk.reason??"(no reason recorded)"})}):null,r(oe,{children:"Action"}),c(n,{dimColor:!0,children:["Run"," ",r(n,{bold:!0,color:"white",children:"vis update"})," ","to apply this change."]})]})},"OutdatedDetail"),sr=te(({finding:e})=>c(p,{flexDirection:"column",children:[r(A,{label:"Versions",children:r(n,{children:String(e.pkg.versions.length)})}),r(oe,{children:"Installed versions"}),e.pkg.versions.map(t=>c(n,{children:[" · ",t]},t)),r(oe,{children:"Action"}),c(n,{dimColor:!0,children:["Run"," ",r(n,{bold:!0,color:"white",children:"vis dedupe"})," ","to consolidate to a single resolution."]})]}),"DuplicateDetail"),lr=te(({finding:e})=>{const t=e.entry.vulnerabilities??[];return c(p,{flexDirection:"column",children:[r(A,{label:"Package",children:e.packageName}),r(A,{label:"Current",children:e.entry.currentRange}),r(A,{label:"Advisories",children:String(t.length)}),e.entry.acceptedRisk?r(A,{label:"Risk ack",children:r(n,{dimColor:!0,children:e.entry.acceptedRisk.reason??"(no reason recorded)"})}):null,t.map(i=>{const s=ir[i.severity]??"gray";return c(p,{flexDirection:"column",marginTop:1,children:[c(p,{children:[r(n,{bold:!0,color:s,children:i.severity}),r(n,{children:" "}),r(n,{children:i.id}),typeof i.cvssScore=="number"?c(n,{dimColor:!0,children:[" · CVSS ",i.cvssScore.toFixed(1)]}):null]}),r(n,{wrap:"wrap",children:i.summary}),i.fixedVersions.length>0?c(n,{dimColor:!0,children:["Fixed in: ",i.fixedVersions.join(", ")]}):null,i.aliases&&i.aliases.length>0?c(n,{dimColor:!0,children:["Aliases: ",i.aliases.join(", ")]}):null]},i.id)})]})},"VulnerabilityDetail"),ar=te(({finding:e})=>{const t=e.entry.socketReport;if(!t)return r(n,{dimColor:!0,children:"No Socket report attached."});const i=Math.round(t.score.overall*100),s=Je(t.score.overall);return c(p,{flexDirection:"column",children:[r(A,{label:"Package",children:e.packageName}),r(A,{label:"Overall",children:c(n,{color:s,children:[String(i),"%"]})}),r(A,{label:"Alerts",children:String(t.alerts.length)}),e.entry.acceptedRisk?r(A,{label:"Risk ack",children:r(n,{dimColor:!0,children:e.entry.acceptedRisk.reason??"(no reason recorded)"})}):null,r(oe,{children:"Score breakdown"}),Object.entries(t.score).map(([o,l])=>{if(o==="overall")return null;const d=typeof l=="number"?l:0,h=Math.round(d*100),a=Je(d);return c(p,{children:[r(p,{width:14,children:c(n,{dimColor:!0,children:[o,":"]})}),c(n,{color:a,children:[String(h),"%"]})]},o)}),r(oe,{children:"Alerts"}),t.alerts.map((o,l)=>{const d=rr[o.severity]??"gray";return c(p,{flexDirection:"column",marginBottom:1,children:[c(p,{children:[r(n,{bold:!0,color:d,children:o.severity}),r(n,{children:" "}),r(n,{children:o.type})]}),o.props?r(n,{dimColor:!0,wrap:"wrap",children:JSON.stringify(o.props)}):null]},`${o.type}-${String(l)}`)})]})},"SocketDetail"),cr=te(({finding:e})=>{const{entry:t}=e;return c(p,{flexDirection:"column",children:[r(A,{label:"Package",children:t.packageName}),r(A,{label:"Category",children:t.category}),r(A,{label:"Replacement",children:t.replacement}),t.overrideSpec?r(A,{label:"Override",children:t.overrideSpec}):null,r(A,{label:"Codemod",children:r(n,{color:t.hasCodemod?"green":"gray",children:t.hasCodemod?"available":"not available"})}),t.docUrl?r(A,{label:"Guide",children:r(n,{color:"cyan",underline:!0,children:t.docUrl})}):null,r(oe,{children:"Action"}),t.hasCodemod?c(n,{dimColor:!0,children:["Run"," ",r(n,{bold:!0,color:"white",children:"vis optimize"})," ","to apply the codemod interactively."]}):t.overrideSpec?c(n,{dimColor:!0,children:["Run"," ",r(n,{bold:!0,color:"white",children:"vis optimize"})," ","to install the package override."]}):t.docUrl?r(n,{dimColor:!0,children:"No automated codemod. Open the migration guide above for the recommended alternative and steps."}):r(n,{dimColor:!0,children:"No automated codemod. Consult the package's docs or the e18e module-replacements guide for an alternative."})]})},"OptimizationDetail"),dr=te(({finding:e})=>{const{diagnostic:t}=e,i=t.status==="warn"?"yellow":t.status==="ok"?"green":"gray";return c(p,{flexDirection:"column",children:[r(A,{label:"Check",children:t.id}),r(A,{label:"Status",children:r(n,{color:i,children:t.status})}),r(oe,{children:"Message"}),r(n,{wrap:"wrap",children:t.message}),t.detail&&Object.keys(t.detail).length>0?c(gi,{children:[r(oe,{children:"Details"}),Object.entries(t.detail).map(([s,o])=>c(p,{children:[r(p,{width:20,children:c(n,{dimColor:!0,children:[s,":"]})}),r(n,{children:String(o)})]},s))]}):null]})},"RuntimeDetail"),ur=te(({finding:e,focused:t,scrollRef:i})=>{const s=t?"white":"gray";if(!e)return r(p,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:r(n,{dimColor:!0,children:"No finding selected"})});let o;switch(e.kind){case"duplicate":{o=r(sr,{finding:e});break}case"optimization":{o=r(cr,{finding:e});break}case"outdated":{o=r(or,{finding:e});break}case"runtime":{o=r(dr,{finding:e});break}case"socket":{o=r(ar,{finding:e});break}case"vulnerability":{o=r(lr,{finding:e});break}default:{o=r(n,{dimColor:!0,children:"Unknown finding kind."});break}}return c(p,{borderColor:s,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[c(p,{flexShrink:0,paddingTop:1,paddingX:2,children:[r(n,{bold:!0,color:"white",children:e.title}),c(n,{dimColor:!0,children:[" ",Rt[e.section]]})]}),c(ki,{flexGrow:1,flexShrink:1,paddingX:2,ref:i,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:[r(n,{}),o]})]})},"DoctorDetailPanel");var pr=Object.defineProperty,Oe=P((e,t)=>pr(e,"name",{value:t,configurable:!0}),"c$2");const Tt={error:"red",warn:"yellow"},hr={error:"✖",warn:"⚠"},gr=Oe(e=>e.kind==="outdated"||e.kind==="vulnerability"||e.kind==="socket"?!!e.entry.acceptedRisk:!1,"hasAcceptedRisk"),fr=Oe(({finding:e,isSelected:t})=>{const i=Tt[e.severity],s=gr(e);return c(p,{flexShrink:0,height:1,children:[r(n,{children:t?">":" "}),c(n,{color:i,children:[" ",hr[e.severity]," "]}),r(p,{flexGrow:1,children:r(n,{bold:t,inverse:t,wrap:"truncate",children:e.title})}),s?r(n,{color:"cyan",children:" ack"}):null,e.subtitle?c(n,{dimColor:!0,wrap:"truncate",children:[" ",e.subtitle]}):null]})},"FindingRow"),mr=Oe(({count:e,section:t})=>c(p,{flexShrink:0,height:1,marginTop:1,children:[r(n,{dimColor:!0,children:"▼ "}),r(n,{bold:!0,color:"white",children:Rt[t].toUpperCase()}),c(n,{dimColor:!0,children:[" (",e,")"]})]}),"SectionHeader"),yr=Oe(({count:e,label:t,status:i})=>c(n,{children:[t,i==="running"?c(n,{children:[" ",r(bt,{type:"dots"})]}):null,i==="error"?r(n,{bold:!0,color:"red",children:" ✖"}):c(n,{dimColor:!0,children:[" (",String(e),")"]})]}),"TabLabel"),wr=Oe(({elapsedMs:e,entries:t,filterActive:i,filterText:s,filterType:o,focused:l,fromCache:d=!1,grouped:h,onViewportHeightChange:a,scrollOffset:f,sectionCounts:k,sectionMessage:v,sectionStatus:I,selectedIndex:z,severityFilter:g,totalAll:D,viewportHeight:B})=>{const J=l?"white":"gray",{measuredHeight:V,ref:L}=Si(B,a);let R=0,_=0;for(const S of t)S.severity==="error"?R+=1:S.severity==="warn"&&(_+=1);const G=[];R>0&&G.push(`${String(R)} error${R===1?"":"s"}`),_>0&&G.push(`${String(_)} warn${_===1?"":"s"}`);const se=G.length>0?` (${G.join(", ")})`:"",ie=(e/1e3).toFixed(1),U=[];for(const[S,C]of h){U.push(r(mr,{count:C.length,section:S},`hdr-${S}`));for(const X of C){const T=t.indexOf(X);U.push(r(fr,{finding:X,isSelected:T===z},X.id))}}let j=0;for(const[,S]of h)j+=2+S.length;const Y=j>V&&V>0;return c(p,{borderColor:J,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[c(p,{flexShrink:0,gap:1,paddingX:1,children:[r(n,{bold:!0,inverse:!0,children:" DOCTOR "}),c(n,{wrap:"truncate",children:[t.length,t.length===D?"":`/${String(D)}`," finding",t.length===1?"":"s",se]}),g?r(n,{bold:!0,color:Tt[g],inverse:!0,children:` ${g.toUpperCase()} ONLY `}):null,d?r(n,{bold:!0,color:"cyan",inverse:!0,children:" CACHED "}):null,c(n,{dimColor:!0,children:[" · ",ie,"s"]})]}),r(p,{flexShrink:0,paddingX:1,paddingY:1,children:r($i,{isFocused:l,keyMap:{next:[],previous:[],useNumbers:!1,useTab:!1},onChange:P(()=>{},"onChange"),showIndex:!1,value:o,children:we.map(({id:S,label:C})=>r(vi,{name:S,children:r(yr,{count:k[S],label:C,status:I[S]})},S))})}),(()=>{const S=Object.keys(I).filter(C=>I[C]==="running"&&v[C]).map(C=>v[C]);return S.length===0?null:r(p,{flexShrink:0,paddingX:1,children:c(n,{dimColor:!0,wrap:"truncate",children:[r(bt,{type:"dots"})," ",S.join(" · ")]})})})(),i&&c(p,{flexShrink:0,paddingX:1,children:[r(n,{bold:!0,color:"white",children:"/ "}),r(n,{children:s}),r(n,{inverse:!0,children:" "})]}),c(p,{flexDirection:"row",flexGrow:1,overflow:"hidden",ref:L,children:[r(p,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:r(p,{flexDirection:"column",marginTop:-f,children:U.length>0?U:r(p,{marginTop:1,children:r(n,{dimColor:!0,children:"No findings match the current filter."})})})}),Y&&r(p,{flexShrink:0,marginLeft:1,marginRight:1,children:r(bi,{contentHeight:j,placement:"inset",scrollOffset:f,style:"block",viewportHeight:V})})]},`list-${o}-${s}`)]})},"DoctorListPanel");var kr=Object.defineProperty,Be=P((e,t)=>kr(e,"name",{value:t,configurable:!0}),"g$1");const br=Be(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)`}},"buildUpdateAction"),vr=Be(e=>{if(e.kind==="optimization")return{command:`vis optimize ${e.entry.packageName}`,description:`Replace ${e.entry.packageName} with ${e.entry.replacement}`}},"buildOptimizeAction"),$r=Be(e=>{if(e.kind!=="outdated"&&e.kind!=="vulnerability"&&e.kind!=="socket")return;const t=e.kind==="outdated"?e.entry.packageName:e.packageName,i=["// Add to vis.config.ts:","security: {"," acceptedRisks: {",` "${t}": {`,' reason: "explain why this risk is acceptable",',' expiresAt: "YYYY-MM-DD",'," },"," },","},"].join(`
|
|
3
|
+
`);return{command:i,configSnippet:i,description:`Acknowledge risk for ${t}`}},"buildAckAction"),Sr=100,Cr=40,xr=10,Rr=Be(({autoExitSeconds:e=0,banner:t,fromCache:i=!1,startedAt:s,store:o})=>{const{exit:l}=mi(),{columns:d,rows:h}=wi(),a=Xt(o.subscribe,o.getSnapshot),[f,k]=Re(!1),[v,I]=Re(!1),[z,g]=Re(0),[D,B]=Re(()=>Date.now());Qe(()=>{const w=setInterval(()=>{B(Date.now())},1e3);return()=>{clearInterval(w)}},[]);const J=D-s,V=Ze(null),L=Ze(null),R=a.entries[a.selectedIndex]??null,_=Ue(()=>{const w={dependencies:0,optimization:0,runtime:0,security:0};for(const y of a.all)w[y.section]+=1;return w},[a.all]),G=t?t.hint?5:4:0,se=Ue(()=>{for(const w of Object.keys(a.sectionStatus))if(a.sectionStatus[w]==="running"&&a.sectionMessage[w])return 1;return 0},[a.sectionStatus,a.sectionMessage]),ie=d>=Sr,U=ie?Math.max(1,h-G-2):Math.floor(h*.55),j=Math.max(1,U-6-se-(a.filterActive?1:0)),[Y,S]=Re(j),C=Y>0?Y:j,X=Ue(()=>{let w=0;for(const[,y]of a.grouped)w+=2+y.length;return w},[a.grouped]),T=Math.max(0,X-C),le=Math.min(z,T),ue=et(w=>{let y=0,b=0;for(const[,Ce]of a.grouped){y+=2;for(let ae=0;ae<Ce.length;ae++){if(b===w)return y;y+=1,b+=1}}return y},[a.grouped]),O=et(w=>{const y=ue(w);g(b=>y>b+C-2?Math.min(T,Math.max(0,y-C+2)):y<b+1?Math.max(0,y-1):b)},[ue,C,T]);if(Qe(()=>{L.current?.scrollToTop()},[R?.id]),yi((w,y)=>{if(w==="c"&&y.ctrl){l();return}if(!v){if(f){y.escape||w==="?"?k(!1):w==="q"?(k(!1),I(!0)):y.downArrow||w==="j"?V.current?.scrollBy(1):(y.upArrow||w==="k")&&V.current?.scrollBy(-1);return}if(w==="?"){k(!0);return}if(w==="q"){I(!0);return}if(y.tab){o.setFocusedPanel(a.focusedPanel==="list"?"detail":"list");return}if(a.filterActive){if(y.escape||y.return){o.setFilterActive(!1);return}if(y.backspace){g(0),o.setFilter(a.filterText.slice(0,-1));return}w&&!y.ctrl&&!y.meta&&(g(0),o.setFilter(a.filterText+w));return}if(a.focusedPanel==="list"&&(y.leftArrow||y.rightArrow)){const b=we.findIndex(ae=>ae.id===a.filterType),Ce=y.rightArrow?(b+1)%we.length:(b-1+we.length)%we.length;g(0),L.current?.scrollToTop(),o.setFilterType(we[Ce].id);return}if(a.focusedPanel==="list"){if(y.downArrow||w==="j"){const b=Math.min(a.selectedIndex+1,a.entries.length-1);o.setSelectedIndex(b),O(b);return}if(y.upArrow||w==="k"){const b=Math.max(a.selectedIndex-1,0);o.setSelectedIndex(b),O(b);return}if(y.pageDown){const b=Math.min(a.selectedIndex+10,a.entries.length-1);o.setSelectedIndex(b),O(b);return}if(y.pageUp){const b=Math.max(a.selectedIndex-10,0);o.setSelectedIndex(b),O(b);return}if(y.home){o.setSelectedIndex(0),g(0);return}if(y.end){const b=a.entries.length-1;o.setSelectedIndex(b),O(b);return}if(w==="/"){o.setFilterActive(!0);return}if(w==="e"){o.setSeverityFilter(a.severityFilter==="error"?void 0:"error"),g(0);return}if(w==="w"){o.setSeverityFilter(a.severityFilter==="warn"?void 0:"warn"),g(0);return}if(w==="u"&&R){const b=br(R);b&&(o.setPendingAction(b),l());return}if(w==="o"&&R){const b=vr(R);b&&(o.setPendingAction(b),l());return}if(w==="a"&&R){const b=$r(R);b&&(o.setPendingAction(b),l());return}if(w==="d"){o.setFocusedPanel("detail");return}return}if(y.escape||y.leftArrow){o.setFocusedPanel("list");return}if(y.downArrow||w==="j"){L.current?.scrollBy(1);return}if(y.upArrow||w==="k"){L.current?.scrollBy(-1);return}if(y.pageDown){L.current?.scrollBy(10);return}if(y.pageUp){L.current?.scrollBy(-10);return}if(y.home){L.current?.scrollToTop();return}y.end&&L.current?.scrollToBottom()}},{isActive:!0}),d<Cr||h<xr)return r(p,{alignItems:"center",height:h,justifyContent:"center",width:d,children:c(n,{color:"yellow",children:["Terminal too small (",d,"x",h,")"]})});const Q=a.focusedPanel==="detail",ee=[c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"q"}),r(n,{dimColor:!0,children:"QUIT"})]},"q"),c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"?"}),r(n,{dimColor:!0,children:"HELP"})]},"?"),c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"↑↓"}),r(n,{dimColor:!0,children:Q?"SCROLL":"NAV"})]},"nav"),Q?c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"←/Esc"}),r(n,{dimColor:!0,children:"LIST"})]},"lr"):c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"←→"}),r(n,{dimColor:!0,children:"SECTION"})]},"lr"),c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"/"}),r(n,{dimColor:!0,children:"SEARCH"})]},"search"),c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"e/w"}),r(n,{dimColor:!0,children:"SEVERITY"})]},"sev"),c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"u/o/a"}),r(n,{dimColor:!0,children:"ACTION"})]},"actions"),c(p,{gap:1,children:[r(n,{bold:!0,color:"white",children:"Tab"}),r(n,{dimColor:!0,children:"PANEL"})]},"tab")],pe=r(p,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:r(p,{gap:2,overflow:"hidden",paddingX:1,children:ee})}),he=c(fi,{footer:c(n,{dimColor:!0,children:[r(n,{bold:!0,color:"white",children:"↑↓"})," scroll ",r(n,{bold:!0,color:"white",children:"?"}),"/",r(n,{bold:!0,color:"white",children:"Esc"})," close"]}),scrollRef:V,title:"DOCTOR — KEYBOARD SHORTCUTS",visible:f,width:56,children:[c(p,{flexDirection:"column",marginBottom:1,children:[c(p,{marginBottom:1,children:[r(n,{dimColor:!0,children:"── "}),r(n,{bold:!0,color:"white",children:"NAVIGATION"})]}),c(p,{children:[r(p,{width:26,children:c(n,{children:[r(n,{bold:!0,color:"white",children:" ↑/k "}),r(n,{dimColor:!0,children:"Move up"})]})}),c(n,{children:[r(n,{bold:!0,color:"white",children:" ↓/j "}),r(n,{dimColor:!0,children:"Move down"})]})]}),c(p,{children:[r(p,{width:26,children:c(n,{children:[r(n,{bold:!0,color:"white",children:" PgUp"}),r(n,{dimColor:!0,children:" Jump up 10"})]})}),c(n,{children:[r(n,{bold:!0,color:"white",children:" PgDn"}),r(n,{dimColor:!0,children:" Jump down 10"})]})]}),c(p,{children:[r(p,{width:26,children:c(n,{children:[r(n,{bold:!0,color:"white",children:" Home"}),r(n,{dimColor:!0,children:" Jump to top"})]})}),c(n,{children:[r(n,{bold:!0,color:"white",children:" End"}),r(n,{dimColor:!0,children:" Jump to bottom"})]})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" Tab"}),r(n,{dimColor:!0,children:" Switch panel"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" →/←"}),r(n,{dimColor:!0,children:" Section tabs (list) / Focus list (detail)"})]})]}),c(p,{flexDirection:"column",marginBottom:1,children:[c(p,{marginBottom:1,children:[r(n,{dimColor:!0,children:"── "}),r(n,{bold:!0,color:"white",children:"FILTER"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" /"}),r(n,{dimColor:!0,children:" Open text filter (Esc/Enter to close)"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" e"}),r(n,{dimColor:!0,children:" Toggle errors-only filter"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" w"}),r(n,{dimColor:!0,children:" Toggle warns-only filter"})]})]}),c(p,{flexDirection:"column",marginBottom:1,children:[c(p,{marginBottom:1,children:[r(n,{dimColor:!0,children:"── "}),r(n,{bold:!0,color:"white",children:"ACTIONS"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" u"}),r(n,{dimColor:!0,children:" Exit + suggest update / dedupe command"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" o"}),r(n,{dimColor:!0,children:" Exit + suggest optimize command"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" a"}),r(n,{dimColor:!0,children:" Exit + print risk-ack snippet"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" d"}),r(n,{dimColor:!0,children:" Focus detail panel"})]})]}),c(p,{flexDirection:"column",children:[c(p,{marginBottom:1,children:[r(n,{dimColor:!0,children:"── "}),r(n,{bold:!0,color:"white",children:"EXIT"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" q"}),r(n,{dimColor:!0,children:" Quit (with countdown)"})]}),c(n,{children:[r(n,{bold:!0,color:"white",children:" Ctrl+C"}),r(n,{dimColor:!0,children:" Quit immediately"})]})]})]}),ge=r(wr,{elapsedMs:J,entries:a.entries,filterActive:a.filterActive,filterText:a.filterText,filterType:a.filterType,focused:a.focusedPanel==="list",fromCache:i,grouped:a.grouped,onViewportHeightChange:S,scrollOffset:le,sectionCounts:_,sectionMessage:a.sectionMessage,sectionStatus:a.sectionStatus,selectedIndex:a.selectedIndex,severityFilter:a.severityFilter,totalAll:a.all.length,viewportHeight:C}),fe=t?r(er,{hint:t.hint,message:t.message,severity:t.severity,title:t.title}):null,Se=r(ur,{finding:R,focused:a.focusedPanel==="detail",scrollRef:L});if(ie){const w=Math.floor(d*.4);return c(p,{flexDirection:"column",height:h,width:d,children:[fe,c(p,{flexDirection:"row",flexGrow:1,children:[r(p,{flexGrow:1,children:ge}),r(p,{width:w,children:Se})]}),pe,r(Xe,{autoExitSeconds:e||3,onCancel:P(()=>{I(!1)},"onCancel"),visible:v}),he]})}return c(p,{flexDirection:"column",height:h,width:d,children:[fe,r(p,{height:U,children:ge}),r(p,{flexGrow:1,children:Se}),pe,r(Xe,{autoExitSeconds:e||3,onCancel:P(()=>{I(!1)},"onCancel"),visible:v}),he]})},"VisDoctorApp");var Tr=Object.defineProperty,ve=P((e,t)=>Tr(e,"name",{value:t,configurable:!0}),"n");const Ar=ve(e=>e.replaceAll(/[$()+.?[\\\]^{|}]/g,String.raw`\$&`),"escapeRegex"),Pr=ve(e=>{const t=e.split("*").map(i=>Ar(i));return new RegExp(`^${t.join(".*")}$`,"i")},"compilePattern"),Ir=ve(e=>e?e.split(",").map(t=>t.trim()).filter(t=>t.length>0).map(t=>Pr(t)):[],"parseFilterPatterns"),Me=ve((e,t)=>{for(const i of t)if(i.test(e))return!0;return!1},"matchesAny"),Dr=ve((e,t,i)=>{if(t.length===0)return e;const s=e.outdated.filter(f=>Me(f.packageName,t)),o=e.duplicates.filter(f=>Me(f.name,t)),l=e.optimizations.filter(f=>Me(f.packageName,t));let d=0,h=0,a=0;for(const f of s)f.vulnerabilities&&(d+=f.vulnerabilities.length),f.socketReport&&(h+=f.socketReport.alerts.length,f.socketReport.score.overall<i&&(a+=1));return{...e,duplicates:o,optimizations:l,outdated:s,socketIssues:{alerts:h,lowScore:a},vulnCount:d}},"applyFilter"),At=ve((e,t)=>t.length===0?[...e]:e.filter(i=>{if(i.kind==="runtime")return!0;const s=i.kind==="duplicate"?i.pkg.name:i.kind==="outdated"||i.kind==="optimization"?i.entry.packageName:i.packageName;return Me(s,t)}),"filterFindingsByPattern");var Or=Object.defineProperty,$e=P((e,t)=>Or(e,"name",{value:t,configurable:!0}),"r");const Pt=["dependencies","security","optimization","runtime"],st=$e(e=>{const t=new Set;if(!e)return t;for(const i of e.split(",")){const s=i.trim().toLowerCase();Pt.includes(s)&&t.add(s)}return t},"parseSectionList"),Nr=$e((e,t)=>{if(e!==void 0&&e!=="")return st(e);const i=st(t);return new Set(Pt.filter(s=>!i.has(s)))},"resolveSections"),It=$e(e=>{const t={micro:0,native:0,preferred:0,socket:0,total:e.length};for(const i of e)switch(i.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},"summarizeOptimizations"),ne=$e((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(i=>i.status==="warn")?"warn":"ok";case"security":return e.vulnCount>0||e.socketIssues.alerts>0?"error":e.socketIssues.lowScore>0?"warn":"ok";default:return"ok"}},"sectionStatus"),Fr=$e((e,t)=>{const i=It(e.optimizations),s={dependencies:ne(e,"dependencies"),optimization:ne(e,"optimization"),runtime:ne(e,"runtime"),security:ne(e,"security")},o=new Set([...Object.values(s),e.supplyChain.status]),l=o.has("error")?"error":o.has("warn")?"warn":"ok";return{dependencies:{duplicates:e.duplicates.length,installed:e.installedCount,outdated:e.outdated.length,status:s.dependencies},elapsedMs:e.elapsedMs,optimizations:{microUtilities:i.micro,native:i.native,preferred:i.preferred,socket:i.socket,status:s.optimization,total:i.total},packageManager:t,runtime:e.runtime.map(d=>({detail:d.detail,id:d.id,message:d.message,status:d.status})),runtimeStatus:s.runtime,security:{alerts:e.socketIssues.alerts,lowScorePackages:e.socketIssues.lowScore,status:s.security,vulnerabilities:e.vulnCount},status:l,supplyChain:{findings:e.supplyChain.findings.map(d=>({detail:d.detail,label:d.label,severity:d.severity})),status:e.supplyChain.status},workspaces:e.workspaceCount}},"buildJsonPayload"),lt=$e((e,t)=>{const i=e.runtime.some(o=>o.status==="warn"),s=e.vulnCount>0||e.socketIssues.alerts>0;return t?s||e.outdated.length>0||e.duplicates.length>0||i:s},"shouldFail");var Mr=Object.defineProperty,Le=P((e,t)=>Mr(e,"name",{value:t,configurable:!0}),"u$1");const jr=["aube-workspace.yaml","pnpm-workspace.yaml"],Te=Le(e=>typeof e=="boolean"?e:void 0,"asBool"),Er=Le(e=>{if(e==="no-downgrade"||e==="off")return e},"asTrustPolicy"),zr=Le(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 i of jr){const s=q(e,i);if(!Ie(s))continue;let o;try{o=Lt(Kt(s))}catch{continue}if(typeof o!="object"||o===null)continue;const l=o;return t.source=i,t.paranoid=Te(l.paranoid),t.trustPolicy=Er(l.trustPolicy),t.blockExoticSubdeps=Te(l.blockExoticSubdeps),t.jailBuilds=Te(l.jailBuilds),t.strictDepBuilds=Te(l.strictDepBuilds),t.minimumReleaseAgeStrict=Te(l.minimumReleaseAgeStrict),typeof l.minimumReleaseAge=="number"&&Number.isFinite(l.minimumReleaseAge)&&(t.minimumReleaseAge=l.minimumReleaseAge),l.allowBuilds&&typeof l.allowBuilds=="object"&&!Array.isArray(l.allowBuilds)&&(t.allowBuildsCount=Object.keys(l.allowBuilds).length),t}return t},"readAubeSecurityPosture"),Br=Le(e=>e.paranoid?{...e,jailBuilds:!0,minimumReleaseAgeStrict:!0,strictDepBuilds:!0,trustPolicy:"no-downgrade"}:e,"applyAubeParanoidOverrides");var Lr=Object.defineProperty,Ge=P((e,t)=>Lr(e,"name",{value:t,configurable:!0}),"i");const Vr=/^(@[\w./-]+\/[\w./-]+|[\w.-]+)@(.+)$/,Ur=Ge(e=>{const t=Vr.exec(e);if(t)return{name:t[1],version:t[2]}},"parsePatchKey"),_r=Ge((e,t)=>{let i;try{if(t==="pnpm"){const o=q(e,"pnpm-workspace.yaml");Ie(o)&&(i=Vt(o)?.patchedDependencies)}else if(t==="bun"){const o=q(e,"package.json");Ie(o)&&(i=yt(o)?.patchedDependencies)}}catch{return[]}if(!i||typeof i!="object")return[];const s=[];for(const[o,l]of Object.entries(i)){if(typeof l!="string"||l.length===0)continue;const d=Ur(o);d&&s.push({name:d.name,patchFile:l,resolvedPatchFile:Wt(l)?l:ft(e,l),version:d.version})}return s},"readPatchedDependencies"),Gr=Ge(e=>{const t=[];for(const i of e)Ie(i.resolvedPatchFile)||t.push({entry:i,kind:"missing-file"});return t},"findPatchIssues");var Hr=Object.defineProperty,Dt=P((e,t)=>Hr(e,"name",{value:t,configurable:!0}),"c");const at=Dt(e=>e.some(t=>t.severity==="error")?"error":e.some(t=>t.severity==="warn")?"warn":"ok","rollUpStatus"),Yr=Dt((e,t={})=>{const i=[],s=e?.security;if(!s)return i.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:i,status:at(i)};const o=s.policies?.firstSeen?.minutes,l=s.policies?.publisherChange,d=s.policies?.installScripts;o===void 0?i.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"}):o===0?i.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"}):i.push({label:`policies.firstSeen.minutes: ${String(o)} minutes`,severity:"ok"}),l?.mode===void 0||l.mode==="off"?i.push({detail:"Packages whose trust level has decreased will not be blocked. Consider 'no-downgrade'.",label:`policies.publisherChange.mode: ${l?.mode??"not set"}`,severity:"warn"}):i.push({label:`policies.publisherChange.mode: ${l.mode}`,severity:"ok"}),s.blockExoticSubdeps===void 0||!s.blockExoticSubdeps?i.push({detail:"Transitive dependencies can pull code from git repos or tarball URLs. Set to true to block.",label:`blockExoticSubdeps: ${String(s.blockExoticSubdeps??!1)}`,severity:"warn"}):i.push({label:"blockExoticSubdeps: true",severity:"ok"});const h=d?.allow?Object.keys(d.allow).length:0;if(h===0?i.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"}):i.push({label:`policies.installScripts.allow: ${String(h)} ${h===1?"entry":"entries"}`,severity:"ok"}),d?.strict&&h===0&&i.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 a=Ci(t.workspaceRoot);if(a.length>0){const f=[...new Set(a.map(k=>k.tool))].sort((k,v)=>k.localeCompare(v)).join(", ");i.push({detail:"Run `vis migrate verify` for the full list, then re-run `vis migrate <tool>` to clean up.",label:`${String(a.length)} leftover ${a.length===1?"reference":"references"} to ${f}`,severity:"warn"})}}if(t.workspaceRoot&&t.packageManager==="aube"){const a=zr(t.workspaceRoot),f=Br(a),k=f.source?` (from ${f.source})`:"";f.paranoid===!0&&i.push({detail:"Forces jailBuilds, trustPolicy=no-downgrade, minimumReleaseAgeStrict, strictStoreIntegrity, and strictDepBuilds on.",label:`aube paranoid: true${k}`,severity:"ok"}),f.trustPolicy==="off"&&i.push({detail:"Trust downgrades between releases will not be blocked. Set trustPolicy: no-downgrade in aube-workspace.yaml.",label:`aube trustPolicy: off${k}`,severity:"warn"}),f.blockExoticSubdeps===!1&&i.push({detail:"Transitive deps from git+, file:, and tarball URLs will not be blocked. Re-enable with blockExoticSubdeps: true.",label:`aube blockExoticSubdeps: false${k}`,severity:"warn"}),f.minimumReleaseAge===0&&i.push({detail:"Newly published versions are not held in a cooling window. Restore with minimumReleaseAge: 1440 (24h) or higher.",label:`aube minimumReleaseAge: 0${k}`,severity:"warn"}),f.jailBuilds===!0&&i.push({label:`aube jailBuilds: true${k}`,severity:"ok"}),f.strictDepBuilds===!0&&i.push({label:`aube strictDepBuilds: true${k}`,severity:"ok"}),f.allowBuildsCount>0&&i.push({label:`aube allowBuilds: ${String(f.allowBuildsCount)} ${f.allowBuildsCount===1?"entry":"entries"}${k}`,severity:"ok"})}if(t.workspaceRoot&&t.packageManager){const a=_r(t.workspaceRoot,t.packageManager);if(a.length>0){const f=Gr(a);if(f.length===0)i.push({label:`patchedDependencies: ${String(a.length)} ${a.length===1?"entry":"entries"} resolved`,severity:"ok"});else for(const k of f)i.push({detail:`Referenced from ${t.packageManager==="pnpm"?"pnpm-workspace.yaml":"package.json"} but the file is not present at ${k.entry.patchFile}.`,label:`patchedDependencies: missing patch file for ${k.entry.name}@${k.entry.version}`,severity:"error"})}}return{findings:i,status:at(i)}},"buildSupplyChainPosture");var Kr=Object.defineProperty,x=P((e,t)=>Kr(e,"name",{value:t,configurable:!0}),"u");const H=x(e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${String(Math.round(e))}ms`,"fmtDuration"),Ne=x(async(e,t,i,s)=>{if(!e)return i();e.start(t);const o=Date.now();try{const l=await i(),d=Date.now()-o,{status:h,summary:a}=s(l,d);return e.finish(t,h,a),l}catch(l){const d=Date.now()-o,h=l instanceof Error?l.message:String(l);throw e.finish(t,"error",`${h} (${H(d)})`),l}},"tracked"),Wr=x((e,t)=>{const i={duplicates:t.duplicates,elapsedMs:0,installedCount:0,optimizations:t.optimizations,outdated:t.outdated,runtime:t.runtime,sections:new Set([e]),socketIssues:{alerts:0,lowScore:0},supplyChain:{findings:[],status:"ok"},vulnCount:0,workspaceCount:0};return xt(i)},"buildSectionFindings"),ct=x(async e=>{const{filterPatterns:t,installed:i,progress:s,resolveCodemods:o,sections:l,store:d,visConfig:h,workspaceRoot:a}=e,f=l.has("dependencies"),k=l.has("security"),v=l.has("optimization"),I=l.has("runtime"),z=x((m,N)=>At(Wr(m,N),t),"sectionFindings"),g=kt(a),{packageManager:D}=ut(a),B=it(q(a,"package.json"),!1),J=wt(a),V=new Set(B);for(const m of J){const N=it(q(ft(a,m),"package.json"),!1);for(const F of N)V.add(F)}const L=Ut(a),R=pt(a,D),_=ht(h?.security,{minimumScore:h?.security?.policies?.score?.minimum}),G=h?.security?.policies?.score?.minimum??gt,se=h?.security?.acceptedRisks,ie=ii(a,g.name),U={exclude:[],ignore:[],include:[],includeLocked:!1,includePrerelease:!1,security:!0,target:"latest"},j=f?ui(a,g.name):[],Y=v?ri(V):[],S=v?ni(V,ie,g,!1):[],C=new Set(Y.map(m=>m.packageName)),X=S.filter(m=>!C.has(m.packageName)),T=[...Y,...X],le=I?Gi(a):[];d&&(f&&d.startSection("dependencies",R.size>0?"checking outdated catalog dependencies":"scanning duplicates"),k&&d.startSection("security",i.length>0?`scanning ${String(i.length)} packages for advisories`:"no installed packages to scan"),v&&d.startSection("optimization","matching e18e + socket overrides"),I&&d.startSection("runtime","running runtime diagnostics")),d&&I&&d.completeSection("runtime",z("runtime",{duplicates:[],optimizations:[],outdated:[],runtime:le}));const ue=(f||k)&&R.size>0?Ne(s,"outdated",()=>_t(R,U,L,void 0,a,_,se),(m,N)=>{const F=m.outdated.length;return{status:F>0?"warn":"ok",summary:F>0?`${String(F)} outdated · ${H(N)}`:`up to date · ${H(N)}`}}):Promise.resolve({failed:[],ignored:[],outdated:[]}),O=k&&i.length>0?Ne(s,"vulnerabilities",()=>Gt(i.map(m=>({name:m.name,version:m.version}))),(m,N)=>{let F=0;for(const re of m.values())F+=re.length;return{status:F>0?"error":"ok",summary:F>0?`${String(F)} found · ${H(N)}`:`none found · ${H(N)}`}}):Promise.resolve(new Map),Q=k&&_.length>0&&i.length>0?Ne(s,"socket",()=>Ht(_,i.map(m=>({name:m.name,version:m.version}))),(m,N)=>{let F=0,re=0;for(const qe of m.values())F+=qe.alerts.length,qe.score.overall<G&&(re+=1);const We=F+re;return{status:We>0?"warn":"ok",summary:We>0?`${String(F)} alert${F===1?"":"s"}, ${String(re)} low-score · ${H(N)}`:`clean · ${H(N)}`}}):Promise.resolve(new Map);let ee,pe,he,ge;const fe=ue.catch(m=>(ee=m instanceof Error?m.message:String(m),d||u.warn(`Outdated scan failed: ${ee}`),{failed:[],ignored:[],outdated:[]})),Se=O.catch(m=>(pe=m instanceof Error?m.message:String(m),d||u.warn(`Vulnerability scan failed: ${pe}`),new Map)),w=Q.catch(m=>(he=m instanceof Error?m.message:String(m),d||u.warn(`Socket scan failed: ${he}`),new Map)),y=d&&f?fe.then(m=>{if(ee){d.failSection("dependencies",ee);return}d.completeSection("dependencies",z("dependencies",{duplicates:j,optimizations:[],outdated:m.outdated,runtime:[]}))}):void 0,b=d&&k?Promise.all([fe,Se,w]).then(([m])=>{const N=ee??pe??he;if(N){d.failSection("security",N);return}d.completeSection("security",z("security",{duplicates:[],optimizations:[],outdated:m.outdated,runtime:[]}))}):void 0,Ce=(async()=>{if(o&&v&&T.length>0&&await Ne(s,"codemods",async()=>(await oi(T),T),(m,N)=>{const F=m.filter(re=>re.hasCodemod||re.category==="socket").length;return{status:"ok",summary:`${String(F)} auto-fixable · ${H(N)}`}}).catch(m=>{ge=m instanceof Error?m.message:String(m)}),d&&v){if(ge){d.failSection("optimization",ge);return}d.completeSection("optimization",z("optimization",{duplicates:[],optimizations:T,outdated:[],runtime:[]}))}})(),[ae,Nt,Ft]=await Promise.all([fe,Se,w]);await Promise.all([y,b,Ce]);let Ye=0,Ke=0;if(k&&_.length>0)for(const m of Ft.values())Ye+=m.alerts.length,m.score.overall<G&&(Ke+=1);let Ve=0;if(k){for(const m of ae.outdated)m.vulnerabilities&&m.vulnerabilities.length>0&&(Ve+=m.vulnerabilities.length);for(const m of Nt.values())Ve+=m.length}return{duplicates:j,installedCount:i.length,optimizations:v?T:[],outdated:f?ae.outdated:[],runtime:le,sections:l,socketIssues:{alerts:Ye,lowScore:Ke},supplyChain:Yr(h,{packageManager:D,workspaceRoot:a}),vulnCount:Ve,workspaceCount:J.length}},"streamScans"),qr=x(e=>{switch(e){case"error":return Ae(M.failure);case"skip":return $(M.dash);case"warn":return Ee(M.warning);default:return be(M.success)}},"sectionIcon"),de=x((e,t)=>{const i=process.stderr.columns??80,s=Math.max(20,Math.min(i-2,60)),o=M.dash.repeat(2),l=`${qr(t)} ${ce(e)}`,d=l.replaceAll(/\[[0-9;]*m/g,"").length,h=Math.max(0,s-d-o.length-2);return`${o} ${l} ${$(M.dash.repeat(h))}`},"heading"),W=x(e=>` ${be(M.success)} ${e}`,"itemOk"),Z=x(e=>` ${Ee(M.warning)} ${e}`,"itemWarn"),He=x(e=>` ${Ae(M.failure)} ${e}`,"itemError"),Ot=x(e=>` ${$(M.dash)} ${$(e)}`,"itemSkip"),K=x((e,t,i)=>{const s=`${ce(String(e))} ${$(t)}`;return i?`${s} ${$(`(${i})`)}`:s},"countLine"),Jr=x(e=>{if(e.sections.has("dependencies")){if(u.log(""),u.log(de("Dependencies",ne(e,"dependencies"))),u.log(W(K(e.installedCount,"packages installed"))),e.outdated.length>0){const t=e.outdated.filter(l=>l.updateType==="major").length,i=e.outdated.filter(l=>l.updateType==="minor").length,s=e.outdated.filter(l=>l.updateType==="patch").length,o=[];t>0&&o.push(`${String(t)} major`),i>0&&o.push(`${String(i)} minor`),s>0&&o.push(`${String(s)} patch`),u.log(Z(K(e.outdated.length,"outdated",o.join(", "))))}else u.log(W("All dependencies up to date"));e.duplicates.length>0?u.log(Z(K(e.duplicates.length,"packages with duplicate versions"))):u.log(W("No duplicate dependencies"))}},"displayDependencies"),Xr=x(e=>{e.sections.has("security")&&(u.log(""),u.log(de("Security",ne(e,"security"))),e.vulnCount>0?u.log(He(K(e.vulnCount,`vulnerabilit${e.vulnCount===1?"y":"ies"} found`))):u.log(W("No known vulnerabilities")),e.socketIssues.alerts>0&&u.log(Z(K(e.socketIssues.alerts,`Socket.dev security alert${e.socketIssues.alerts===1?"":"s"}`))),e.socketIssues.lowScore>0&&u.log(Z(K(e.socketIssues.lowScore,`package${e.socketIssues.lowScore===1?"":"s"} with low security score`))),e.socketIssues.alerts===0&&e.socketIssues.lowScore===0&&e.vulnCount===0&&u.log(W("No security issues detected")))},"displaySecurity"),Qr=x(e=>{if(!e.sections.has("optimization"))return;u.log(""),u.log(de("Optimization",ne(e,"optimization")));const t=It(e.optimizations);if(t.total===0){u.log(W("No optimizations available"));return}t.native>0&&u.log(Z(K(t.native,"replaceable with native APIs"))),t.preferred>0&&u.log(Z(K(t.preferred,"with lighter alternatives"))),t.micro>0&&u.log(Z(K(t.micro,"trivial micro-utilities"))),t.socket>0&&u.log(Z(K(t.socket,"@socketregistry overrides available")))},"displayOptimization"),Zr=x(e=>{u.log(""),u.log(de("Supply Chain",e.supplyChain.status));for(const t of e.supplyChain.findings){const i=t.severity==="ok"?W(t.label):t.severity==="error"?He(t.label):Z(t.label);u.log(i),t.detail&&u.log(` ${$(M.arrow)} ${$(t.detail)}`)}e.supplyChain.status!=="ok"&&u.log(` ${$(M.arrow)} ${$("Configure with security.* in vis.config.ts. See `vis check --security-config` for details.")}`)},"displaySupplyChain"),en=x(e=>{if(e.sections.has("runtime")){u.log(""),u.log(de("Runtime",ne(e,"runtime")));for(const t of e.runtime)t.status==="ok"?u.log(W(t.message)):t.status==="skip"?u.log(Ot(t.message)):u.log(Z(t.message))}},"displayRuntime"),tn=x((e,t)=>{const i=e.vulnCount,s=e.runtime.filter(l=>l.status==="warn").length,o=e.outdated.length+e.duplicates.length+e.optimizations.length+s;if(t){if(i===0&&o===0)u.success(`Everything looks good! ${$(`(${H(e.elapsedMs)})`)}`);else{const l=[];i>0&&l.push(Ae(`${String(i)} security`)),o>0&&l.push(Ee(`${String(o)} improvement${o===1?"":"s"}`)),u.log(`${Ae(M.failure)} ${l.join(", ")} ${$(`(${H(e.elapsedMs)})`)}`)}return}u.log(""),u.log(de("Summary","ok")),i===0&&o===0?u.success(`Everything looks good! ${$(`(${H(e.elapsedMs)})`)}`):(i>0&&u.error(`${String(i)} security issue${i===1?"":"s"}`),o>0&&u.log(` ${Pe(M.arrow)} ${ce(String(o))} ${$(`improvement${o===1?"":"s"} available`)} ${$(`(${H(e.elapsedMs)})`)}`))},"displaySummary"),rn=x(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){u.log(""),u.log(ce("Next steps:"));for(const i of t)u.log(` ${$(M.arrow)} ${i}`)}u.log("")},"displayActions"),nn=x((e,t)=>{t||(Jr(e),Xr(e),Qr(e),en(e),Zr(e)),tn(e,t)},"displayResults"),on=x((e,t,i,s,o)=>{const l=[],d=e.has("dependencies"),h=e.has("security"),a=e.has("optimization");return(d||h)&&t>0&&l.push({id:"outdated",label:"Outdated catalog dependencies"}),h&&s>0&&l.push({id:"vulnerabilities",label:"Known vulnerabilities (OSV)"}),h&&i&&s>0&&l.push({id:"socket",label:"Socket.dev supply-chain reports"}),a&&o&&l.push({id:"codemods",label:"Codemod availability"}),l},"planScanTasks"),sn=x(e=>{if(u.log(""),u.log(`${ce(Pe("vis doctor"))} ${$("— project health check")}`),u.log(W(`Detected ${e.packageManagerName} v${e.packageManagerVersion}`)),e.workspaceCount!==void 0&&e.workspaceCount>0&&u.log(W(K(e.workspaceCount,`workspace package${e.workspaceCount===1?"":"s"}`))),e.runtimeFindings.length===0)u.log(W(`Node.js ${e.nodeVersion}`));else{for(const t of e.runtimeFindings){const i=t.severity==="error"?Ae:Ee;u.log(He(`Runtime: ${i(t.message)}`))}u.log(` ${$(M.arrow)} Run ${be("vis toolchain install")} to install pinned versions, or ${be("vis toolchain status")} for the per-tool breakdown.`)}u.log("")},"printBanner"),Mn=x(async({logger:e,options:t,visConfig:i,visConfigError:s,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root.");const l=t.format==="json"||t.json===!0,d=Nr(t.only,t.skip),h=!!t.quiet,a=t.progress===!1,f=Ir(t.filter);if(d.size===0){u.error("No sections selected. Check your --only / --skip values."),process.exitCode=2;return}const k=Date.now(),v=kt(o),I=ci(o),z=!!process.stdout.isTTY,g=!l&&z&&!Yt&&!h&&!a;!l&&!g&&sn({nodeVersion:process.versions.node,packageManagerName:v.name,packageManagerVersion:v.version,runtimeFindings:I,workspaceCount:void 0});const D=pt(o,ut(o).packageManager),B=pi(o,v.name),J=B.length,V=ht(i?.security).length>0,L=i?.security?.policies?.score?.minimum??gt,R=wt(o);if(!l&&!h&&!g){const O=R.length>0?$(` · ${String(R.length)} workspace package${R.length===1?"":"s"}`):"";u.log(`${$("·")} ${$("Found")} ${ce(String(J))} ${$(`installed package${J===1?"":"s"}`)}${O}`)}const _=s?{hint:s.file?`Continuing with default settings — fix or regenerate ${s.file} (vis init --force).`:"Continuing with default settings.",message:s.message,severity:"error",title:s.file?`Failed to load ${s.file}`:"Failed to load vis.config"}:void 0,G=hi(o,v.name)?.file,se=G?q(o,G):void 0,ie=ti(o),U=t.cache!==!1&&!t.fix?Ai({configPath:ie,lockfilePath:se,sections:d,socketEnabled:V,workspaceRoot:o}):void 0,j=U?Pi(U):void 0,Y=j!==void 0;let S,C;if(g){const O=j?new nt({activeSections:d,findings:At(xt(j),f)}):new nt({activeSections:d}),Q=qt(Jt.createElement(Rr,{banner:_,fromCache:Y,startedAt:k,store:O}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0});try{S=j??await ct({filterPatterns:f,installed:B,resolveCodemods:!!t.fix,sections:d,store:O,visConfig:i,workspaceRoot:o})}catch(ee){throw Q.unmount(),ee}await Q.waitUntilExit(),C=O.getSnapshot().pendingAction}else if(j)S=j;else{const O=on(d,D.size,V,J,!!t.fix),Q=di(O,{live:!l&&!h&&!a});try{S=await ct({filterPatterns:f,installed:B,progress:Q,resolveCodemods:!!t.fix,sections:d,visConfig:i,workspaceRoot:o})}finally{Q.stop()}}const X={...S,elapsedMs:Date.now()-k};if(U&&!Y)try{Ii(U,X)}catch{}const T=Dr(X,f,L);if(l){process.stdout.write(`${JSON.stringify(Fr(T,v.name),void 0,2)}
|
|
4
|
+
`),t.exitCode&<(T,!!t.strict)&&(process.exitCode=1);return}Y&&!h&&u.log(`${$("·")} Cached results (use --no-cache to refresh)`),f.length>0&&!h&&u.log(`${$("·")} Filter active: ${Pe(t.filter??"")}`),nn(T,h);const le=T.runtime.some(O=>O.id===Fe&&O.status==="warn"),ue=T.sections.has("optimization")&&T.optimizations.length>0;t.fix&&(ue||le)?await ln({force:!!t.fixForce,logger:e,pm:v,recoverOrphans:le,results:T,useEditorconfig:i?.editorconfig??!0,workspaceRoot:o}):h||rn(T),C&&(process.stdout.write(`
|
|
5
|
+
`),process.stdout.write(`${ce("→ ")}${C.description}
|
|
6
|
+
`),C.configSnippet?(process.stdout.write(`
|
|
7
|
+
`),process.stdout.write(`${$(C.configSnippet)}
|
|
8
|
+
`)):process.stdout.write(` ${Pe(C.command)}
|
|
9
|
+
`),process.stdout.write(`
|
|
10
|
+
`)),t.exitCode&<(T,!!t.strict)&&(process.exitCode=1)},"execute"),ln=x(async e=>{const{force:t,logger:i,pm:s,recoverOrphans:o,results:l,useEditorconfig:d,workspaceRoot:h}=e;u.log(""),u.log(de("Applying fixes","ok"));const a=l.optimizations.filter(g=>g.category==="socket"&&g.overrideSpec).map(g=>({original:g.packageName,spec:g.overrideSpec})),f=l.optimizations.filter(g=>g.category!=="socket"&&g.hasCodemod),k=l.optimizations.filter(g=>g.category!=="socket"&&!g.hasCodemod);let v=!1,I=0;const z=[];if(o){const g=ji({force:t});if(g.killed.length>0&&(u.success(`Cleaned up ${String(g.killed.length)} orphaned process${g.killed.length===1?"":"es"} (PIDs: ${g.killed.join(", ")}).`),v=!0),g.failed.length>0){const D=t?"":" Re-run with `--fix --fix-force` to escalate to SIGKILL.";u.warn(`Could not signal ${String(g.failed.length)} orphan${g.failed.length===1?"":"s"}: ${g.failed.map(B=>`${String(B.pid)} (${B.reason})`).join(", ")}.${D}`)}}if(a.length>0){const g=si(h,q(h,"package.json"),a,s,d);g.added.length>0&&(u.success(`Added ${String(g.added.length)} security override${g.added.length===1?"":"s"}.`),v=!0),g.updated.length>0&&(u.success(`Updated ${String(g.updated.length)} override${g.updated.length===1?"":"s"}.`),v=!0)}for(const g of f)try{const D=await li(h,g.packageName);D.filesChanged>0&&(u.success(`${g.packageName}: ${String(D.filesChanged)} file${D.filesChanged===1?"":"s"} updated`),I+=1,v=!0)}catch(D){const B=D instanceof Error?D.message:String(D);z.push({error:B,package:g.packageName}),u.warn(`${g.packageName}: codemod failed — ${B}`)}a.length>0&&(u.log(`${Pe(M.arrow)} Running ${s.name} install to update lockfile…`),ai(s,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:!1,lockfileOnly:!1,noOptional:!1,offline:!1,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},h,i),v=!0),u.log(""),v?u.success(`Fixes applied. ${I>0?`${String(I)} codemod${I===1?"":"s"} applied.`:""}`.trim()):u.log(Ot("No auto-fixable items in the current run.")),z.length>0&&u.warn(`${String(z.length)} codemod${z.length===1?"":"s"} failed (run ${be("vis optimize")} for the interactive picker).`),k.length>0&&u.notice(`${String(k.length)} optimization${k.length===1?"":"s"} need manual review (no codemod). Run ${be("vis optimize")} to inspect them.`)},"runFixes");export{Mn as default};
|