valaxy 1.0.0-rc.11 → 1.0.0-rc.13
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/client/.gitignore +7 -0
- package/client/components/ValaxyLocalSearch.vue +1 -1
- package/client/composables/app/useValaxyHead.ts +1 -1
- package/client/composables/features/copy-markdown.ts +20 -6
- package/client/composables/search/useLocalSearch.ts +5 -5
- package/client/modules/devtools.ts +53 -58
- package/client/modules/unhead.ts +1 -1
- package/client/setup/main.ts +1 -1
- package/dist/node/cli/index.d.mts +18 -3
- package/dist/node/cli/index.mjs +6 -4
- package/dist/node/index.d.mts +89 -9
- package/dist/node/index.mjs +6 -4
- package/dist/shared/{valaxy.-PAGdT3g.mjs → valaxy.BroDoXzi.mjs} +960 -279
- package/dist/shared/{valaxy.CmvWuejN.d.mts → valaxy.BxsKyIbS.d.mts} +5 -1
- package/dist/types/index.d.mts +2 -2
- package/package.json +48 -48
- package/shared/node/i18n.ts +1 -1
- package/types/config.ts +3 -1
- package/types/frontmatter/page.ts +2 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isClient, useClipboard } from '@vueuse/core'
|
|
2
2
|
import { computed, ref, watchEffect } from 'vue'
|
|
3
3
|
import { useRoute } from 'vue-router'
|
|
4
|
+
import { useSiteConfig } from '../../config'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Composable for copying raw Markdown content of the current post.
|
|
7
|
-
* Requires `siteConfig.llms.files: true` to have .md files available at build output.
|
|
8
|
+
* Requires `siteConfig.llms.enable: true` and `siteConfig.llms.files: true` to have .md files available at build output.
|
|
8
9
|
*
|
|
9
10
|
* The `available` ref is initially `false` and becomes `true` after a HEAD request
|
|
10
11
|
* confirms the `.md` file exists. This allows themes to conditionally render
|
|
@@ -26,6 +27,7 @@ import { useRoute } from 'vue-router'
|
|
|
26
27
|
*/
|
|
27
28
|
export function useCopyMarkdown() {
|
|
28
29
|
const route = useRoute()
|
|
30
|
+
const siteConfig = useSiteConfig()
|
|
29
31
|
const copied = ref(false)
|
|
30
32
|
const loading = ref(false)
|
|
31
33
|
const available = ref(false)
|
|
@@ -39,14 +41,26 @@ export function useCopyMarkdown() {
|
|
|
39
41
|
return `${p}.md`
|
|
40
42
|
})
|
|
41
43
|
|
|
42
|
-
//
|
|
44
|
+
// Only probe when raw Markdown output is enabled.
|
|
43
45
|
if (isClient) {
|
|
44
|
-
watchEffect(() => {
|
|
46
|
+
watchEffect((onCleanup) => {
|
|
45
47
|
available.value = false
|
|
46
48
|
error.value = null
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
if (!siteConfig.value.llms.enable || !siteConfig.value.llms.files)
|
|
50
|
+
return
|
|
51
|
+
|
|
52
|
+
const controller = new AbortController()
|
|
53
|
+
onCleanup(() => controller.abort())
|
|
54
|
+
|
|
55
|
+
fetch(mdUrl.value, { method: 'HEAD', signal: controller.signal })
|
|
56
|
+
.then((res) => {
|
|
57
|
+
if (!controller.signal.aborted)
|
|
58
|
+
available.value = res.ok
|
|
59
|
+
})
|
|
60
|
+
.catch(() => {
|
|
61
|
+
if (!controller.signal.aborted)
|
|
62
|
+
available.value = false
|
|
63
|
+
})
|
|
50
64
|
})
|
|
51
65
|
}
|
|
52
66
|
|
|
@@ -13,7 +13,7 @@ export interface LocalSearchResult {
|
|
|
13
13
|
export function useLocalSearch(query: Ref<string>) {
|
|
14
14
|
const results = shallowRef<LocalSearchResult[]>([])
|
|
15
15
|
const loading = ref(false)
|
|
16
|
-
|
|
16
|
+
const miniSearch = shallowRef<MiniSearch | null>(null)
|
|
17
17
|
|
|
18
18
|
async function load(locale = 'root') {
|
|
19
19
|
loading.value = true
|
|
@@ -25,9 +25,9 @@ export function useLocalSearch(query: Ref<string>) {
|
|
|
25
25
|
return
|
|
26
26
|
}
|
|
27
27
|
const mod = await loader()
|
|
28
|
-
const data: string =
|
|
28
|
+
const data: string = mod.default
|
|
29
29
|
const { default: MiniSearchCtor } = await import('minisearch')
|
|
30
|
-
miniSearch = MiniSearchCtor.loadJSON(data, {
|
|
30
|
+
miniSearch.value = MiniSearchCtor.loadJSON(data, {
|
|
31
31
|
fields: ['title', 'titles', 'text'],
|
|
32
32
|
storeFields: ['title', 'titles'],
|
|
33
33
|
})
|
|
@@ -38,11 +38,11 @@ export function useLocalSearch(query: Ref<string>) {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
watchEffect(() => {
|
|
41
|
-
if (!miniSearch || !query.value.trim()) {
|
|
41
|
+
if (!miniSearch.value || !query.value.trim()) {
|
|
42
42
|
results.value = []
|
|
43
43
|
return
|
|
44
44
|
}
|
|
45
|
-
results.value = miniSearch.search(query.value, {
|
|
45
|
+
results.value = miniSearch.value.search(query.value, {
|
|
46
46
|
prefix: true,
|
|
47
47
|
fuzzy: 0.2,
|
|
48
48
|
boost: { title: 4, text: 2, titles: 1 },
|
|
@@ -1,62 +1,57 @@
|
|
|
1
1
|
import type { UserModule } from '../types'
|
|
2
|
+
import { createValaxyPageBridge } from '@valaxyjs/devtools/page'
|
|
3
|
+
import { useWindowSize } from '@vueuse/core'
|
|
4
|
+
import { effectScope, onScopeDispose, watch } from 'vue'
|
|
5
|
+
import { useScreenSize } from '../composables/helper/useScreenSize'
|
|
6
|
+
import { useValaxyConfig } from '../config'
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
icon: 'i-ri-github-fill',
|
|
41
|
-
action: {
|
|
42
|
-
type: 'url',
|
|
43
|
-
src: normalizeRepositoryUrl(pkg.repository.url),
|
|
44
|
-
},
|
|
8
|
+
export const install: UserModule = ({ app, router }) => {
|
|
9
|
+
const scope = effectScope()
|
|
10
|
+
app.runWithContext(() => scope.run(() => {
|
|
11
|
+
const config = useValaxyConfig()
|
|
12
|
+
const { width, height } = useWindowSize()
|
|
13
|
+
const screen = useScreenSize()
|
|
14
|
+
const bridge = createValaxyPageBridge(router, {
|
|
15
|
+
getDebug() {
|
|
16
|
+
const route = router.currentRoute.value
|
|
17
|
+
const { siteConfig, themeConfig, theme } = config.value
|
|
18
|
+
return {
|
|
19
|
+
route: {
|
|
20
|
+
path: route.path,
|
|
21
|
+
fullPath: route.fullPath,
|
|
22
|
+
name: route.name == null ? undefined : String(route.name),
|
|
23
|
+
layout: String(route.meta.layout || 'default'),
|
|
24
|
+
query: route.query,
|
|
25
|
+
params: route.params,
|
|
26
|
+
},
|
|
27
|
+
viewport: {
|
|
28
|
+
width: width.value,
|
|
29
|
+
height: height.value,
|
|
30
|
+
breakpoints: [
|
|
31
|
+
{ label: 'xs', active: screen.isXs.value },
|
|
32
|
+
{ label: 'sm', active: screen.isSm.value },
|
|
33
|
+
{ label: 'md', active: screen.isMd.value },
|
|
34
|
+
{ label: 'lg', active: screen.isLg.value },
|
|
35
|
+
{ label: 'xl', active: screen.isXl.value },
|
|
36
|
+
{ label: '2xl', active: screen.is2xl.value },
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
config: {
|
|
40
|
+
theme: theme || '',
|
|
41
|
+
site: { lang: siteConfig.lang, title: siteConfig.title, url: siteConfig.url },
|
|
42
|
+
themeConfig: { ...themeConfig },
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
45
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
})
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const install: UserModule = async () => {
|
|
61
|
-
await addValaxyTabAndCommand()
|
|
46
|
+
})
|
|
47
|
+
const sync = () => bridge.sync()
|
|
48
|
+
watch([width, height, config, ...Object.values(screen)], sync, { deep: true })
|
|
49
|
+
import.meta.hot?.on('valaxy:pageData', sync)
|
|
50
|
+
onScopeDispose(() => {
|
|
51
|
+
bridge.close()
|
|
52
|
+
import.meta.hot?.off('valaxy:pageData', sync)
|
|
53
|
+
})
|
|
54
|
+
}))
|
|
55
|
+
app.onUnmount(() => scope.stop())
|
|
56
|
+
import.meta.hot?.dispose(() => scope.stop())
|
|
62
57
|
}
|
package/client/modules/unhead.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { UserModule } from '../types'
|
|
2
|
-
import { InferSeoMetaPlugin } from '@unhead/
|
|
2
|
+
import { InferSeoMetaPlugin } from '@unhead/bundler'
|
|
3
3
|
|
|
4
4
|
export const install: UserModule = async ({ head, isClient }) => {
|
|
5
5
|
// Disables on client build, allows 0kb runtime
|
package/client/setup/main.ts
CHANGED
|
@@ -27,7 +27,7 @@ export default function setupMain(ctx: ValaxySSGContext, config: ComputedRef<Val
|
|
|
27
27
|
installNprogress(ctx)
|
|
28
28
|
installFloatingVue(ctx, config)
|
|
29
29
|
|
|
30
|
-
if (import.meta.env.DEV && ctx.isClient) {
|
|
30
|
+
if (import.meta.env.DEV && ctx.isClient && config.value.devtools) {
|
|
31
31
|
import('../modules/devtools').then(({ install: installDevtools }) => {
|
|
32
32
|
setTimeout(() => {
|
|
33
33
|
installDevtools(ctx)
|
|
@@ -1,20 +1,35 @@
|
|
|
1
1
|
import { Argv } from 'yargs';
|
|
2
|
-
import { LogLevel, ViteDevServer } from 'vite';
|
|
2
|
+
import { LogLevel, InlineConfig, ViteDevServer } from 'vite';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* valaxy build
|
|
6
|
+
*/
|
|
7
|
+
declare function execBuild({ ssg, root, output, log, siteUrl }: {
|
|
8
|
+
ssg: boolean;
|
|
9
|
+
root: string;
|
|
10
|
+
output: string;
|
|
11
|
+
log: string;
|
|
12
|
+
siteUrl?: string;
|
|
13
|
+
}): Promise<void>;
|
|
14
|
+
|
|
15
|
+
declare function startValaxyDev({ root, port, remote, log, open, vite, }: {
|
|
5
16
|
root?: string;
|
|
6
17
|
port?: number;
|
|
7
18
|
remote?: boolean;
|
|
8
19
|
log?: LogLevel;
|
|
9
20
|
open?: boolean;
|
|
21
|
+
/** Final host overrides for programmatic callers such as desktop hosts. */
|
|
22
|
+
vite?: InlineConfig;
|
|
10
23
|
}): Promise<ViteDevServer>;
|
|
11
24
|
declare function registerDevCommand(cli: Argv): void;
|
|
12
25
|
|
|
26
|
+
/** Programmatic lifecycle contract supported by desktop hosts. */
|
|
27
|
+
declare const desktopRuntimeVersion = 1;
|
|
13
28
|
interface CreateCliOptions {
|
|
14
29
|
userRoot?: string;
|
|
15
30
|
}
|
|
16
31
|
declare function createCli(argv?: string[], options?: CreateCliOptions): Promise<Argv<object>>;
|
|
17
32
|
declare function run(argv?: string[], options?: CreateCliOptions): Promise<void>;
|
|
18
33
|
|
|
19
|
-
export { createCli, registerDevCommand, run, startValaxyDev };
|
|
34
|
+
export { createCli, desktopRuntimeVersion, execBuild, registerDevCommand, run, startValaxyDev };
|
|
20
35
|
export type { CreateCliOptions };
|
package/dist/node/cli/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import 'node:path';
|
|
|
2
2
|
import 'node:process';
|
|
3
3
|
import 'yargs';
|
|
4
4
|
import 'yargs/helpers';
|
|
5
|
-
export { c as createCli,
|
|
5
|
+
export { c as createCli, s as desktopRuntimeVersion, u as execBuild, O as registerDevCommand, a1 as run, a3 as startValaxyDev } from '../../shared/valaxy.BroDoXzi.mjs';
|
|
6
6
|
import 'node:os';
|
|
7
7
|
import 'consola';
|
|
8
8
|
import 'consola/utils';
|
|
@@ -23,15 +23,15 @@ import 'cross-spawn';
|
|
|
23
23
|
import 'mlly';
|
|
24
24
|
import 'resolve-global';
|
|
25
25
|
import '@valaxyjs/utils';
|
|
26
|
+
import 'node:fs';
|
|
26
27
|
import 'node:fs/promises';
|
|
27
28
|
import 'dayjs';
|
|
28
29
|
import 'feed';
|
|
29
30
|
import 'markdown-exit';
|
|
30
31
|
import 'table';
|
|
31
32
|
import 'hookable';
|
|
32
|
-
import 'node:fs';
|
|
33
33
|
import '@intlify/unplugin-vue-i18n/vite';
|
|
34
|
-
import '@unhead/
|
|
34
|
+
import '@unhead/bundler/vite';
|
|
35
35
|
import 'unplugin-vue-components/vite';
|
|
36
36
|
import 'vite-plugin-vue-layouts-next';
|
|
37
37
|
import 'vitepress-plugin-group-icons';
|
|
@@ -39,6 +39,7 @@ import 'p-map';
|
|
|
39
39
|
import 'node:buffer';
|
|
40
40
|
import 'minisearch';
|
|
41
41
|
import '@shikijs/transformers';
|
|
42
|
+
import 'lru-cache';
|
|
42
43
|
import 'shiki';
|
|
43
44
|
import 'css-i18n';
|
|
44
45
|
import 'markdown-it-anchor';
|
|
@@ -53,7 +54,6 @@ import 'katex';
|
|
|
53
54
|
import 'katex/contrib/mhchem';
|
|
54
55
|
import 'unplugin-vue-markdown/vite';
|
|
55
56
|
import 'js-base64';
|
|
56
|
-
import 'lru-cache';
|
|
57
57
|
import 'jiti';
|
|
58
58
|
import 'unocss';
|
|
59
59
|
import 'pascalcase';
|
|
@@ -63,6 +63,8 @@ import 'node:child_process';
|
|
|
63
63
|
import 'node:v8';
|
|
64
64
|
import 'vite-ssg-sitemap';
|
|
65
65
|
import '@unhead/vue/server';
|
|
66
|
+
import 'vue-router/unplugin';
|
|
67
|
+
import 'vue/compiler-sfc';
|
|
66
68
|
import '@clack/prompts';
|
|
67
69
|
import 'node:net';
|
|
68
70
|
import 'node:readline';
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import * as vite from 'vite';
|
|
2
1
|
import { UserConfig, InlineConfig, ViteDevServer, PluginOption, Plugin } from 'vite';
|
|
3
|
-
import { S as SiteConfig, D as DefaultTheme, R as RuntimeConfig, a as RedirectItem, V as ValaxyConfig, P as PartialDeep, b as ValaxyAddon, U as UserSiteConfig } from '../shared/valaxy.
|
|
2
|
+
import { S as SiteConfig, D as DefaultTheme, R as RuntimeConfig, a as RedirectItem, V as ValaxyConfig, P as PartialDeep, b as ValaxyAddon, U as UserSiteConfig } from '../shared/valaxy.BxsKyIbS.mjs';
|
|
4
3
|
import Vue from '@vitejs/plugin-vue';
|
|
5
4
|
import { Hookable } from 'hookable';
|
|
6
5
|
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
@@ -12,12 +11,13 @@ import Layouts from 'vite-plugin-vue-layouts-next';
|
|
|
12
11
|
import { EditableTreeNode } from 'vue-router/unplugin';
|
|
13
12
|
import Router from 'vue-router/vite';
|
|
14
13
|
import { MarkdownEnv } from 'unplugin-vue-markdown/types';
|
|
14
|
+
import { ValaxyDevtoolsAddon } from '@valaxyjs/devtools/plugin';
|
|
15
15
|
import { Argv } from 'yargs';
|
|
16
16
|
import { KatexOptions } from 'katex';
|
|
17
17
|
import { MarkdownExitOptions, MarkdownExit, StateCore, Token } from 'markdown-exit';
|
|
18
18
|
import { ThemeRegistration, BuiltinTheme, LanguageInput, ShikiTransformer, Highlighter } from 'shiki';
|
|
19
19
|
import { Header } from '@valaxyjs/utils';
|
|
20
|
-
export { CreateCliOptions, createCli, registerDevCommand, run, startValaxyDev } from './cli/index.mjs';
|
|
20
|
+
export { CreateCliOptions, createCli, desktopRuntimeVersion, execBuild, registerDevCommand, run, startValaxyDev } from './cli/index.mjs';
|
|
21
21
|
import { Awaitable } from '@antfu/utils';
|
|
22
22
|
import * as defu from 'defu';
|
|
23
23
|
import '@vueuse/integrations/useFuse';
|
|
@@ -352,6 +352,12 @@ interface MarkdownAnchorOptions {
|
|
|
352
352
|
* @zh 扩展 Markdown 配置,包含代码高亮、Markdown-it 和插件配置
|
|
353
353
|
*/
|
|
354
354
|
interface MarkdownOptions extends MarkdownRendererOptions {
|
|
355
|
+
/**
|
|
356
|
+
* Cache repeated highlighted code blocks (up to 8 MiB per highlighter).
|
|
357
|
+
* Enabled for built-in transforms. Custom codeTransformers/shikiSetup must
|
|
358
|
+
* opt in only when their output depends solely on the code, language and attrs.
|
|
359
|
+
*/
|
|
360
|
+
highlightCache?: boolean;
|
|
355
361
|
/**
|
|
356
362
|
* Setup markdown-it instance before applying plugins
|
|
357
363
|
*/
|
|
@@ -547,7 +553,11 @@ interface ContentLoaderContext {
|
|
|
547
553
|
}
|
|
548
554
|
interface ContentLoader {
|
|
549
555
|
name: string;
|
|
556
|
+
/** Validate the complete output before writing; fail production builds on errors. */
|
|
557
|
+
strict?: boolean;
|
|
550
558
|
load: (ctx: ContentLoaderContext) => Promise<ContentItem[]> | ContentItem[];
|
|
559
|
+
/** Publish associated metadata only after content has been validated and written. */
|
|
560
|
+
onLoaded?: (ctx: ContentLoaderContext) => void | Promise<void>;
|
|
551
561
|
/**
|
|
552
562
|
* Polling interval (ms) for dev mode.
|
|
553
563
|
* undefined = no polling
|
|
@@ -808,7 +818,7 @@ interface ValaxyExtendConfig {
|
|
|
808
818
|
* - `true` (default): all pages render KaTeX, unless `frontmatter.katex: false`
|
|
809
819
|
* - `false`: no pages render KaTeX by default, but individual pages can opt-in via `frontmatter.katex: true`
|
|
810
820
|
*
|
|
811
|
-
* @see [Example | Valaxy](https://valaxy.site/examples/
|
|
821
|
+
* @see [Example | Valaxy](https://valaxy.site/examples/math)
|
|
812
822
|
* @see https://katex.org/
|
|
813
823
|
* @default true
|
|
814
824
|
*/
|
|
@@ -912,10 +922,19 @@ interface ValaxyExtendConfig {
|
|
|
912
922
|
};
|
|
913
923
|
/**
|
|
914
924
|
* @experimental
|
|
915
|
-
* Enable
|
|
916
|
-
* @see https://devtools
|
|
925
|
+
* Enable Vite DevTools, Valaxy DevTools and Vue DevTools
|
|
926
|
+
* @see https://devtools.vite.dev/
|
|
917
927
|
*/
|
|
918
928
|
devtools?: boolean;
|
|
929
|
+
/**
|
|
930
|
+
* Enable the local, read-only MCP endpoint during development.
|
|
931
|
+
* @zh 开启开发环境的本地只读 MCP 服务,默认关闭。
|
|
932
|
+
* @default false
|
|
933
|
+
*/
|
|
934
|
+
mcp?: boolean | {
|
|
935
|
+
/** Include drafts in MCP results. Password-protected pages remain excluded. */
|
|
936
|
+
includeDrafts?: boolean;
|
|
937
|
+
};
|
|
919
938
|
/**
|
|
920
939
|
* @en config for markdown (include markdown-it plugins)
|
|
921
940
|
* @zh markdown 相关配置
|
|
@@ -1002,10 +1021,14 @@ interface ValaxyAddonResolver {
|
|
|
1002
1021
|
options: Record<string, any>;
|
|
1003
1022
|
configFile?: string;
|
|
1004
1023
|
pkg: Record<string, any>;
|
|
1024
|
+
/** Loaded only when development tools are enabled. */
|
|
1025
|
+
devtools?: ValaxyDevtoolsAddon;
|
|
1005
1026
|
extendCli?: ValaxyAddonExtendCli;
|
|
1006
1027
|
setup?: (node: ValaxyNode) => void;
|
|
1007
1028
|
}
|
|
1008
1029
|
type ValaxyNodeAddon = ValaxyAddon & {
|
|
1030
|
+
/** Loaded only when development tools are enabled. */
|
|
1031
|
+
devtools?: ValaxyDevtoolsAddon;
|
|
1009
1032
|
extendCli?: ValaxyAddonExtendCli;
|
|
1010
1033
|
setup?: ValaxyAddonResolver['setup'];
|
|
1011
1034
|
};
|
|
@@ -1154,6 +1177,57 @@ declare const customElements: Set<string>;
|
|
|
1154
1177
|
*/
|
|
1155
1178
|
declare const defaultViteConfig: UserConfig;
|
|
1156
1179
|
|
|
1180
|
+
interface ContentDiagnostic {
|
|
1181
|
+
code: string;
|
|
1182
|
+
severity: 'error' | 'warning';
|
|
1183
|
+
message: string;
|
|
1184
|
+
hint: string;
|
|
1185
|
+
line?: number;
|
|
1186
|
+
}
|
|
1187
|
+
interface ContentPageInfo {
|
|
1188
|
+
path: string;
|
|
1189
|
+
/** Routes after configured build-time hooks; runtime router changes are excluded. */
|
|
1190
|
+
routes: {
|
|
1191
|
+
path: string;
|
|
1192
|
+
aliases: string[];
|
|
1193
|
+
previewPath: string;
|
|
1194
|
+
layout: string | false;
|
|
1195
|
+
}[];
|
|
1196
|
+
/** Only public article metadata, never raw configuration or frontmatter. */
|
|
1197
|
+
metadata: Record<string, string | string[] | boolean>;
|
|
1198
|
+
draft: boolean;
|
|
1199
|
+
hidden: boolean;
|
|
1200
|
+
includedInProductionRoutes: boolean;
|
|
1201
|
+
}
|
|
1202
|
+
interface ContentCheckResult {
|
|
1203
|
+
path: string;
|
|
1204
|
+
ok: boolean;
|
|
1205
|
+
page?: ContentPageInfo;
|
|
1206
|
+
diagnostics: ContentDiagnostic[];
|
|
1207
|
+
/** At most 100 diagnostics are returned; this counts all detected diagnostics. */
|
|
1208
|
+
totalDiagnostics: number;
|
|
1209
|
+
}
|
|
1210
|
+
interface ContentServiceOptions {
|
|
1211
|
+
/** Apply the MCP visibility policy. CLI/API callers can inspect their own private files. */
|
|
1212
|
+
publicOnly?: boolean;
|
|
1213
|
+
includeDrafts?: boolean;
|
|
1214
|
+
/** Resolved Vite base, when called from a running development server. */
|
|
1215
|
+
base?: string;
|
|
1216
|
+
/** Resolved Vite public directory; false disables public assets. */
|
|
1217
|
+
publicDir?: string | false;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Inspect Markdown through Valaxy's route pipeline without starting a server.
|
|
1222
|
+
* Configured route/Markdown hooks run as they do during route generation. Scans
|
|
1223
|
+
* are serialized and rebuilt per request so edits and removals are observable.
|
|
1224
|
+
*/
|
|
1225
|
+
declare function createContentService(app: ValaxyNode, settings?: ContentServiceOptions): {
|
|
1226
|
+
inspectPage: (path: string) => Promise<ContentPageInfo>;
|
|
1227
|
+
checkPage: (path: string) => Promise<ContentCheckResult>;
|
|
1228
|
+
dispose: () => Promise<void>;
|
|
1229
|
+
};
|
|
1230
|
+
|
|
1157
1231
|
declare let version: string;
|
|
1158
1232
|
|
|
1159
1233
|
declare const GLOBAL_STATE: {
|
|
@@ -1161,6 +1235,12 @@ declare const GLOBAL_STATE: {
|
|
|
1161
1235
|
server: ViteDevServer | undefined;
|
|
1162
1236
|
};
|
|
1163
1237
|
|
|
1238
|
+
/**
|
|
1239
|
+
* Load content from all loaders and write .md files to cache directory.
|
|
1240
|
+
* Uses digest-based incremental caching to skip unchanged files.
|
|
1241
|
+
*/
|
|
1242
|
+
declare function loadAllContent(loaders: ContentLoader[], ctx: ContentLoaderContext): Promise<void>;
|
|
1243
|
+
|
|
1164
1244
|
/**
|
|
1165
1245
|
* Post process valaxyOptions
|
|
1166
1246
|
* @param valaxyOptions
|
|
@@ -1194,7 +1274,7 @@ declare function createValaxyPlugin(options: ResolvedValaxyOptions, serverOption
|
|
|
1194
1274
|
* with valaxyPrefix
|
|
1195
1275
|
*/
|
|
1196
1276
|
declare function getServerInfoText(msg: string): string;
|
|
1197
|
-
declare function createServer(valaxyApp: ValaxyNode, viteConfig?: InlineConfig, serverOptions?: ValaxyServerOptions): Promise<
|
|
1277
|
+
declare function createServer(valaxyApp: ValaxyNode, viteConfig?: InlineConfig, serverOptions?: ValaxyServerOptions): Promise<ViteDevServer>;
|
|
1198
1278
|
|
|
1199
1279
|
/**
|
|
1200
1280
|
* @see https://github.com/mdn/dom-examples/blob/main/web-crypto/encrypt-decrypt/aes-cbc.js
|
|
@@ -1245,5 +1325,5 @@ declare function toAtFS(path: string): string;
|
|
|
1245
1325
|
declare function resolveImportPath(importName: string, ensure?: true): Promise<string>;
|
|
1246
1326
|
declare function resolveImportPath(importName: string, ensure?: boolean): Promise<string | undefined>;
|
|
1247
1327
|
|
|
1248
|
-
export { $t, ALL_ROUTE, EXCERPT_SEPARATOR, GLOBAL_STATE, PATHNAME_PROTOCOL_RE, StateManager, ViteValaxyPlugins, build, createMemoryReleasePlugin, createServer, createValaxyPlugin, customElements, defaultSiteConfig, defaultValaxyConfig, defaultViteConfig, defineAddon, defineConfig, defineContentLoader, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, encryptContent, generateClientRedirects, getGitTimestamp, getIndexHtml, getServerInfoText, isExternal, isInstalledGlobally, isKatexEnabled, isKatexPluginNeeded, isMathJaxEnabled, isPath, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonsConfig, resolveImportPath, resolveImportUrl, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, ssgBuild, toAtFS, transformObject, version };
|
|
1249
|
-
export type { CdnModule, ContentItem, ContentLoader, ContentLoaderContext, GroupIconOptions, GroupIconValue, HookResult, LoadConfigFromFileOptions, MdAfterRenderContext, ResolvedConfig, ResolvedValaxyOptions, UnoSetup, UserInputConfig, UserValaxyNodeConfig, ValaxyAddonCliContext, ValaxyAddonExport, ValaxyAddonExtendCli, ValaxyAddonFn, ValaxyAddonLike, ValaxyAddonResolver, ValaxyAddons, ValaxyApp, ValaxyConfigExport, ValaxyConfigExtendKey, ValaxyConfigFn, ValaxyEntryOptions, ValaxyExtendConfig, ValaxyFileInfo, ValaxyHooks, ValaxyNode, ValaxyNodeAddon, ValaxyNodeConfig, ValaxyPickConfig, ValaxyServerOptions, ValaxyTheme };
|
|
1328
|
+
export { $t, ALL_ROUTE, EXCERPT_SEPARATOR, GLOBAL_STATE, PATHNAME_PROTOCOL_RE, StateManager, ViteValaxyPlugins, build, createContentService, createMemoryReleasePlugin, createServer, createValaxyNode, createValaxyPlugin, customElements, defaultSiteConfig, defaultValaxyConfig, defaultViteConfig, defineAddon, defineConfig, defineContentLoader, defineSiteConfig, defineTheme, defineUnoSetup, defineValaxyAddon, defineValaxyConfig, defineValaxyTheme, encryptContent, generateClientRedirects, getGitTimestamp, getIndexHtml, getServerInfoText, isExternal, isInstalledGlobally, isKatexEnabled, isKatexPluginNeeded, isMathJaxEnabled, isPath, loadAllContent, loadConfigFromFile, mergeValaxyConfig, mergeViteConfigs, postProcessForSSG, processValaxyOptions, resolveAddonsConfig, resolveImportPath, resolveImportUrl, resolveOptions, resolveSiteConfig, resolveSiteConfigFromRoot, resolveThemeConfigFromRoot, resolveThemeValaxyConfig, resolveUserThemeConfig, resolveValaxyConfig, resolveValaxyConfigFromRoot, ssgBuild, toAtFS, transformObject, version };
|
|
1329
|
+
export type { CdnModule, ContentCheckResult, ContentDiagnostic, ContentItem, ContentLoader, ContentLoaderContext, ContentPageInfo, ContentServiceOptions, GroupIconOptions, GroupIconValue, HookResult, LoadConfigFromFileOptions, MdAfterRenderContext, ResolvedConfig, ResolvedValaxyOptions, UnoSetup, UserInputConfig, UserValaxyNodeConfig, ValaxyAddonCliContext, ValaxyAddonExport, ValaxyAddonExtendCli, ValaxyAddonFn, ValaxyAddonLike, ValaxyAddonResolver, ValaxyAddons, ValaxyApp, ValaxyConfigExport, ValaxyConfigExtendKey, ValaxyConfigFn, ValaxyEntryOptions, ValaxyExtendConfig, ValaxyFileInfo, ValaxyHooks, ValaxyNode, ValaxyNodeAddon, ValaxyNodeConfig, ValaxyPickConfig, ValaxyServerOptions, ValaxyTheme };
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as ALL_ROUTE, E as EXCERPT_SEPARATOR, G as GLOBAL_STATE, P as PATHNAME_PROTOCOL_RE, S as StateManager, V as ViteValaxyPlugins, b as build, c as createCli, a as
|
|
1
|
+
export { A as ALL_ROUTE, E as EXCERPT_SEPARATOR, G as GLOBAL_STATE, P as PATHNAME_PROTOCOL_RE, S as StateManager, V as ViteValaxyPlugins, b as build, c as createCli, a as createContentService, d as createMemoryReleasePlugin, e as createServer, f as createValaxyNode, g as createValaxyPlugin, h as customElements, i as defaultSiteConfig, j as defaultValaxyConfig, k as defaultViteConfig, l as defineAddon, m as defineConfig, n as defineSiteConfig, o as defineTheme, p as defineValaxyAddon, q as defineValaxyConfig, r as defineValaxyTheme, s as desktopRuntimeVersion, t as encryptContent, u as execBuild, v as generateClientRedirects, w as getGitTimestamp, x as getIndexHtml, y as getServerInfoText, z as isExternal, B as isInstalledGlobally, C as isKatexEnabled, D as isKatexPluginNeeded, F as isMathJaxEnabled, H as isPath, I as loadAllContent, J as loadConfigFromFile, K as mergeValaxyConfig, L as mergeViteConfigs, M as postProcessForSSG, N as processValaxyOptions, O as registerDevCommand, Q as resolveAddonsConfig, R as resolveImportPath, T as resolveImportUrl, U as resolveOptions, W as resolveSiteConfig, X as resolveSiteConfigFromRoot, Y as resolveThemeConfigFromRoot, Z as resolveThemeValaxyConfig, _ as resolveUserThemeConfig, $ as resolveValaxyConfig, a0 as resolveValaxyConfigFromRoot, a1 as run, a2 as ssgBuild, a3 as startValaxyDev, a4 as toAtFS, a5 as transformObject, a6 as version } from '../shared/valaxy.BroDoXzi.mjs';
|
|
2
2
|
import 'node:path';
|
|
3
3
|
import 'consola';
|
|
4
4
|
import 'fs-extra';
|
|
@@ -23,15 +23,15 @@ import 'cross-spawn';
|
|
|
23
23
|
import 'mlly';
|
|
24
24
|
import 'resolve-global';
|
|
25
25
|
import '@valaxyjs/utils';
|
|
26
|
+
import 'node:fs';
|
|
26
27
|
import 'node:fs/promises';
|
|
27
28
|
import 'dayjs';
|
|
28
29
|
import 'feed';
|
|
29
30
|
import 'markdown-exit';
|
|
30
31
|
import 'table';
|
|
31
32
|
import 'hookable';
|
|
32
|
-
import 'node:fs';
|
|
33
33
|
import '@intlify/unplugin-vue-i18n/vite';
|
|
34
|
-
import '@unhead/
|
|
34
|
+
import '@unhead/bundler/vite';
|
|
35
35
|
import 'unplugin-vue-components/vite';
|
|
36
36
|
import 'vite-plugin-vue-layouts-next';
|
|
37
37
|
import 'vitepress-plugin-group-icons';
|
|
@@ -39,6 +39,7 @@ import 'p-map';
|
|
|
39
39
|
import 'node:buffer';
|
|
40
40
|
import 'minisearch';
|
|
41
41
|
import '@shikijs/transformers';
|
|
42
|
+
import 'lru-cache';
|
|
42
43
|
import 'shiki';
|
|
43
44
|
import 'css-i18n';
|
|
44
45
|
import 'markdown-it-anchor';
|
|
@@ -53,7 +54,6 @@ import 'katex';
|
|
|
53
54
|
import 'katex/contrib/mhchem';
|
|
54
55
|
import 'unplugin-vue-markdown/vite';
|
|
55
56
|
import 'js-base64';
|
|
56
|
-
import 'lru-cache';
|
|
57
57
|
import 'jiti';
|
|
58
58
|
import 'unocss';
|
|
59
59
|
import 'pascalcase';
|
|
@@ -63,6 +63,8 @@ import 'node:child_process';
|
|
|
63
63
|
import 'node:v8';
|
|
64
64
|
import 'vite-ssg-sitemap';
|
|
65
65
|
import '@unhead/vue/server';
|
|
66
|
+
import 'vue-router/unplugin';
|
|
67
|
+
import 'vue/compiler-sfc';
|
|
66
68
|
import '@clack/prompts';
|
|
67
69
|
import 'node:net';
|
|
68
70
|
import 'node:readline';
|