@visulima/vis 1.0.0-alpha.24 → 1.0.0-alpha.25
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 +61 -0
- package/LICENSE.md +1260 -152
- package/README.md +5 -3
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +19 -0
- package/dist/packem_chunks/bin.js +299 -290
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +2 -2
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +10 -10
- 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 +2 -2
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +5 -5
- package/dist/packem_chunks/handler22.js +2 -2
- package/dist/packem_chunks/handler23.js +2 -2
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler32.js +3 -3
- package/dist/packem_chunks/handler34.js +5 -28
- package/dist/packem_chunks/handler35.js +22 -5
- package/dist/packem_chunks/handler36.js +60 -21
- package/dist/packem_chunks/handler37.js +6 -61
- package/dist/packem_chunks/handler38.js +24 -6
- package/dist/packem_chunks/handler39.js +152 -707
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +10 -24
- package/dist/packem_chunks/handler41.js +25 -286
- package/dist/packem_chunks/handler42.js +707 -152
- package/dist/packem_chunks/handler43.js +24 -10
- package/dist/packem_chunks/handler44.js +322 -25
- package/dist/packem_chunks/handler45.js +46 -24
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +7 -7
- package/dist/packem_chunks/handler48.js +65 -58
- package/dist/packem_chunks/handler5.js +3 -3
- package/dist/packem_chunks/handler6.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 +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +16 -16
- package/dist/packem_chunks/index.js +6 -6
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.js +3 -3
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/affected-shas-Dm7eqcI8.js +1 -0
- package/dist/packem_shared/{ai-analysis-B8pDCOuT.js → ai-analysis-Csn82p17.js} +1 -1
- package/dist/packem_shared/{ai-fix-DiGSrGKv.js → ai-fix-BlYyz5bI.js} +3 -3
- package/dist/packem_shared/{cyclonedx-DPEW0nwS.js → cyclonedx-D6F9rAay.js} +1 -1
- package/dist/packem_shared/dependency-scan-s2MD0vi-.js +1 -0
- package/dist/packem_shared/{docker-_pBC9Loj.js → docker-BU-7veP5.js} +1 -1
- package/dist/packem_shared/index-D9ZIw4ra.js +29 -0
- package/dist/packem_shared/{index-D_tAc2nS.js → index-PexbdLyT.js} +1 -1
- package/dist/packem_shared/lifecycle-ChCFTm5Q.js +2 -0
- package/dist/packem_shared/{lockfile-CQLFNyVa.js → lockfile-BG1HvBzH.js} +1 -1
- package/dist/packem_shared/{min-release-age-Cz6HbF-I.js → min-release-age-heJgeP7o.js} +1 -1
- package/dist/packem_shared/{pm-runner-Dnj9J3KF.js → pm-runner-Cj76BV8q.js} +1 -1
- package/dist/packem_shared/{provenance-yESbF7Vs.js → provenance-CdvMwB2R.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-BpxcFRuk.js → resolve-explicit-CRFybyxv.js} +1 -1
- package/dist/packem_shared/{s1ngularity-B_xjP4lC.js → s1ngularity-CiZla5EP.js} +1 -1
- package/dist/packem_shared/{signatures-DBwSnMBB.js → signatures-BsEDWhME.js} +1 -1
- package/dist/packem_shared/{typosquats-Citu7BRY.js → typosquats-_7T7U2q2.js} +1 -1
- package/dist/packem_shared/vis-update-app-qhQPV97i.js +1 -0
- package/index.js +52 -52
- package/package.json +14 -25
- package/schemas/project.schema.json +4 -0
- package/schemas/vis-config.schema.json +5 -0
- package/dist/packem_shared/dependency-scan-BbtivycX.js +0 -1
- package/dist/packem_shared/index-B8Ko8mwG.js +0 -29
- package/dist/packem_shared/lifecycle-DJDsjoic.js +0 -2
- package/dist/packem_shared/vis-update-app-BWA1kA1q.js +0 -1
|
@@ -1,708 +1,153 @@
|
|
|
1
|
-
var le=Object.defineProperty;var T=(a,e)=>le(a,"name",{value:e,configurable:!0});import{createRequire as se}from"node:module";import{E as S,j as I,q as H}from"../packem_shared/index.server-B7ETiT4C.js";import{projectGraphToDot as he}from"@visulima/task-runner";import{render as fe}from"@visulima/tui";import{aE as V,C as ge,O as me,s as ue}from"./bin.js";import be,{useSyncExternalStore as we,useState as j,useRef as Q,useMemo as P,useCallback as X,useEffect as ve}from"react";import Ce from"graphology";import W from"graphology-layout-forceatlas2";import{d as Se}from"../packem_shared/anolilab-text-CAM_E6uK.js";import{jsx as r,jsxs as o}from"react/jsx-runtime";import{Box as s}from"@visulima/tui/components/box";import{Dialog as Te}from"@visulima/tui/components/dialog";import{Text as t}from"@visulima/tui/components/text";import{useApp as Ee}from"@visulima/tui/hooks/use-app";import{useInput as Ne}from"@visulima/tui/hooks/use-input";import{useWindowSize as Ie}from"@visulima/tui/hooks/use-window-size";import{ScrollView as Me}from"@visulima/tui/components/scroll-view";import{ScrollBar as Ae}from"@visulima/tui/components/scroll-bar";const ce=se(import.meta.url),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=T(a=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[e,n]=F.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return F.getBuiltinModule(a)}return ce(a)},"__cjs_getBuiltinModule"),{readFileSync:de,writeFileSync:pe}=D("node:fs"),{createRequire:xe}=D("node:module"),{join:ye,dirname:ke}=D("node:path");var Re=`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
|
|
2
|
-
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:""}}}@layer theme{:root,:host{--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-light:300;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-normal:0em;--leading-tight:1.25;--leading-snug:1.375;--radius-sm:.25rem;--ease-out:cubic-bezier(0, 0, .2, 1);--blur-sm:8px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--sans);--default-mono-font-family:var(--mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--node-app:#000;--node-lib:#707070;--edge:#bdbdbd;--edge-faint:#e0e0e0;--mono:ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;--sans:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif}@media (prefers-color-scheme:dark){:root{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--node-app:#fff;--node-lib:#8a8a8a;--edge:#3e3e3e;--edge-faint:#2e2e2e}}html[data-theme=light]{--bg:#f5f5f5;--panel:#fff;--panel2:#f0f0f0;--fg:#000;--muted:#555;--faint:#707070;--border:#e0e0e0;--border2:#bdbdbd;--row-hover:#f0f0f0;--accent:#d71921;--accent-soft:#d719210d;--link:#0050c0;--node-app:#000;--node-lib:#707070;--edge:#bdbdbd;--edge-faint:#e0e0e0}html[data-theme=dark]{--bg:#141414;--panel:#1c1c1c;--panel2:#242424;--fg:#fff;--muted:#b8b8b8;--faint:#8a8a8a;--border:#2e2e2e;--border2:#3e3e3e;--row-hover:#1f1f1f;--accent:#ff4d54;--accent-soft:#ff4d5414;--link:#7eb0f9;--node-app:#fff;--node-lib:#8a8a8a;--edge:#3e3e3e;--edge-faint:#2e2e2e}body{background-image:radial-gradient(circle, var(--border) .5px, transparent .5px);font-feature-settings:"ss01";background-size:14px 14px}}@layer components{.tbtn-theme [data-icon=moon]{display:inline-flex}.tbtn-theme [data-icon=sun]{display:none}@media (prefers-color-scheme:dark){.tbtn-theme [data-icon=moon]{display:none}.tbtn-theme [data-icon=sun]{display:inline-flex}}html[data-theme=light] .tbtn-theme [data-icon=moon]{display:inline-flex}html[data-theme=light] .tbtn-theme [data-icon=sun],html[data-theme=dark] .tbtn-theme [data-icon=moon]{display:none}html[data-theme=dark] .tbtn-theme [data-icon=sun]{display:inline-flex}.anolilab-logo{width:auto;height:13px;fill:var(--fg)}.anolilab-accent{fill:#dfff1b}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-4{right:calc(var(--spacing) * 4)}.bottom-4{bottom:calc(var(--spacing) * 4)}.bottom-5{bottom:calc(var(--spacing) * 5)}.left-0{left:calc(var(--spacing) * 0)}.left-4{left:calc(var(--spacing) * 4)}.isolate{isolation:isolate}.z-20{z-index:20}.z-30{z-index:30}.z-\\[2\\]{z-index:2}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-12{margin-inline:calc(var(--spacing) * 12)}.mx-\\[0\\.12em\\]{margin-inline:.12em}.mx-auto{margin-inline:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-12{margin-top:calc(var(--spacing) * 12)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-10{margin-bottom:calc(var(--spacing) * 10)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-auto{margin-left:auto}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.size-\\[7px\\]{width:7px;height:7px}.h-2{height:calc(var(--spacing) * 2)}.h-5{height:calc(var(--spacing) * 5)}.h-7{height:calc(var(--spacing) * 7)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-\\[6px\\]{height:6px}.h-\\[7px\\]{height:7px}.h-\\[8px\\]{height:8px}.h-\\[10px\\]{height:10px}.h-\\[18px\\]{height:18px}.h-full{height:100%}.h-px{height:1px}.max-h-72{max-height:calc(var(--spacing) * 72)}.min-h-\\[400px\\]{min-height:400px}.min-h-\\[480px\\]{min-height:480px}.min-h-screen{min-height:100vh}.w-2{width:calc(var(--spacing) * 2)}.w-3{width:calc(var(--spacing) * 3)}.w-4{width:calc(var(--spacing) * 4)}.w-7{width:calc(var(--spacing) * 7)}.w-9{width:calc(var(--spacing) * 9)}.w-\\[7px\\]{width:7px}.w-\\[8px\\]{width:8px}.w-full{width:100%}.w-px{width:1px}.max-w-\\[380px\\]{max-width:380px}.max-w-\\[1080px\\]{max-width:1080px}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-5{min-width:calc(var(--spacing) * 5)}.min-w-\\[200px\\]{min-width:200px}.min-w-\\[220px\\]{min-width:220px}.min-w-\\[260px\\]{min-width:260px}.flex-1{flex:1}.flex-\\[1_1_280px\\]{flex:280px}.flex-auto{flex:auto}.flex-none{flex:none}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.caption-bottom{caption-side:bottom}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-move{cursor:move}.cursor-pointer{cursor:pointer}.resize{resize:both}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\\[72px_1fr\\]{grid-template-columns:72px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0{gap:calc(var(--spacing) * 0)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.gap-12{gap:calc(var(--spacing) * 12)}.gap-16{gap:calc(var(--spacing) * 16)}.gap-\\[0\\.65rem\\]{gap:.65rem}.gap-\\[2px\\]{gap:2px}.gap-\\[7px\\]{gap:7px}.gap-px{gap:1px}:where(.space-y-0\\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-6{column-gap:calc(var(--spacing) * 6)}.gap-y-1{row-gap:calc(var(--spacing) * 1)}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-\\[3px\\]{border-radius:3px}.rounded-\\[4px\\]{border-radius:4px}.rounded-full{border-radius:3.40282e38px}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent,.border-accent\\/60{border-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.border-accent\\/60{border-color:color-mix(in oklab, var(--accent) 60%, transparent)}}.border-border{border-color:var(--border)}.border-border2{border-color:var(--border2)}.border-fg{border-color:var(--fg)}.border-link{border-color:var(--link)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-accent\\/40{background-color:var(--accent)}@supports (color:color-mix(in lab, red, red)){.bg-accent\\/40{background-color:color-mix(in oklab, var(--accent) 40%, transparent)}}.bg-bg,.bg-bg\\/40{background-color:var(--bg)}@supports (color:color-mix(in lab, red, red)){.bg-bg\\/40{background-color:color-mix(in oklab, var(--bg) 40%, transparent)}}.bg-border{background-color:var(--border)}.bg-border2{background-color:var(--border2)}.bg-edge{background-color:var(--edge)}.bg-edge-faint{background-color:var(--edge-faint)}.bg-fg{background-color:var(--fg)}.bg-node-app{background-color:var(--node-app)}.bg-node-lib{background-color:var(--node-lib)}.bg-panel,.bg-panel\\/95{background-color:var(--panel)}@supports (color:color-mix(in lab, red, red)){.bg-panel\\/95{background-color:color-mix(in oklab, var(--panel) 95%, transparent)}}.bg-panel2{background-color:var(--panel2)}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.px-0{padding-inline:calc(var(--spacing) * 0)}.px-0\\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.px-12{padding-inline:calc(var(--spacing) * 12)}.px-\\[5px\\]{padding-inline:5px}.px-\\[6px\\]{padding-inline:6px}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-16{padding-block:calc(var(--spacing) * 16)}.py-\\[3px\\]{padding-block:3px}.py-px{padding-block:1px}.pt-0\\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-5{padding-top:calc(var(--spacing) * 5)}.pt-7{padding-top:calc(var(--spacing) * 7)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-12{padding-top:calc(var(--spacing) * 12)}.pr-0{padding-right:calc(var(--spacing) * 0)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-6{padding-right:calc(var(--spacing) * 6)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pb-1\\.5{padding-bottom:calc(var(--spacing) * 1.5)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pb-6{padding-bottom:calc(var(--spacing) * 6)}.pb-8{padding-bottom:calc(var(--spacing) * 8)}.pb-12{padding-bottom:calc(var(--spacing) * 12)}.pl-0{padding-left:calc(var(--spacing) * 0)}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-\\[7px\\]{padding-left:7px}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.align-middle{vertical-align:middle}.align-top{vertical-align:top}.font-mono{font-family:var(--mono)}.font-sans{font-family:var(--sans)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[13px\\]{font-size:13px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[22px\\]{font-size:22px}.text-\\[28px\\]{font-size:28px}.text-\\[44px\\]{font-size:44px}.text-\\[72px\\]{font-size:72px}.text-\\[clamp\\(28px\\,5vw\\,52px\\)\\]{font-size:clamp(28px,5vw,52px)}.leading-\\[0\\.9\\]{--tw-leading:.9;line-height:.9}.leading-none{--tw-leading:1;line-height:1}.leading-snug{--tw-leading:var(--leading-snug);line-height:var(--leading-snug)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-light{--tw-font-weight:var(--font-weight-light);font-weight:var(--font-weight-light)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[-0\\.02em\\]{--tw-tracking:-.02em;letter-spacing:-.02em}.tracking-\\[0\\.1em\\]{--tw-tracking:.1em;letter-spacing:.1em}.tracking-\\[0\\.05em\\]{--tw-tracking:.05em;letter-spacing:.05em}.tracking-\\[0\\.08em\\]{--tw-tracking:.08em;letter-spacing:.08em}.tracking-\\[0\\.11em\\]{--tw-tracking:.11em;letter-spacing:.11em}.tracking-\\[0\\.12em\\]{--tw-tracking:.12em;letter-spacing:.12em}.tracking-\\[0\\.15em\\]{--tw-tracking:.15em;letter-spacing:.15em}.tracking-\\[0\\.16em\\]{--tw-tracking:.16em;letter-spacing:.16em}.tracking-\\[0\\.22em\\]{--tw-tracking:.22em;letter-spacing:.22em}.tracking-normal{--tw-tracking:var(--tracking-normal);letter-spacing:var(--tracking-normal)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.text-accent{color:var(--accent)}.text-bg{color:var(--bg)}.text-faint{color:var(--faint)}.text-fg{color:var(--fg)}.text-link{color:var(--link)}.text-muted{color:var(--muted)}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.no-underline{text-decoration-line:none}.opacity-40{opacity:.4}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_4px_12px_rgba\\(0\\,0\\,0\\,0\\.08\\)\\]{--tw-shadow:0 4px 12px var(--tw-shadow-color,#00000014);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_8px_24px_rgba\\(0\\,0\\,0\\,0\\.12\\)\\]{--tw-shadow:0 8px 24px var(--tw-shadow-color,#0000001f);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.outline-0{outline-style:var(--tw-outline-style);outline-width:0}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}.group-data-\\[state\\=off\\]\\:opacity-30:is(:where(.group)[data-state=off] *){opacity:.3}.placeholder\\:text-faint::placeholder{color:var(--faint)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:left-0:before{content:var(--tw-content);left:calc(var(--spacing) * 0)}.before\\:text-faint:before{content:var(--tw-content);color:var(--faint)}.before\\:content-\\[\\'→\\'\\]:before{--tw-content:"→";content:var(--tw-content)}.after\\:ml-auto:after{content:var(--tw-content);margin-left:auto}.after\\:font-mono:after{content:var(--tw-content);font-family:var(--mono)}.after\\:text-\\[9px\\]:after{content:var(--tw-content);font-size:9px}.after\\:tracking-\\[0\\.1em\\]:after{content:var(--tw-content);--tw-tracking:.1em;letter-spacing:.1em}.after\\:text-accent:after{content:var(--tw-content);color:var(--accent)}.after\\:content-\\[\\'ON\\'\\]:after{--tw-content:"ON";content:var(--tw-content)}.last\\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.focus-within\\:border-fg:focus-within{border-color:var(--fg)}@media (hover:hover){.hover\\:border-fg:hover{border-color:var(--fg)}.hover\\:bg-accent:hover{background-color:var(--accent)}.hover\\:bg-row-hover:hover{background-color:var(--row-hover)}.hover\\:text-accent:hover{color:var(--accent)}.hover\\:text-fg:hover{color:var(--fg)}.hover\\:text-white:hover{color:var(--color-white)}.hover\\:opacity-90:hover{opacity:.9}}.focus-visible\\:ring-1:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus-visible\\:ring-fg:focus-visible{--tw-ring-color:var(--fg)}.focus-visible\\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\\:pointer-events-none:disabled{pointer-events:none}.disabled\\:opacity-40:disabled{opacity:.4}.aria-selected\\:bg-row-hover[aria-selected=true]{background-color:var(--row-hover)}.data-\\[open\\=false\\]\\:hidden[data-open=false]{display:none}.data-\\[pinned\\=true\\]\\:pointer-events-auto[data-pinned=true]{pointer-events:auto}.data-\\[pinned\\=true\\]\\:border-accent[data-pinned=true]{border-color:var(--accent)}.data-\\[state\\=off\\]\\:text-faint[data-state=off]{color:var(--faint)}.data-\\[state\\=off\\]\\:line-through[data-state=off]{text-decoration-line:line-through}.data-\\[state\\=off\\]\\:after\\:text-faint[data-state=off]:after{content:var(--tw-content);color:var(--faint)}.data-\\[state\\=off\\]\\:after\\:content-\\[\\'OFF\\'\\][data-state=off]:after{--tw-content:"OFF";content:var(--tw-content)}.data-\\[state\\=selected\\]\\:bg-row-hover[data-state=selected]{background-color:var(--row-hover)}.data-\\[state\\=zero\\]\\:text-accent[data-state=zero]{color:var(--accent)}@media (min-width:40rem){.sm\\:min-w-\\[320px\\]{min-width:320px}}@media (min-width:48rem){.md\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\\:grid-cols-\\[1\\.4fr_1fr\\]{grid-template-columns:1.4fr 1fr}}.\\[\\&_svg\\]\\:size-\\[14px\\] svg{width:14px;height:14px}.\\[\\&_svg\\]\\:shrink-0 svg{flex-shrink:0}.\\[\\&_tr\\]\\:border-b-0 tr{border-bottom-style:var(--tw-border-style);border-bottom-width:0}.\\[\\&\\>\\*\\+\\*\\]\\:ml-6>*+*{margin-left:calc(var(--spacing) * 6)}.\\[\\&\\>\\*\\+\\*\\]\\:border-l>*+*{border-left-style:var(--tw-border-style);border-left-width:1px}.\\[\\&\\>\\*\\+\\*\\]\\:border-border>*+*{border-color:var(--border)}.\\[\\&\\>\\*\\+\\*\\]\\:pl-6>*+*{padding-left:calc(var(--spacing) * 6)}.\\[\\&\\>td\\]\\:border-b>td{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.\\[\\&\\>td\\]\\:border-border>td{border-color:var(--border)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}`,Fe=Object.defineProperty,$=T((a,e)=>Fe(a,"name",{value:e,configurable:!0}),"d$1");const ze=Re,$e=xe(import.meta.url),L=$((a,e)=>{const n=$e.resolve(a);return de(ye(ke(n),e),"utf8")},"readUmd"),Le=L("sigma","sigma.min.js"),je=L("graphology","graphology.umd.min.js"),Pe=L("@floating-ui/core","floating-ui.core.umd.min.js"),De=L("@floating-ui/dom","floating-ui.dom.umd.min.js"),Oe='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/></svg>',_e='<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M4.93 19.07l1.41-1.41m11.32-11.32 1.41-1.41"/></svg>',N=$(a=>a.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),"escapeHtml"),Be=9,Ue=4,Ge=$((a,e)=>{if(a.length===0)return[];const n=new Ce({multi:!0,type:"directed"});for(const i of a){const g=n.order/a.length*Math.PI*2;n.addNode(i.name,{path:i.path,size:i.type==="application"?Be:Ue,type:i.type,x:Math.cos(g),y:Math.sin(g)})}for(const i of e)n.hasNode(i.source)&&n.hasNode(i.target)&&n.addEdge(i.source,i.target,{type:i.type});const l=W.inferSettings(n);W.assign(n,{iterations:600,settings:{...l,adjustSizes:!0,barnesHutOptimize:n.order>100,gravity:1.2,linLogMode:!0,scalingRatio:8,slowDown:4}});const c=[];return n.forEachNode((i,g)=>{c.push({name:i,path:g.path,size:g.size,type:g.type,x:g.x,y:g.y})}),c},"computeLayout"),qe=$(a=>{const e=a.now??new Date,n=a.nodes.filter(m=>m.type==="application").length,l=a.nodes.length-n,c=Ge(a.nodes,a.edges),i=new Set(c.map(m=>m.name)),g=a.edges.filter(m=>i.has(m.source)&&i.has(m.target)),d={edges:g,nodes:c},v=a.nodes.length===0,h={chip:"font-mono tracking-[0.08em] text-muted border border-border2 inline-flex h-7 items-center justify-center rounded-[4px] px-3 text-[11px] font-medium uppercase",dvNum:"font-mono text-[22px] font-medium text-fg leading-none",labelMono:"font-mono text-[10px] uppercase tracking-[0.15em] text-faint"};return`<!doctype html>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<label class="flex items-center gap-3 border-b border-border2 transition-colors duration-150 hover:border-fg focus-within:border-fg pb-1.5">
|
|
27
|
-
<span class="${h.labelMono} select-none">find:</span>
|
|
28
|
-
<input id="filter" type="search" class="w-full min-w-0 border-0 bg-transparent py-0.5 text-fg text-[12px] font-mono outline-0 placeholder:text-faint" placeholder="package name…" aria-label="Filter packages" autocomplete="off" spellcheck="false" />
|
|
29
|
-
<span id="filter-count" data-state="" class="font-mono text-faint text-[10px] tracking-[0.05em] shrink-0 select-none data-[state=zero]:text-accent" aria-live="polite"></span>
|
|
30
|
-
</label>
|
|
31
|
-
<div id="filter-results" data-open="false" class="data-[open=false]:hidden absolute z-20 top-full left-0 right-0 mt-2 bg-panel border border-border max-h-72 overflow-y-auto shadow-[0_4px_12px_rgba(0,0,0,0.08)]" role="listbox" aria-label="Matching packages"></div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
<main class="relative flex-1 min-h-[480px]">${v?'<div class="flex flex-col items-center justify-center min-h-[400px] gap-4 text-center"><div class="font-sans text-[72px] font-semibold text-fg leading-none tracking-tight">NONE</div><div class="font-mono text-faint text-[12px] uppercase tracking-[0.15em]">No projects discovered in this workspace.</div></div>':`<div id="graph" class="absolute inset-0"></div>
|
|
35
|
-
<div id="tooltip" data-pinned="false" class="fixed z-30 top-0 left-0 hidden bg-panel border border-border2 px-4 py-3 max-w-[380px] pointer-events-none font-sans shadow-[0_8px_24px_rgba(0,0,0,0.12)] data-[pinned=true]:pointer-events-auto data-[pinned=true]:border-accent"></div>
|
|
36
|
-
<div id="legend" class="absolute top-4 right-4 bg-panel/95 backdrop-blur-sm border border-border px-4 py-3 min-w-[200px]">
|
|
37
|
-
<div class="${h.labelMono} mb-2">Filter</div>
|
|
38
|
-
<div data-toggle="app" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-2 h-2 rounded-full bg-node-app shrink-0 group-data-[state=off]:opacity-30"></span>Application</div>
|
|
39
|
-
<div data-toggle="lib" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-2 h-2 rounded-full bg-node-lib shrink-0 group-data-[state=off]:opacity-30"></span>Library</div>
|
|
40
|
-
<div data-toggle="prod" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-edge shrink-0 group-data-[state=off]:opacity-30"></span>Static dep</div>
|
|
41
|
-
<div data-toggle="dev" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-edge-faint shrink-0 group-data-[state=off]:opacity-30"></span>Dev / implicit</div>
|
|
42
|
-
<div data-toggle="peer" data-state="on" class="group flex items-center gap-3 py-1 cursor-pointer text-[12px] text-fg select-none transition-colors hover:text-accent data-[state=off]:line-through data-[state=off]:text-faint after:content-['ON'] after:font-mono after:text-[9px] after:tracking-[0.1em] after:ml-auto after:text-accent data-[state=off]:after:content-['OFF'] data-[state=off]:after:text-faint" role="switch" aria-checked="true" tabindex="0"><span class="inline-block w-4 h-px bg-accent shrink-0 group-data-[state=off]:opacity-30"></span>Peer</div>
|
|
43
|
-
</div>
|
|
44
|
-
<div class="absolute bottom-4 left-4 flex flex-wrap items-center gap-x-6 gap-y-2 bg-panel/95 backdrop-blur-sm border border-border px-4 py-2 font-mono text-[10px] uppercase tracking-[0.15em] text-faint">
|
|
45
|
-
<div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">/</span><span>Search</span></div>
|
|
46
|
-
<div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">R</span><span>Fit view</span></div>
|
|
47
|
-
<div class="flex items-center gap-2"><span class="inline-flex h-5 min-w-5 items-center justify-center px-1.5 border border-border2 rounded text-fg bg-panel2 normal-case tracking-normal text-[10px]">Click</span><span>Pin · click empty to unpin</span></div>
|
|
48
|
-
</div>`}</main>
|
|
49
|
-
<footer class="flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-8 py-4 text-[10px] uppercase border-t border-border font-mono text-faint tracking-[0.1em]">
|
|
50
|
-
<span><b class="text-fg font-semibold">${N(a.tool.name)}</b> ${N(a.tool.version)} · generated ${N(e.toISOString())}</span>
|
|
51
|
-
<span class="inline-flex items-center gap-2"><span>built by</span><a class="sig-by-link inline-flex items-center" href="https://anolilab.com" rel="noreferrer noopener" target="_blank" aria-label="Anolilab">${Se}</a></span>
|
|
52
|
-
</footer>
|
|
53
|
-
</div>
|
|
54
|
-
<script>${je}<\/script>
|
|
55
|
-
<script>${Le}<\/script>
|
|
56
|
-
<script>${Pe}<\/script>
|
|
57
|
-
<script>${De}<\/script>
|
|
58
|
-
<script>
|
|
59
|
-
(() => {
|
|
60
|
-
const root = document.documentElement;
|
|
61
|
-
const themeBtn = document.getElementById('theme');
|
|
62
|
-
const mql = window.matchMedia('(prefers-color-scheme: dark)');
|
|
63
|
-
|
|
64
|
-
try {
|
|
65
|
-
const stored = localStorage.getItem('vis-graph-theme');
|
|
66
|
-
if (stored === 'light' || stored === 'dark') {
|
|
67
|
-
root.dataset.theme = stored;
|
|
68
|
-
}
|
|
69
|
-
} catch {}
|
|
70
|
-
|
|
71
|
-
const data = ${JSON.stringify(d).replaceAll("</",String.raw`<\/`)};
|
|
72
|
-
if (!data.nodes.length || !window.graphology || !window.Sigma) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Reusable Tailwind utility-class strings for dynamically-created elements.
|
|
77
|
-
// Inline-everywhere is the system of record; these strings only exist
|
|
78
|
-
// because the JS DOM API can't read Tailwind from the markup.
|
|
79
|
-
const CLS = {
|
|
80
|
-
ttlName: 'font-sans text-fg text-[13px] font-semibold leading-tight mb-1 break-words',
|
|
81
|
-
ttlType: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em]',
|
|
82
|
-
ttlPath: 'font-mono text-muted text-[10px] mt-2 break-all',
|
|
83
|
-
ttlSection: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] mt-3 mb-1',
|
|
84
|
-
ttlEmpty: 'font-mono text-faint text-[10px] italic mt-2',
|
|
85
|
-
ttlMore: 'font-mono text-faint text-[10px] italic pl-3 mt-1',
|
|
86
|
-
ttlUl: 'mt-1 space-y-0.5',
|
|
87
|
-
ttlLi: "font-mono text-fg text-[11px] leading-snug pl-3 relative before:content-['→'] before:text-faint before:absolute before:left-0",
|
|
88
|
-
matchItem: 'flex items-center justify-between gap-3 px-3 py-2 cursor-pointer text-[12px] hover:bg-row-hover aria-selected:bg-row-hover',
|
|
89
|
-
miName: 'font-sans text-fg truncate',
|
|
90
|
-
miMark: 'bg-accent-soft text-accent rounded-sm px-0.5',
|
|
91
|
-
miKind: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] shrink-0',
|
|
92
|
-
matchEmpty: 'font-mono text-faint text-[10px] uppercase tracking-[0.15em] px-3 py-3',
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// Read live colors from the rendered CSS so theme switches stay in one
|
|
96
|
-
// place: change vars → call sigma.refresh() and node/edge colors update.
|
|
97
|
-
const css = () => {
|
|
98
|
-
const s = getComputedStyle(root);
|
|
99
|
-
return {
|
|
100
|
-
app: s.getPropertyValue('--node-app').trim(),
|
|
101
|
-
lib: s.getPropertyValue('--node-lib').trim(),
|
|
102
|
-
edge: s.getPropertyValue('--edge').trim(),
|
|
103
|
-
edgeFaint: s.getPropertyValue('--edge-faint').trim(),
|
|
104
|
-
accent: s.getPropertyValue('--accent').trim(),
|
|
105
|
-
fg: s.getPropertyValue('--fg').trim(),
|
|
106
|
-
muted: s.getPropertyValue('--muted').trim(),
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
let theme = css();
|
|
111
|
-
|
|
112
|
-
const Graph = window.graphology.Graph || window.graphology;
|
|
113
|
-
const graph = new Graph({ multi: true, type: 'directed' });
|
|
114
|
-
|
|
115
|
-
const colorForNode = (type) => type === 'application' ? theme.app : theme.lib;
|
|
116
|
-
const colorForEdge = (type) => {
|
|
117
|
-
if (type === 'peerDependency') return theme.accent;
|
|
118
|
-
if (type === 'devDependency' || type === 'implicit') return theme.edgeFaint;
|
|
119
|
-
return theme.edge;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// Attribute is named "kind", not "type": sigma reads node.type as its
|
|
123
|
-
// program-class name and bails when it sees "application" / "library".
|
|
124
|
-
for (const n of data.nodes) {
|
|
125
|
-
graph.addNode(n.name, {
|
|
126
|
-
x: n.x,
|
|
127
|
-
y: n.y,
|
|
128
|
-
size: n.size,
|
|
129
|
-
label: n.name,
|
|
130
|
-
kind: n.type,
|
|
131
|
-
path: n.path,
|
|
132
|
-
color: colorForNode(n.type),
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
for (const e of data.edges) {
|
|
137
|
-
graph.addEdge(e.source, e.target, {
|
|
138
|
-
color: colorForEdge(e.type),
|
|
139
|
-
depType: e.type,
|
|
140
|
-
size: 1,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// Adjacency for tooltip & hover-emphasis.
|
|
145
|
-
const depMap = {}, rdepMap = {};
|
|
146
|
-
for (const n of data.nodes) { depMap[n.name] = []; rdepMap[n.name] = []; }
|
|
147
|
-
for (const e of data.edges) {
|
|
148
|
-
depMap[e.source].push(e.target);
|
|
149
|
-
rdepMap[e.target].push(e.source);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const container = document.getElementById('graph');
|
|
153
|
-
const tooltip = document.getElementById('tooltip');
|
|
154
|
-
const filterInput = document.getElementById('filter');
|
|
155
|
-
const filterCount = document.getElementById('filter-count');
|
|
156
|
-
const filterResults = document.getElementById('filter-results');
|
|
157
|
-
|
|
158
|
-
const renderer = new window.Sigma(graph, container, {
|
|
159
|
-
renderEdgeLabels: false,
|
|
160
|
-
labelColor: { color: theme.fg },
|
|
161
|
-
labelFont: 'system-ui, -apple-system, sans-serif',
|
|
162
|
-
labelSize: 11,
|
|
163
|
-
labelWeight: '500',
|
|
164
|
-
labelDensity: 0.7,
|
|
165
|
-
labelGridCellSize: 80,
|
|
166
|
-
defaultEdgeColor: theme.edge,
|
|
167
|
-
defaultNodeColor: theme.lib,
|
|
168
|
-
defaultEdgeType: 'arrow',
|
|
169
|
-
minCameraRatio: 0.05,
|
|
170
|
-
maxCameraRatio: 8,
|
|
171
|
-
// Suppress sigma's built-in hover label panel. We render our own tooltip,
|
|
172
|
-
// so its empty label box (the small rectangle near the cursor) is noise.
|
|
173
|
-
defaultDrawNodeHover: () => undefined,
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// State: hover follows the mouse, focus is sticky (set by clicking a node
|
|
177
|
-
// or selecting a search result), pin keeps the tooltip locked in place.
|
|
178
|
-
let hoveredNode = null;
|
|
179
|
-
let focusedNode = null;
|
|
180
|
-
let pinned = false;
|
|
181
|
-
let filterTerm = '';
|
|
182
|
-
let matches = [];
|
|
183
|
-
let activeMatchIndex = -1;
|
|
184
|
-
|
|
185
|
-
// Legend filter state: each key toggles the visibility of a category.
|
|
186
|
-
// previewCategory is set transiently while hovering a legend row so the
|
|
187
|
-
// user can sneak-peek which lines/nodes belong to that category without
|
|
188
|
-
// committing to a toggle.
|
|
189
|
-
const visible = { app: true, lib: true, prod: true, dev: true, peer: true };
|
|
190
|
-
let previewCategory = null;
|
|
191
|
-
const isNodeCat = (k) => k === 'app' || k === 'lib';
|
|
192
|
-
const isEdgeCat = (k) => k === 'prod' || k === 'dev' || k === 'peer';
|
|
193
|
-
const edgeCategory = (depType) => {
|
|
194
|
-
if (depType === 'peerDependency') return 'peer';
|
|
195
|
-
if (depType === 'devDependency' || depType === 'implicit') return 'dev';
|
|
196
|
-
return 'prod';
|
|
197
|
-
};
|
|
198
|
-
const nodeVisible = (kind) => visible[kind === 'application' ? 'app' : 'lib'];
|
|
199
|
-
|
|
200
|
-
const activeNode = () => focusedNode || hoveredNode;
|
|
201
|
-
|
|
202
|
-
renderer.setSetting('nodeReducer', (node, attrs) => {
|
|
203
|
-
if (!nodeVisible(attrs.kind)) {
|
|
204
|
-
return { ...attrs, hidden: true, label: '' };
|
|
205
|
-
}
|
|
206
|
-
// Legend-row preview takes precedence over normal focus/hover emphasis:
|
|
207
|
-
// hovering a category gives an unambiguous "show me what's in this set".
|
|
208
|
-
if (previewCategory) {
|
|
209
|
-
const nodeCat = attrs.kind === 'application' ? 'app' : 'lib';
|
|
210
|
-
const inPreview = isNodeCat(previewCategory) ? nodeCat === previewCategory : false;
|
|
211
|
-
return {
|
|
212
|
-
...attrs,
|
|
213
|
-
color: inPreview ? attrs.color : theme.edgeFaint,
|
|
214
|
-
label: inPreview ? attrs.label : '',
|
|
215
|
-
zIndex: inPreview ? 1 : 0,
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
const active = activeNode();
|
|
219
|
-
const matchedFilter = !filterTerm || node.toLowerCase().includes(filterTerm);
|
|
220
|
-
const isActive = active === node;
|
|
221
|
-
const isRelated = active && (depMap[active]?.includes(node) || rdepMap[active]?.includes(node));
|
|
222
|
-
const dim = (filterTerm && !matchedFilter) || (active && !isActive && !isRelated);
|
|
223
|
-
return {
|
|
224
|
-
...attrs,
|
|
225
|
-
color: isActive ? theme.accent : attrs.color,
|
|
226
|
-
label: dim ? '' : attrs.label,
|
|
227
|
-
zIndex: isActive ? 2 : isRelated ? 1 : 0,
|
|
228
|
-
};
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
renderer.setSetting('edgeReducer', (edge, attrs) => {
|
|
232
|
-
if (!visible[edgeCategory(attrs.depType)]) {
|
|
233
|
-
return { ...attrs, hidden: true };
|
|
234
|
-
}
|
|
235
|
-
const ext = graph.extremities(edge);
|
|
236
|
-
if (!nodeVisible(graph.getNodeAttribute(ext[0], 'kind')) || !nodeVisible(graph.getNodeAttribute(ext[1], 'kind'))) {
|
|
237
|
-
return { ...attrs, hidden: true };
|
|
238
|
-
}
|
|
239
|
-
if (previewCategory) {
|
|
240
|
-
if (isEdgeCat(previewCategory)) {
|
|
241
|
-
const inPreview = edgeCategory(attrs.depType) === previewCategory;
|
|
242
|
-
return { ...attrs, color: inPreview ? theme.accent : theme.edgeFaint, size: inPreview ? 1.5 : 0.3, zIndex: inPreview ? 1 : 0 };
|
|
243
|
-
}
|
|
244
|
-
// Previewing a node category dims every edge — the focus is on the dots.
|
|
245
|
-
return { ...attrs, color: theme.edgeFaint, size: 0.3 };
|
|
246
|
-
}
|
|
247
|
-
const active = activeNode();
|
|
248
|
-
const touchesActive = active && (ext[0] === active || ext[1] === active);
|
|
249
|
-
if (active && !touchesActive) {
|
|
250
|
-
return { ...attrs, color: theme.edgeFaint, hidden: false, size: 0.5 };
|
|
251
|
-
}
|
|
252
|
-
if (touchesActive) {
|
|
253
|
-
return { ...attrs, color: theme.accent, size: 1.5, zIndex: 1 };
|
|
254
|
-
}
|
|
255
|
-
return attrs;
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
// Tooltip body assembled with safe DOM methods (createElement +
|
|
259
|
-
// textContent) — no innerHTML, no template strings of user data.
|
|
260
|
-
const MAX_TOOLTIP_ITEMS = 8;
|
|
261
|
-
const setTooltipContent = (name) => {
|
|
262
|
-
const node = graph.getNodeAttributes(name);
|
|
263
|
-
const deps = depMap[name] || [];
|
|
264
|
-
const rdeps = rdepMap[name] || [];
|
|
265
|
-
tooltip.textContent = '';
|
|
266
|
-
|
|
267
|
-
const nameEl = document.createElement('div');
|
|
268
|
-
nameEl.className = CLS.ttlName;
|
|
269
|
-
nameEl.textContent = name;
|
|
270
|
-
tooltip.appendChild(nameEl);
|
|
271
|
-
|
|
272
|
-
const typeEl = document.createElement('div');
|
|
273
|
-
typeEl.className = CLS.ttlType;
|
|
274
|
-
typeEl.textContent = node.kind + (pinned ? ' · pinned' : '');
|
|
275
|
-
tooltip.appendChild(typeEl);
|
|
276
|
-
|
|
277
|
-
if (node.path) {
|
|
278
|
-
const pathEl = document.createElement('div');
|
|
279
|
-
pathEl.className = CLS.ttlPath;
|
|
280
|
-
pathEl.textContent = node.path;
|
|
281
|
-
tooltip.appendChild(pathEl);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
const addSection = (label, items) => {
|
|
285
|
-
const heading = document.createElement('div');
|
|
286
|
-
heading.className = CLS.ttlSection;
|
|
287
|
-
heading.textContent = label + ' (' + items.length + ')';
|
|
288
|
-
tooltip.appendChild(heading);
|
|
289
|
-
const ul = document.createElement('ul');
|
|
290
|
-
ul.className = CLS.ttlUl;
|
|
291
|
-
const shown = items.slice(0, MAX_TOOLTIP_ITEMS);
|
|
292
|
-
for (const item of shown) {
|
|
293
|
-
const li = document.createElement('li');
|
|
294
|
-
li.className = CLS.ttlLi;
|
|
295
|
-
li.textContent = item;
|
|
296
|
-
ul.appendChild(li);
|
|
297
|
-
}
|
|
298
|
-
if (items.length > MAX_TOOLTIP_ITEMS) {
|
|
299
|
-
const more = document.createElement('li');
|
|
300
|
-
more.className = CLS.ttlMore;
|
|
301
|
-
more.textContent = (items.length - MAX_TOOLTIP_ITEMS) + ' more';
|
|
302
|
-
ul.appendChild(more);
|
|
303
|
-
}
|
|
304
|
-
tooltip.appendChild(ul);
|
|
305
|
-
};
|
|
306
|
-
|
|
307
|
-
if (deps.length) addSection('Depends on', deps);
|
|
308
|
-
if (rdeps.length) addSection('Required by', rdeps);
|
|
309
|
-
if (!deps.length && !rdeps.length) {
|
|
310
|
-
const empty = document.createElement('div');
|
|
311
|
-
empty.className = CLS.ttlEmpty;
|
|
312
|
-
empty.textContent = 'No dependencies';
|
|
313
|
-
tooltip.appendChild(empty);
|
|
314
|
-
}
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
// Tooltip placement delegated to Floating UI. We build a virtual reference
|
|
318
|
-
// element that either follows the cursor (hover) or anchors to a node's
|
|
319
|
-
// viewport position (pinned), then run computePosition with flip + shift +
|
|
320
|
-
// size middleware so the tooltip always fits the viewport.
|
|
321
|
-
const FUI = window.FloatingUIDOM;
|
|
322
|
-
let lastMouse = null;
|
|
323
|
-
let anchorMode = 'cursor'; // 'cursor' (follows mouse) or 'node' (sticky to node)
|
|
324
|
-
let anchorNode = null;
|
|
325
|
-
let cleanupAutoUpdate = null;
|
|
326
|
-
|
|
327
|
-
const cursorRef = {
|
|
328
|
-
getBoundingClientRect() {
|
|
329
|
-
const x = lastMouse ? lastMouse.clientX : 0;
|
|
330
|
-
const y = lastMouse ? lastMouse.clientY : 0;
|
|
331
|
-
return { width: 0, height: 0, x, y, top: y, left: x, right: x, bottom: y };
|
|
332
|
-
},
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
const nodeRef = {
|
|
336
|
-
getBoundingClientRect() {
|
|
337
|
-
if (!anchorNode || !graph.hasNode(anchorNode)) {
|
|
338
|
-
return { width: 0, height: 0, x: 0, y: 0, top: 0, left: 0, right: 0, bottom: 0 };
|
|
339
|
-
}
|
|
340
|
-
const pos = renderer.getNodeDisplayData(anchorNode);
|
|
341
|
-
const vp = renderer.graphToViewport({ x: pos.x, y: pos.y });
|
|
342
|
-
const rect = container.getBoundingClientRect();
|
|
343
|
-
const r = (pos.size || 4) + 4;
|
|
344
|
-
const cx = rect.left + vp.x;
|
|
345
|
-
const cy = rect.top + vp.y;
|
|
346
|
-
return { width: r * 2, height: r * 2, x: cx - r, y: cy - r, top: cy - r, left: cx - r, right: cx + r, bottom: cy + r };
|
|
347
|
-
},
|
|
348
|
-
};
|
|
349
|
-
|
|
350
|
-
const updatePosition = async () => {
|
|
351
|
-
if (tooltip.style.display !== 'block') return;
|
|
352
|
-
const ref = anchorMode === 'node' ? nodeRef : cursorRef;
|
|
353
|
-
const { x, y } = await FUI.computePosition(ref, tooltip, {
|
|
354
|
-
placement: 'right-start',
|
|
355
|
-
strategy: 'fixed',
|
|
356
|
-
middleware: [
|
|
357
|
-
FUI.offset(12),
|
|
358
|
-
FUI.flip({ fallbackPlacements: ['left-start', 'right-end', 'left-end', 'top', 'bottom'] }),
|
|
359
|
-
FUI.shift({ padding: 12 }),
|
|
360
|
-
FUI.size({
|
|
361
|
-
padding: 12,
|
|
362
|
-
apply({ availableWidth, availableHeight, elements }) {
|
|
363
|
-
const maxW = Math.min(380, Math.max(220, availableWidth));
|
|
364
|
-
const maxH = Math.max(160, availableHeight);
|
|
365
|
-
Object.assign(elements.floating.style, {
|
|
366
|
-
maxWidth: maxW + 'px',
|
|
367
|
-
maxHeight: maxH + 'px',
|
|
368
|
-
overflowY: 'auto',
|
|
369
|
-
});
|
|
370
|
-
},
|
|
371
|
-
}),
|
|
372
|
-
],
|
|
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/index.server-B7ETiT4C.js";import{b,B as m,n as ie}from"./config.js";import{i as O,C as _,Q as ve,z as W,M as c,y as be,a as we}from"../packem_shared/readFileSync-CGmzMUF2-D6rUjGDn.js";import{p as a}from"./bin.js";import{B as ce,y as ke,A as xe}from"../packem_shared/pm-runner-Cj76BV8q.js";import{g as Ce}from"../packem_shared/index-D9ZIw4ra.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
|
+
`);for(const[i,n]of r.entries()){const u=k(x(` ${String(i+1)}.`)),p=n.hint?d(` — ${n.hint}`):"";process.stderr.write(`${u} ${n.label}${p}
|
|
3
|
+
`)}for(;;){const i=await E(e,`
|
|
4
|
+
${d(`Enter choice (1-${String(r.length)}):`)} `),n=Number.parseInt(i,10);if(n>=1&&n<=r.length)return r[n-1].value;const u=r.find(p=>p.value===i||p.label.toLowerCase()===i.toLowerCase());if(u)return u.value;process.stderr.write(` ${d("Invalid choice. Try again.")}
|
|
5
|
+
`)}},"select"),Ke=A(async e=>{const t=$e({input:process.stdin,output:process.stdout});try{process.stderr.write(`
|
|
6
|
+
${k(x("vis create"))} ${d("— project scaffolding")}
|
|
7
|
+
|
|
8
|
+
`);const r=e.inMonorepo?[{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}]:[{hint:"Full workspace setup",label:"Vis Monorepo",value:"vis:monorepo"},{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}];let i=await se(t,"Select a template:",r);if(i==="__custom__"&&(i=await E(t,`
|
|
9
|
+
${d("Template (npm package or GitHub URL):")} `),!i))throw new Error("No template specified.");const n=Ae(),u=await E(t,`
|
|
10
|
+
${d(`Project name (${n}):`)} `)||n;if(!pe(T(u)))throw new Error(`Invalid project name: "${u}". Must be a valid npm package name.`);const p=T(u),o=await E(t,` ${d(`Target directory (${p}):`)} `)||p;let l=!1;const s=_(e.cwd,o);if(!ue(s)&&(l=await V(t,`Directory "${o}" is not empty. Overwrite?`,!1),!l))throw new Error("Aborted — directory not empty.");let w;e.inMonorepo||(e.defaultPm?(w=e.defaultPm,process.stderr.write(` ${d(`Package manager: ${w} (from config)`)}
|
|
11
|
+
`)):w=await se(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let $=!1;e.inMonorepo||($=await V(t,"Initialize a git repository?",e.defaultGitInit??!1));const y=e.defaultEditor==="vscode",h=await V(t,"Generate VS Code configuration?",y)?"vscode":void 0;return process.stderr.write(`
|
|
12
|
+
`),{editor:h,gitInit:$,overwrite:l,pm:w,projectName:u,targetDir:o,template:i}}finally{t.close()}},"runInteractivePrompts");var Qe=Object.defineProperty,S=g((e,t)=>Qe(e,"name",{value:t,configurable:!0}),"i");const Xe=S((e,t)=>{a.info("Scaffolding application via create-vite...");const r=[W(t.cwd,t.targetDir)||".",...e.args];return r.includes("--no-immediate")||r.push("--no-immediate"),ce(t.pm,{additionalPackages:[],args:r,package:"create-vite",shellMode:!1,silent:!1},t.cwd,t.logger)},"executeApp"),Ze=S(e=>`${JSON.stringify({devDependencies:{typescript:"^5.0.0",vitest:"^3.0.0"},exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},files:["dist"],main:"./dist/index.js",name:e,scripts:{build:"tsc",dev:"tsc --watch",test:"vitest run","test:watch":"vitest"},type:"module",types:"./dist/index.d.ts",version:"0.0.1"},null,4)}
|
|
13
|
+
`,"libraryPackageJson"),et=S(()=>`${JSON.stringify({compilerOptions:{declaration:!0,declarationMap:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,sourceMap:!0,strict:!0,target:"ES2022"},include:["src/**/*"]},null,4)}
|
|
14
|
+
`,"libraryTsconfig"),tt=S(e=>`/**
|
|
15
|
+
* ${e} — library entry point.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export const greet = (name: string): string => \`Hello from ${e}, \${name}!\`;
|
|
19
|
+
`,"librarySrcIndex"),rt=S(e=>`import { describe, expect, it } from "vitest";
|
|
20
|
+
|
|
21
|
+
import { greet } from "../src/index";
|
|
22
|
+
|
|
23
|
+
describe("${e}", () => {
|
|
24
|
+
it("should greet", () => {
|
|
25
|
+
expect(greet("world")).toBe("Hello from ${e}, world!");
|
|
373
26
|
});
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
nameEl.className = CLS.miName;
|
|
502
|
-
const idx = m.name.toLowerCase().indexOf(filterTerm);
|
|
503
|
-
if (idx >= 0) {
|
|
504
|
-
nameEl.appendChild(document.createTextNode(m.name.slice(0, idx)));
|
|
505
|
-
const mark = document.createElement('mark');
|
|
506
|
-
mark.className = CLS.miMark;
|
|
507
|
-
mark.textContent = m.name.slice(idx, idx + filterTerm.length);
|
|
508
|
-
nameEl.appendChild(mark);
|
|
509
|
-
nameEl.appendChild(document.createTextNode(m.name.slice(idx + filterTerm.length)));
|
|
510
|
-
} else {
|
|
511
|
-
nameEl.textContent = m.name;
|
|
512
|
-
}
|
|
513
|
-
row.appendChild(nameEl);
|
|
514
|
-
|
|
515
|
-
const kindEl = document.createElement('span');
|
|
516
|
-
kindEl.className = CLS.miKind;
|
|
517
|
-
kindEl.textContent = m.type === 'application' ? 'app' : 'lib';
|
|
518
|
-
row.appendChild(kindEl);
|
|
519
|
-
|
|
520
|
-
row.addEventListener('mousedown', (ev) => {
|
|
521
|
-
ev.preventDefault();
|
|
522
|
-
focusOnNode(m.name);
|
|
523
|
-
filterResults.dataset.open = 'false';
|
|
524
|
-
});
|
|
525
|
-
filterResults.appendChild(row);
|
|
526
|
-
}
|
|
527
|
-
if (matches.length > limit) {
|
|
528
|
-
const more = document.createElement('div');
|
|
529
|
-
more.className = CLS.matchEmpty;
|
|
530
|
-
more.textContent = '+ ' + (matches.length - limit) + ' more — refine to see';
|
|
531
|
-
filterResults.appendChild(more);
|
|
532
|
-
}
|
|
533
|
-
filterResults.dataset.open = 'true';
|
|
534
|
-
};
|
|
535
|
-
|
|
536
|
-
const recomputeMatches = () => {
|
|
537
|
-
if (!filterTerm) { matches = []; return; }
|
|
538
|
-
matches = [];
|
|
539
|
-
for (const n of data.nodes) {
|
|
540
|
-
if (n.name.toLowerCase().includes(filterTerm)) matches.push(n);
|
|
541
|
-
}
|
|
542
|
-
matches.sort((a, b) => {
|
|
543
|
-
// Apps first, then by closeness of match position, then by name.
|
|
544
|
-
if (a.type !== b.type) return a.type === 'application' ? -1 : 1;
|
|
545
|
-
const ai = a.name.toLowerCase().indexOf(filterTerm);
|
|
546
|
-
const bi = b.name.toLowerCase().indexOf(filterTerm);
|
|
547
|
-
if (ai !== bi) return ai - bi;
|
|
548
|
-
return a.name.localeCompare(b.name);
|
|
549
|
-
});
|
|
550
|
-
};
|
|
551
|
-
|
|
552
|
-
let rafQueued = false;
|
|
553
|
-
filterInput.addEventListener('input', () => {
|
|
554
|
-
filterTerm = filterInput.value.toLowerCase().trim();
|
|
555
|
-
recomputeMatches();
|
|
556
|
-
activeMatchIndex = matches.length ? 0 : -1;
|
|
557
|
-
renderResults();
|
|
558
|
-
if (!rafQueued) {
|
|
559
|
-
rafQueued = true;
|
|
560
|
-
requestAnimationFrame(() => {
|
|
561
|
-
rafQueued = false;
|
|
562
|
-
renderer.refresh({ skipIndexation: true });
|
|
563
|
-
});
|
|
564
|
-
}
|
|
565
|
-
});
|
|
566
|
-
|
|
567
|
-
filterInput.addEventListener('focus', () => {
|
|
568
|
-
if (filterTerm) filterResults.dataset.open = 'true';
|
|
569
|
-
});
|
|
570
|
-
|
|
571
|
-
document.addEventListener('mousedown', (e) => {
|
|
572
|
-
if (!filterResults.contains(e.target) && e.target !== filterInput) {
|
|
573
|
-
filterResults.dataset.open = 'false';
|
|
574
|
-
}
|
|
575
|
-
});
|
|
576
|
-
|
|
577
|
-
filterInput.addEventListener('keydown', (e) => {
|
|
578
|
-
if (e.key === 'ArrowDown') {
|
|
579
|
-
if (matches.length) {
|
|
580
|
-
e.preventDefault();
|
|
581
|
-
activeMatchIndex = (activeMatchIndex + 1) % matches.length;
|
|
582
|
-
renderResults();
|
|
583
|
-
}
|
|
584
|
-
} else if (e.key === 'ArrowUp') {
|
|
585
|
-
if (matches.length) {
|
|
586
|
-
e.preventDefault();
|
|
587
|
-
activeMatchIndex = (activeMatchIndex - 1 + matches.length) % matches.length;
|
|
588
|
-
renderResults();
|
|
589
|
-
}
|
|
590
|
-
} else if (e.key === 'Enter') {
|
|
591
|
-
if (matches.length && activeMatchIndex >= 0) {
|
|
592
|
-
e.preventDefault();
|
|
593
|
-
focusOnNode(matches[activeMatchIndex].name);
|
|
594
|
-
filterResults.dataset.open = 'false';
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
|
|
599
|
-
// ── Legend / category filter ─────────────────────────────────────────
|
|
600
|
-
const legend = document.getElementById('legend');
|
|
601
|
-
const toggleCategory = (key) => {
|
|
602
|
-
if (!(key in visible)) return;
|
|
603
|
-
visible[key] = !visible[key];
|
|
604
|
-
const row = legend?.querySelector('[data-toggle="' + key + '"]');
|
|
605
|
-
if (row) {
|
|
606
|
-
row.dataset.state = visible[key] ? 'on' : 'off';
|
|
607
|
-
row.setAttribute('aria-checked', String(visible[key]));
|
|
608
|
-
}
|
|
609
|
-
renderer.refresh({ skipIndexation: true });
|
|
610
|
-
};
|
|
611
|
-
let previewRafQueued = false;
|
|
612
|
-
const queuePreviewRefresh = () => {
|
|
613
|
-
if (previewRafQueued) return;
|
|
614
|
-
previewRafQueued = true;
|
|
615
|
-
requestAnimationFrame(() => {
|
|
616
|
-
previewRafQueued = false;
|
|
617
|
-
renderer.refresh({ skipIndexation: true });
|
|
618
|
-
});
|
|
619
|
-
};
|
|
620
|
-
legend?.querySelectorAll('[data-toggle]').forEach((row) => {
|
|
621
|
-
row.addEventListener('click', () => toggleCategory(row.dataset.toggle));
|
|
622
|
-
row.addEventListener('mouseenter', () => {
|
|
623
|
-
previewCategory = row.dataset.toggle;
|
|
624
|
-
queuePreviewRefresh();
|
|
625
|
-
});
|
|
626
|
-
row.addEventListener('mouseleave', () => {
|
|
627
|
-
previewCategory = null;
|
|
628
|
-
queuePreviewRefresh();
|
|
629
|
-
});
|
|
630
|
-
row.addEventListener('focus', () => {
|
|
631
|
-
previewCategory = row.dataset.toggle;
|
|
632
|
-
queuePreviewRefresh();
|
|
633
|
-
});
|
|
634
|
-
row.addEventListener('blur', () => {
|
|
635
|
-
previewCategory = null;
|
|
636
|
-
queuePreviewRefresh();
|
|
637
|
-
});
|
|
638
|
-
row.addEventListener('keydown', (e) => {
|
|
639
|
-
if (e.key === ' ' || e.key === 'Enter') {
|
|
640
|
-
e.preventDefault();
|
|
641
|
-
toggleCategory(row.dataset.toggle);
|
|
642
|
-
}
|
|
643
|
-
});
|
|
644
|
-
});
|
|
645
|
-
|
|
646
|
-
// ── Camera controls ──────────────────────────────────────────────────
|
|
647
|
-
const resetView = () => {
|
|
648
|
-
renderer.getCamera().animatedReset({ duration: 600 });
|
|
649
|
-
};
|
|
650
|
-
|
|
651
|
-
const applyTheme = () => {
|
|
652
|
-
theme = css();
|
|
653
|
-
graph.forEachNode((node, attrs) => {
|
|
654
|
-
graph.setNodeAttribute(node, 'color', colorForNode(attrs.kind));
|
|
655
|
-
});
|
|
656
|
-
graph.forEachEdge((edge, attrs) => {
|
|
657
|
-
graph.setEdgeAttribute(edge, 'color', colorForEdge(attrs.depType));
|
|
658
|
-
});
|
|
659
|
-
renderer.setSetting('labelColor', { color: theme.fg });
|
|
660
|
-
renderer.setSetting('defaultEdgeColor', theme.edge);
|
|
661
|
-
renderer.setSetting('defaultNodeColor', theme.lib);
|
|
662
|
-
renderer.refresh();
|
|
663
|
-
};
|
|
664
|
-
|
|
665
|
-
themeBtn?.addEventListener('click', () => {
|
|
666
|
-
const isDark = root.dataset.theme ? root.dataset.theme === 'dark' : mql.matches;
|
|
667
|
-
const next = isDark ? 'light' : 'dark';
|
|
668
|
-
root.dataset.theme = next;
|
|
669
|
-
try { localStorage.setItem('vis-graph-theme', next); } catch {}
|
|
670
|
-
applyTheme();
|
|
671
|
-
});
|
|
672
|
-
|
|
673
|
-
mql.addEventListener('change', () => {
|
|
674
|
-
if (!root.dataset.theme) applyTheme();
|
|
675
|
-
});
|
|
676
|
-
|
|
677
|
-
// Keyboard shortcuts: '/' focuses search, 'R' fits view, Esc clears + unpins.
|
|
678
|
-
window.addEventListener('keydown', (e) => {
|
|
679
|
-
const inField = document.activeElement === filterInput;
|
|
680
|
-
if (e.key === '/' && !inField) {
|
|
681
|
-
e.preventDefault();
|
|
682
|
-
filterInput.focus();
|
|
683
|
-
filterInput.select();
|
|
684
|
-
} else if ((e.key === 'r' || e.key === 'R') && !inField) {
|
|
685
|
-
e.preventDefault();
|
|
686
|
-
resetView();
|
|
687
|
-
} else if (e.key === 'Escape') {
|
|
688
|
-
if (inField) {
|
|
689
|
-
filterInput.value = '';
|
|
690
|
-
filterTerm = '';
|
|
691
|
-
matches = [];
|
|
692
|
-
renderResults();
|
|
693
|
-
renderer.refresh({ skipIndexation: true });
|
|
694
|
-
filterInput.blur();
|
|
695
|
-
} else if (pinned || focusedNode) {
|
|
696
|
-
focusedNode = null;
|
|
697
|
-
pinned = false;
|
|
698
|
-
tooltip.dataset.pinned = 'false';
|
|
699
|
-
if (!hoveredNode) hideTooltip();
|
|
700
|
-
renderer.refresh({ skipIndexation: true });
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
});
|
|
704
|
-
})();
|
|
705
|
-
<\/script>
|
|
706
|
-
</body>
|
|
707
|
-
</html>`},"emitGraphHtml");var He=Object.defineProperty,M=T((a,e)=>He(a,"name",{value:e,configurable:!0}),"l");const Ve={application:0,library:3,service:1,tool:2},J=M(a=>Ve[a]??Number.MAX_SAFE_INTEGER,"typeRank"),Qe=M(a=>{const e=new Map;for(const[n,l]of Object.entries(a.dependencies))for(const c of l){const i=e.get(c.target)??[];i.push(n),e.set(c.target,i)}return Object.values(a.nodes).map(n=>({deps:a.dependencies[n.name]??[],name:n.name,reverseDeps:e.get(n.name)??[],type:n.type})).sort((n,l)=>n.type!==l.type?J(n.type)-J(l.type):n.name.localeCompare(l.name))},"buildNodes"),Xe=M((a,e,n)=>{let l=a;if(e==="app"?l=l.filter(c=>c.type==="application"):e==="lib"&&(l=l.filter(c=>c.type!=="application")),n){const c=n.toLowerCase();l=l.filter(i=>i.name.toLowerCase().includes(c))}return l},"filterNodes");class We{static{T(this,"GraphStore")}static{M(this,"GraphStore")}#e;#r=new Set;#a;constructor(e){this.#a=e;const n=Qe(e);this.#e={allNodes:n,filterActive:!1,filterText:"",filterType:"all",focusedPanel:"list",selectedIndex:0}}getSnapshot=M(()=>this.#e,"getSnapshot");subscribe=M(e=>(this.#r.add(e),()=>{this.#r.delete(e)}),"subscribe");getFilteredNodes(){return Xe(this.#e.allNodes,this.#e.filterType,this.#e.filterText)}getStats(){const e=this.#e.allNodes.filter(c=>c.type==="application").length,n=this.#e.allNodes.length,l=Object.values(this.#a.dependencies).reduce((c,i)=>c+i.length,0);return{apps:e,deps:l,libs:n-e,total:n}}setSelectedIndex(e){const n=this.getFilteredNodes(),l=n.length===0?-1:Math.max(0,Math.min(e,n.length-1));l!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:l})}setFocusedPanel(e){e!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:e})}setFilterType(e){e!==this.#e.filterType&&this.#t({...this.#e,filterType:e,selectedIndex:0})}setFilter(e){this.#t({...this.#e,filterText:e,selectedIndex:0})}setFilterActive(e){e!==this.#e.filterActive&&this.#t({...this.#e,filterActive:e,filterText:e?this.#e.filterText:"",selectedIndex:e?this.#e.selectedIndex:0})}#t(e){this.#e=e;for(const n of this.#r)try{n()}catch{}}}var Je=Object.defineProperty,Ye=T((a,e)=>Je(a,"name",{value:e,configurable:!0}),"p");const Ke=Ye(({focused:a,node:e,scrollRef:n})=>{const l=a?"white":"gray";if(!e)return r(s,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",children:r(t,{dimColor:!0,children:"No project selected"})});const c=e.type==="application",i=c?"yellow":"cyan",g=c?"Application":"Library";return r(s,{borderColor:l,borderStyle:"single",borderTopRightTitle:` ${g} `,borderTopTitle:` ${e.name} `,flexDirection:"column",flexGrow:1,children:o(Me,{flexGrow:1,flexShrink:1,paddingX:2,ref:n,scrollbar:!0,scrollbarColor:"gray",children:[o(s,{flexDirection:"column",marginTop:1,children:[o(s,{children:[r(t,{dimColor:!0,children:"── "}),r(t,{bold:!0,color:"white",children:"DEPENDS ON"}),o(t,{dimColor:!0,children:[" ","(",e.deps.length,")"]})]}),e.deps.length===0?r(s,{marginTop:1,paddingLeft:2,children:r(t,{dimColor:!0,children:"No dependencies"})}):r(s,{flexDirection:"column",marginTop:1,children:e.deps.map(d=>o(s,{gap:1,paddingLeft:2,children:[r(t,{color:"cyan",children:"→"}),r(t,{children:d.target}),d.type!=="static"&&o(t,{dimColor:!0,children:["(",d.type,")"]})]},d.target))})]}),o(s,{flexDirection:"column",marginTop:1,children:[o(s,{children:[r(t,{dimColor:!0,children:"── "}),r(t,{bold:!0,color:"white",children:"REQUIRED BY"}),o(t,{dimColor:!0,children:[" ","(",e.reverseDeps.length,")"]})]}),e.reverseDeps.length===0?r(s,{marginTop:1,paddingLeft:2,children:r(t,{dimColor:!0,children:"No reverse dependencies"})}):r(s,{flexDirection:"column",marginTop:1,children:e.reverseDeps.map(d=>o(s,{gap:1,paddingLeft:2,children:[r(t,{color:"magenta",children:"←"}),r(t,{children:d})]},d))})]}),o(s,{flexDirection:"column",marginTop:1,children:[o(s,{children:[r(t,{dimColor:!0,children:"── "}),r(t,{bold:!0,color:"white",children:"INFO"})]}),o(s,{flexDirection:"column",marginTop:1,paddingLeft:2,children:[o(s,{children:[r(s,{width:16,children:r(t,{dimColor:!0,children:"Type:"})}),r(t,{color:i,children:g})]}),o(s,{children:[r(s,{width:16,children:r(t,{dimColor:!0,children:"Dependencies:"})}),r(t,{children:String(e.deps.length)})]}),o(s,{children:[r(s,{width:16,children:r(t,{dimColor:!0,children:"Required by:"})}),r(t,{children:String(e.reverseDeps.length)})]}),o(s,{children:[r(s,{width:16,children:r(t,{dimColor:!0,children:"Connectivity:"})}),r(t,{children:String(e.deps.length+e.reverseDeps.length)})]})]})]})]})})},"ProjectDetailPanel");var Ze=Object.defineProperty,O=T((a,e)=>Ze(a,"name",{value:e,configurable:!0}),"m");const et=[{key:"all",label:"All",shortcut:"1"},{key:"app",label:"Apps",shortcut:"2"},{key:"lib",label:"Libs",shortcut:"3"}],Y=O(({isSelected:a,node:e})=>{const n=e.type==="application",l=n?"yellow":"cyan",c=n?"app":"lib";return o(s,{flexShrink:0,height:1,children:[o(t,{children:[a?"▶":" "," "]}),r(s,{flexGrow:1,children:r(t,{bold:a,inverse:a,wrap:"truncate",children:e.name})}),o(t,{color:l,children:[" ",c]}),o(t,{dimColor:!0,children:[" ","→",e.deps.length," ","←",e.reverseDeps.length]})]})},"ProjectRow"),K=O(({count:a,label:e})=>o(s,{flexShrink:0,height:1,marginTop:1,children:[o(t,{dimColor:!0,children:["▼"," "]}),r(t,{bold:!0,color:"white",children:e.toUpperCase()}),o(t,{dimColor:!0,children:[" ","(",a,")"]})]}),"TypeHeader"),tt=O(({filterActive:a,filterText:e,filterType:n,focused:l,nodes:c,scrollOffset:i,selectedIndex:g,stats:d,viewportHeight:v})=>{const h=l?"white":"gray",m=c.filter(y=>y.type==="application"),f=c.filter(y=>y.type!=="application"),b=[];let w=0;if(m.length>0){b.push(r(K,{count:m.length,label:"Applications"},"hdr-apps"));for(const y of m){const C=w;b.push(r(Y,{isSelected:C===g,node:y},y.name)),w++}}if(f.length>0){b.push(r(K,{count:f.length,label:"Libraries"},"hdr-libs"));for(const y of f){const C=w;b.push(r(Y,{isSelected:C===g,node:y},y.name)),w++}}let k=0;m.length>0&&(k+=2+m.length),f.length>0&&(k+=2+f.length);const E=k>v&&v>0;return o(s,{borderColor:h,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[o(s,{flexShrink:0,gap:1,paddingX:1,children:[r(t,{bold:!0,inverse:!0,children:" VIS "}),o(t,{wrap:"truncate",children:[d.total," ","packages"]}),o(t,{dimColor:!0,children:["(",d.apps," ","apps,"," ",d.libs," ","libs,"," ",d.deps," ","deps)"]})]}),r(s,{flexShrink:0,gap:1,paddingX:1,paddingY:1,children:et.map(y=>{const C=n===y.key;return o(s,{children:[r(t,{dimColor:!C,children:"["}),r(t,{bold:C,color:C?"cyan":"gray",children:y.shortcut}),r(t,{dimColor:!C,children:"]"}),o(t,{color:C?"white":"gray",children:[" ",y.label]})]},y.key)})}),a&&o(s,{flexShrink:0,paddingX:1,children:[r(t,{bold:!0,color:"white",children:"/ "}),r(t,{children:e}),r(t,{inverse:!0,children:" "})]}),o(s,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[r(s,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:r(s,{flexDirection:"column",marginTop:-i,children:b})}),E&&r(s,{flexShrink:0,marginLeft:1,marginRight:1,children:r(Ae,{contentHeight:k,placement:"inset",scrollOffset:i,style:"block",viewportHeight:v})})]})]})},"ProjectListPanel");var rt=Object.defineProperty,at=T((a,e)=>rt(a,"name",{value:e,configurable:!0}),"E");const ot=100,nt=40,it=10,Z={1:"all",2:"app",3:"lib"},lt=at(({autoExitSeconds:a=0,store:e})=>{const{exit:n}=Ee(),{columns:l,rows:c}=Ie(),i=we(e.subscribe,e.getSnapshot),[g,d]=j(!1),v=Q(null),h=Q(null),[m,f]=j(0),[b,w]=j(!1),k=P(()=>e.getFilteredNodes(),[i.allNodes,i.filterType,i.filterText]),E=P(()=>e.getStats(),[i.allNodes]),y=k[i.selectedIndex]??null,C=P(()=>{let u=0,p=0;for(const x of k)x.type==="application"?u+=1:p+=1;return{appsCount:u,libsCount:p}},[k]),_=X(u=>{const{appsCount:p,libsCount:x}=C;if(u<p)return(p>0?2:0)+u;const ne=p>0?2+p:0,ie=x>0?2:0;return ne+ie+(u-p)},[C]),z=Math.max(1,c-8-(i.filterActive?1:0)),R=X(u=>{const p=_(u);f(x=>p>x+z-2?Math.max(0,p-z+2):p<x+1?Math.max(0,p-1):x)},[_,z]);if(ve(()=>{h.current?.scrollToTop()},[y?.name]),Ne((u,p)=>{if(u==="c"&&p.ctrl){n();return}if(!b){if(g){p.escape||u==="?"?d(!1):u==="q"?(d(!1),w(!0)):p.downArrow||u==="j"?v.current?.scrollBy(1):(p.upArrow||u==="k")&&v.current?.scrollBy(-1);return}if(u==="?"){d(!0);return}if(u==="q"){w(!0);return}if(p.tab){e.setFocusedPanel(i.focusedPanel==="list"?"detail":"list");return}if(Z[u]){e.setFilterType(Z[u]);return}if(i.filterActive){if(p.escape){e.setFilterActive(!1);return}if(p.return){e.setFilterActive(!1);return}if(p.backspace){e.setFilter(i.filterText.slice(0,-1));return}if(u&&!p.ctrl&&!p.meta){e.setFilter(i.filterText+u);return}return}if(i.focusedPanel==="list"){if(k.length===0){u==="/"&&e.setFilterActive(!0);return}if(p.downArrow||u==="j"){const x=Math.min(i.selectedIndex+1,k.length-1);e.setSelectedIndex(x),R(x);return}if(p.upArrow||u==="k"){const x=Math.max(i.selectedIndex-1,0);e.setSelectedIndex(x),R(x);return}if(p.pageDown){const x=Math.min(i.selectedIndex+10,k.length-1);e.setSelectedIndex(x),R(x);return}if(p.pageUp){const x=Math.max(i.selectedIndex-10,0);e.setSelectedIndex(x),R(x);return}if(p.home){e.setSelectedIndex(0),f(0);return}if(p.end){const x=k.length-1;e.setSelectedIndex(x),R(x);return}if(u==="/"){e.setFilterActive(!0);return}if(p.rightArrow){e.setFocusedPanel("detail");return}return}if(i.focusedPanel==="detail"){if(p.escape||p.leftArrow){e.setFocusedPanel("list");return}if(p.downArrow||u==="j"){h.current?.scrollBy(1);return}if(p.upArrow||u==="k"){h.current?.scrollBy(-1);return}if(p.pageDown){h.current?.scrollBy(10);return}if(p.pageUp){h.current?.scrollBy(-10);return}if(p.home){h.current?.scrollToTop();return}p.end&&h.current?.scrollToBottom()}}},{isActive:!0}),l<nt||c<it)return r(s,{alignItems:"center",height:c,justifyContent:"center",width:l,children:o(t,{color:"yellow",children:["Terminal too small (",l,"x",c,")"]})});const ae=l>=ot,B=r(s,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:o(s,{flexWrap:"wrap",gap:2,paddingX:1,children:[o(s,{gap:1,children:[r(t,{bold:!0,color:"white",children:"q"}),r(t,{dimColor:!0,children:"QUIT"})]},"q"),o(s,{gap:1,children:[r(t,{bold:!0,color:"white",children:"?"}),r(t,{dimColor:!0,children:"HELP"})]},"?"),o(s,{gap:1,children:[r(t,{bold:!0,color:"white",children:"↑↓"}),r(t,{dimColor:!0,children:"NAV"})]},"nav"),o(s,{gap:1,children:[r(t,{bold:!0,color:"white",children:"1-3 /"}),r(t,{dimColor:!0,children:"FILTER"})]},"f"),o(s,{gap:1,children:[r(t,{bold:!0,color:"white",children:"Tab"}),r(t,{dimColor:!0,children:"PANEL"})]},"t")]})}),U=o(Te,{footer:o(t,{dimColor:!0,children:[r(t,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",r(t,{bold:!0,color:"white",children:"?"}),"/",r(t,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:v,title:"KEYBOARD SHORTCUTS",visible:g,width:52,children:[o(s,{flexDirection:"column",marginBottom:1,children:[o(s,{marginBottom:1,children:[r(t,{dimColor:!0,children:"── "}),r(t,{bold:!0,color:"white",children:"NAVIGATION"})]}),o(s,{children:[r(s,{width:24,children:o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","↑","/k"]}),r(t,{dimColor:!0,children:" Move up"})]})}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","↓","/j"]}),r(t,{dimColor:!0,children:" Move down"})]})]}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","Tab"]}),r(t,{dimColor:!0,children:" Switch panel"})]}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","→","/","←"]}),r(t,{dimColor:!0,children:" Focus detail/list"})]}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","PgUp/PgDn"]}),r(t,{dimColor:!0,children:" Jump 10 items"})]}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","Home/End"]}),r(t,{dimColor:!0,children:" Jump to start/end"})]})]}),o(s,{flexDirection:"column",marginBottom:1,children:[o(s,{marginBottom:1,children:[r(t,{dimColor:!0,children:"── "}),r(t,{bold:!0,color:"white",children:"FILTERS"})]}),o(s,{children:[r(s,{width:24,children:o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","1"]}),r(t,{dimColor:!0,children:" All"})]})}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","2"]}),r(t,{dimColor:!0,children:" Apps only"})]})]}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","3"]}),r(t,{dimColor:!0,children:" Libraries only"})]}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","/"]}),r(t,{dimColor:!0,children:" Text filter"})]})]}),o(s,{flexDirection:"column",children:[o(s,{marginBottom:1,children:[r(t,{dimColor:!0,children:"── "}),r(t,{bold:!0,color:"white",children:"ACTIONS"})]}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","q"]}),r(t,{dimColor:!0,children:" Quit"})]}),o(t,{children:[o(t,{bold:!0,color:"white",children:[" ","?"]}),r(t,{dimColor:!0,children:" Toggle help"})]})]})]}),G=r(tt,{filterActive:i.filterActive,filterText:i.filterText,filterType:i.filterType,focused:i.focusedPanel==="list",nodes:k,scrollOffset:m,selectedIndex:i.selectedIndex,stats:E,viewportHeight:z}),q=r(Ke,{focused:i.focusedPanel==="detail",node:y,scrollRef:h});if(ae){const u=Math.floor(l*.35);return o(s,{flexDirection:"column",height:c,width:l,children:[o(s,{flexDirection:"row",flexGrow:1,children:[r(s,{flexGrow:1,children:G}),r(s,{width:u,children:q})]}),B,r(V,{autoExitSeconds:a??3,onCancel:T(()=>{w(!1)},"onCancel"),visible:b}),U]})}const oe=Math.floor(c*.55);return o(s,{flexDirection:"column",height:c,width:l,children:[r(s,{height:oe,children:G}),r(s,{flexGrow:1,children:q}),B,r(V,{autoExitSeconds:a??3,onCancel:T(()=>{w(!1)},"onCancel"),visible:b}),U]})},"VisGraphApp");var st=Object.defineProperty,A=T((a,e)=>st(a,"name",{value:e,configurable:!0}),"y");const re=A((a,e,n,l,c,i,g,d)=>{const v=n?S("└── "):S("├── "),h=c.has(a),m=h?S(" (*)"):"",f=l.get(a),b=f?.type==="application"?I(a):a;if(i.push(`${e}${v}${b}${m}`),h)return;c.add(a);const w=f?.deps??[],k=n?`${e} `:`${e}${S("│")} `;if(d>=g&&w.length>0){i.push(`${k}${S(`... ${w.length} more`)}`);return}for(let E=0;E<w.length;E++){const y=w[E];y&&re(y.target,k,E===w.length-1,l,c,i,g,d+1)}},"printDepsTree"),ee=A((a,e,n,l,c,i)=>{const g=e.get(a),d=g?.type==="application"?I(a):a;l.push(`${i}${d}`),n.add(a);const v=g?.deps??[];if(v.length===0){l.push(`${i} ${S("(no dependencies)")}`);return}if(c<=0){l.push(`${i} ${S(`... ${v.length} dependencies`)}`);return}for(let h=0;h<v.length;h++){const m=v[h];m&&re(m.target,i,h===v.length-1,e,n,l,c,1)}},"printRootProject"),te=A((a,e)=>{const n=new Map;for(const[f,b]of Object.entries(a.nodes))n.set(f,{deps:(a.dependencies[f]??[]).map(w=>({target:w.target,type:w.type})),name:f,type:b.type});const l=[],c=[];for(const[f,b]of n)b.type==="application"?l.push(f):c.push(f);l.sort(),c.sort();const i=l.length+c.length,g=Object.values(a.dependencies).reduce((f,b)=>f+b.length,0),d=[I("Project Dependency Graph"),""];if(l.length>0){d.push(` ${I(H(`Applications (${l.length})`))}`,"");for(const f of l)ee(f,n,new Set,d,e," "),d.push("")}if(c.length>0){d.push(` ${I(H(`Libraries (${c.length})`))}`,"");for(const f of c)ee(f,n,new Set,d,e," "),d.push("")}const v=process.stdout.columns||80;d.push(S("─".repeat(Math.min(v,60)))),d.push(`${I(String(i))} packages ${S("·")} ${I(String(g))} dependencies ${S("·")} ${I(String(l.length))} apps${S(",")} ${I(String(c.length))} libraries`);const h=new Set;let m=!1;for(const f of[...l,...c]){const b=n.get(f)?.deps??[];for(const w of b)h.has(w.target)&&(m=!0),h.add(w.target);h.add(f)}return m&&d.push(S("(*) = already shown above")),d.join(`
|
|
708
|
-
`)},"projectGraphToAscii"),ct=A(a=>{const e=Object.values(a.nodes).map(n=>({name:n.name,type:n.type}));return{edges:Object.values(a.dependencies).flat(),nodes:e}},"projectGraphToJson"),dt=A(a=>{const e=Object.values(a.nodes).map(l=>({name:l.name,path:l.data?.root,type:l.type})),n=[];for(const l of Object.values(a.dependencies))for(const c of l)n.push({source:c.source,target:c.target,type:c.type});return qe({edges:n,nodes:e,tool:{name:"vis-graph",version:"alpha"},workspaceRoot:process.cwd()})},"projectGraphToHtml"),At=A(async({logger:a,options:e,visConfig:n,workspaceRoot:l})=>{if(!l)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const c=l,{packageJsons:i,workspace:g}=ge(c,n),d=me(c,g,i),v=!!process.stdout.isTTY&&!ue,h=e.format??(v?"tui":"ascii"),m=e.output,f=e.depth??1/0;let b;switch(h){case"dot":{b=he(d);break}case"html":{b=dt(d);break}case"json":{b=JSON.stringify(ct(d),void 0,2);break}case"tui":{if(!v){b=te(d,f);break}const w=n?.tui?.autoExit===!0?3:typeof n?.tui?.autoExit=="number"?n.tui.autoExit:0;process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume());const k=setInterval(()=>{},1e3),E=new We(d);await fe(be.createElement(lt,{autoExitSeconds:w,store:E}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),clearInterval(k);return}default:b=te(d,f)}m?(pe(m,b,"utf8"),a.info(`Graph written to ${m}`)):a.info(b)},"execute");export{At as default};
|
|
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};
|