@visulima/vis 1.0.0-alpha.13 → 1.0.0-alpha.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/LICENSE.md +7242 -385
- package/dist/bin.js +1 -1
- package/dist/config/index.d.ts +493 -1
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/applyDefaults.js +2 -2
- package/dist/packem_chunks/bin.js +1134 -199
- package/dist/packem_chunks/doctor-probe.js +2 -2
- package/dist/packem_chunks/fix.js +11 -11
- 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 +5 -5
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +20 -18
- package/dist/packem_chunks/handler15.js +1 -20
- 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 +5 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -5
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +5 -1
- package/dist/packem_chunks/handler23.js +1 -5
- package/dist/packem_chunks/handler24.js +3 -1
- package/dist/packem_chunks/handler25.js +1 -3
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler27.js +7 -1
- package/dist/packem_chunks/handler28.js +22 -6
- package/dist/packem_chunks/handler29.js +3 -23
- package/dist/packem_chunks/handler3.js +4 -4
- package/dist/packem_chunks/handler30.js +18 -3
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +24 -24
- package/dist/packem_chunks/handler34.js +2 -2
- package/dist/packem_chunks/handler35.js +2 -2
- package/dist/packem_chunks/handler36.js +20 -20
- package/dist/packem_chunks/handler37.js +2 -2
- package/dist/packem_chunks/handler38.js +6 -22
- package/dist/packem_chunks/handler39.js +11 -11
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +5 -22
- package/dist/packem_chunks/handler41.js +24 -6
- package/dist/packem_chunks/handler42.js +10 -5
- package/dist/packem_chunks/handler43.js +153 -10
- package/dist/packem_chunks/handler44.js +25 -153
- package/dist/packem_chunks/handler45.js +3 -25
- package/dist/packem_chunks/handler46.js +27 -3
- package/dist/packem_chunks/handler47.js +41 -26
- package/dist/packem_chunks/handler48.js +32 -40
- package/dist/packem_chunks/handler5.js +7 -7
- 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 +3 -3
- package/dist/packem_chunks/help-command.js +18 -0
- package/dist/packem_chunks/index.js +4 -4
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/tar.js +1 -1
- package/dist/packem_shared/ai-analysis-Dzs_nUwM.js +68 -0
- package/dist/packem_shared/ai-cache-Dtvmbsru.js +1 -0
- package/dist/packem_shared/{ai-fix-nn4zOE95.js → ai-fix-BmLM72GS.js} +4 -4
- package/dist/packem_shared/cache-directory-xASJia6M.js +1 -0
- package/dist/packem_shared/dependency-scan-DmwPKwLy.js +2 -0
- package/dist/packem_shared/docker-CA-scYu0.js +2 -0
- package/dist/packem_shared/failure-log-fD4DiFb1.js +2 -0
- package/dist/packem_shared/flakiness-BIg1rwvp.js +1 -0
- package/dist/packem_shared/{giget-CcEy_Elm.js → giget-BX2ixMoa.js} +2 -2
- package/dist/packem_shared/index-OlP7U_t5.js +6 -0
- package/dist/packem_shared/lockfile-BXylopgH.js +1 -0
- package/dist/packem_shared/otelPlugin-y5hoCw4b.js +1 -0
- package/dist/packem_shared/registry-BHqKXiLb.js +2 -0
- package/dist/packem_shared/run-summary-utils-D39XBHWW.js +1 -0
- package/dist/packem_shared/runtime-check-BaKni2y1.js +1 -0
- package/dist/packem_shared/selectors-BvtUXWGY.js +3 -0
- package/dist/packem_shared/toolchain-B7sIiJxK.js +5 -0
- package/dist/packem_shared/typosquats-XkC1CnOa.js +1 -0
- package/dist/packem_shared/verify-BVTcVfoW.js +1 -0
- package/dist/packem_shared/{vis-update-app-D1jl0UZZ.js → vis-update-app-DR8c4OfG.js} +1 -1
- package/package.json +15 -30
- package/dist/packem_shared/ai-analysis-hm8d2W7z.js +0 -67
- package/dist/packem_shared/ai-cache-DoiF80AR.js +0 -1
- package/dist/packem_shared/cache-directory-CwHlJhgx.js +0 -1
- package/dist/packem_shared/dependency-scan-COr5n63B.js +0 -2
- package/dist/packem_shared/docker-D6OGr5_S.js +0 -2
- package/dist/packem_shared/failure-log-iUVLf6ts.js +0 -2
- package/dist/packem_shared/flakiness-D9wf0t56.js +0 -1
- package/dist/packem_shared/otel-DxDUPJJH.js +0 -6
- package/dist/packem_shared/otelPlugin-CQq6poq8.js +0 -1
- package/dist/packem_shared/registry-CkubDdiY.js +0 -2
- package/dist/packem_shared/run-summary-utils-BfBvjzhY.js +0 -1
- package/dist/packem_shared/runtime-check-BXZ43CBW.js +0 -1
- package/dist/packem_shared/selectors-BylODRiM.js +0 -3
- package/dist/packem_shared/toolchain-BgBOUHII.js +0 -5
- package/dist/packem_shared/typosquats-CcZl99B1.js +0 -1
- package/dist/packem_shared/verify-Baj5mFJ7.js +0 -1
|
@@ -1,153 +1,25 @@
|
|
|
1
|
-
var ge=Object.defineProperty;var g=(e,t)=>ge(e,"name",{value:t,configurable:!0});import{createRequire as he}from"node:module";import{dim as d,bold as k,cyan as x}from"@visulima/colorize";import{isAccessibleSync as P,ensureDirSync as b,writeFileSync as m,readJsonSync as ie}from"@visulima/fs";import{resolve as _,basename as ve,relative as W,join as c,sep as be,isAbsolute as we}from"@visulima/path";import{am as ke,p as a,e as ce,h as xe,A as $e}from"./bin.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,V=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}=V("node:child_process"),{createInterface:_e}=V("node:readline"),{readdirSync:je,chmodSync:Ce}=V("node:fs");var Pe=Object.defineProperty,L=g((e,t)=>Pe(e,"name",{value:t,configurable:!0}),"e");const Ne={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Oe=["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 Oe)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=Ne[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 J(){return ae[Me(0,ae.length-1)]}g(J,"getRandomWord");le(J,"getRandomWord");var ze=Object.defineProperty,Le=g((e,t)=>ze(e,"name",{value:t,configurable:!0}),"o$1");const Ae=Le(()=>`${J()}-${J()}`,"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 Fe=ke(Be);var Je=Object.defineProperty,I=g((e,t)=>Je(e,"name",{value:t,configurable:!0}),"r$2");const pe=I(e=>e?Fe(e).validForNewPackages:!1,"isValidPackageName"),T=I(e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),"toValidPackageName"),Ve=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),ue=I(e=>P(e)?je(e).every(t=>Ve.has(t)):!0,"isEmptyDir"),We=I((e,t)=>{const r=_(t,e);return{packageName:T(ve(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"),F=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
|
-
`)
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
`)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
`)
|
|
9
|
-
${d("Template (npm package or GitHub URL):")} `),!i))throw new Error("No template specified.");const n=Ae(),u=await E(t,`
|
|
10
|
-
${
|
|
11
|
-
`)
|
|
12
|
-
`)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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,N=g((e,t)=>ut(e,"name",{value:t,configurable:!0}),"n");const dt=N(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=N(()=>`packages:
|
|
52
|
-
- "apps/*"
|
|
53
|
-
- "packages/*"
|
|
54
|
-
`,"pnpmWorkspaceYaml"),gt=N(()=>`# 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=N(()=>`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=N(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=N(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(P(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(P(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"),Pt=j((e,t)=>{const r=c(e,".ai");b(r);const i=c(r,"instructions");if(P(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"),Nt=j(e=>{ye("git",["init"],{cwd:e,stdio:"pipe"}).status===0?a.success("Initialized git repository"):a.warn("Failed to initialize git repository")},"initGitRepo"),Ot=j((e,t,r,i=!1)=>(a.info("Installing dependencies..."),xe(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"),Gt=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,$=$e(l);let y,h,f,O=o?.defaultEditor,M=o?.gitInit??!1,Y=[],q=$,K=!1;if(p.length===0&&w&&!r.noInteractive){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),O=v.editor??O,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)),O=r.editor==="vscode"?"vscode":O,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(`..${be}`)||we(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}O==="vscode"&&St(f),P(f)&&Pt(f,q.name),M&&!s&&Nt(f);let ee=!1;o?.install!==!1&&P(c(f,"package.json"))&&(ee=Ot(f,q,t,o?.preferOffline)),Et(f,l,q.name,ee)},"execute");export{Gt as default};
|
|
1
|
+
var he=Object.defineProperty;var D=(e,s)=>he(e,"name",{value:s,configurable:!0});import{createRequire as ke}from"node:module";import{aB as re,aC as ee,Z as E,ay as Pe,ax as L,aD as ve,S as te,aX as oe,c as w,j as v,E as u,q as R,e as x,d as b,a4 as we,R as De,aY as be,aZ as xe,a_ as Ne,a$ as Je}from"./bin.js";import{isAccessibleSync as I,readJsonSync as j,readFileSync as Se,writeFileSync as Te,writeJsonSync as C,walkSync as G}from"@visulima/fs";import{M as W,C as Z,z as P}from"../packem_shared/index-OlP7U_t5.js";import{o as ie}from"../packem_shared/index-DH-5hsrC.js";const ye=ke(import.meta.url),z=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$e=D(e=>{if(typeof z<"u"&&z.versions&&z.versions.node){const[s,o]=z.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return z.getBuiltinModule(e)}return ye(e)},"__cjs_getBuiltinModule"),{readFileSync:pe,writeFileSync:se}=$e("node:fs");var Re=Object.defineProperty,O=D((e,s)=>Re(e,"name",{value:s,configurable:!0}),"r$3");const We=O(e=>/[*?[\]{}!]/.test(e),"isGlob"),je=O(e=>typeof e=="string"?e:e.reason,"ruleReason"),Me=O(e=>typeof e=="string"?void 0:e.replacement,"ruleReplacement"),ae=O((e,s)=>e.some(o=>ie(o,s)),"matchesAnyGlob"),ne=O((e,s)=>{if(typeof e=="string")return!0;const o=Array.isArray(e.packages)&&e.packages.length>0,t=Array.isArray(e.paths)&&e.paths.length>0;return!!(!o&&!t||o&&s.packageName!==void 0&&ae(e.packages,s.packageName)||t&&ae(e.paths,s.packageDir))},"ruleAppliesToInstance"),Fe=O((e,s)=>{const o=s[e.depName];if(o!==void 0&&ne(o,e))return{pattern:e.depName,rule:o};for(const[t,r]of Object.entries(s))if(We(t)&&ie(t,e.depName)&&ne(r,e))return{pattern:t,rule:r}},"findMatchingRule"),Ie=O((e,s)=>{if(Object.keys(s).length===0)return[];const o=[];for(const t of e){if(t.isInternal)continue;const r=Fe(t,s);r&&o.push({depName:t.depName,depType:t.depType,matchedPattern:r.pattern,packageDir:t.packageDir,packageJsonPath:t.packageJsonPath,packageName:t.packageName,reason:je(r.rule),replacement:Me(r.rule),specifier:t.specifier})}return o},"lintBannedDeps");var Ee=Object.defineProperty,_=D((e,s)=>Ee(e,"name",{value:s,configurable:!0}),"m");const Ce=new Set(["dependencies","devDependencies","peerDependencies"]),Ve=_(e=>e.startsWith("catalog:"),"isCatalogReference"),Ae=_(e=>e.startsWith("workspace:"),"isWorkspaceReference"),Oe=_((e,s)=>{if(!e)return!1;for(const o of e.values())if(o.has(s))return!0;return!1},"isPinnedInAnyCatalog"),He=_((e,s={})=>{const o=s.min??3,t=new Set(s.ignoreDeps),r=e.filter(i=>i.isInternal||!Ce.has(i.depType)||Ae(i.specifier)||s.dep!==void 0&&i.depName!==s.dep?!1:!t.has(i.depName)),n=new Map;for(const i of r){const p=n.get(i.depName);p?p.push(i):n.set(i.depName,[i])}const a=[];for(const[i,p]of n){if(Oe(s.catalogs,i)||p.some(m=>Ve(m.specifier)))continue;const c=new Map;for(const m of p){let d=c.get(m.specifier);d||(d=new Set,c.set(m.specifier,d)),d.add(m.packageJsonPath)}const f=[...c.entries()].sort((m,d)=>m[1].size!==d[1].size?d[1].size-m[1].size:m[0].localeCompare(d[0]))[0];!f||f[1].size<o||a.push({catalogName:"default",depName:i,instanceCount:f[1].size,specifier:f[0]})}return a.sort((i,p)=>i.depName.localeCompare(p.depName))},"proposeCatalogAdditions"),_e=_((e,s)=>{if(s.length===0)return;const o=W(e,"pnpm-workspace.yaml"),t=I(o)?pe(o,"utf8"):"",r=t.includes(`\r
|
|
2
|
+
`)?`\r
|
|
3
|
+
`:`
|
|
4
|
+
`,n=s.filter(d=>d.catalogName==="default").sort((d,g)=>d.depName.localeCompare(g.depName));if(n.length===0)return;const a=t.length>0?t.split(r):[],i=a.findIndex(d=>/^catalog\s*:\s*$/.test(d));if(i===-1){const d=["catalog:"];for(const $ of n)d.push(` ${$.depName}: "${$.specifier}"`);let g=0;for(;g<a.length&&(a[g]??"").trim().length===0;)g+=1;const h=[...a.slice(0,g),...d,"",...a.slice(g)].join(r);return se(o,h.endsWith(r)?h:`${h}${r}`),o}let p=a.length;const c=new Set;for(let d=i+1;d<a.length;d+=1){const g=a[d]??"",h=g.trimStart();if(g.length===0)continue;if(g.length-h.length===0&&h.length>0&&!h.startsWith("#")){p=d;break}const $=/^([\w./@-]+)\s*:/.exec(h);$?.[1]&&c.add($[1])}const f=[];for(const d of n)c.has(d.depName)||f.push(` ${d.depName}: "${d.specifier}"`);if(f.length===0)return;const m=[...a.slice(0,p),...f,...a.slice(p)].join(r);return se(o,m.endsWith(r)?m:`${m}${r}`),o},"applyCatalogProposals"),ze=_((e,s)=>{if(s.length===0)return"";const o=W(e,"pnpm-workspace.yaml"),t=I(o)?pe(o,"utf8"):"",r=[...s].sort((i,p)=>i.depName.localeCompare(p.depName)),n=["--- pnpm-workspace.yaml","+++ pnpm-workspace.yaml"],a=t.includes(`\r
|
|
5
|
+
`)?`\r
|
|
6
|
+
`:`
|
|
7
|
+
`;if((t.length>0?t.split(a):[]).findIndex(i=>/^catalog\s*:\s*$/.test(i))===-1){n.push("@@ +1 @@","+catalog:");for(const i of r)n.push(`+ ${i.depName}: "${i.specifier}"`)}else{n.push("@@ catalog: @@");for(const i of r)n.push(`+ ${i.depName}: "${i.specifier}"`)}return n.join(a)},"renderCatalogProposalsDiff");var Be=Object.defineProperty,ce=D((e,s)=>Be(e,"name",{value:s,configurable:!0}),"l");const Le=ce(e=>{const s=[],o=re(e);if(o){const r=W(e,"pnpm-workspace.yaml");for(const n of o)n.startsWith("!")||ee(e,[n]).length===0&&s.push({pattern:n,source:"pnpm-workspace.yaml",sourcePath:r})}const t=W(e,"package.json");if(I(t)){const r=j(t).workspaces,n=Array.isArray(r)?r:r?.packages;if(n)for(const a of n)typeof a!="string"||a.startsWith("!")||ee(e,[a]).length===0&&s.push({pattern:a,source:"package.json",sourcePath:t})}return s},"lintDeadWorkspacePatterns"),qe=ce((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.sourcePath);a?a.push(n):t.set(n.sourcePath,[n])}const r=[];for(const[n,a]of t){const i=new Set(a.map(f=>f.pattern));if(n.endsWith(".yaml")||n.endsWith(".yml")){const f=Se(n).split(`
|
|
8
|
+
`).filter(m=>{const d=m.trim();if(!d.startsWith("- "))return!0;const g=d.slice(2).replaceAll(/^['"]|['"]$/g,"");return!i.has(g)}).join(`
|
|
9
|
+
`);Te(n,f,{overwrite:!0}),r.push(n);continue}const p=j(n),c=p.workspaces;Array.isArray(c)?p.workspaces=c.filter(f=>typeof f!="string"||!i.has(f)):c&&Array.isArray(c.packages)&&(c.packages=c.packages.filter(f=>typeof f!="string"||!i.has(f))),C(n,p,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyDeadWorkspacePatternFixes");var Ue=Object.defineProperty,fe=D((e,s)=>Ue(e,"name",{value:s,configurable:!0}),"f$2");const Ge=["dependencies","devDependencies","peerDependencies","optionalDependencies"],Ze=fe((e,s={})=>{const o=new Set(s.ignoreBlocks),t=Pe(e),r=[];for(const n of t){const a=W(e,n,"package.json"),i=L(a);if(!i)continue;const p=typeof i.name=="string"?i.name:void 0;for(const c of Ge){if(o.has(c))continue;const f=i[c];typeof f=="object"&&f!==null&&!Array.isArray(f)&&Object.keys(f).length===0&&r.push({depType:c,packageDir:n,packageJsonPath:a,packageName:p})}}return r},"lintEmptyDeps"),Xe=fe((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=j(n);for(const p of a){const c=i[p.depType];typeof c=="object"&&c!==null&&!Array.isArray(c)&&Object.keys(c).length===0&&Reflect.deleteProperty(i,p.depType)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyEmptyDepsFixes");var Ye=Object.defineProperty,le=D((e,s)=>Ye(e,"name",{value:s,configurable:!0}),"o");const Ke=/\/+$/,X=/node_modules/,Y=/\.git/,Qe=/[$()+.?[\\\]^{|}]/g,et=/\/\*\*$|\/\*\/\*$/,tt=le((e,s)=>{const o=s.replace(Ke,"");if(o.startsWith("!"))return[];const t=[];if(o.endsWith("/*")){const n=o.slice(0,-2),a=Z(e,n);if(!I(a))return[];for(const i of G(a,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[X,Y]}))i.path===a||i.name.startsWith(".")||t.push(W(n,i.name));return t}if(o.endsWith("/**")||o.endsWith("/*/*")){const n=o.replace(et,""),a=Z(e,n);if(!I(a))return[];for(const i of G(a,{includeFiles:!1,includeSymlinks:!1,skip:[X,Y]})){if(i.path===a)continue;const p=i.path.slice(a.length+1);t.push(`${n}/${p}`)}return t}if(!o.includes("/")&&o.includes("*")){const n=o.replaceAll(Qe,"\\$&").replaceAll("*",".*"),a=new RegExp(`^${n}$`);for(const i of G(e,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[X,Y]}))i.path!==e&&a.test(i.name)&&t.push(i.name);return t}const r=Z(e,o);return I(r)&&t.push(o),t},"collectPatternMatches"),ot=le(e=>{const s=re(e)??ve(e)??[],o=new Set,t=[];for(const r of s)for(const n of tt(e,r))n==="."||o.has(n)||(o.add(n),I(W(e,n,"package.json"))||t.push({packageDir:n}));return t},"lintMissingPackageJson");var st=Object.defineProperty,at=D((e,s)=>st(e,"name",{value:s,configurable:!0}),"r$2");const nt=["dependencies","devDependencies","optionalDependencies","peerDependencies"],rt=at((e,s={})=>{const o=new Set(s.depTypes??nt),t=new Set(s.ignoreDeps),r=new Map;for(const a of e)a.packageDir!=="."||!o.has(a.depType)||r.set(a.depName,{depType:a.depType,specifier:a.specifier});if(r.size===0)return[];const n=[];for(const a of e){if(a.packageDir==="."||!o.has(a.depType)||t.has(a.depName))continue;const i=r.get(a.depName);i&&n.push({childSpecifier:a.specifier,depName:a.depName,depType:a.depType,packageDir:a.packageDir,packageJsonPath:a.packageJsonPath,packageName:a.packageName,rootDepType:i.depType,rootSpecifier:i.specifier})}return n},"lintRedefineRoot");var it=Object.defineProperty,ge=D((e,s)=>it(e,"name",{value:s,configurable:!0}),"a$1");const pt=ge((e,s)=>{if(!s)return[];const o=W(e,"package.json"),t=L(o);if(!t)return[];if(t.private!==!0)return[];const r=t.dependencies;if(typeof r!="object"||r===null||Array.isArray(r))return[];const n=Object.keys(r);return n.length===0?[]:[{depNames:n,packageJsonPath:o}]},"lintRootDeps"),ct=ge((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){const n=j(r.packageJsonPath),a=n.dependencies;if(typeof a!="object"||a===null)continue;const i=a;n.devDependencies??={};const p=n.devDependencies;for(const c of r.depNames){const f=i[c];typeof f=="string"&&(c in p||(p[c]=f),Reflect.deleteProperty(i,c))}Object.keys(i).length===0&&Reflect.deleteProperty(n,"dependencies"),C(r.packageJsonPath,n,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootDepsFixes");var ft=Object.defineProperty,de=D((e,s)=>ft(e,"name",{value:s,configurable:!0}),"r$1");const lt=/^[a-z][\w-]*@\S+$/i,gt=de((e,s,o={})=>{if(!s)return[];const t=W(e,"package.json"),r=L(t);if(!r)return[];const n=r.packageManager;return typeof n=="string"&<.test(n)?[]:[{packageJsonPath:t,suggested:o.suggested}]},"lintRootPackageManager"),dt=de((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){if(!r.suggested)continue;const n=j(r.packageJsonPath);n.packageManager=r.suggested,C(r.packageJsonPath,n,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootPackageManagerFixes");var ut=Object.defineProperty,ue=D((e,s)=>ut(e,"name",{value:s,configurable:!0}),"a");const mt=ue((e,s)=>{if(!s)return[];const o=W(e,"package.json"),t=L(o);return t?t.private===!0?[]:[{packageJsonPath:o,rawValue:t.private}]:[]},"lintRootPrivate"),ht=ue((e,s={})=>{const{useEditorconfig:o}=s,t=[];for(const r of e){const n=j(r.packageJsonPath);let a=n;if("private"in n)n.private=!0;else{const{name:i,version:p,...c}=n,f={};i!==void 0&&(f.name=i),p!==void 0&&(f.version=p),f.private=!0;for(const[m,d]of Object.entries(c))f[m]=d;a=f}C(r.packageJsonPath,a,{indent:E(r.packageJsonPath,{useEditorconfig:o}),overwrite:!0}),t.push(r.packageJsonPath)}return t},"applyRootPrivateFixes");var kt=Object.defineProperty,Q=D((e,s)=>kt(e,"name",{value:s,configurable:!0}),"p$1");const yt=[{id:"react",label:"React",members:["react","react-dom","react-test-renderer"]},{id:"next",label:"Next.js",members:["next","@next/font","@next/bundle-analyzer","@next/mdx","@next/third-parties","@next/eslint-plugin-next","eslint-config-next"]},{id:"babel",label:"Babel",prefixes:["@babel/"]},{id:"storybook",label:"Storybook",members:["storybook","sb"],prefixes:["@storybook/"]},{id:"vitest",label:"Vitest",members:["vitest"],prefixes:["@vitest/"]},{id:"playwright",label:"Playwright",members:["playwright","@playwright/test"]},{id:"trpc",label:"tRPC",prefixes:["@trpc/"]},{id:"prisma",label:"Prisma",members:["prisma"],prefixes:["@prisma/"]},{id:"turborepo",label:"Turborepo",members:["turbo","turbo-ignore","@turbo/gen","eslint-config-turbo","eslint-plugin-turbo"]},{id:"typescript-eslint",label:"typescript-eslint",members:["typescript-eslint"],prefixes:["@typescript-eslint/"]},{id:"eslint-stylistic",label:"ESLint Stylistic",prefixes:["@stylistic/"]},{id:"lexical",label:"Lexical",members:["lexical"],prefixes:["@lexical/"]},{id:"nx",label:"Nx",prefixes:["@nx/","@nrwl/"]}],$t=new Set(["dependencies","devDependencies","peerDependencies"]),Pt=Q((e,s)=>{for(const o of e)if(o.members?.includes(s)||o.prefixes?.some(t=>s.startsWith(t)))return o},"familyForDep"),vt=Q(e=>e.startsWith("workspace:")||e.startsWith("catalog:"),"isWorkspaceOrCatalogReference"),wt=Q((e,s={})=>{const o=new Set(s.ignoreFamilies),t=new Map;for(const i of yt)t.set(i.id,i);for(const i of s.extraFamilies??[])t.set(i.id,i);const r=[...t.values()],n=new Map;for(const i of e){if(i.isInternal||!$t.has(i.depType)||vt(i.specifier))continue;const p=Pt(r,i.depName);if(!p||o.has(p.id))continue;const c=n.get(p.id),f={depName:i.depName,depType:i.depType,packageDir:i.packageDir,packageJsonPath:i.packageJsonPath,packageName:i.packageName,specifier:i.specifier};c?c.push(f):n.set(p.id,[f])}const a=[];for(const[i,p]of n){const c=[...new Set(p.map(m=>m.specifier))];if(c.length<2)continue;const f=t.get(i);f&&a.push({family:i,familyLabel:f.label??i,members:p,specifiers:c})}return a},"lintSimilarDeps");var Dt=Object.defineProperty,B=D((e,s)=>Dt(e,"name",{value:s,configurable:!0}),"r");const bt=B(e=>e.startsWith("@types/"),"isTypesPackage"),xt=B((e,s={})=>{const o=new Set(s.ignoreDeps),t=new Map,r=B(a=>{const i=t.get(a);if(i!==void 0)return i;try{const p=j(a).private===!0;return t.set(a,p),p}catch{return t.set(a,!1),!1}},"isPrivate"),n=[];for(const a of e)a.depType==="dependencies"&&bt(a.depName)&&(o.has(a.depName)||r(a.packageJsonPath)&&n.push({childSpecifier:a.specifier,depName:a.depName,packageDir:a.packageDir,packageJsonPath:a.packageJsonPath,packageName:a.packageName}));return n},"lintTypesInDeps"),Nt=B((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=j(n),p=i.dependencies;if(typeof p!="object"||p===null)continue;const c=p;i.devDependencies??={};const f=i.devDependencies;for(const m of a){const d=c[m.depName];typeof d=="string"&&(m.depName in f||(f[m.depName]=d),Reflect.deleteProperty(c,m.depName))}Object.keys(c).length===0&&Reflect.deleteProperty(i,"dependencies"),C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyTypesInDepsFixes");var Jt=Object.defineProperty,q=D((e,s)=>Jt(e,"name",{value:s,configurable:!0}),"f");const St=q(e=>e.startsWith("workspace:"),"isWorkspaceSpecifier"),Tt=q((e,s={})=>{const o=s.fixSpecifier??"workspace:*",t=[];for(const r of e)r.isInternal&&(St(r.specifier)||t.push({depName:r.depName,depType:r.depType,fix:o,packageDir:r.packageDir,packageJsonPath:r.packageJsonPath,packageName:r.packageName,specifier:r.specifier}));return t},"lintWorkspaceProtocol"),Rt=q((e,s,o,t)=>{const r=s.split(".");let n=e;for(let p=0;p<r.length-1;p+=1){const c=r[p],f=n[c];(typeof f!="object"||f===null)&&(n[c]={}),n=n[c]}const a=r.at(-1);let i=n[a];(typeof i!="object"||i===null)&&(i={},n[a]=i),i[o]=t},"setNestedField"),Wt=q((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=j(n);for(const p of a)if(p.depType.includes("."))Rt(i,p.depType,p.depName,p.fix);else{const c=i[p.depType];typeof c=="object"&&c!==null&&(c[p.depName]=p.fix)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyWorkspaceProtocolFixes");var jt=Object.defineProperty,V=D((e,s)=>jt(e,"name",{value:s,configurable:!0}),"p");const Mt=new Set(["dependencies","devDependencies","peerDependencies"]),Ft=V(e=>e.startsWith("catalog:"),"isCatalogReference"),It=V(e=>e.startsWith("workspace:"),"isWorkspaceReference"),Et=V(e=>{if(!e.startsWith("catalog:"))return;const s=e.slice(8);return s===""?"default":s},"catalogNameOf"),Ct=V((e,s)=>{if(e.get("default")?.has(s))return"default";const o=[...e.keys()].filter(t=>t!=="default").sort();for(const t of o)if(e.get(t)?.has(s))return t},"findCatalogPinning"),Vt=V(e=>e==="default"?"catalog:":`catalog:${e}`,"buildCatalogSpecifier"),At=V((e,s)=>{const o=[...e].sort((r,n)=>(r.packageName??r.packageDir).localeCompare(n.packageName??n.packageDir));let t;for(const r of o){const n=te(r.specifier);if(!n)continue;if(!t){t=r;continue}const a=te(t.specifier);if(!a){t=r;continue}const i=oe(a,n),p=oe(n,a);(s==="highest"&&i||s==="lowest"&&p)&&(t=r)}if(t)return{canonical:t,canonicalSource:t.packageName??t.packageDir}},"pickCanonicalBySemver"),Ot=V((e,s={})=>{const o=s.resolve??"highest",t=new Set(s.ignoreDeps),r=[],n=e.filter(i=>i.isInternal||!Mt.has(i.depType)||It(i.specifier)||s.dep!==void 0&&i.depName!==s.dep?!1:!t.has(i.depName)),a=new Map;for(const i of n){const p=a.get(i.depName);p?p.push(i):a.set(i.depName,[i])}for(const[i,p]of a){const c=s.pinned?.get(i);if(c!==void 0){for(const g of p)g.specifier!==c&&r.push({canonicalSource:"cli:--pin",depName:i,depType:g.depType,fix:c,packageDir:g.packageDir,packageJsonPath:g.packageJsonPath,packageName:g.packageName,specifier:g.specifier});continue}if(o==="catalog"){const{catalogs:g}=s;if(!g)continue;const h=Ct(g,i);if(!h)continue;const $=Vt(h);for(const S of p)Et(S.specifier)!==h&&r.push({canonicalSource:`catalog:${h}`,depName:i,depType:S.depType,fix:$,packageDir:S.packageDir,packageJsonPath:S.packageJsonPath,packageName:S.packageName,specifier:S.specifier});continue}const f=p.filter(g=>!Ft(g.specifier));if(f.length<2||new Set(f.map(g=>g.specifier)).size<=1)continue;const m=At(f,o);if(!m)continue;const d=m.canonical.specifier;for(const g of f)g.specifier!==d&&r.push({canonicalSource:m.canonicalSource,depName:i,depType:g.depType,fix:d,packageDir:g.packageDir,packageJsonPath:g.packageJsonPath,packageName:g.packageName,specifier:g.specifier})}return r},"lintWorkspaceVersions"),Ht=V((e,s={})=>{const{useEditorconfig:o}=s,t=new Map;for(const n of e){const a=t.get(n.packageJsonPath);a?a.push(n):t.set(n.packageJsonPath,[n])}const r=[];for(const[n,a]of t){const i=j(n);for(const p of a){const c=i[p.depType];typeof c=="object"&&c!==null&&(c[p.depName]=p.fix)}C(n,i,{indent:E(n,{useEditorconfig:o}),overwrite:!0}),r.push(n)}return r},"applyWorkspaceVersionsFixes");var _t=Object.defineProperty,y=D((e,s)=>_t(e,"name",{value:s,configurable:!0}),"u");const zt=y(e=>{if(I(W(e,"pnpm-workspace.yaml")))return!0;const s=W(e,"package.json");if(!I(s))return!1;try{return j(s).workspaces!==void 0}catch{return!1}},"detectWorkspaceConfig"),A=y((e,s)=>{const o=new Map;for(const t of e){const r=s(t),n=o.get(r);n?n.push(t):o.set(r,[t])}return o},"groupBy"),Bt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ workspace-protocol: no violations"));return}const r=o?"Fixed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} workspace-protocol violation${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>p.packageName??p.packageJsonPath)){const p=P(s,i[0].packageJsonPath);t.info(` ${v(a)} ${u(`(${p})`)}`);for(const c of i){const f=o?R("→"):x("→");t.info(` ${u(c.depType)} ${c.depName}: ${b(c.specifier)} ${f} ${w(c.fix)}`)}}o||t.info(u(" Run with --fix to rewrite specifiers in place."))},"printWorkspaceProtocolHuman"),Lt=y((e,s,o)=>{if(e.length===0){o.info(w("✓ redefine-root: no violations"));return}o.info(x(v(`Found ${String(e.length)} dep${e.length===1?"":"s"} re-declared from root`)));for(const[t,r]of A(e,n=>n.packageName??n.packageJsonPath)){const n=P(s,r[0].packageJsonPath);o.info(` ${v(t)} ${u(`(${n})`)}`);for(const a of r)o.info(` ${u(a.depType)} ${a.depName}: ${b(a.childSpecifier)} ${u(`(root ${a.rootDepType}: ${a.rootSpecifier})`)}`)}o.info(u(" Remove these from child package.json files — root pin will resolve."))},"printRedefineRootHuman"),qt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ workspace-versions: no drift"));return}const r=o?"Fixed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} workspace-version drift${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>p.depName)){const p=i[0].fix,c=i[0].canonicalSource;t.info(` ${v(a)} ${u(`canonical: ${p} (from ${c})`)}`);for(const f of i){const m=P(s,f.packageJsonPath),d=f.packageName??m,g=o?R("→"):x("→");t.info(` ${d} ${u(`(${m})`)} ${u(f.depType)}: ${b(f.specifier)} ${g} ${w(f.fix)}`)}}o||t.info(u(" Run with --fix to align drifting specifiers."))},"printWorkspaceVersionsHuman"),Ut=y((e,s,o)=>{if(e.length===0){o.info(w("✓ banned-deps: no violations"));return}o.info(b(v(`Found ${String(e.length)} banned dep${e.length===1?"":"s"}`)));for(const[t,r]of A(e,n=>n.packageName??n.packageJsonPath)){const n=P(s,r[0].packageJsonPath);o.info(` ${v(t)} ${u(`(${n})`)}`);for(const a of r){const i=a.replacement?` ${u("→")} ${w(a.replacement)}`:"";o.info(` ${u(a.depType)} ${b(a.depName)}${i}`),o.info(` ${u(a.reason)}`)}}},"printBannedDepsHuman"),Gt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ catalog-proposals: nothing worth promoting"));return}const r=o?"Added":"Would add",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} catalog entr${e.length===1?"y":"ies"}`)));for(const a of e)t.info(` ${v(a.depName)}: ${w(a.specifier)} ${u(`(${String(a.instanceCount)} packages agree)`)}`);if(!o){const a=ze(s,e);if(a){t.info(""),t.info(u("Proposed pnpm-workspace.yaml changes:"));for(const i of a.split(`
|
|
10
|
+
`))i.startsWith("+")?t.info(w(i)):i.startsWith("-")?t.info(b(i)):t.info(u(i))}t.info(u(" Run with --fix to write these entries to pnpm-workspace.yaml."))}},"printCatalogProposalsHuman"),Zt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ custom-types: no engines / packageManager / volta drift"));return}const r=o?"Fixed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} custom-type drift${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>`${p.customType} ${p.depName}`)){const p=i[0].fix,c=i[0].canonicalSource;t.info(` ${v(a)} ${u(`canonical: ${p} (from ${c})`)}`);for(const f of i){const m=P(s,f.packageJsonPath),d=f.packageName??m,g=o?R("→"):x("→");t.info(` ${d} ${u(`(${m})`)}: ${b(f.specifier)} ${g} ${w(f.fix)}`)}}o||t.info(u(" Run with --fix to align engines/packageManager/volta versions."))},"printCustomTypesHuman"),Xt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ empty-deps: no empty dependency blocks"));return}const r=o?"Removed":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} empty dependency block${e.length===1?"":"s"}`)));for(const[a,i]of A(e,p=>p.packageName??p.packageJsonPath)){const p=P(s,i[0].packageJsonPath);t.info(` ${v(a)} ${u(`(${p})`)}`);for(const c of i)t.info(` ${u(c.depType)}: ${b("{}")}`)}o||t.info(u(" Run with --fix to drop empty blocks."))},"printEmptyDepsHuman"),Yt=y((e,s,o,t)=>{if(e.length===0){t.info(w('✓ root-private: root package.json is "private": true'));return}const r=o?"Set":"Missing",n=o?R:b;for(const a of e){const i=P(s,a.packageJsonPath);if(t.info(n(v(`${r} "private": true on root ${u(`(${i})`)}`))),!o){const p=a.rawValue===void 0?"absent":JSON.stringify(a.rawValue);t.info(` ${u("current:")} ${b(p)}`)}}o||t.info(u(' Run with --fix to set "private": true.'))},"printRootPrivateHuman"),Kt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ root-package-manager: packageManager field present"));return}const r=o?"Set":"Missing",n=o?R:b;for(const a of e){const i=P(s,a.packageJsonPath);t.info(n(v(`${r} packageManager on root ${u(`(${i})`)}`))),!o&&!a.suggested&&t.info(u(" no canonical specifier configured (set policy.rootPackageManager.suggested to enable --fix)"))}o||t.info(u(' e.g. "packageManager": "pnpm@10.32.1"'))},"printRootPackageManagerHuman"),Qt=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ root-deps: no runtime dependencies on private root"));return}const r=o?"Moved":"Found",n=o?R:x;for(const a of e){const i=P(s,a.packageJsonPath);t.info(n(v(`${r} ${String(a.depNames.length)} runtime dep${a.depNames.length===1?"":"s"} on private root ${u(`(${i})`)}`)));for(const p of a.depNames)t.info(` ${b(p)}`)}o||t.info(u(" Run with --fix to move them to devDependencies."))},"printRootDepsHuman"),eo=y((e,s)=>{if(e.length===0){s.info(w("✓ missing-package-json: every workspace dir has a package.json"));return}s.info(x(v(`Found ${String(e.length)} workspace dir${e.length===1?"":"s"} without a package.json`)));for(const o of e)s.info(` ${b(o.packageDir)}`);s.info(u(" Either delete the directory or scaffold a package.json (vis create)."))},"printMissingPackageJsonHuman"),to=y((e,s,o)=>{if(e.length===0){o.info(w("✓ dead-workspace-pattern: every workspace pattern matches at least one package"));return}const t=s?"Removed":"Found",r=s?R:x;o.info(r(v(`${t} ${String(e.length)} unmatched workspace pattern${e.length===1?"":"s"}`)));for(const[n,a]of A(e,i=>i.source)){o.info(` ${v(n)}`);for(const i of a)o.info(` ${b(i.pattern)}`)}s||o.info(u(" Run with --fix to drop dead patterns."))},"printDeadWorkspacePatternsHuman"),oo=y((e,s,o,t)=>{if(e.length===0){t.info(w("✓ types-in-deps: no @types/* in dependencies of private packages"));return}const r=o?"Moved":"Found",n=o?R:x;t.info(n(v(`${r} ${String(e.length)} @types/* dep${e.length===1?"":"s"} in dependencies`)));for(const[a,i]of A(e,p=>p.packageName??p.packageJsonPath)){const p=P(s,i[0].packageJsonPath);t.info(` ${v(a)} ${u(`(${p})`)}`);for(const c of i)t.info(` ${b(c.depName)} ${u(c.childSpecifier)}`)}o||t.info(u(" Run with --fix to move them to devDependencies."))},"printTypesInDepsHuman"),so=y((e,s,o)=>{if(e.length===0){o.info(w("✓ similar-deps: every related dep family is in sync"));return}o.info(x(v(`Found ${String(e.length)} family${e.length===1?"":" families"} with version drift`)));for(const t of e){o.info(` ${v(t.familyLabel)} ${u(`(${t.specifiers.join(", ")})`)}`);for(const r of t.members){const n=P(s,r.packageJsonPath),a=r.packageName??n;o.info(` ${a} ${u(`(${n})`)} ${u(r.depType)}: ${b(r.depName)}@${x(r.specifier)}`)}}o.info(u(" Pick a single specifier per family and align by hand — auto-fix is unsafe across name boundaries."))},"printSimilarDepsHuman"),ao=y((e,s,o,t,r)=>{let n=!0;const a=y(i=>{n||r.info(""),n=!1,i()},"section");t.workspaceProtocol&&a(()=>{Bt(e.workspaceProtocol??[],s,o.workspaceProtocol,r)}),t.redefineRoot&&a(()=>{Lt(e.redefineRoot??[],s,r)}),t.workspaceVersions&&a(()=>{qt(e.workspaceVersions??[],s,o.workspaceVersions,r)}),t.customTypes&&a(()=>{Zt(e.customTypes??[],s,o.customTypes,r)}),e.catalogProposals!==void 0&&a(()=>{Gt(e.catalogProposals??[],s,o.catalogProposals,r)}),t.bannedDeps&&a(()=>{Ut(e.bannedDeps??[],s,r)}),t.emptyDeps&&a(()=>{Xt(e.emptyDeps??[],s,o.emptyDeps,r)}),t.rootPrivate&&a(()=>{Yt(e.rootPrivate??[],s,o.rootPrivate,r)}),t.rootPackageManager&&a(()=>{Kt(e.rootPackageManager??[],s,o.rootPackageManager,r)}),t.rootDeps&&a(()=>{Qt(e.rootDeps??[],s,o.rootDeps,r)}),t.missingPackageJson&&a(()=>{eo(e.missingPackageJson??[],r)}),t.deadWorkspacePatterns&&a(()=>{to(e.deadWorkspacePatterns??[],o.deadWorkspacePatterns,r)}),t.typesInDeps&&a(()=>{oo(e.typesInDeps??[],s,o.typesInDeps,r)}),t.similarDeps&&a(()=>{so(e.similarDeps??[],s,r)})},"printHuman"),no=y((e,s)=>{for(const o of e.workspaceProtocol??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`workspace-protocol ${t} ${o.depType} ${o.depName} ${o.specifier} → ${o.fix}
|
|
11
|
+
`)}for(const o of e.redefineRoot??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`redefine-root ${t} ${o.depType} ${o.depName} ${o.childSpecifier}
|
|
12
|
+
`)}for(const o of e.workspaceVersions??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`workspace-versions ${t} ${o.depType} ${o.depName} ${o.specifier} → ${o.fix}
|
|
13
|
+
`)}for(const o of e.customTypes??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`custom-types ${t} ${o.customType} ${o.depName} ${o.specifier} → ${o.fix}
|
|
14
|
+
`)}for(const o of e.bannedDeps??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`banned-deps ${t} ${o.depType} ${o.depName} ${o.reason}
|
|
15
|
+
`)}for(const o of e.catalogProposals??[])process.stdout.write(`catalog-proposal ${o.catalogName} ${o.depName} ${o.specifier} ${String(o.instanceCount)}
|
|
16
|
+
`);for(const o of e.emptyDeps??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`empty-deps ${t} ${o.depType}
|
|
17
|
+
`)}for(const o of e.rootPrivate??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`root-private ${t}
|
|
18
|
+
`)}for(const o of e.rootPackageManager??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`root-package-manager ${t} ${o.suggested??""}
|
|
19
|
+
`)}for(const o of e.rootDeps??[]){const t=P(s,o.packageJsonPath);for(const r of o.depNames)process.stdout.write(`root-deps ${t} ${r}
|
|
20
|
+
`)}for(const o of e.missingPackageJson??[])process.stdout.write(`missing-package-json ${o.packageDir}
|
|
21
|
+
`);for(const o of e.deadWorkspacePatterns??[])process.stdout.write(`dead-workspace-pattern ${o.source} ${o.pattern}
|
|
22
|
+
`);for(const o of e.typesInDeps??[]){const t=P(s,o.packageJsonPath);process.stdout.write(`types-in-deps ${t} ${o.depName} ${o.childSpecifier}
|
|
23
|
+
`)}for(const o of e.similarDeps??[])for(const t of o.members){const r=P(s,t.packageJsonPath);process.stdout.write(`similar-deps ${o.family} ${r} ${t.depType} ${t.depName} ${t.specifier}
|
|
24
|
+
`)}},"printMinimal"),ro=y((e,s,o,t)=>{const r=y(a=>({...a,packageJsonPath:P(s,a.packageJsonPath)}),"relativize"),n={fixed:o};if(t.workspaceProtocol){const a=(e.workspaceProtocol??[]).map(i=>r(i));n.workspaceProtocol={issues:a,total:a.length}}if(t.redefineRoot){const a=(e.redefineRoot??[]).map(i=>r(i));n.redefineRoot={issues:a,total:a.length}}if(t.workspaceVersions){const a=(e.workspaceVersions??[]).map(i=>r(i));n.workspaceVersions={issues:a,total:a.length}}if(t.customTypes){const a=(e.customTypes??[]).map(i=>r(i));n.customTypes={issues:a,total:a.length}}if(t.bannedDeps){const a=(e.bannedDeps??[]).map(i=>r(i));n.bannedDeps={issues:a,total:a.length}}if(e.catalogProposals!==void 0){const a=e.catalogProposals;n.catalogProposals={proposals:a,total:a.length}}if(t.emptyDeps){const a=(e.emptyDeps??[]).map(i=>r(i));n.emptyDeps={issues:a,total:a.length}}if(t.rootPrivate){const a=(e.rootPrivate??[]).map(i=>r(i));n.rootPrivate={issues:a,total:a.length}}if(t.rootPackageManager){const a=(e.rootPackageManager??[]).map(i=>r(i));n.rootPackageManager={issues:a,total:a.length}}if(t.rootDeps){const a=(e.rootDeps??[]).map(i=>r(i));n.rootDeps={issues:a,total:a.length}}if(t.missingPackageJson){const a=e.missingPackageJson??[];n.missingPackageJson={issues:a,total:a.length}}if(t.deadWorkspacePatterns){const a=e.deadWorkspacePatterns??[];n.deadWorkspacePatterns={issues:a,total:a.length}}if(t.typesInDeps){const a=(e.typesInDeps??[]).map(i=>r(i));n.typesInDeps={issues:a,total:a.length}}if(t.similarDeps){const a=(e.similarDeps??[]).map(i=>({...i,members:i.members.map(p=>({...p,packageJsonPath:P(s,p.packageJsonPath)}))}));n.similarDeps={issues:a,total:a.length}}process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
25
|
+
`)},"printJson"),T=y((e,s,o)=>{const t=e[s];return typeof t=="boolean"?t:e[o]===!0},"flag"),io=y(e=>{const s=e,o=(e.ban?.length??0)>0,t=(e.pin?.length??0)>0,r=T(s,"workspaceProtocol","workspace-protocol"),n=T(s,"redefineRoot","redefine-root"),a=T(s,"bannedDeps","banned-deps"),i=T(s,"workspaceVersions","workspace-versions"),p=T(s,"customTypes","custom-types"),c=T(s,"emptyDeps","empty-deps"),f=T(s,"rootPrivate","root-private"),m=T(s,"rootPackageManager","root-package-manager"),d=T(s,"rootDeps","root-deps"),g=T(s,"missingPackageJson","missing-package-json"),h=T(s,"deadWorkspacePatterns","dead-workspace-patterns"),$=T(s,"typesInDeps","types-in-deps"),S=T(s,"similarDeps","similar-deps");return r||n||a||i||p||c||f||m||d||g||h||$||S||o||t?{bannedDeps:a||o,customTypes:p,deadWorkspacePatterns:h,emptyDeps:c,missingPackageJson:g,redefineRoot:n,rootDeps:d,rootPackageManager:m,rootPrivate:f,similarDeps:S,typesInDeps:$,workspaceProtocol:r,workspaceVersions:i||t}:{bannedDeps:!0,customTypes:!0,deadWorkspacePatterns:!0,emptyDeps:!0,missingPackageJson:!0,redefineRoot:!0,rootDeps:!0,rootPackageManager:!0,rootPrivate:!0,similarDeps:!0,typesInDeps:!0,workspaceProtocol:!0,workspaceVersions:!0}},"resolveSelection"),po=y(e=>{const s=new Map;for(const o of e??[]){const t=o.lastIndexOf("@");if(t<=0||t===o.length-1)throw new Error(`Invalid --pin "${o}". Use: name@<specifier> (e.g. react@^18.2.0).`);const r=o.slice(0,t),n=o.slice(t+1);s.set(r,n)}return s},"parsePinFlags"),co=new Set(["catalog","highest","lowest"]),fo=y(e=>{if(e===void 0)return"highest";if(!co.has(e))throw new Error(`Invalid --resolve "${e}". Use: highest, lowest, or catalog.`);return e},"parseResolveStrategy"),F=y((e,s)=>e?s===void 0||s===!0:!1,"isAutofixAllowed"),lo={"custom-types":"policy.customTypes.autofix","workspace-protocol":"policy.workspaceProtocol.autofix","workspace-versions":"policy.workspaceVersions.autofix"},K=y((e,s,o,t)=>{const r=lo[s],n=o==="prompt"?`${r} = "prompt" (interactive mode not yet implemented; report-only)`:`${r} = false`,a=`Set "${r}": true (or remove it) to enable rewrites.`;e.warn(`${s}: ${String(t)} issue${t===1?"":"s"} not rewritten — ${n}. ${a}`)},"warnAutofixDenied"),$o=y(async({logger:e,options:s,visConfig:o,workspaceRoot:t})=>{if(!t)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const r=t,n=s.fix??!1,a=s.format??"human",i=s.quiet??!1;if(!["human","json","minimal"].includes(a))throw new Error(`Invalid --format "${a}". Use: human, json, or minimal.`);const p=io(s),c=o?.policy??{},f=o?.editorconfig??!0,m=po(s.pin),d=s.ban??[];(s.dep!==void 0||s.resolve!==void 0)&&!p.workspaceVersions&&!i&&e.warn("--dep / --resolve only apply to --workspace-versions; ignored.");const g=we(r),h={},$={catalogProposals:!1,customTypes:!1,deadWorkspacePatterns:!1,emptyDeps:!1,rootDeps:!1,rootPackageManager:!1,rootPrivate:!1,typesInDeps:!1,workspaceProtocol:!1,workspaceVersions:!1},S=zt(r);let N=0;if(p.workspaceProtocol){const l=Tt(g,{fixSpecifier:s.fixSpecifier}),k=F(n,c.workspaceProtocol?.autofix);k&&l.length>0&&(Wt(l,{useEditorconfig:f}),$.workspaceProtocol=!0),h.workspaceProtocol=l,k||(N+=l.length),n&&!k&&l.length>0&&!i&&K(e,"workspace-protocol",c.workspaceProtocol?.autofix,l.length)}if(p.redefineRoot){const l=rt(g,{ignoreDeps:c.redefineRoot?.ignore});h.redefineRoot=l,N+=l.length}if(p.workspaceVersions){const l=fo(s.resolve??c.workspaceVersions?.resolve),k=l==="catalog"?De(r):void 0;l==="catalog"&&(!k||k.size===0)&&!i&&e.warn("--resolve catalog: no catalog found in pnpm-workspace.yaml or root package.json — nothing to align.");const J=Ot(g,{catalogs:k,dep:s.dep,ignoreDeps:c.workspaceVersions?.ignore,pinned:m.size>0?m:void 0,resolve:l}),H=F(n,c.workspaceVersions?.autofix);if(H&&J.length>0&&(Ht(J,{useEditorconfig:f}),$.workspaceVersions=!0),h.workspaceVersions=J,H||(N+=J.length),n&&!H&&J.length>0&&!i&&K(e,"workspace-versions",c.workspaceVersions?.autofix,J.length),s.proposeMin!==void 0){if(l!=="catalog"&&!i)e.warn("--propose-min only runs under --resolve catalog; ignored.");else if(l==="catalog"){const M=He(g,{catalogs:k,ignoreDeps:c.workspaceVersions?.ignore,min:s.proposeMin});H&&M.length>0&&(_e(r,M),$.catalogProposals=!0),h.catalogProposals=M}}}if(p.customTypes){const l=c.customTypes?.extraTypes,k=be(l);if(k.length>0){for(const me of k)e.error(`policy.customTypes.${me}`);process.exitCode=1;return}const J=xe(r,l),H=(s.resolve??c.customTypes?.resolve)==="lowest"?"lowest":"highest",M=Ne(J,{dep:s.dep,ignoreDeps:c.customTypes?.ignore,resolve:H}),U=F(n,c.customTypes?.autofix);U&&M.length>0&&(Je(M,{useEditorconfig:f}),$.customTypes=!0),h.customTypes=M,U||(N+=M.length),n&&!U&&M.length>0&&!i&&K(e,"custom-types",c.customTypes?.autofix,M.length)}if(p.bannedDeps){const l={...c.bannedDeps};for(const J of d)l[J]={reason:"banned via --ban CLI flag"};Object.keys(l).length===0&&s.bannedDeps&&!i&&e.warn("--banned-deps: no policy.bannedDeps in vis config, nothing to check.");const k=Ie(g,l);h.bannedDeps=k,N+=k.length}if(p.emptyDeps){const l=Ze(r,{ignoreBlocks:c.emptyDeps?.ignoreBlocks}),k=F(n,c.emptyDeps?.autofix);k&&l.length>0&&(Xe(l,{useEditorconfig:f}),$.emptyDeps=!0),h.emptyDeps=l,k||(N+=l.length)}if(p.rootPrivate){const l=mt(r,S),k=F(n,c.rootPrivate?.autofix);k&&l.length>0&&(ht(l,{useEditorconfig:f}),$.rootPrivate=!0),h.rootPrivate=l,k||(N+=l.length)}if(p.rootPackageManager){const l=gt(r,S,{suggested:c.rootPackageManager?.suggested}),k=F(n,c.rootPackageManager?.autofix);k&&l.some(J=>J.suggested!==void 0)&&(dt(l,{useEditorconfig:f}),$.rootPackageManager=!0),h.rootPackageManager=l,(!k||!$.rootPackageManager)&&(N+=l.filter(J=>J.suggested===void 0||!$.rootPackageManager).length)}if(p.rootDeps){const l=pt(r,S),k=F(n,c.rootDeps?.autofix);k&&l.length>0&&(ct(l,{useEditorconfig:f}),$.rootDeps=!0),h.rootDeps=l,k||(N+=l.length)}if(p.missingPackageJson){const l=ot(r);h.missingPackageJson=l,N+=l.length}if(p.deadWorkspacePatterns){const l=Le(r),k=F(n,c.deadWorkspacePatterns?.autofix);k&&l.length>0&&(qe(l,{useEditorconfig:f}),$.deadWorkspacePatterns=!0),h.deadWorkspacePatterns=l,k||(N+=l.length)}if(p.typesInDeps){const l=xt(g,{ignoreDeps:c.typesInDeps?.ignore}),k=F(n,c.typesInDeps?.autofix);k&&l.length>0&&(Nt(l,{useEditorconfig:f}),$.typesInDeps=!0),h.typesInDeps=l,k||(N+=l.length)}if(p.similarDeps){const l=wt(g,{extraFamilies:c.similarDeps?.extraFamilies,ignoreFamilies:c.similarDeps?.ignoreFamilies});h.similarDeps=l,N+=l.length}i||(a==="json"?ro(h,r,$,p):a==="minimal"?no(h,r):ao(h,r,$,p,e)),N>0&&(process.exitCode=1)},"execute");export{$o as default};
|