@visulima/vis 6.0.1 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +6 -6
- package/dist/packem_chunks/handler12.js +4 -4
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler26.js +4 -4
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler61.js +3 -3
- package/dist/packem_chunks/handler65.js +4 -4
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +6 -6
- package/dist/packem_chunks/handler71.js +26 -46
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler78.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{affected-selection-CrW7fWEd.js → affected-selection-DGb6Xu5K.js} +1 -1
- package/dist/packem_shared/{bin-D3TtXgz6.js → bin-AZQv95jh.js} +1 -1
- package/dist/packem_shared/dependency-scan-CawAKoU_.js +1 -0
- package/dist/packem_shared/detect-CbMRSXkM.js +1 -0
- package/dist/packem_shared/{ecosystem-gate-ByxWtzPE.js → ecosystem-gate-DiqQj0LJ.js} +1 -1
- package/dist/packem_shared/env-consistency-B4rU4MQb.js +1 -0
- package/dist/packem_shared/{index-DGdD4w-b.js → index-CDHP1kby.js} +1 -1
- package/dist/packem_shared/{index-BKbMnn8K.js → index-JRb5wabN.js} +1 -1
- package/dist/packem_shared/{package-version-QFmE9anh.js → package-version-KLwH0Ivy.js} +1 -1
- package/dist/packem_shared/{project-name-filter-DIqpdsvP.js → project-name-filter-B1ZCsbOW.js} +1 -1
- package/dist/packem_shared/runtime-check-D3cRDuoi.js +1 -0
- package/dist/packem_shared/scaffold-files-DVyfB0yz.js +28 -0
- package/dist/packem_shared/toolchain-CP79HNVy.js +5 -0
- package/dist/packem_shared/{vis-user-error-S0Fesz5y.js → vis-user-error-CRmrBaD1.js} +1 -1
- package/dist/packem_shared/watch-loop-D1_e-qIl.js +11 -0
- package/index.js +26 -26
- package/package.json +9 -9
- package/dist/packem_shared/dependency-scan-B8jroa1D.js +0 -1
- package/dist/packem_shared/env-consistency-Dt_uDbSP.js +0 -1
- package/dist/packem_shared/runtime-check-1U8HrQd9.js +0 -1
- package/dist/packem_shared/toolchain-Bz70UIcp.js +0 -5
- package/dist/packem_shared/watch-loop-BEnGuMBn.js +0 -11
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import{createRequire as Se}from"node:module";import{j as w,q as _,F as u}from"../packem_shared/index.server-Ca_EEVfw.js";import{U as x,$ as Ie,e as p,a as F,l as ye,v as ve}from"../packem_shared/index-BzhrR_iC.js";import{p as n}from"./cli-main.js";import{o as be,d as Ae,n as De}from"../packem_shared/pm-runner-RM72mDZg.js";import{V as O}from"../packem_shared/vis-user-error-S0Fesz5y.js";import{Q as Ne,m as Pe}from"./catalog.js";import{r as Oe,a as qe,d as Me}from"../packem_shared/git-source-DExWbfN0.js";import{g as Fe}from"../packem_shared/_commonjsHelpers-DTfxOvZk.js";import{y as I}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{h as k,U as d}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";import{p as se}from"../packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js";let Te;const Ce=e=>(Te??=Se(import.meta.url))(e),P=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,B=e=>{if(typeof P<"u"&&P.versions&&P.versions.node){const[t,r]=P.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return P.getBuiltinModule(e)}return Ce(e)},{spawnSync:Ee}=B("node:child_process"),{createInterface:we}=B("node:readline"),{readdirSync:Re,mkdtempSync:ze,realpathSync:oe,cpSync:Le,lstatSync:Ge,rmSync:Ue,chmodSync:Be}=B("node:fs"),{tmpdir:He}=B("node:os"),Je={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Ve=["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:","gitlab://","bitbucket:","sourcehut:","git:","http://","https://"],We=e=>{for(const t of Ve)if(e.startsWith(t))return!0;return/^[\w.-]+@[\w.-]+:/.test(e)?!0:!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e)},Xe=new Set(["sv"]),Ke=e=>{if(Xe.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}`},Ye=(e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),i=Je[r];return i?{args:t,source:r,type:i}:We(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:Ke(e),type:"remote:npm"}},Qe=e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},ce=["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"],Ze=(e,t)=>Math.floor(e+Math.random()*(t-e+1));function le(){return ce[Ze(0,ce.length-1)]}const et=()=>`${le()}-${le()}`;var V,pe;function tt(){return pe||(pe=1,V=["_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"]),V}var W,ue;function rt(){if(ue)return W;ue=1;const e=tt();var t=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),r=["node_modules","favicon.ico"];function i(a){var s=[],c=[];if(a===null)return c.push("name cannot be null"),o(s,c);if(a===void 0)return c.push("name cannot be undefined"),o(s,c);if(typeof a!="string")return c.push("name must be a string"),o(s,c);if(a.length||c.push("name length must be greater than zero"),a.startsWith(".")&&c.push("name cannot start with a period"),a.startsWith("-")&&c.push("name cannot start with a hyphen"),a.match(/^_/)&&c.push("name cannot start with an underscore"),a.trim()!==a&&c.push("name cannot contain leading or trailing spaces"),r.forEach(function(v){a.toLowerCase()===v&&c.push(v+" is not a valid package name")}),e.includes(a.toLowerCase())&&s.push(a+" is a core module name"),a.length>214&&s.push("name can no longer contain more than 214 characters"),a.toLowerCase()!==a&&s.push("name can no longer contain capital letters"),/[~'!()*]/.test(a.split("/").slice(-1)[0])&&s.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(a)!==a){var l=a.match(t);if(l){var y=l[1],h=l[2];if(h.startsWith(".")&&c.push("name cannot start with a period"),encodeURIComponent(y)===y&&encodeURIComponent(h)===h)return o(s,c)}c.push("name can only contain URL-friendly characters")}return o(s,c)}var o=function(a,s){var c={validForNewPackages:s.length===0&&a.length===0,validForOldPackages:s.length===0,warnings:a,errors:s};return c.warnings.length||delete c.warnings,c.errors.length||delete c.errors,c};return W=i,W}var it=rt();const nt=Fe(it),ke=e=>e?nt(e).validForNewPackages:!1,M=e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),at=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),$e=e=>I(e)?Re(e).every(r=>at.has(r)):!0,ot=(e,t)=>{const r=x(t,e);return{packageName:M(Ie(r)),targetDir:r}},st=e=>$e(e),q=(e,t)=>new Promise(r=>{e.question(t,i=>{r(i.trim())})}),X=async(e,t,r=!0)=>{const o=await q(e,` ${t} ${u(r?"[Y/n]":"[y/N]")} `);return o===""?r:o.toLowerCase()==="y"||o.toLowerCase()==="yes"},Y=async(e,t,r)=>{process.stderr.write(` ${t}
|
|
2
|
-
`);for(const[i,o]of r.entries()){const a=w(
|
|
1
|
+
import{createRequire as je}from"node:module";import{j as w,q as $,F as p}from"../packem_shared/index.server-Ca_EEVfw.js";import{U as _,$ as Ce,e as u,a as B,l as he,v as ye}from"../packem_shared/index-BzhrR_iC.js";import{p as n}from"./cli-main.js";import{o as ve,d as Ie,n as Ae}from"../packem_shared/pm-runner-RM72mDZg.js";import{V as P}from"../packem_shared/vis-user-error-CRmrBaD1.js";import{Q as Ne,m as De}from"./catalog.js";import{r as Pe,a as qe,d as Oe}from"../packem_shared/git-source-DExWbfN0.js";import{g as Be}from"../packem_shared/_commonjsHelpers-DTfxOvZk.js";import{y as K}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{a as Fe,g as He,b as Ve}from"../packem_shared/scaffold-files-DVyfB0yz.js";import{h as x,U as f}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";let Se;const Te=e=>(Se??=je(import.meta.url))(e),D=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,U=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 Te(e)},{spawnSync:Ee}=U("node:child_process"),{createInterface:be}=U("node:readline"),{readdirSync:Re,mkdtempSync:ze,realpathSync:oe,cpSync:Me,lstatSync:Le,rmSync:Ge,chmodSync:Ue}=U("node:fs"),{tmpdir:We}=U("node:os"),Je={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Xe=["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:","gitlab://","bitbucket:","sourcehut:","git:","http://","https://"],Ke=e=>{for(const t of Xe)if(e.startsWith(t))return!0;return/^[\w.-]+@[\w.-]+:/.test(e)?!0:!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e)},Ye=new Set(["sv"]),Qe=e=>{if(Ye.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}`},Ze=(e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),i=Je[r];return i?{args:t,source:r,type:i}:Ke(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:Qe(e),type:"remote:npm"}},et=e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},se=["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"],tt=(e,t)=>Math.floor(e+Math.random()*(t-e+1));function le(){return se[tt(0,se.length-1)]}const rt=()=>`${le()}-${le()}`;var V,ce;function it(){return ce||(ce=1,V=["_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"]),V}var W,pe;function at(){if(pe)return W;pe=1;const e=it();var t=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),r=["node_modules","favicon.ico"];function i(a){var l=[],s=[];if(a===null)return s.push("name cannot be null"),o(l,s);if(a===void 0)return s.push("name cannot be undefined"),o(l,s);if(typeof a!="string")return s.push("name must be a string"),o(l,s);if(a.length||s.push("name length must be greater than zero"),a.startsWith(".")&&s.push("name cannot start with a period"),a.startsWith("-")&&s.push("name cannot start with a hyphen"),a.match(/^_/)&&s.push("name cannot start with an underscore"),a.trim()!==a&&s.push("name cannot contain leading or trailing spaces"),r.forEach(function(v){a.toLowerCase()===v&&s.push(v+" is not a valid package name")}),e.includes(a.toLowerCase())&&l.push(a+" is a core module name"),a.length>214&&l.push("name can no longer contain more than 214 characters"),a.toLowerCase()!==a&&l.push("name can no longer contain capital letters"),/[~'!()*]/.test(a.split("/").slice(-1)[0])&&l.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(a)!==a){var c=a.match(t);if(c){var y=c[1],h=c[2];if(h.startsWith(".")&&s.push("name cannot start with a period"),encodeURIComponent(y)===y&&encodeURIComponent(h)===h)return o(l,s)}s.push("name can only contain URL-friendly characters")}return o(l,s)}var o=function(a,l){var s={validForNewPackages:l.length===0&&a.length===0,validForOldPackages:l.length===0,warnings:a,errors:l};return s.warnings.length||delete s.warnings,s.errors.length||delete s.errors,s};return W=i,W}var nt=at();const ot=Be(nt),we=e=>e?ot(e).validForNewPackages:!1,O=e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),st=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),ke=e=>K(e)?Re(e).every(r=>st.has(r)):!0,lt=(e,t)=>{const r=_(t,e);return{packageName:O(Ce(r)),targetDir:r}},ct=e=>ke(e),q=(e,t)=>new Promise(r=>{e.question(t,i=>{r(i.trim())})}),J=async(e,t,r=!0)=>{const o=await q(e,` ${t} ${p(r?"[Y/n]":"[y/N]")} `);return o===""?r:o.toLowerCase()==="y"||o.toLowerCase()==="yes"},Y=async(e,t,r)=>{process.stderr.write(` ${t}
|
|
2
|
+
`);for(const[i,o]of r.entries()){const a=w($(` ${String(i+1)}.`)),l=o.hint?p(` — ${o.hint}`):"";process.stderr.write(`${a} ${o.label}${l}
|
|
3
3
|
`)}for(;;){const i=await q(e,`
|
|
4
|
-
${
|
|
5
|
-
`)}},
|
|
6
|
-
${w(
|
|
4
|
+
${p(`Enter choice (1-${String(r.length)}):`)} `),o=Number.parseInt(i,10);if(o>=1&&o<=r.length)return r[o-1].value;const a=r.find(l=>l.value===i||l.label.toLowerCase()===i.toLowerCase());if(a)return a.value;process.stderr.write(` ${p("Invalid choice. Try again.")}
|
|
5
|
+
`)}},pt=async(e,t)=>{const r=be({input:process.stdin,output:process.stdout});try{return await Y(r,e,t)}finally{r.close()}},ut=async e=>{const t=be({input:process.stdin,output:process.stdout});try{process.stderr.write(`
|
|
6
|
+
${w($("vis create"))} ${p("— project scaffolding")}
|
|
7
7
|
|
|
8
8
|
`);let r=e.presetTemplate;if(!r){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__"}];if(r=await Y(t,"Select a template:",R),r==="__custom__"&&(r=await q(t,`
|
|
9
|
-
${
|
|
10
|
-
${
|
|
11
|
-
`)):v=await Y(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let
|
|
12
|
-
`),{editor:
|
|
13
|
-
|
|
14
|
-
`,
|
|
9
|
+
${p("Template (npm package, @org, or GitHub URL):")} `),!r))throw new Error("No template specified.")}const i=rt(),a=await q(t,`
|
|
10
|
+
${p(`Project name (${i}):`)} `)||i;if(!we(O(a)))throw new Error(`Invalid project name: "${a}". Must be a valid npm package name.`);const l=O(a),c=await q(t,` ${p(`Target directory (${l}):`)} `)||l;let y=!1;const h=_(e.cwd,c);if(!ke(h)&&(y=await J(t,`Directory "${c}" is not empty. Overwrite?`,!1),!y))throw new Error("Aborted — directory not empty.");let v;e.inMonorepo||(e.defaultPm?(v=e.defaultPm,process.stderr.write(` ${p(`Package manager: ${v} (from config)`)}
|
|
11
|
+
`)):v=await Y(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let E=!1;e.inMonorepo||(E=await J(t,"Initialize a git repository?",e.defaultGitInit??!1));const j=e.defaultEditor==="vscode",I=await J(t,"Generate VS Code configuration?",j)?"vscode":void 0;return process.stderr.write(`
|
|
12
|
+
`),{editor:I,gitInit:E,overwrite:y,pm:v,projectName:a,targetDir:c,template:r}}finally{t.close()}},L=50,ue=64,de=200,Q=300,dt=256*1024,mt=1e4,me=/^[a-z0-9][a-z0-9._-]*$/,$e=/^@([a-z0-9][a-z0-9._~-]*)(?::([a-z0-9][a-z0-9._-]*))?$/,gt=/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/,ft=/^\w[\w.-]*$/,ht=/^(?:github|gh|gitlab|bitbucket|sourcehut):/,m=e=>new P(`Invalid organization template manifest: ${e}`),T=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),G=e=>$e.test(e),yt=e=>{if(typeof e!="string")throw m("every template needs a string description");const t=e.replaceAll(new RegExp("\\p{Cc}","gu"),"").trim();if(t.length===0||t.length>de)throw m(`descriptions must be 1-${de} characters`);return t},vt=e=>{if(typeof e!="string"||e.length===0||e.length>Q)throw m("bundled source path must be a non-empty string");const t=e.split("/");if(!t.every(r=>ft.test(r)))throw m(`bundled source path "${e}" must be relative and contain only plain segments`);return t.join("/")},bt=e=>{if(!T(e))throw m("every template needs a source object");switch(e.kind){case"bundled":return{kind:"bundled",path:vt(e.path)};case"git":{const{url:t}=e;if(typeof t!="string"||t.length>Q||/\s/.test(t)||t.startsWith("-"))throw m("git source url is malformed");const r=Pe(t);if(!ht.test(r.source)||r.gitlabUrl!==void 0)throw m(`git source "${t}" must use github, gitlab, bitbucket or sourcehut on the default host`);return{kind:"git",url:t}}case"npm":{const{package:t}=e;if(typeof t!="string"||t.length>Q||!gt.test(t))throw m("npm source must be a plain package name (no version, no flags)");return{kind:"npm",package:t}}default:throw m(`unknown source kind "${String(e.kind)}" (expected npm, git or bundled)`)}},wt=e=>{let t;if(Array.isArray(e)){if(e.length>L)throw m(`at most ${L} templates are allowed`);t=e.map(i=>[T(i)?i.name:void 0,i])}else if(T(e)){if(Object.keys(e).length>L)throw m(`at most ${L} templates are allowed`);t=Object.entries(e)}else throw m("templates must be an array or an object");const r=new Set;return t.map(([i,o])=>{if(typeof i!="string"||i.length>ue||!me.test(i))throw m(`template name ${JSON.stringify(i)} must match ${me.source} (max ${ue})`);if(r.has(i))throw m(`duplicate template name "${i}"`);if(r.add(i),!T(o))throw m(`template "${i}" must be an object`);return{description:yt(o.description),name:i,source:bt(o.source)}})},ge=(e,t,r)=>{const{source:i}=e;switch(i.kind){case"bundled":{if(!t.tarball)throw m(`bundled template "${e.name}" needs a https dist.tarball for its package`);return{args:r,source:t.tarball,subdir:i.path,type:"remote:bundled"}}case"git":return{args:r,source:i.url,type:"remote:git"};case"npm":return{args:r,source:i.package,type:"remote:npm"};default:throw m(`unknown source kind for "${e.name}"`)}},kt=async(e,t)=>{const r=`${e}/create`,i=Ne(r,De(t)),o=new AbortController,a=setTimeout(()=>{o.abort()},mt);let l;try{const h=await fetch(`${i.url.replace(/\/+$/,"")}/${r.replaceAll("/","%2F")}/latest`,{headers:{accept:"application/json",...i.token?{authorization:`Bearer ${i.token}`}:{}},signal:o.signal});if(h.status===404)return;if(!h.ok)throw new Error(`registry responded ${String(h.status)} for ${r}`);l=await h.text()}finally{clearTimeout(a)}if(l.length>dt)throw m("package manifest is too large");const s=JSON.parse(l);if(!T(s)||!T(s.createConfig)||s.createConfig.templates===void 0)return;const c=wt(s.createConfig.templates);return{tarball:T(s.dist)&&typeof s.dist.tarball=="string"&&/^https:\/\//.test(s.dist.tarball)?s.dist.tarball:void 0,templates:c}},fe=(e,t)=>{n.info(""),n.info(` ${e} templates:`);for(const r of t)n.info(` ${w($(`${e}:${r.name}`))} ${p(r.description)}`);n.info("")},X=async(e,t)=>{const r=$e.exec(e);if(!r)throw new P(`"${e}" is not an organization template.`);const i=`@${r[1]}`,o=r[2],a=await kt(i,t.cwd);if(!a){if(t.list){n.info(`${i}/create has no createConfig.templates manifest. "vis create ${i}" runs it as a template.`);return}if(o)throw new P(`${i}/create has no createConfig.templates manifest, so "${i}:${o}" cannot be resolved.`);return{config:{args:t.args,source:`${i}/create`,type:"remote:npm"},name:i.slice(1)}}if(t.list){fe(i,a.templates);return}if(o){const c=a.templates.find(y=>y.name===o);if(!c)throw new P(`${i} has no template "${o}". Available: ${a.templates.map(y=>y.name).join(", ")}`);return{config:ge(c,a,t.args),name:c.name}}if(!t.interactive)throw fe(i,a.templates),new P(`Choose a template in non-interactive mode: vis create ${i}:<name>`);const l=await pt(`${i} templates`,a.templates.map(c=>({hint:c.description,label:c.name,value:c.name}))),s=a.templates.find(c=>c.name===l);return{config:ge(s,a,t.args),name:s.name}},$t=(e,t)=>{n.info("Scaffolding application via create-vite...");const i=[B(t.cwd,t.targetDir)||".",...e.args];return i.includes("--no-immediate")||i.push("--no-immediate"),ve(t.pm,{additionalPackages:[],args:i,package:"create-vite",shellMode:!1,silent:!1},t.cwd,t.logger)},_t=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
|
+
`,xt=()=>`${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
|
+
`,jt=e=>`/**
|
|
15
15
|
* ${e} — library entry point.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
export const greet = (name: string): string => \`Hello from ${e}, \${name}!\`;
|
|
19
|
-
`,
|
|
19
|
+
`,St=e=>`import { describe, expect, it } from "vitest";
|
|
20
20
|
|
|
21
21
|
import { greet } from "../src/index";
|
|
22
22
|
|
|
@@ -25,12 +25,12 @@ describe("${e}", () => {
|
|
|
25
25
|
expect(greet("world")).toBe("Hello from ${e}, world!");
|
|
26
26
|
});
|
|
27
27
|
});
|
|
28
|
-
`,
|
|
28
|
+
`,Tt=(e,t)=>{const{projectName:r,targetDir:i}=t;return n.info("Scaffolding library package..."),x(i),x(u(i,"src")),x(u(i,"__tests__")),f(u(i,"package.json"),_t(r)),n.success("Created package.json"),f(u(i,"tsconfig.json"),xt()),n.success("Created tsconfig.json"),f(u(i,"src","index.ts"),jt(r)),n.success("Created src/index.ts"),f(u(i,"__tests__","index.test.ts"),St(r)),n.success("Created __tests__/index.test.ts"),f(u(i,".gitignore"),`node_modules/
|
|
29
29
|
dist/
|
|
30
30
|
.env
|
|
31
31
|
.DS_Store
|
|
32
|
-
`),n.success("Created .gitignore"),0},
|
|
33
|
-
`,
|
|
32
|
+
`),n.success("Created .gitignore"),0},Et=(e,t)=>{switch(e.type){case"builtin:app":return $t(e,t);case"builtin:library":return Tt(e,t);default:throw new Error(`Unknown built-in template type: ${e.type}`)}},Ct=async(e,t)=>{const r=e.subdir??"",i=ze(u(We(),"vis-bundled-"));try{await qe(e.source,{dir:i,force:!0});const o=oe(i),a=oe(_(o,r)),l=B(o,a);if(l===".."||l.startsWith(`..${he}`)||ye(l))throw new Error(`bundled path "${r}" resolves outside the package`);return Me(a,t.targetDir,{filter:s=>!Le(s).isSymbolicLink(),recursive:!0}),n.info(`Copied bundled template "${r}"`),0}catch(o){const a=o instanceof Error?o.message:String(o);return n.warn(`Failed to scaffold bundled template: ${a}`),1}finally{Ge(i,{force:!0,recursive:!0})}},It=(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
|
+
`,At=e=>`#!/usr/bin/env node
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* ${e} — code generator
|
|
@@ -39,19 +39,19 @@ dist/
|
|
|
39
39
|
*/
|
|
40
40
|
|
|
41
41
|
console.log("Hello from ${e}!");
|
|
42
|
-
`,
|
|
43
|
-
`,
|
|
42
|
+
`,Nt=()=>`${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
|
+
`,Dt=()=>`/**
|
|
44
44
|
* Generator core logic — export functions used by the CLI entry point.
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
47
|
export const generate = (): void => {
|
|
48
48
|
// TODO: Implement your generator logic here
|
|
49
49
|
};
|
|
50
|
-
`,
|
|
51
|
-
`,
|
|
50
|
+
`,Pt=(e,t="")=>{const{projectName:r,targetDir:i}=e;n.info("Scaffolding code generator..."),x(i),x(u(i,"bin")),x(u(i,"src")),f(u(i,"package.json"),It(r,t||`Code generator: ${r}`)),n.success("Created package.json");const o=u(i,"bin","index.js");return f(o,At(r)),Ue(o,493),n.success("Created bin/index.js (executable)"),f(u(i,"tsconfig.json"),Nt()),n.success("Created tsconfig.json"),f(u(i,"src","index.ts"),Dt()),n.success("Created src/index.ts"),0},qt=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
|
+
`,Ot=()=>`packages:
|
|
52
52
|
- "apps/*"
|
|
53
53
|
- "packages/*"
|
|
54
|
-
`,
|
|
54
|
+
`,Rt=()=>`# Dependencies
|
|
55
55
|
node_modules/
|
|
56
56
|
|
|
57
57
|
# Build output
|
|
@@ -81,7 +81,7 @@ pnpm-debug.log*
|
|
|
81
81
|
# Cache
|
|
82
82
|
.turbo/
|
|
83
83
|
.cache/
|
|
84
|
-
`,
|
|
84
|
+
`,zt=()=>`root = true
|
|
85
85
|
|
|
86
86
|
[*]
|
|
87
87
|
indent_style = space
|
|
@@ -124,30 +124,10 @@ pnpm test
|
|
|
124
124
|
├── pnpm-workspace.yaml
|
|
125
125
|
└── package.json
|
|
126
126
|
\`\`\`
|
|
127
|
-
`,
|
|
128
|
-
`),n.success("Merged .vscode/settings.json")}catch{n.warn("Could not merge .vscode/settings.json, skipping")}else d(r,`${JSON.stringify(i,null,4)}
|
|
129
|
-
`),n.success("Created .vscode/settings.json");const o=p(t,"extensions.json"),a={recommendations:["oxc.oxc-vscode"]};if(I(o))try{const s=se(o);d(o,`${JSON.stringify({...s,recommendations:[...new Set([...s.recommendations||[],...a.recommendations])]},null,4)}
|
|
130
|
-
`),n.success("Merged .vscode/extensions.json")}catch{n.warn("Could not merge .vscode/extensions.json, skipping")}else d(o,`${JSON.stringify(a,null,4)}
|
|
131
|
-
`),n.success("Created .vscode/extensions.json")},Ht=(e,t)=>{const r=p(e,".ai");k(r);const i=p(r,"instructions");if(I(i))return;const o=`# 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
|
-
`;d(i,o),n.success("Created .ai/instructions")},Jt=e=>{Ee("git",["init"],{cwd:e,stdio:"pipe"}).status===0?n.success("Initialized git repository"):n.warn("Failed to initialize git repository")},Vt=(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)),Wt=e=>{const a=e.split("#")[0].split("?")[0].replace(/\/+$/,"").replace(/\.git$/,"").split("/").filter(Boolean).at(-1)??"",s=a.includes(":")?a.split(":").pop()??a:a;return M(s)||"my-project"},Xt=e=>{if(n.info(""),n.info(" Built-in templates:"),n.info(` ${w(_("vis:monorepo"))} ${u("Full pnpm workspace setup")}`),n.info(` ${w(_("vis:app"))} ${u("Application scaffold via create-vite")}`),n.info(` ${w(_("vis:library"))} ${u("Reusable TypeScript library package")}`),n.info(` ${w(_("vis:generator"))} ${u("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(` ${w(_(t))}${" ".repeat(Math.max(1,16-t.length))}${u(r)}`)}n.info(""),n.info(" Remote templates:"),n.info(` ${u("Any npm create-* package:")} vis create vite`),n.info(` ${u("GitHub repository:")} vis create user/repo`),n.info(` ${u("GitLab / Bitbucket:")} vis create gitlab:group/subgroup/repo`),n.info(` ${u("Self-hosted GitLab:")} vis create gitlab://git.example.com/group/repo`),n.info(` ${u("Full URL:")} vis create https://github.com/user/repo`),n.info(` ${u("SSH (private repos):")} vis create git@git.example.com:group/repo`),n.info(""),n.info(` ${u("Template args after --:")} vis create vite -- --template react-ts`),n.info("")},Kt=(e,t,r,i)=>{const o=x(t)===x(e)?"":e;process.stderr.write(`
|
|
127
|
+
`,Lt=e=>{const{projectName:t,targetDir:r}=e;return n.info("Scaffolding monorepo workspace..."),x(r),x(u(r,"apps")),x(u(r,"packages")),f(u(r,"package.json"),qt(t)),n.success("Created package.json"),f(u(r,"pnpm-workspace.yaml"),Ot()),n.success("Created pnpm-workspace.yaml"),f(u(r,".gitignore"),Rt()),n.success("Created .gitignore"),f(u(r,".editorconfig"),zt()),n.success("Created .editorconfig"),f(u(r,"README.md"),Mt(t)),n.success("Created README.md"),f(u(r,"apps",".gitkeep"),""),f(u(r,"packages",".gitkeep"),""),0},Gt={"create-nuxt":{monoArgs:["--no-gitInit"]},"create-vite":{args:["--no-immediate"]},sv:{args:["--no-install"],prependCommand:"create"}},Ut=(e,t,r)=>{const i=Gt[e];if(!i)return t;const o=[...t];if(i.prependCommand&&!o.includes(i.prependCommand)&&o.unshift(i.prependCommand),i.args)for(const a of i.args)o.includes(a)||o.push(a);if(r&&i.monoArgs)for(const a of i.monoArgs)o.includes(a)||o.push(a);return o},Bt=(e,t)=>{const r=B(t.cwd,t.targetDir)||".",i=[...e.args];i.includes(r)||i.unshift(r);const o=Ut(e.source,i,t.inMonorepo);return n.info(`Running ${e.source} via ${t.pm.name} dlx...`),ve(t.pm,{additionalPackages:[],args:o,package:e.source,shellMode:!1,silent:!1},t.cwd,t.logger)},Ft=async(e,t)=>{const{createConfig:r}=t;n.info(`Downloading template from ${e.source}...`);try{const i=await Oe(e.source,{auth:r?.auth,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 o=i instanceof Error?i.message:String(i);return n.warn(`Failed to download template: ${o}`),/\b(?:401|403|404)\b/.test(o)&&n.warn("Private or self-hosted repository? Set GITHUB_TOKEN, GITLAB_TOKEN or BITBUCKET_TOKEN, or use an SSH source such as git:git@host:group/repo."),1}},Ht=async(e,t)=>{switch(e.type){case"builtin:app":case"builtin:library":return Et(e,t);case"builtin:generator":return Pt(t);case"builtin:monorepo":return Lt(t);case"remote:bundled":return Ct(e,t);case"remote:git":return Ft(e,t);case"remote:npm":return Bt(e,t);default:throw new Error(`Unknown template type: ${e.type}`)}},Vt=e=>{Ee("git",["init"],{cwd:e,stdio:"pipe"}).status===0?n.success("Initialized git repository"):n.warn("Failed to initialize git repository")},Wt=(e,t,r,i=!1)=>(n.info("Installing dependencies..."),Ae(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)),Jt=e=>{const a=e.split("#")[0].split("?")[0].replace(/\/+$/,"").replace(/\.git$/,"").split("/").filter(Boolean).at(-1)??"",l=a.includes(":")?a.split(":").pop()??a:a;return O(l)||"my-project"},Xt=e=>{if(n.info(""),n.info(" Built-in templates:"),n.info(` ${w($("vis:monorepo"))} ${p("Full pnpm workspace setup")}`),n.info(` ${w($("vis:app"))} ${p("Application scaffold via create-vite")}`),n.info(` ${w($("vis:library"))} ${p("Reusable TypeScript library package")}`),n.info(` ${w($("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(` ${w($(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:group/subgroup/repo`),n.info(` ${p("Self-hosted GitLab:")} vis create gitlab://git.example.com/group/repo`),n.info(` ${p("Full URL:")} vis create https://github.com/user/repo`),n.info(` ${p("SSH (private repos):")} vis create git@git.example.com:group/repo`),n.info(""),n.info(` ${p("Template args after --:")} vis create vite -- --template react-ts`),n.info("")},Kt=(e,t,r,i)=>{const o=_(t)===_(e)?"":e;process.stderr.write(`
|
|
148
128
|
`),n.success("Project created successfully!"),process.stderr.write(`
|
|
149
129
|
`),n.notice("Next steps:"),o&&n.info(` cd ${o}`),i||n.info(` ${r} install`),n.info(` ${r} run dev`),process.stderr.write(`
|
|
150
|
-
`)},ur=async({argument:e,logger:t,options:r,rawUnknown:i,visConfig:o,workspaceRoot:a})=>{const
|
|
151
|
-
Use --list to see available templates, or run interactively in a terminal.`);{let
|
|
152
|
-
Use a different name or clear the directory first.`);
|
|
153
|
-
`);const re=await
|
|
130
|
+
`)},ur=async({argument:e,logger:t,options:r,rawUnknown:i,visConfig:o,workspaceRoot:a})=>{const l=Array.isArray(e)?e:e?[e]:[],s=o?.create,c=r.cwd||a||process.cwd(),h=!!process.stdin.isTTY&&r.interactive!==!1;if(r.list){if(l[0]&&G(l[0])){await X(l[0],{args:[],cwd:a||c,interactive:!1,list:!0});return}Xt(s?.templates);return}const v=!!a,E=l.length===0&&h,j=s?.defaultTemplate;l.length===0&&j&&!E&&l.push(j);const I=j?s?.templates?.[j]??j:void 0,R=E&&I&&G(I)?await X(I,{args:[],cwd:a||c,interactive:!0}):void 0,Z=Ie(c);let k,b,g,A=s?.defaultEditor,z=s?.gitInit??!1,F=[],N=Z,ee=!1;if(Fe(r.editor),E){const d=await ut({cwd:c,defaultEditor:s?.defaultEditor,defaultGitInit:s?.gitInit,defaultPm:s?.defaultPm,inMonorepo:v,presetTemplate:j});k=d.template,b=d.projectName,g=_(c,d.targetDir),A=d.editor??A,z=d.gitInit,ee=d.overwrite,d.pm&&(N={name:d.pm,version:Z.version})}else{if(l.length===0)throw new Error(`No template specified. Usage: vis create <template> [name] [-- args...]
|
|
131
|
+
Use --list to see available templates, or run interactively in a terminal.`);{let d=[...i??[]];if(d.length===0){const ae=process.argv.slice(2),ne=ae.indexOf("--");ne!==-1&&(d=ae.slice(ne+1))}const S=l.indexOf("--"),xe=S===-1?l:l.slice(0,S);F=[...S===-1?[]:l.slice(S+1),...d],[k,b]=xe,!b&&k&&!G(k)&&(b=Jt(k)),A=r.editor==="vscode"?"vscode":A,z=!!r.gitInit||z}}if(!k)throw new Error("No template specified.");const C=s?.templates?.[k]??k;let M;if(G(C)){const d=R??await X(C,{args:F,cwd:a||c,interactive:h});if(!d)return;M=d.config,b??=d.name}else M=Ze(C,F);if(!g){const d=v?et(M.type):".",S=lt(b??"",_(c,d));g=S.targetDir,b=S.packageName}const te=O(b??"");if(!we(te))throw new Error(`Invalid project name: "${b}". Use lowercase alphanumeric characters and hyphens.`);b=te;const _e=_(g),H=B(_(c),_e);if(H===".."||H.startsWith(`..${he}`)||ye(H))throw new Error(`Target directory "${g}" is outside the working directory. Use a name without "../" path segments.`);if(!ee&&!ct(g))throw new Error(`Target directory "${g}" is not empty.
|
|
132
|
+
Use a different name or clear the directory first.`);C!==k&&n.info(`Alias: ${w($(k))} → ${p(C)}`),n.info(`Template: ${w($(C))}`),n.info(`Project: ${w(b)}`),n.info(`Target: ${p(g)}`),process.stderr.write(`
|
|
133
|
+
`);const re=await Ht(M,{createConfig:s,cwd:c,inMonorepo:v,logger:t,pm:N,projectName:b,targetDir:g});if(re!==0){process.exitCode=re;return}A==="vscode"&&He(g),r.agent&&K(g)&&Ve(g,N.name),z&&!v&&Vt(g);let ie=!1;s?.install!==!1&&K(u(g,"package.json"))&&(ie=Wt(g,N,t,s?.preferOffline)),Kt(g,c,N.name,ie)};export{ur as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as ae}from"node:module";import{e as h,z as O}from"../packem_shared/index-BzhrR_iC.js";import{V as J}from"../packem_shared/vis-user-error-
|
|
1
|
+
import{createRequire as ae}from"node:module";import{e as h,z as O}from"../packem_shared/index-BzhrR_iC.js";import{V as J}from"../packem_shared/vis-user-error-CRmrBaD1.js";import{ab as z,ac as he,ad as X,ae as R,af as me,ag as pe,ah as ke,ai as $e,aj as j,ak as we,al as Y,am as Q,an as Z,ao as ee,ap as te}from"./cli-main.js";import{y as b}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{f as Ee}from"./ts-loader.js";import{L as ye}from"../packem_shared/index-BisalDCf.js";import{P as ve}from"./catalog.js";import{allKnownTags as Se,tagsFromPaths as Re,NATIVE_BINDING_VERSION as G}from"#native";import{h as ne}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";let ce;const fe=e=>(ce??=ae(import.meta.url))(e),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,n]=x.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return x.getBuiltinModule(e)}return fe(e)},{readdirSync:q,statSync:M,readFileSync:I,existsSync:T,writeFileSync:y,unlinkSync:le,rmSync:ue,chmodSync:de}=F("node:fs"),{cwd:A}=x,{createInterface:ge}=F("node:readline"),{spawnSync:E}=F("node:child_process"),{basename:be}=F("node:path"),_e=/^# ([^:\s]\S*)(?::\s+(.+))?$/,xe=e=>{const t=[],n=e.split(`
|
|
2
2
|
`);let s;for(const o of n){if(o.startsWith("#!")||o.startsWith("# Generated by")||o.startsWith("# NOTE:")||o==="set -e"||o==="")continue;const i=_e.exec(o);if(i){s&&t.push(s),s={command:"",id:i[1]??"",...i[2]?{name:i[2]}:{}};continue}s?s.command=s.command.length>0?`${s.command}
|
|
3
3
|
${o}`:o:s={command:o,id:"(custom)"}}return s&&t.push(s),t},Ae=(e,t)=>{const n=h(e,t),s=[],o=new Set(z);if(b(n))for(const i of q(n)){if(i.startsWith(".")||i==="_"||!o.has(i))continue;const r=h(n,i);if(!M(r).isFile())continue;const c=O(r),a=xe(c);s.push({blocks:a,rawLineCount:c.split(`
|
|
4
4
|
`).length,stage:i})}return s.sort((i,r)=>i.stage.localeCompare(r.stage)),{hooksDirectory:t,stages:s}},Ie=e=>{const t=[];if(e.stages.length===0)return t.push(`No hooks installed in ${e.hooksDirectory}/.`),t;t.push(`Hooks in ${e.hooksDirectory}/:`);for(const n of e.stages)if(t.push("",`${n.stage} (${n.rawLineCount} lines)`),n.blocks.length===0)t.push(" (empty)");else for(const s of n.blocks){const o=s.name?`${s.id} — ${s.name}`:s.id;t.push(` - ${o}`);const i=s.command.split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as Vt}from"node:module";import{X as ke,F as P,b as $e,q as yt,T as bt}from"../packem_shared/index.server-Ca_EEVfw.js";import{e as V,z as Se,U as Ht}from"../packem_shared/index-BzhrR_iC.js";import{i as _e}from"../packem_shared/index-BjdW45xX.js";import{whichBin as Bt}from"#native";import{b as Kt,a as qt,e as Yt}from"../packem_shared/ai-analysis-pldoS_N4.js";import{a3 as Jt,u as Xt,s as Zt,t as Qt,p as g,c as it}from"./cli-main.js";import{l as ze}from"./ts-loader.js";import{y as Z}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{U as at}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";import{L as en,k as tn,l as nn,P as an,r as rn,S as on,U as rt,i as sn,V as ot,h as cn,j as ln,M as st,d as pn,b as dn}from"./catalog.js";import{d as fn,c as gn}from"../packem_shared/pm-runner-RM72mDZg.js";import{s as D}from"../packem_shared/index-B4AjSxHU.js";import{c as xt,s as be,g as un,p as mn,e as hn}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as Vt}from"node:module";import{X as ke,F as P,b as $e,q as yt,T as bt}from"../packem_shared/index.server-Ca_EEVfw.js";import{e as V,z as Se,U as Ht}from"../packem_shared/index-BzhrR_iC.js";import{i as _e}from"../packem_shared/index-BjdW45xX.js";import{whichBin as Bt}from"#native";import{b as Kt,a as qt,e as Yt}from"../packem_shared/ai-analysis-pldoS_N4.js";import{a3 as Jt,u as Xt,s as Zt,t as Qt,p as g,c as it}from"./cli-main.js";import{l as ze}from"./ts-loader.js";import{y as Z}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{U as at}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";import{L as en,k as tn,l as nn,P as an,r as rn,S as on,U as rt,i as sn,V as ot,h as cn,j as ln,M as st,d as pn,b as dn}from"./catalog.js";import{d as fn,c as gn}from"../packem_shared/pm-runner-RM72mDZg.js";import{s as D}from"../packem_shared/index-B4AjSxHU.js";import{c as xt,s as be,g as un,p as mn,e as hn}from"../packem_shared/index-CDHP1kby.js";import{d as vn}from"../packem_shared/anolilab-text-CAM_E6uK.js";import{t as wn,b as yn,G as bn}from"../packem_shared/ecosystem-gate-DiqQj0LJ.js";import{s as $n}from"../packem_shared/scan-progress-RwCRxJdX.js";import{p as $t}from"../packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js";import{r as Sn,l as An,f as Nn,a as Cn}from"../packem_shared/dependency-scan-CawAKoU_.js";import{r as En}from"../packem_shared/manifests-Du4yKlf_.js";import{c as oe,h as On,i as In,l as Rn,m as jn}from"../packem_shared/multi-eco-lockfiles-B2X3yhyo.js";import{l as Pn,p as Tn,O as Ln}from"../packem_shared/osv-bloom-BCAX5ARR.js";import{D as Fn,f as ct,e as Un,i as zn}from"../packem_shared/formatBytes-_HvjOy8a-B_qQr4Hw.js";let Ft;const Ut=e=>(Ft??=Vt(import.meta.url))(e),ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Q=e=>{if(typeof ne<"u"&&ne.versions&&ne.versions.node){const[t,n]=ne.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return ne.getBuiltinModule(e)}return Ut(e)},{spawnSync:zt}=Q("node:child_process"),{createInterface:Wt}=Q("node:readline"),{stripVTControlCharacters:Gt}=Q("node:util"),{createHash:xn}=Q("node:crypto"),{relative:kt,join:kn}=Q("node:path"),{readFileSync:Dn,writeFileSync:Mn,renameSync:_n,unlinkSync:Vn}=Q("node:fs"),lt=(e,t={})=>{Array.isArray(t.extensions)||(t.extensions=["js","mjs","cjs","ts"]);const n=[];for(const i of en(e,t))n.push(i.path);return n},Ae=e=>`${e.packageName}@${e.packageVersion}:${e.vulnerability.id}`,Wn=e=>e==null||e===!0||e===""||e==="true"||e.toString().toLowerCase()==="all",Hn=(e,t)=>{if(Wn(t))return e;const n=String(t).trim();if(/^\d+$/.test(n)){const a=Number.parseInt(n,10)-1,r=e[a];return r?[r]:[]}const i=n.toLowerCase();return e.filter(a=>{const{aliases:r,id:o}=a.vulnerability;return o.toLowerCase()===i||(r??[]).some(c=>c.toLowerCase()===i)})},Bn=e=>{const{packageName:t,packageVersion:n,vulnerability:i}=e,a=(i.aliases??[]).join(", ")||"none",r=(i.fixedVersions??[]).join(", ")||"no fixed version published";return`You are a security engineer. Explain this dependency vulnerability for a developer triaging it.
|
|
2
2
|
|
|
3
3
|
Package: ${t}@${n}
|
|
4
4
|
Advisory: ${i.id} (aliases: ${a})
|