valaxy 0.17.2 → 0.17.4
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/main.ts +10 -4
- package/client/styles/components/code.scss +7 -0
- package/dist/chunk-UTVJER4P.mjs +146 -0
- package/dist/chunk-VJXQXPVC.cjs +145 -0
- package/dist/{config-hKSeaczj.d.cts → config-hM2lXH4J.d.cts} +19 -2
- package/dist/{config-hKSeaczj.d.ts → config-hM2lXH4J.d.ts} +19 -2
- package/dist/node/cli/index.cjs +1 -1
- package/dist/node/cli/index.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +63 -12
- package/dist/node/index.d.ts +63 -12
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.mjs +1 -1
- package/package.json +12 -12
- package/shims.d.ts +9 -1
- package/types/config.ts +14 -1
- package/types/posts.ts +5 -0
- package/dist/chunk-IMEGZXRP.cjs +0 -147
- package/dist/chunk-U4OPXBYO.mjs +0 -148
- /package/dist/{chunk-TEOGEXZQ.cjs → chunk-FNMRWIFM.cjs} +0 -0
- /package/dist/{chunk-ZO24WTQL.mjs → chunk-R4WV6S3O.mjs} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ZoomOptions } from 'medium-zoom';
|
|
2
2
|
import { FuseOptions } from '@vueuse/integrations/useFuse';
|
|
3
3
|
import { ILazyLoadOptions } from 'vanilla-lazyload';
|
|
4
|
+
import { RouteRecordRaw } from 'vue-router';
|
|
4
5
|
import { NodeRelations, ImageObject } from '@unhead/schema-org';
|
|
5
6
|
|
|
6
7
|
interface ValaxyAddon<AddonOptions = Record<string, any>> {
|
|
@@ -185,6 +186,11 @@ interface PageFrontMatter extends Record<string, any> {
|
|
|
185
186
|
* @description:zh-CN 限制代码块的高度,单位是 px
|
|
186
187
|
*/
|
|
187
188
|
codeHeightLimit?: number;
|
|
189
|
+
/**
|
|
190
|
+
* @description:en-US Source path for client redirection
|
|
191
|
+
* @description:zh-CN 客户端重定向的源路径
|
|
192
|
+
*/
|
|
193
|
+
from?: string | string[];
|
|
188
194
|
}
|
|
189
195
|
interface PostFrontMatter extends PageFrontMatter {
|
|
190
196
|
/**
|
|
@@ -279,6 +285,10 @@ interface RedirectRule {
|
|
|
279
285
|
to: string;
|
|
280
286
|
from: string | string[];
|
|
281
287
|
}
|
|
288
|
+
interface RedirectItem {
|
|
289
|
+
from: string;
|
|
290
|
+
to: string;
|
|
291
|
+
}
|
|
282
292
|
interface SiteConfig {
|
|
283
293
|
/**
|
|
284
294
|
* enable auto (light/dark mode)
|
|
@@ -552,7 +562,10 @@ interface SiteConfig {
|
|
|
552
562
|
* @description:en-US client redirect rules
|
|
553
563
|
* @description:zh-CN 客户端重定向规则
|
|
554
564
|
*/
|
|
555
|
-
redirects?:
|
|
565
|
+
redirects?: {
|
|
566
|
+
useVueRouter?: boolean;
|
|
567
|
+
rules?: RedirectRule[];
|
|
568
|
+
};
|
|
556
569
|
}
|
|
557
570
|
type PartialDeep<T> = {
|
|
558
571
|
[P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P];
|
|
@@ -562,6 +575,10 @@ type PartialDeep<T> = {
|
|
|
562
575
|
*/
|
|
563
576
|
interface RuntimeConfig {
|
|
564
577
|
addons: Record<string, ValaxyAddon>;
|
|
578
|
+
redirects: {
|
|
579
|
+
useVueRouter: boolean;
|
|
580
|
+
redirectRoutes: RouteRecordRaw[];
|
|
581
|
+
};
|
|
565
582
|
}
|
|
566
583
|
interface Pkg {
|
|
567
584
|
name: string;
|
|
@@ -604,4 +621,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
|
|
|
604
621
|
*/
|
|
605
622
|
type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
|
|
606
623
|
|
|
607
|
-
export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type
|
|
624
|
+
export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type RedirectItem as b, type SiteConfig as c, type RuntimeConfig as d, type Pkg as e, type ValaxyConfig as f, type UserValaxyConfig as g, type Photo as h, type PageFrontMatter as i, type PostFrontMatter as j, type Page as k };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ZoomOptions } from 'medium-zoom';
|
|
2
2
|
import { FuseOptions } from '@vueuse/integrations/useFuse';
|
|
3
3
|
import { ILazyLoadOptions } from 'vanilla-lazyload';
|
|
4
|
+
import { RouteRecordRaw } from 'vue-router';
|
|
4
5
|
import { NodeRelations, ImageObject } from '@unhead/schema-org';
|
|
5
6
|
|
|
6
7
|
interface ValaxyAddon<AddonOptions = Record<string, any>> {
|
|
@@ -185,6 +186,11 @@ interface PageFrontMatter extends Record<string, any> {
|
|
|
185
186
|
* @description:zh-CN 限制代码块的高度,单位是 px
|
|
186
187
|
*/
|
|
187
188
|
codeHeightLimit?: number;
|
|
189
|
+
/**
|
|
190
|
+
* @description:en-US Source path for client redirection
|
|
191
|
+
* @description:zh-CN 客户端重定向的源路径
|
|
192
|
+
*/
|
|
193
|
+
from?: string | string[];
|
|
188
194
|
}
|
|
189
195
|
interface PostFrontMatter extends PageFrontMatter {
|
|
190
196
|
/**
|
|
@@ -279,6 +285,10 @@ interface RedirectRule {
|
|
|
279
285
|
to: string;
|
|
280
286
|
from: string | string[];
|
|
281
287
|
}
|
|
288
|
+
interface RedirectItem {
|
|
289
|
+
from: string;
|
|
290
|
+
to: string;
|
|
291
|
+
}
|
|
282
292
|
interface SiteConfig {
|
|
283
293
|
/**
|
|
284
294
|
* enable auto (light/dark mode)
|
|
@@ -552,7 +562,10 @@ interface SiteConfig {
|
|
|
552
562
|
* @description:en-US client redirect rules
|
|
553
563
|
* @description:zh-CN 客户端重定向规则
|
|
554
564
|
*/
|
|
555
|
-
redirects?:
|
|
565
|
+
redirects?: {
|
|
566
|
+
useVueRouter?: boolean;
|
|
567
|
+
rules?: RedirectRule[];
|
|
568
|
+
};
|
|
556
569
|
}
|
|
557
570
|
type PartialDeep<T> = {
|
|
558
571
|
[P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P];
|
|
@@ -562,6 +575,10 @@ type PartialDeep<T> = {
|
|
|
562
575
|
*/
|
|
563
576
|
interface RuntimeConfig {
|
|
564
577
|
addons: Record<string, ValaxyAddon>;
|
|
578
|
+
redirects: {
|
|
579
|
+
useVueRouter: boolean;
|
|
580
|
+
redirectRoutes: RouteRecordRaw[];
|
|
581
|
+
};
|
|
565
582
|
}
|
|
566
583
|
interface Pkg {
|
|
567
584
|
name: string;
|
|
@@ -604,4 +621,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
|
|
|
604
621
|
*/
|
|
605
622
|
type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
|
|
606
623
|
|
|
607
|
-
export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type
|
|
624
|
+
export { type Album as A, DefaultTheme as D, type ExcerptType as E, type FuseListItem as F, type PartialDeep as P, type RedirectRule as R, type SocialLink as S, type UserSiteConfig as U, type ValaxyAddon as V, type Post as a, type RedirectItem as b, type SiteConfig as c, type RuntimeConfig as d, type Pkg as e, type ValaxyConfig as f, type UserValaxyConfig as g, type Photo as h, type PageFrontMatter as i, type PostFrontMatter as j, type Page as k };
|
package/dist/node/cli/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVJXQXPVCcjs = require('../../chunk-VJXQXPVC.cjs');require('../../chunk-FNMRWIFM.cjs');exports.cli = _chunkVJXQXPVCcjs.M; exports.run = _chunkVJXQXPVCcjs.N;
|
package/dist/node/cli/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
|
-
import{M as a,N as b}from"../../chunk-
|
|
2
|
+
import{M as a,N as b}from"../../chunk-UTVJER4P.mjs";import"../../chunk-R4WV6S3O.mjs";export{a as cli,b as run};
|
package/dist/node/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVJXQXPVCcjs = require('../chunk-VJXQXPVC.cjs');require('../chunk-FNMRWIFM.cjs');exports.build = _chunkVJXQXPVCcjs.H; exports.cli = _chunkVJXQXPVCcjs.M; exports.createServer = _chunkVJXQXPVCcjs.L; exports.defaultSiteConfig = _chunkVJXQXPVCcjs.k; exports.defaultValaxyConfig = _chunkVJXQXPVCcjs.o; exports.defineAddon = _chunkVJXQXPVCcjs.v; exports.defineConfig = _chunkVJXQXPVCcjs.q; exports.defineSiteConfig = _chunkVJXQXPVCcjs.l; exports.defineTheme = _chunkVJXQXPVCcjs.A; exports.defineUnoSetup = _chunkVJXQXPVCcjs.B; exports.defineValaxyAddon = _chunkVJXQXPVCcjs.u; exports.defineValaxyConfig = _chunkVJXQXPVCcjs.p; exports.defineValaxyTheme = _chunkVJXQXPVCcjs.z; exports.ensurePrefix = _chunkVJXQXPVCcjs.e; exports.generateClientRedirects = _chunkVJXQXPVCcjs.K; exports.getGitTimestamp = _chunkVJXQXPVCcjs.a; exports.getIndexHtml = _chunkVJXQXPVCcjs.G; exports.isExternal = _chunkVJXQXPVCcjs.c; exports.isPath = _chunkVJXQXPVCcjs.g; exports.loadConfig = _chunkVJXQXPVCcjs.i; exports.loadConfigFromFile = _chunkVJXQXPVCcjs.j; exports.mergeValaxyConfig = _chunkVJXQXPVCcjs.s; exports.mergeViteConfigs = _chunkVJXQXPVCcjs.F; exports.postProcessForSSG = _chunkVJXQXPVCcjs.J; exports.processValaxyOptions = _chunkVJXQXPVCcjs.C; exports.resolveAddonConfig = _chunkVJXQXPVCcjs.w; exports.resolveImportPath = _chunkVJXQXPVCcjs.b; exports.resolveOptions = _chunkVJXQXPVCcjs.D; exports.resolveSiteConfig = _chunkVJXQXPVCcjs.n; exports.resolveSiteConfigFromRoot = _chunkVJXQXPVCcjs.m; exports.resolveThemeConfigFromRoot = _chunkVJXQXPVCcjs.x; exports.resolveThemeValaxyConfig = _chunkVJXQXPVCcjs.E; exports.resolveUserThemeConfig = _chunkVJXQXPVCcjs.y; exports.resolveValaxyConfig = _chunkVJXQXPVCcjs.t; exports.resolveValaxyConfigFromRoot = _chunkVJXQXPVCcjs.r; exports.run = _chunkVJXQXPVCcjs.N; exports.slash = _chunkVJXQXPVCcjs.d; exports.ssgBuild = _chunkVJXQXPVCcjs.I; exports.toAtFS = _chunkVJXQXPVCcjs.f; exports.transformObject = _chunkVJXQXPVCcjs.h;
|
package/dist/node/index.d.cts
CHANGED
|
@@ -3,7 +3,7 @@ export { cli, run } from './cli/index.cjs';
|
|
|
3
3
|
import * as vite from 'vite';
|
|
4
4
|
import { UserConfig, InlineConfig } from 'vite';
|
|
5
5
|
import * as valaxy_types from 'valaxy/types';
|
|
6
|
-
import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, SiteConfig, UserSiteConfig } from 'valaxy/types';
|
|
6
|
+
import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, RedirectItem, SiteConfig, UserSiteConfig } from 'valaxy/types';
|
|
7
7
|
import Vue from '@vitejs/plugin-vue';
|
|
8
8
|
import Components from 'unplugin-vue-components/vite';
|
|
9
9
|
import Layouts from 'vite-plugin-vue-layouts';
|
|
@@ -13,7 +13,7 @@ import { EditableTreeNode } from 'unplugin-vue-router';
|
|
|
13
13
|
import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
|
|
14
14
|
import { Hookable } from 'hookable';
|
|
15
15
|
import MarkdownIt from 'markdown-it';
|
|
16
|
-
import {
|
|
16
|
+
import { LanguageInput, ShikijiTransformer, Highlighter, ThemeRegistration, BuiltinTheme } from 'shikiji';
|
|
17
17
|
import anchorPlugin from 'markdown-it-anchor';
|
|
18
18
|
import { KatexOptions } from 'katex';
|
|
19
19
|
import { FrontmatterPluginOptions } from '@mdit-vue/plugin-frontmatter';
|
|
@@ -23,11 +23,12 @@ import { TocPluginOptions } from '@mdit-vue/plugin-toc';
|
|
|
23
23
|
import { ComponentPluginOptions } from '@mdit-vue/plugin-component';
|
|
24
24
|
import { Awaitable } from '@antfu/utils';
|
|
25
25
|
import * as defu from 'defu';
|
|
26
|
-
import { P as PartialDeep$1 } from '../config-
|
|
26
|
+
import { P as PartialDeep$1 } from '../config-hM2lXH4J.cjs';
|
|
27
27
|
import 'yargs';
|
|
28
28
|
import 'medium-zoom';
|
|
29
29
|
import '@vueuse/integrations/useFuse';
|
|
30
30
|
import 'vanilla-lazyload';
|
|
31
|
+
import 'vue-router';
|
|
31
32
|
import '@unhead/schema-org';
|
|
32
33
|
|
|
33
34
|
declare module 'vite' {
|
|
@@ -55,9 +56,9 @@ interface Blocks {
|
|
|
55
56
|
details?: BlockItem;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
type ThemeOptions =
|
|
59
|
-
light:
|
|
60
|
-
dark:
|
|
59
|
+
type ThemeOptions = ThemeRegistration | BuiltinTheme | {
|
|
60
|
+
light: ThemeRegistration | BuiltinTheme;
|
|
61
|
+
dark: ThemeRegistration | BuiltinTheme;
|
|
61
62
|
};
|
|
62
63
|
interface MarkdownOptions {
|
|
63
64
|
/**
|
|
@@ -79,7 +80,50 @@ interface MarkdownOptions {
|
|
|
79
80
|
allowedAttributes?: string[];
|
|
80
81
|
disable?: boolean;
|
|
81
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Custom theme for syntax highlighting.
|
|
85
|
+
*
|
|
86
|
+
* You can also pass an object with `light` and `dark` themes to support dual themes.
|
|
87
|
+
*
|
|
88
|
+
* @example { theme: 'github-dark' }
|
|
89
|
+
* @example { theme: { light: 'github-light', dark: 'github-dark' } }
|
|
90
|
+
*
|
|
91
|
+
* You can use an existing theme.
|
|
92
|
+
* @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#all-themes
|
|
93
|
+
* Or add your own theme.
|
|
94
|
+
* @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#load-custom-themes
|
|
95
|
+
*/
|
|
96
|
+
theme?: ThemeOptions;
|
|
97
|
+
/**
|
|
98
|
+
* Languages for syntax highlighting.
|
|
99
|
+
* @see https://github.com/antfu/shikiji/blob/main/docs/languages.md#all-themes
|
|
100
|
+
*/
|
|
101
|
+
languages?: LanguageInput[];
|
|
102
|
+
/**
|
|
103
|
+
* Custom language aliases.
|
|
104
|
+
*
|
|
105
|
+
* @example { 'my-lang': 'js' }
|
|
106
|
+
* @see https://github.com/antfu/shikiji/tree/main#custom-language-aliases
|
|
107
|
+
*/
|
|
108
|
+
languageAlias?: Record<string, string>;
|
|
109
|
+
/**
|
|
110
|
+
* Show line numbers in code blocks
|
|
111
|
+
* @default false
|
|
112
|
+
*/
|
|
113
|
+
lineNumbers?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Fallback language when the specified language is not available.
|
|
116
|
+
*/
|
|
82
117
|
defaultHighlightLang?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Transformers applied to code blocks
|
|
120
|
+
* @see https://github.com/antfu/shikiji#hast-transformers
|
|
121
|
+
*/
|
|
122
|
+
codeTransformers?: ShikijiTransformer[];
|
|
123
|
+
/**
|
|
124
|
+
* Setup Shikiji instance
|
|
125
|
+
*/
|
|
126
|
+
shikijiSetup?: (shikiji: Highlighter) => void | Promise<void>;
|
|
83
127
|
frontmatter?: FrontmatterPluginOptions;
|
|
84
128
|
headers?: HeadersPluginOptions;
|
|
85
129
|
sfc?: SfcPluginOptions;
|
|
@@ -98,16 +142,10 @@ interface MarkdownOptions {
|
|
|
98
142
|
async: boolean;
|
|
99
143
|
classes: string;
|
|
100
144
|
};
|
|
101
|
-
lineNumbers?: boolean;
|
|
102
145
|
/**
|
|
103
146
|
* @see https://katex.org/docs/options.html
|
|
104
147
|
*/
|
|
105
148
|
katex?: KatexOptions;
|
|
106
|
-
/**
|
|
107
|
-
* shiki
|
|
108
|
-
*/
|
|
109
|
-
theme?: ThemeOptions;
|
|
110
|
-
languages?: ILanguageRegistration[];
|
|
111
149
|
/**
|
|
112
150
|
* Custom block configurations
|
|
113
151
|
*/
|
|
@@ -161,6 +199,10 @@ interface ValaxyExtendConfig {
|
|
|
161
199
|
katex: boolean;
|
|
162
200
|
};
|
|
163
201
|
vite?: UserConfig;
|
|
202
|
+
/**
|
|
203
|
+
* @vitejs/plugin-vue options
|
|
204
|
+
* @see https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/README.md
|
|
205
|
+
*/
|
|
164
206
|
vue?: Parameters<typeof Vue>[0];
|
|
165
207
|
components?: Parameters<typeof Components>[0];
|
|
166
208
|
layouts?: Parameters<typeof Layouts>[0];
|
|
@@ -224,6 +266,11 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
|
|
|
224
266
|
* package.json root
|
|
225
267
|
*/
|
|
226
268
|
pkgRoot: string;
|
|
269
|
+
/**
|
|
270
|
+
* temp dir, store d.ts and other temp files
|
|
271
|
+
* .valaxy
|
|
272
|
+
*/
|
|
273
|
+
tempDir: string;
|
|
227
274
|
/**
|
|
228
275
|
* Client root path
|
|
229
276
|
* @default 'valaxy/client'
|
|
@@ -268,6 +315,10 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
|
|
|
268
315
|
* Record<package-name, OptionResolver>
|
|
269
316
|
*/
|
|
270
317
|
addons: ValaxyAddonResolver[];
|
|
318
|
+
/**
|
|
319
|
+
* Collect redirect rule
|
|
320
|
+
*/
|
|
321
|
+
redirects: RedirectItem[];
|
|
271
322
|
}
|
|
272
323
|
interface ValaxyServerOptions {
|
|
273
324
|
onConfigReload?: (newConfig: ValaxyNodeConfig, config: ValaxyNodeConfig, force?: boolean) => void;
|
package/dist/node/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export { cli, run } from './cli/index.js';
|
|
|
3
3
|
import * as vite from 'vite';
|
|
4
4
|
import { UserConfig, InlineConfig } from 'vite';
|
|
5
5
|
import * as valaxy_types from 'valaxy/types';
|
|
6
|
-
import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, SiteConfig, UserSiteConfig } from 'valaxy/types';
|
|
6
|
+
import { DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, RedirectItem, SiteConfig, UserSiteConfig } from 'valaxy/types';
|
|
7
7
|
import Vue from '@vitejs/plugin-vue';
|
|
8
8
|
import Components from 'unplugin-vue-components/vite';
|
|
9
9
|
import Layouts from 'vite-plugin-vue-layouts';
|
|
@@ -13,7 +13,7 @@ import { EditableTreeNode } from 'unplugin-vue-router';
|
|
|
13
13
|
import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
|
|
14
14
|
import { Hookable } from 'hookable';
|
|
15
15
|
import MarkdownIt from 'markdown-it';
|
|
16
|
-
import {
|
|
16
|
+
import { LanguageInput, ShikijiTransformer, Highlighter, ThemeRegistration, BuiltinTheme } from 'shikiji';
|
|
17
17
|
import anchorPlugin from 'markdown-it-anchor';
|
|
18
18
|
import { KatexOptions } from 'katex';
|
|
19
19
|
import { FrontmatterPluginOptions } from '@mdit-vue/plugin-frontmatter';
|
|
@@ -23,11 +23,12 @@ import { TocPluginOptions } from '@mdit-vue/plugin-toc';
|
|
|
23
23
|
import { ComponentPluginOptions } from '@mdit-vue/plugin-component';
|
|
24
24
|
import { Awaitable } from '@antfu/utils';
|
|
25
25
|
import * as defu from 'defu';
|
|
26
|
-
import { P as PartialDeep$1 } from '../config-
|
|
26
|
+
import { P as PartialDeep$1 } from '../config-hM2lXH4J.js';
|
|
27
27
|
import 'yargs';
|
|
28
28
|
import 'medium-zoom';
|
|
29
29
|
import '@vueuse/integrations/useFuse';
|
|
30
30
|
import 'vanilla-lazyload';
|
|
31
|
+
import 'vue-router';
|
|
31
32
|
import '@unhead/schema-org';
|
|
32
33
|
|
|
33
34
|
declare module 'vite' {
|
|
@@ -55,9 +56,9 @@ interface Blocks {
|
|
|
55
56
|
details?: BlockItem;
|
|
56
57
|
}
|
|
57
58
|
|
|
58
|
-
type ThemeOptions =
|
|
59
|
-
light:
|
|
60
|
-
dark:
|
|
59
|
+
type ThemeOptions = ThemeRegistration | BuiltinTheme | {
|
|
60
|
+
light: ThemeRegistration | BuiltinTheme;
|
|
61
|
+
dark: ThemeRegistration | BuiltinTheme;
|
|
61
62
|
};
|
|
62
63
|
interface MarkdownOptions {
|
|
63
64
|
/**
|
|
@@ -79,7 +80,50 @@ interface MarkdownOptions {
|
|
|
79
80
|
allowedAttributes?: string[];
|
|
80
81
|
disable?: boolean;
|
|
81
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Custom theme for syntax highlighting.
|
|
85
|
+
*
|
|
86
|
+
* You can also pass an object with `light` and `dark` themes to support dual themes.
|
|
87
|
+
*
|
|
88
|
+
* @example { theme: 'github-dark' }
|
|
89
|
+
* @example { theme: { light: 'github-light', dark: 'github-dark' } }
|
|
90
|
+
*
|
|
91
|
+
* You can use an existing theme.
|
|
92
|
+
* @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#all-themes
|
|
93
|
+
* Or add your own theme.
|
|
94
|
+
* @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#load-custom-themes
|
|
95
|
+
*/
|
|
96
|
+
theme?: ThemeOptions;
|
|
97
|
+
/**
|
|
98
|
+
* Languages for syntax highlighting.
|
|
99
|
+
* @see https://github.com/antfu/shikiji/blob/main/docs/languages.md#all-themes
|
|
100
|
+
*/
|
|
101
|
+
languages?: LanguageInput[];
|
|
102
|
+
/**
|
|
103
|
+
* Custom language aliases.
|
|
104
|
+
*
|
|
105
|
+
* @example { 'my-lang': 'js' }
|
|
106
|
+
* @see https://github.com/antfu/shikiji/tree/main#custom-language-aliases
|
|
107
|
+
*/
|
|
108
|
+
languageAlias?: Record<string, string>;
|
|
109
|
+
/**
|
|
110
|
+
* Show line numbers in code blocks
|
|
111
|
+
* @default false
|
|
112
|
+
*/
|
|
113
|
+
lineNumbers?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Fallback language when the specified language is not available.
|
|
116
|
+
*/
|
|
82
117
|
defaultHighlightLang?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Transformers applied to code blocks
|
|
120
|
+
* @see https://github.com/antfu/shikiji#hast-transformers
|
|
121
|
+
*/
|
|
122
|
+
codeTransformers?: ShikijiTransformer[];
|
|
123
|
+
/**
|
|
124
|
+
* Setup Shikiji instance
|
|
125
|
+
*/
|
|
126
|
+
shikijiSetup?: (shikiji: Highlighter) => void | Promise<void>;
|
|
83
127
|
frontmatter?: FrontmatterPluginOptions;
|
|
84
128
|
headers?: HeadersPluginOptions;
|
|
85
129
|
sfc?: SfcPluginOptions;
|
|
@@ -98,16 +142,10 @@ interface MarkdownOptions {
|
|
|
98
142
|
async: boolean;
|
|
99
143
|
classes: string;
|
|
100
144
|
};
|
|
101
|
-
lineNumbers?: boolean;
|
|
102
145
|
/**
|
|
103
146
|
* @see https://katex.org/docs/options.html
|
|
104
147
|
*/
|
|
105
148
|
katex?: KatexOptions;
|
|
106
|
-
/**
|
|
107
|
-
* shiki
|
|
108
|
-
*/
|
|
109
|
-
theme?: ThemeOptions;
|
|
110
|
-
languages?: ILanguageRegistration[];
|
|
111
149
|
/**
|
|
112
150
|
* Custom block configurations
|
|
113
151
|
*/
|
|
@@ -161,6 +199,10 @@ interface ValaxyExtendConfig {
|
|
|
161
199
|
katex: boolean;
|
|
162
200
|
};
|
|
163
201
|
vite?: UserConfig;
|
|
202
|
+
/**
|
|
203
|
+
* @vitejs/plugin-vue options
|
|
204
|
+
* @see https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/README.md
|
|
205
|
+
*/
|
|
164
206
|
vue?: Parameters<typeof Vue>[0];
|
|
165
207
|
components?: Parameters<typeof Components>[0];
|
|
166
208
|
layouts?: Parameters<typeof Layouts>[0];
|
|
@@ -224,6 +266,11 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
|
|
|
224
266
|
* package.json root
|
|
225
267
|
*/
|
|
226
268
|
pkgRoot: string;
|
|
269
|
+
/**
|
|
270
|
+
* temp dir, store d.ts and other temp files
|
|
271
|
+
* .valaxy
|
|
272
|
+
*/
|
|
273
|
+
tempDir: string;
|
|
227
274
|
/**
|
|
228
275
|
* Client root path
|
|
229
276
|
* @default 'valaxy/client'
|
|
@@ -268,6 +315,10 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
|
|
|
268
315
|
* Record<package-name, OptionResolver>
|
|
269
316
|
*/
|
|
270
317
|
addons: ValaxyAddonResolver[];
|
|
318
|
+
/**
|
|
319
|
+
* Collect redirect rule
|
|
320
|
+
*/
|
|
321
|
+
redirects: RedirectItem[];
|
|
271
322
|
}
|
|
272
323
|
interface ValaxyServerOptions {
|
|
273
324
|
onConfigReload?: (newConfig: ValaxyNodeConfig, config: ValaxyNodeConfig, force?: boolean) => void;
|
package/dist/node/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"../chunk-UTVJER4P.mjs";import"../chunk-R4WV6S3O.mjs";export{H as build,M as cli,L as createServer,k as defaultSiteConfig,o as defaultValaxyConfig,v as defineAddon,q as defineConfig,l as defineSiteConfig,A as defineTheme,B as defineUnoSetup,u as defineValaxyAddon,p as defineValaxyConfig,z as defineValaxyTheme,e as ensurePrefix,K as generateClientRedirects,a as getGitTimestamp,G as getIndexHtml,c as isExternal,g as isPath,i as loadConfig,j as loadConfigFromFile,s as mergeValaxyConfig,F as mergeViteConfigs,J as postProcessForSSG,C as processValaxyOptions,w as resolveAddonConfig,b as resolveImportPath,D as resolveOptions,n as resolveSiteConfig,m as resolveSiteConfigFromRoot,x as resolveThemeConfigFromRoot,E as resolveThemeValaxyConfig,y as resolveUserThemeConfig,t as resolveValaxyConfig,r as resolveValaxyConfigFromRoot,N as run,d as slash,I as ssgBuild,f as toAtFS,h as transformObject};
|
package/dist/types/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var _chunkFNMRWIFMcjs = require('../chunk-FNMRWIFM.cjs');_chunkFNMRWIFMcjs.e.call(void 0, );_chunkFNMRWIFMcjs.e.call(void 0, );_chunkFNMRWIFMcjs.e.call(void 0, );_chunkFNMRWIFMcjs.e.call(void 0, );_chunkFNMRWIFMcjs.e.call(void 0, );_chunkFNMRWIFMcjs.e.call(void 0, );_chunkFNMRWIFMcjs.e.call(void 0, );
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { a as Post } from '../config-
|
|
2
|
-
export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem,
|
|
1
|
+
import { a as Post } from '../config-hM2lXH4J.cjs';
|
|
2
|
+
export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, k as Page, i as PageFrontMatter, P as PartialDeep, h as Photo, e as Pkg, j as PostFrontMatter, b as RedirectItem, R as RedirectRule, d as RuntimeConfig, c as SiteConfig, S as SocialLink, U as UserSiteConfig, g as UserValaxyConfig, V as ValaxyAddon, f as ValaxyConfig } from '../config-hM2lXH4J.cjs';
|
|
3
3
|
import 'medium-zoom';
|
|
4
4
|
import '@vueuse/integrations/useFuse';
|
|
5
5
|
import 'vanilla-lazyload';
|
|
6
|
+
import 'vue-router';
|
|
6
7
|
import '@unhead/schema-org';
|
|
7
8
|
|
|
8
9
|
type CleanUrlsMode = 'disabled' | 'without-subfolders' | 'with-subfolders';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { a as Post } from '../config-
|
|
2
|
-
export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem,
|
|
1
|
+
import { a as Post } from '../config-hM2lXH4J.js';
|
|
2
|
+
export { A as Album, D as DefaultTheme, E as ExcerptType, F as FuseListItem, k as Page, i as PageFrontMatter, P as PartialDeep, h as Photo, e as Pkg, j as PostFrontMatter, b as RedirectItem, R as RedirectRule, d as RuntimeConfig, c as SiteConfig, S as SocialLink, U as UserSiteConfig, g as UserValaxyConfig, V as ValaxyAddon, f as ValaxyConfig } from '../config-hM2lXH4J.js';
|
|
3
3
|
import 'medium-zoom';
|
|
4
4
|
import '@vueuse/integrations/useFuse';
|
|
5
5
|
import 'vanilla-lazyload';
|
|
6
|
+
import 'vue-router';
|
|
6
7
|
import '@unhead/schema-org';
|
|
7
8
|
|
|
8
9
|
type CleanUrlsMode = 'disabled' | 'without-subfolders' | 'with-subfolders';
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import {createRequire as __createRequire} from 'module';var require=__createRequire(import.meta.url);
|
|
2
|
-
import{d as e}from"../chunk-
|
|
2
|
+
import{d as e}from"../chunk-R4WV6S3O.mjs";e();e();e();e();e();e();e();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.4",
|
|
5
5
|
"description": "📄 Vite & Vue powered static blog generator.",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "me@yunyoujun.cn",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@antfu/utils": "^0.7.7",
|
|
61
61
|
"@ctrl/tinycolor": "^4.0.3",
|
|
62
|
-
"@iconify-json/carbon": "^1.1.
|
|
62
|
+
"@iconify-json/carbon": "^1.1.28",
|
|
63
63
|
"@iconify-json/ri": "^1.1.19",
|
|
64
64
|
"@intlify/unplugin-vue-i18n": "^2.0.0",
|
|
65
65
|
"@types/body-scroll-lock": "^3.1.2",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"@unhead/schema-org": "^1.8.10",
|
|
69
69
|
"@unhead/vue": "^1.8.10",
|
|
70
70
|
"@vitejs/plugin-vue": "^5.0.3",
|
|
71
|
-
"@vue/devtools-api": "^7.0.
|
|
71
|
+
"@vue/devtools-api": "^7.0.14",
|
|
72
72
|
"@vueuse/core": "^10.7.2",
|
|
73
73
|
"@vueuse/integrations": "^10.7.2",
|
|
74
74
|
"body-scroll-lock": "4.0.0-beta.0",
|
|
@@ -89,8 +89,7 @@
|
|
|
89
89
|
"is-installed-globally": "^1.0.0",
|
|
90
90
|
"jiti": "^1.21.0",
|
|
91
91
|
"katex": "^0.16.9",
|
|
92
|
-
"
|
|
93
|
-
"lru-cache": "^10.1.0",
|
|
92
|
+
"lru-cache": "^10.2.0",
|
|
94
93
|
"markdown-it": "^14.0.0",
|
|
95
94
|
"markdown-it-anchor": "^8.6.7",
|
|
96
95
|
"markdown-it-attrs": "^4.1.6",
|
|
@@ -107,22 +106,24 @@
|
|
|
107
106
|
"pinia": "^2.1.7",
|
|
108
107
|
"qrcode": "^1.5.3",
|
|
109
108
|
"sass": "^1.70.0",
|
|
110
|
-
"
|
|
109
|
+
"shikiji": "0.9.7",
|
|
110
|
+
"shikiji-transformers": "0.9.7",
|
|
111
111
|
"star-markdown-css": "^0.4.2",
|
|
112
112
|
"unconfig": "^0.3.11",
|
|
113
|
-
"unocss": "^0.58.
|
|
113
|
+
"unocss": "^0.58.4",
|
|
114
114
|
"unplugin-vue-components": "^0.26.0",
|
|
115
115
|
"unplugin-vue-router": "^0.7.0",
|
|
116
116
|
"vanilla-lazyload": "^17.8.5",
|
|
117
117
|
"vite": "^5.0.12",
|
|
118
|
-
"vite-plugin-vue-devtools": "^7.0.
|
|
118
|
+
"vite-plugin-vue-devtools": "^7.0.14",
|
|
119
119
|
"vite-plugin-vue-layouts": "0.11.0",
|
|
120
120
|
"vite-ssg": "0.23.6",
|
|
121
121
|
"vite-ssg-sitemap": "0.6.1",
|
|
122
122
|
"vue": "^3.4.15",
|
|
123
|
-
"vue-i18n": "^9.9.
|
|
123
|
+
"vue-i18n": "^9.9.1",
|
|
124
124
|
"vue-router": "^4.2.5",
|
|
125
|
-
"yargs": "^17.7.2"
|
|
125
|
+
"yargs": "^17.7.2",
|
|
126
|
+
"@valaxyjs/devtools": "0.0.1"
|
|
126
127
|
},
|
|
127
128
|
"devDependencies": {
|
|
128
129
|
"@mdit-vue/plugin-component": "^2.0.0",
|
|
@@ -143,8 +144,7 @@
|
|
|
143
144
|
"debug": "^4.3.4",
|
|
144
145
|
"diacritics": "^1.3.0",
|
|
145
146
|
"https-localhost": "^4.7.1",
|
|
146
|
-
"markdown-it-image-figures": "^2.1.1"
|
|
147
|
-
"shiki-processor": "^0.1.3"
|
|
147
|
+
"markdown-it-image-figures": "^2.1.1"
|
|
148
148
|
},
|
|
149
149
|
"scripts": {
|
|
150
150
|
"build": "rimraf dist && tsup --splitting",
|
package/shims.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'vue-router'
|
|
2
2
|
|
|
3
|
-
import './client/typed-router'
|
|
3
|
+
// import './client/typed-router'
|
|
4
4
|
|
|
5
5
|
import type { Post } from './types'
|
|
6
6
|
import type { Header } from './node/markdown'
|
|
@@ -60,3 +60,11 @@ declare module 'vue-router' {
|
|
|
60
60
|
frontmatter: Post
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
declare module '/@valaxyjs/redirects' {
|
|
65
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
66
|
+
|
|
67
|
+
export const redirectRoutes: RouteRecordRaw[]
|
|
68
|
+
|
|
69
|
+
export const useVueRouter: boolean
|
|
70
|
+
}
|
package/types/config.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ZoomOptions } from 'medium-zoom'
|
|
2
2
|
import type { FuseOptions } from '@vueuse/integrations/useFuse'
|
|
3
3
|
import type { ILazyLoadOptions } from 'vanilla-lazyload'
|
|
4
|
+
import type { RouteRecordRaw } from 'vue-router'
|
|
4
5
|
import type { ValaxyAddon } from '../types'
|
|
5
6
|
import type { DefaultTheme } from './default-theme'
|
|
6
7
|
import type { PostFrontMatter } from './posts'
|
|
@@ -27,6 +28,11 @@ export interface RedirectRule {
|
|
|
27
28
|
from: string | string[]
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
export interface RedirectItem {
|
|
32
|
+
from: string
|
|
33
|
+
to: string
|
|
34
|
+
}
|
|
35
|
+
|
|
30
36
|
// shared with valaxy node and client
|
|
31
37
|
export interface SiteConfig {
|
|
32
38
|
/**
|
|
@@ -323,7 +329,10 @@ export interface SiteConfig {
|
|
|
323
329
|
* @description:en-US client redirect rules
|
|
324
330
|
* @description:zh-CN 客户端重定向规则
|
|
325
331
|
*/
|
|
326
|
-
redirects?:
|
|
332
|
+
redirects?: {
|
|
333
|
+
useVueRouter?: boolean
|
|
334
|
+
rules?: RedirectRule[]
|
|
335
|
+
}
|
|
327
336
|
}
|
|
328
337
|
|
|
329
338
|
export type PartialDeep<T> = {
|
|
@@ -335,6 +344,10 @@ export type PartialDeep<T> = {
|
|
|
335
344
|
*/
|
|
336
345
|
export interface RuntimeConfig {
|
|
337
346
|
addons: Record<string, ValaxyAddon>
|
|
347
|
+
redirects: {
|
|
348
|
+
useVueRouter: boolean
|
|
349
|
+
redirectRoutes: RouteRecordRaw[]
|
|
350
|
+
}
|
|
338
351
|
}
|
|
339
352
|
|
|
340
353
|
export interface Pkg {
|
package/types/posts.ts
CHANGED
|
@@ -176,6 +176,11 @@ export interface PageFrontMatter extends Record<string, any> {
|
|
|
176
176
|
* @description:zh-CN 限制代码块的高度,单位是 px
|
|
177
177
|
*/
|
|
178
178
|
codeHeightLimit?: number
|
|
179
|
+
/**
|
|
180
|
+
* @description:en-US Source path for client redirection
|
|
181
|
+
* @description:zh-CN 客户端重定向的源路径
|
|
182
|
+
*/
|
|
183
|
+
from?: string | string[]
|
|
179
184
|
}
|
|
180
185
|
|
|
181
186
|
export interface PostFrontMatter extends PageFrontMatter {
|