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