@visulima/vis 3.0.6 → 4.0.1

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