@bndynet/vue-site 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -0
- package/bin/vue-site.mjs +355 -0
- package/dist/components/AppLayout.vue.d.ts +2 -0
- package/dist/components/DynamicIcon.vue.d.ts +6 -0
- package/dist/components/MarkdownView.vue.d.ts +5 -0
- package/dist/components/NavGroup.vue.d.ts +6 -0
- package/dist/components/NavItem.vue.d.ts +9 -0
- package/dist/components/PageView.vue.d.ts +2 -0
- package/dist/components/SideNav.vue.d.ts +2 -0
- package/dist/components/SiteExternalLinks.vue.d.ts +8 -0
- package/dist/components/ThemeSwitch.vue.d.ts +10 -0
- package/dist/components/TooltipOverlay.vue.d.ts +18 -0
- package/dist/components/TopPrimaryNav.vue.d.ts +2 -0
- package/dist/components/UiTooltip.vue.d.ts +35 -0
- package/dist/composables/useNavLayout.d.ts +5 -0
- package/dist/composables/useSiteConfig.d.ts +9 -0
- package/dist/composables/useTheme.d.ts +12 -0
- package/dist/create-app.d.ts +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.es.js +38146 -0
- package/dist/nav-utils.d.ts +8 -0
- package/dist/router.d.ts +3 -0
- package/dist/style.css +1 -0
- package/dist/theme/presets.d.ts +5 -0
- package/dist/theme/resolve-palettes.d.ts +6 -0
- package/dist/types.d.ts +106 -0
- package/package.json +58 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ResolvedNavItem } from './types';
|
|
2
|
+
/** Deepest path from any root item (1 = only top-level leaves). */
|
|
3
|
+
export declare function maxNavDepth(items: ResolvedNavItem[]): number;
|
|
4
|
+
export declare function subtreeContainsPath(item: ResolvedNavItem, path: string): boolean;
|
|
5
|
+
/** First top-level item whose subtree contains `path` (fallback: first item). */
|
|
6
|
+
export declare function findActiveTopLevelItem(items: ResolvedNavItem[], path: string): ResolvedNavItem | undefined;
|
|
7
|
+
/** First routable path in a subtree (for group targets). */
|
|
8
|
+
export declare function getFirstLeafPath(item: ResolvedNavItem): string | null;
|
package/dist/router.d.ts
ADDED
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.page-view[data-v-98336c56]{min-height:200px}.page-loading[data-v-98336c56]{display:flex;justify-content:center;padding:60px 0}.page-loading-dot[data-v-98336c56]{width:8px;height:8px;border-radius:50%;background:var(--color-link);animation:pulse-98336c56 1s ease-in-out infinite}@keyframes pulse-98336c56{0%,to{opacity:.3;transform:scale(.8)}50%{opacity:1;transform:scale(1)}}.nav-item[data-v-03ee80b4]{display:flex;align-items:center;gap:10px;padding:9px 14px;margin-bottom:2px;border-radius:8px;color:var(--color-sidebar-text);font-size:.9rem;font-weight:500;text-decoration:none;transition:background-color .15s ease,color .15s ease}.nav-item--indent[data-v-03ee80b4]{padding-left:22px;font-size:.85rem}.nav-item[data-v-03ee80b4]:hover{background:var(--color-sidebar-item-hover);text-decoration:none}.nav-item--active[data-v-03ee80b4]{background:var(--color-sidebar-item-active);color:var(--color-sidebar-item-active-text)}.nav-item-label[data-v-03ee80b4]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nav-group-header[data-v-0faf5c71]{display:flex;align-items:center;gap:10px;width:100%;padding:9px 14px;margin-bottom:2px;border:none;border-radius:8px;background:none;color:var(--color-sidebar-text);font-size:.9rem;font-weight:500;cursor:pointer;text-align:left;transition:background-color .15s ease}.nav-group-header[data-v-0faf5c71]:hover{background:var(--color-sidebar-item-hover)}.nav-group-label[data-v-0faf5c71]{flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nav-group-chevron[data-v-0faf5c71]{flex-shrink:0;transition:transform .2s ease;opacity:.5}.nav-group--expanded .nav-group-chevron[data-v-0faf5c71]{transform:rotate(90deg)}.nav-group-children[data-v-0faf5c71]{padding-left:8px}.tooltip-overlay[data-v-31d77ab5]{max-width:min(280px,calc(100vw - 16px));padding:6px 10px;font-size:.75rem;line-height:1.35;font-weight:500;color:var(--color-sidebar-text, #1e293b);background:var(--color-sidebar-bg, #f8fafc);border:1px solid var(--color-sidebar-border, #e2e8f0);border-radius:8px;box-shadow:0 4px 12px #0f172a1f,0 2px 4px #0f172a0f;pointer-events:none}.ui-tooltip[data-v-c96e8e51]{display:inline-flex;align-items:center;max-width:100%}.site-external-links[data-v-70c288f3]{display:flex;align-items:center;gap:6px}.site-external-link[data-v-70c288f3]{display:flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border-radius:999px;text-decoration:none;cursor:pointer;background:transparent;color:var(--color-theme-switch-text);border:1px solid transparent;box-shadow:none;transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease,color .2s ease}.site-external-link[data-v-70c288f3]:hover{background:var(--color-theme-switch-hover);border-color:color-mix(in srgb,var(--color-theme-switch-text) 16%,transparent);box-shadow:0 2px 4px #0f172a12,0 6px 14px #0f172a14;text-decoration:none}.site-external-link[data-v-70c288f3]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--color-sidebar-bg),0 0 0 4px color-mix(in srgb,var(--color-link) 85%,transparent)}.site-external-links--compact .site-external-link[data-v-70c288f3]{width:28px;height:28px}.theme-switch[data-v-42e72bf0]{position:relative;display:inline-flex;flex-direction:column;align-items:center;width:fit-content;max-width:100%;color:var(--color-theme-switch-text)}.theme-switch summary[data-v-42e72bf0]{list-style:none}.theme-switch summary[data-v-42e72bf0]::-webkit-details-marker{display:none}.theme-switch-trigger[data-v-42e72bf0]{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border-radius:999px;cursor:pointer;background:transparent;color:var(--color-theme-switch-text);border:1px solid transparent;box-shadow:none;transition:background-color .2s ease,border-color .2s ease,box-shadow .2s ease}.theme-switch-trigger[data-v-42e72bf0]:hover{background:var(--color-theme-switch-hover);border-color:color-mix(in srgb,var(--color-theme-switch-text) 16%,transparent);box-shadow:0 2px 4px #0f172a12,0 6px 14px #0f172a14}.theme-switch-trigger[data-v-42e72bf0]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--color-sidebar-bg),0 0 0 4px color-mix(in srgb,var(--color-link) 85%,transparent)}.theme-switch-trigger-icon[data-v-42e72bf0]{display:flex;align-items:center;justify-content:center}.theme-switch-menu[data-v-42e72bf0]{position:absolute;left:50%;right:auto;top:calc(100% + 6px);transform:translate(-50%);z-index:40;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:40px;padding:6px;border-radius:12px;background:var(--color-sidebar-bg);border:1px solid var(--color-sidebar-border);box-shadow:0 4px 12px #0f172a1f,0 12px 28px #0f172a1a}.theme-switch-option[data-v-42e72bf0]{display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;margin:0;border:none;border-radius:999px;cursor:pointer;color:var(--color-sidebar-text);background:transparent;transition:background-color .15s ease}.theme-switch-option[data-v-42e72bf0]:hover{background:var(--color-sidebar-item-hover)}.theme-switch-option--active[data-v-42e72bf0]{background:var(--color-sidebar-item-active);color:var(--color-sidebar-item-active-text)}.theme-switch-option[data-v-42e72bf0]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--color-content-bg),0 0 0 4px color-mix(in srgb,var(--color-link) 85%,transparent)}.theme-switch--compact .theme-switch-trigger[data-v-42e72bf0]{width:28px;height:28px}.theme-switch--compact .theme-switch-menu[data-v-42e72bf0]{top:auto;bottom:calc(100% + 6px);transform:translate(-50%);padding:4px;gap:2px;border-radius:10px;box-shadow:0 -4px 12px #0f172a1a,0 -8px 24px #0f172a14}.theme-switch--compact .theme-switch-option[data-v-42e72bf0]{width:30px;height:30px}@media(prefers-reduced-motion:reduce){.theme-switch-trigger[data-v-42e72bf0]{transition:none}}.site-primary-nav-links[data-v-49be0e52]{display:flex;align-items:stretch;gap:0;min-width:0;flex:1;overflow-x:auto;padding:0;-webkit-overflow-scrolling:touch;scrollbar-width:thin}.site-primary-nav-link[data-v-49be0e52]{display:inline-flex;align-items:center;gap:8px;flex-shrink:0;padding:0 14px;border-radius:0;font-size:.9rem;font-weight:600;color:var(--color-sidebar-text);text-decoration:none;background:transparent;transition:background-color .15s ease,color .15s ease}.site-primary-nav-link[data-v-49be0e52]:hover{background:var(--color-sidebar-item-hover);text-decoration:none}.site-primary-nav-link--active[data-v-49be0e52]{background:var(--color-sidebar-item-active);color:var(--color-sidebar-item-active-text)}.site-primary-nav-link-label[data-v-49be0e52]{white-space:nowrap}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html{font-size:16px;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif;line-height:1.6;color:var(--color-text);background-color:var(--color-bg);transition:color .2s ease,background-color .2s ease}a{color:var(--color-link);text-decoration:none}a:hover{text-decoration:underline}img{max-width:100%;height:auto}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--color-scrollbar);border-radius:3px}:root{--site-top-nav-height: 48px;--site-sidebar-width: 200px}.site-layout{min-height:100vh}.site-layout--tiered-nav .site-sidebar{top:var(--site-top-nav-height);height:calc(100vh - var(--site-top-nav-height))}.site-layout--tiered-nav .site-content{margin-top:var(--site-top-nav-height)}.site-layout--tiered-no-sidebar .site-content{margin-left:0}.site-footer-standalone{margin-left:0;padding:20px 48px 32px;text-align:center;border-top:1px solid var(--color-border);background:var(--color-content-bg);transition:background-color .2s ease}.site-primary-nav{position:fixed;top:0;left:0;right:0;z-index:21;display:flex;align-items:stretch;height:var(--site-top-nav-height);padding:0 12px 0 0;box-sizing:border-box;background:var(--color-sidebar-bg);border-bottom:1px solid var(--color-sidebar-border);transition:background-color .2s ease,border-color .2s ease}.site-primary-nav-end{display:flex;align-items:center;gap:6px;flex-shrink:0}.site-primary-nav-theme{flex-shrink:0}.site-primary-nav-brand{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;flex:0 0 var(--site-sidebar-width);width:var(--site-sidebar-width);min-width:0;max-width:var(--site-sidebar-width);box-sizing:border-box;padding:0 12px;text-decoration:none;color:inherit}.site-primary-nav-brand:hover{text-decoration:none;opacity:.9}.site-primary-nav-logo{display:block;height:auto;max-height:32px;width:auto;max-width:100%;object-fit:contain}.site-primary-nav-title{min-width:0;font-size:1.05rem;font-weight:700;color:var(--color-sidebar-title);letter-spacing:-.01em;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.site-layout--tiered-nav .site-sidebar-nav{padding-top:12px}.site-sidebar-toolbar{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px;width:100%}.site-sidebar{position:fixed;top:0;left:0;width:var(--site-sidebar-width);height:100vh;background:var(--color-sidebar-bg);border-right:1px solid var(--color-sidebar-border);display:flex;flex-direction:column;overflow-y:auto;z-index:10;transition:background-color .2s ease,border-color .2s ease}.site-sidebar-header{padding:1rem 1rem .75rem;display:flex;justify-content:center}.site-sidebar-brand{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;min-width:0;max-width:100%}.site-sidebar-logo{display:block;max-width:100%;height:auto;max-height:40px;width:auto;object-fit:contain}.site-sidebar-title{min-width:0;font-size:1.15rem;font-weight:700;color:var(--color-sidebar-title);letter-spacing:-.01em;line-height:1.25;text-align:center}.site-sidebar-nav{flex:1;padding:0 8px}.site-sidebar-footer{padding:10px 12px 12px;border-top:1px solid var(--color-sidebar-border);display:flex;flex-direction:column;align-items:center;gap:10px}.site-footer-text{margin:0;font-size:.75rem;line-height:1.45;color:var(--color-text-secondary);white-space:pre-wrap;word-break:break-word;text-align:center}.site-content{margin-left:var(--site-sidebar-width);min-height:100vh;background:var(--color-content-bg);transition:background-color .2s ease}.site-content-inner{max-width:860px;margin:0 auto;padding:40px 48px}.markdown-body h1{font-size:2rem;font-weight:700;margin-bottom:.5rem;padding-bottom:.3rem;border-bottom:1px solid var(--color-border);color:var(--color-text)}.markdown-body h2{font-size:1.5rem;font-weight:600;margin-top:2rem;margin-bottom:.75rem;padding-bottom:.25rem;border-bottom:1px solid var(--color-border);color:var(--color-text)}.markdown-body h3{font-size:1.25rem;font-weight:600;margin-top:1.5rem;margin-bottom:.5rem;color:var(--color-text)}.markdown-body h4,.markdown-body h5,.markdown-body h6{font-size:1rem;font-weight:600;margin-top:1.25rem;margin-bottom:.5rem;color:var(--color-text)}.markdown-body p{margin-bottom:1rem;color:var(--color-text-secondary);line-height:1.75}.markdown-body ul,.markdown-body ol{margin-bottom:1rem;padding-left:2em;color:var(--color-text-secondary)}.markdown-body li{margin-bottom:.25rem}.markdown-body li>ul,.markdown-body li>ol{margin-bottom:0}.markdown-body code{font-family:SF Mono,Fira Code,Fira Mono,Menlo,Consolas,monospace;font-size:.875em;padding:.2em .4em;background:var(--color-code-bg);border-radius:4px;color:var(--color-code-text)}.markdown-body pre{margin-bottom:1.25rem;border-radius:8px;overflow-x:auto;border:1px solid var(--color-code-border)}.markdown-body pre code{display:block;padding:16px 20px;background:var(--color-code-block-bg);font-size:.85rem;line-height:1.6;border-radius:0}.markdown-body blockquote{margin-bottom:1rem;padding:12px 20px;border-left:4px solid var(--color-blockquote-border);background:var(--color-blockquote-bg);border-radius:0 6px 6px 0;color:var(--color-blockquote-text)}.markdown-body blockquote p:last-child{margin-bottom:0}.markdown-body table{width:100%;margin-bottom:1rem;border-collapse:collapse;border:1px solid var(--color-table-border)}.markdown-body th{background:var(--color-table-header-bg);padding:10px 14px;text-align:left;font-weight:600;border:1px solid var(--color-table-border);color:var(--color-text)}.markdown-body td{padding:10px 14px;border:1px solid var(--color-table-border);color:var(--color-text-secondary)}.markdown-body tr:hover td{background:var(--color-table-row-hover)}.markdown-body hr{margin:2rem 0;border:none;border-top:1px solid var(--color-border)}.markdown-body a{color:var(--color-link)}.markdown-body a:hover{color:var(--color-link-hover)}.markdown-body img{max-width:100%;border-radius:6px}.markdown-body strong{color:var(--color-text)}[data-theme=light] .hljs{color:#24292f;background:var(--color-code-block-bg)}[data-theme=light] .hljs-comment,[data-theme=light] .hljs-quote{color:#6a737d;font-style:italic}[data-theme=light] .hljs-keyword,[data-theme=light] .hljs-selector-tag,[data-theme=light] .hljs-type{color:#d73a49}[data-theme=light] .hljs-string,[data-theme=light] .hljs-addition{color:#032f62}[data-theme=light] .hljs-number,[data-theme=light] .hljs-literal{color:#005cc5}[data-theme=light] .hljs-built_in,[data-theme=light] .hljs-builtin-name,[data-theme=light] .hljs-title,[data-theme=light] .hljs-title.function_,[data-theme=light] .hljs-section{color:#6f42c1}[data-theme=light] .hljs-attr,[data-theme=light] .hljs-attribute{color:#005cc5}[data-theme=light] .hljs-variable,[data-theme=light] .hljs-template-variable{color:#e36209}[data-theme=light] .hljs-name,[data-theme=light] .hljs-tag{color:#22863a}[data-theme=light] .hljs-selector-class,[data-theme=light] .hljs-selector-id{color:#6f42c1}[data-theme=light] .hljs-deletion{color:#b31d28;background:#ffeef0}[data-theme=light] .hljs-addition{background:#f0fff4}[data-theme=light] .hljs-meta{color:#735c0f}[data-theme=light] .hljs-regexp{color:#032f62}[data-theme=light] .hljs-symbol{color:#005cc5}[data-theme=light] .hljs-params{color:#24292f}[data-theme=dark] .hljs{color:#e2e8f0;background:var(--color-code-block-bg)}[data-theme=dark] .hljs-comment,[data-theme=dark] .hljs-quote{color:#8b949e;font-style:italic}[data-theme=dark] .hljs-keyword,[data-theme=dark] .hljs-selector-tag,[data-theme=dark] .hljs-type{color:#ff7b72}[data-theme=dark] .hljs-string,[data-theme=dark] .hljs-addition{color:#a5d6ff}[data-theme=dark] .hljs-number,[data-theme=dark] .hljs-literal{color:#79c0ff}[data-theme=dark] .hljs-built_in,[data-theme=dark] .hljs-builtin-name,[data-theme=dark] .hljs-title,[data-theme=dark] .hljs-title.function_,[data-theme=dark] .hljs-section{color:#d2a8ff}[data-theme=dark] .hljs-attr,[data-theme=dark] .hljs-attribute{color:#79c0ff}[data-theme=dark] .hljs-variable,[data-theme=dark] .hljs-template-variable{color:#ffa657}[data-theme=dark] .hljs-name,[data-theme=dark] .hljs-tag{color:#7ee787}[data-theme=dark] .hljs-selector-class,[data-theme=dark] .hljs-selector-id{color:#d2a8ff}[data-theme=dark] .hljs-deletion{color:#ffdcd7;background:#67060c}[data-theme=dark] .hljs-addition{background:#0d4429}[data-theme=dark] .hljs-meta{color:#d29922}[data-theme=dark] .hljs-regexp{color:#a5d6ff}[data-theme=dark] .hljs-symbol{color:#79c0ff}[data-theme=dark] .hljs-params{color:#e2e8f0}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ThemeConfig } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Full CSS variable map per theme id (light / dark / each extra theme).
|
|
4
|
+
* Extra themes copy resolved `light` or `dark` (see `basedOn`), then merge `palette`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function resolveThemePalettes(theme?: ThemeConfig): Record<string, Record<string, string>>;
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { UserConfig as ViteUserConfig } from 'vite';
|
|
3
|
+
export interface NavItem {
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: string;
|
|
6
|
+
page?: (() => Promise<{
|
|
7
|
+
default: string;
|
|
8
|
+
}>) | (() => Promise<{
|
|
9
|
+
default: Component;
|
|
10
|
+
}>);
|
|
11
|
+
children?: NavItem[];
|
|
12
|
+
path?: string;
|
|
13
|
+
}
|
|
14
|
+
/** CSS custom properties for one theme (`--color-bg`, etc.). */
|
|
15
|
+
export type ThemePaletteVars = Record<string, string>;
|
|
16
|
+
/** Extra theme: copies a built-in palette (`basedOn`), then merges `palette`. */
|
|
17
|
+
export interface ThemeOption {
|
|
18
|
+
/** Value for `data-theme` and localStorage */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Label in the theme switcher */
|
|
21
|
+
label: string;
|
|
22
|
+
/** Lucide icon name for the switcher (default: `palette`) */
|
|
23
|
+
icon?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Which resolved built-in palette to extend (`light` / `dark`, after `theme.palettes.light` / `.dark`).
|
|
26
|
+
* @default 'light'
|
|
27
|
+
*/
|
|
28
|
+
basedOn?: 'light' | 'dark';
|
|
29
|
+
/** Partial CSS variables merged on top of the copied built-in palette */
|
|
30
|
+
palette?: ThemePaletteVars;
|
|
31
|
+
}
|
|
32
|
+
export interface ThemeConfig {
|
|
33
|
+
/**
|
|
34
|
+
* Default theme id. Must be `light`, `dark`, or an `id` from `extraThemes`.
|
|
35
|
+
* @default 'light'
|
|
36
|
+
*/
|
|
37
|
+
default?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Global CSS variable overrides on `:root`, applied after the active theme palette
|
|
40
|
+
* (useful for a few tweaks shared across themes).
|
|
41
|
+
*/
|
|
42
|
+
colors?: Record<string, string>;
|
|
43
|
+
/** Themes in addition to built-in `light` and `dark` */
|
|
44
|
+
extraThemes?: ThemeOption[];
|
|
45
|
+
/**
|
|
46
|
+
* Override tokens for the built-in `light` / `dark` palettes only (merged into defaults).
|
|
47
|
+
* Additional themes use `extraThemes[].basedOn` + `extraThemes[].palette`.
|
|
48
|
+
*/
|
|
49
|
+
palettes?: {
|
|
50
|
+
light?: ThemePaletteVars;
|
|
51
|
+
dark?: ThemePaletteVars;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export type SiteViteConfig = Partial<Omit<ViteUserConfig, 'root'>> & {
|
|
55
|
+
/** Options passed to @vitejs/plugin-vue (the Vue plugin is added automatically) */
|
|
56
|
+
vue?: Record<string, any>;
|
|
57
|
+
};
|
|
58
|
+
export interface SiteEnvConfig {
|
|
59
|
+
/** Dev server port (default: Vite auto-selects) */
|
|
60
|
+
port?: number;
|
|
61
|
+
/** Build output directory relative to site root (CLI default: `{basename}-dist`, e.g. `example-dist`) */
|
|
62
|
+
outDir?: string;
|
|
63
|
+
/** Tag prefixes treated as native custom elements (e.g. ['chat-', 'i-']) */
|
|
64
|
+
customElements?: string[];
|
|
65
|
+
/**
|
|
66
|
+
* Local packages to watch for source changes and exclude from pre-bundling.
|
|
67
|
+
* - `string` -- symlinked package name (npm workspaces / npm link)
|
|
68
|
+
* - `{ name, entryPath }` -- resolve imports to a source entry file so Vite compiles it directly (e.g. `'../my-lib/src/index.ts'`)
|
|
69
|
+
*/
|
|
70
|
+
watchPackages?: (string | {
|
|
71
|
+
name: string;
|
|
72
|
+
entryPath: string;
|
|
73
|
+
})[];
|
|
74
|
+
/** Raw Vite configuration overrides merged into the CLI's base config */
|
|
75
|
+
vite?: SiteViteConfig;
|
|
76
|
+
}
|
|
77
|
+
/** Icon link in the header / theme bar (Lucide icon name + URL). */
|
|
78
|
+
export interface SiteExternalLink {
|
|
79
|
+
icon: string;
|
|
80
|
+
link: string;
|
|
81
|
+
/** Tooltip text on hover; if omitted, the hostname is used when possible */
|
|
82
|
+
title?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface SiteConfig {
|
|
85
|
+
title: string;
|
|
86
|
+
logo?: string;
|
|
87
|
+
nav: NavItem[];
|
|
88
|
+
theme?: ThemeConfig;
|
|
89
|
+
footer?: string;
|
|
90
|
+
readme?: string;
|
|
91
|
+
/** External links shown as icons next to the theme control */
|
|
92
|
+
links?: SiteExternalLink[];
|
|
93
|
+
/**
|
|
94
|
+
* Normalized repository URL from `package.json` `repository` (parent directory first,
|
|
95
|
+
* then site root). Injected by the `vue-site` CLI; omit when calling `createSiteApp` manually.
|
|
96
|
+
*/
|
|
97
|
+
packageRepository?: string | null;
|
|
98
|
+
/** Development / build environment configuration */
|
|
99
|
+
env?: SiteEnvConfig;
|
|
100
|
+
}
|
|
101
|
+
export interface ResolvedNavItem extends NavItem {
|
|
102
|
+
resolvedPath: string;
|
|
103
|
+
isHome: boolean;
|
|
104
|
+
isGroup: boolean;
|
|
105
|
+
resolvedChildren?: ResolvedNavItem[];
|
|
106
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@bndynet/vue-site",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "A configurable Vue 3 site framework with sidebar navigation, markdown rendering, and theme switching.",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/bndynet/vue-site.git"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.es.js",
|
|
11
|
+
"module": "./dist/index.es.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./dist/index.es.js",
|
|
16
|
+
"types": "./dist/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./style.css": "./dist/style.css"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"vue-site": "./bin/vue-site.mjs",
|
|
22
|
+
"vs": "./bin/vue-site.mjs"
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"bin"
|
|
27
|
+
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"scripts": {
|
|
32
|
+
"test": "node -e \"process.exit(0)\"",
|
|
33
|
+
"lint": "node -e \"process.exit(0)\"",
|
|
34
|
+
"clean": "rimraf dist example/example-dist",
|
|
35
|
+
"build:lib": "vite build",
|
|
36
|
+
"build:lib:watch": "vite build --watch",
|
|
37
|
+
"dev:example": "npm --prefix example run dev",
|
|
38
|
+
"dev": "npm run build:lib && concurrently -k -n lib,example -c blue,magenta \"npm run build:lib:watch\" \"npm run dev:example\"",
|
|
39
|
+
"build": "npm run build:lib",
|
|
40
|
+
"preview": "npm run build:lib && cd example && npm run preview"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@vitejs/plugin-vue": "^5.2.0",
|
|
44
|
+
"highlight.js": "^11.11.0",
|
|
45
|
+
"lucide-vue-next": "^0.475.0",
|
|
46
|
+
"markdown-it": "^14.1.0",
|
|
47
|
+
"vite": "^6.2.0",
|
|
48
|
+
"vue": "^3.5.0",
|
|
49
|
+
"vue-router": "^4.5.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/markdown-it": "^14.1.0",
|
|
53
|
+
"rimraf": "^6.1.3",
|
|
54
|
+
"typescript": "~5.7.0",
|
|
55
|
+
"vite-plugin-dts": "^4.5.0",
|
|
56
|
+
"vue-tsc": "^2.2.0"
|
|
57
|
+
}
|
|
58
|
+
}
|