valaxy 0.17.5 → 0.18.0-beta.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.
Files changed (39) hide show
  1. package/client/components/ValaxyMd.vue +1 -4
  2. package/client/components/builtin/ValaxyMermaid.vue +86 -0
  3. package/client/components/internals/ShadowRoot.vue +24 -0
  4. package/client/composables/common.ts +4 -2
  5. package/client/composables/dark.ts +3 -2
  6. package/client/composables/post.ts +5 -6
  7. package/client/constants/index.ts +0 -0
  8. package/client/modules/mermaid.ts +26 -0
  9. package/client/setup/mermaid.ts +15 -0
  10. package/client/setups.ts +8 -0
  11. package/client/stores/index.ts +1 -0
  12. package/client/stores/router.ts +10 -0
  13. package/client/stores/site.ts +8 -6
  14. package/client/types/index.ts +3 -0
  15. package/client/utils/code.ts +24 -0
  16. package/client/utils/index.ts +1 -0
  17. package/client/utils/time.ts +0 -6
  18. package/dist/chunk-AQGELPBR.mjs +142 -0
  19. package/dist/chunk-GO3LEXT4.cjs +141 -0
  20. package/dist/{config-hM2lXH4J.d.cts → config-qoiMoYQY.d.cts} +0 -6
  21. package/dist/{config-hM2lXH4J.d.ts → config-qoiMoYQY.d.ts} +0 -6
  22. package/dist/node/cli/index.cjs +1 -1
  23. package/dist/node/cli/index.mjs +1 -1
  24. package/dist/node/index.cjs +1 -1
  25. package/dist/node/index.d.cts +50 -23
  26. package/dist/node/index.d.ts +50 -23
  27. package/dist/node/index.mjs +1 -1
  28. package/dist/types/index.cjs +1 -1
  29. package/dist/types/index.d.cts +2 -2
  30. package/dist/types/index.d.ts +2 -2
  31. package/dist/types/index.mjs +1 -1
  32. package/package.json +11 -9
  33. package/shims.d.ts +7 -1
  34. package/types/config.ts +0 -8
  35. package/types/data.ts +0 -1
  36. package/dist/chunk-CBD6N7G5.cjs +0 -145
  37. package/dist/chunk-YJCKNZWO.mjs +0 -146
  38. /package/dist/{chunk-R4WV6S3O.mjs → chunk-MJRGR35B.mjs} +0 -0
  39. /package/dist/{chunk-FNMRWIFM.cjs → chunk-RWOIGW5M.cjs} +0 -0
@@ -604,12 +604,6 @@ interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
604
604
  * generated by runtime
605
605
  */
606
606
  runtimeConfig: RuntimeConfig;
607
- /**
608
- * Don't fail builds due to dead links.
609
- *
610
- * @default true
611
- */
612
- ignoreDeadLinks: boolean;
613
607
  }
614
608
  /**
615
609
  * user site config
@@ -604,12 +604,6 @@ interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
604
604
  * generated by runtime
605
605
  */
606
606
  runtimeConfig: RuntimeConfig;
607
- /**
608
- * Don't fail builds due to dead links.
609
- *
610
- * @default true
611
- */
612
- ignoreDeadLinks: boolean;
613
607
  }
614
608
  /**
615
609
  * user site config
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCBD6N7G5cjs = require('../../chunk-CBD6N7G5.cjs');require('../../chunk-FNMRWIFM.cjs');exports.cli = _chunkCBD6N7G5cjs.M; exports.run = _chunkCBD6N7G5cjs.N;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGO3LEXT4cjs = require('../../chunk-GO3LEXT4.cjs');require('../../chunk-RWOIGW5M.cjs');exports.cli = _chunkGO3LEXT4cjs.M; exports.run = _chunkGO3LEXT4cjs.N;
@@ -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-YJCKNZWO.mjs";import"../../chunk-R4WV6S3O.mjs";export{a as cli,b as run};
2
+ import{M as a,N as b}from"../../chunk-AQGELPBR.mjs";import"../../chunk-MJRGR35B.mjs";export{a as cli,b as run};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkCBD6N7G5cjs = require('../chunk-CBD6N7G5.cjs');require('../chunk-FNMRWIFM.cjs');exports.build = _chunkCBD6N7G5cjs.H; exports.cli = _chunkCBD6N7G5cjs.M; exports.createServer = _chunkCBD6N7G5cjs.L; exports.defaultSiteConfig = _chunkCBD6N7G5cjs.k; exports.defaultValaxyConfig = _chunkCBD6N7G5cjs.o; exports.defineAddon = _chunkCBD6N7G5cjs.v; exports.defineConfig = _chunkCBD6N7G5cjs.q; exports.defineSiteConfig = _chunkCBD6N7G5cjs.l; exports.defineTheme = _chunkCBD6N7G5cjs.A; exports.defineUnoSetup = _chunkCBD6N7G5cjs.B; exports.defineValaxyAddon = _chunkCBD6N7G5cjs.u; exports.defineValaxyConfig = _chunkCBD6N7G5cjs.p; exports.defineValaxyTheme = _chunkCBD6N7G5cjs.z; exports.ensurePrefix = _chunkCBD6N7G5cjs.e; exports.generateClientRedirects = _chunkCBD6N7G5cjs.K; exports.getGitTimestamp = _chunkCBD6N7G5cjs.a; exports.getIndexHtml = _chunkCBD6N7G5cjs.G; exports.isExternal = _chunkCBD6N7G5cjs.c; exports.isPath = _chunkCBD6N7G5cjs.g; exports.loadConfig = _chunkCBD6N7G5cjs.i; exports.loadConfigFromFile = _chunkCBD6N7G5cjs.j; exports.mergeValaxyConfig = _chunkCBD6N7G5cjs.s; exports.mergeViteConfigs = _chunkCBD6N7G5cjs.F; exports.postProcessForSSG = _chunkCBD6N7G5cjs.J; exports.processValaxyOptions = _chunkCBD6N7G5cjs.C; exports.resolveAddonsConfig = _chunkCBD6N7G5cjs.w; exports.resolveImportPath = _chunkCBD6N7G5cjs.b; exports.resolveOptions = _chunkCBD6N7G5cjs.D; exports.resolveSiteConfig = _chunkCBD6N7G5cjs.n; exports.resolveSiteConfigFromRoot = _chunkCBD6N7G5cjs.m; exports.resolveThemeConfigFromRoot = _chunkCBD6N7G5cjs.x; exports.resolveThemeValaxyConfig = _chunkCBD6N7G5cjs.E; exports.resolveUserThemeConfig = _chunkCBD6N7G5cjs.y; exports.resolveValaxyConfig = _chunkCBD6N7G5cjs.t; exports.resolveValaxyConfigFromRoot = _chunkCBD6N7G5cjs.r; exports.run = _chunkCBD6N7G5cjs.N; exports.slash = _chunkCBD6N7G5cjs.d; exports.ssgBuild = _chunkCBD6N7G5cjs.I; exports.toAtFS = _chunkCBD6N7G5cjs.f; exports.transformObject = _chunkCBD6N7G5cjs.h;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkGO3LEXT4cjs = require('../chunk-GO3LEXT4.cjs');require('../chunk-RWOIGW5M.cjs');exports.build = _chunkGO3LEXT4cjs.H; exports.cli = _chunkGO3LEXT4cjs.M; exports.createServer = _chunkGO3LEXT4cjs.L; exports.defaultSiteConfig = _chunkGO3LEXT4cjs.k; exports.defaultValaxyConfig = _chunkGO3LEXT4cjs.o; exports.defineAddon = _chunkGO3LEXT4cjs.v; exports.defineConfig = _chunkGO3LEXT4cjs.q; exports.defineSiteConfig = _chunkGO3LEXT4cjs.l; exports.defineTheme = _chunkGO3LEXT4cjs.A; exports.defineUnoSetup = _chunkGO3LEXT4cjs.B; exports.defineValaxyAddon = _chunkGO3LEXT4cjs.u; exports.defineValaxyConfig = _chunkGO3LEXT4cjs.p; exports.defineValaxyTheme = _chunkGO3LEXT4cjs.z; exports.ensurePrefix = _chunkGO3LEXT4cjs.e; exports.generateClientRedirects = _chunkGO3LEXT4cjs.K; exports.getGitTimestamp = _chunkGO3LEXT4cjs.a; exports.getIndexHtml = _chunkGO3LEXT4cjs.G; exports.isExternal = _chunkGO3LEXT4cjs.c; exports.isPath = _chunkGO3LEXT4cjs.g; exports.loadConfig = _chunkGO3LEXT4cjs.i; exports.loadConfigFromFile = _chunkGO3LEXT4cjs.j; exports.mergeValaxyConfig = _chunkGO3LEXT4cjs.s; exports.mergeViteConfigs = _chunkGO3LEXT4cjs.F; exports.postProcessForSSG = _chunkGO3LEXT4cjs.J; exports.processValaxyOptions = _chunkGO3LEXT4cjs.C; exports.resolveAddonsConfig = _chunkGO3LEXT4cjs.w; exports.resolveImportPath = _chunkGO3LEXT4cjs.b; exports.resolveOptions = _chunkGO3LEXT4cjs.D; exports.resolveSiteConfig = _chunkGO3LEXT4cjs.n; exports.resolveSiteConfigFromRoot = _chunkGO3LEXT4cjs.m; exports.resolveThemeConfigFromRoot = _chunkGO3LEXT4cjs.x; exports.resolveThemeValaxyConfig = _chunkGO3LEXT4cjs.E; exports.resolveUserThemeConfig = _chunkGO3LEXT4cjs.y; exports.resolveValaxyConfig = _chunkGO3LEXT4cjs.t; exports.resolveValaxyConfigFromRoot = _chunkGO3LEXT4cjs.r; exports.run = _chunkGO3LEXT4cjs.N; exports.slash = _chunkGO3LEXT4cjs.d; exports.ssgBuild = _chunkGO3LEXT4cjs.I; exports.toAtFS = _chunkGO3LEXT4cjs.f; exports.transformObject = _chunkGO3LEXT4cjs.h;
@@ -3,27 +3,27 @@ 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, RedirectItem, SiteConfig, UserSiteConfig } from 'valaxy/types';
6
+ import { SiteConfig, DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, RedirectItem, UserSiteConfig } from 'valaxy/types';
7
+ import { MarkdownEnv } from 'unplugin-vue-markdown/types';
7
8
  import Vue from '@vitejs/plugin-vue';
8
9
  import Components from 'unplugin-vue-components/vite';
9
10
  import Layouts from 'vite-plugin-vue-layouts';
11
+ import Markdown from 'unplugin-vue-markdown/vite';
10
12
  import Router from 'unplugin-vue-router/vite';
11
13
  import { VitePluginConfig } from 'unocss/vite';
12
14
  import { EditableTreeNode } from 'unplugin-vue-router';
13
15
  import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
14
16
  import { Hookable } from 'hookable';
15
17
  import MarkdownIt from 'markdown-it';
16
- import { LanguageInput, ShikijiTransformer, Highlighter, ThemeRegistration, BuiltinTheme } from 'shikiji';
18
+ import { LanguageInput, ShikiTransformer, Highlighter, ThemeRegistration, BuiltinTheme } from 'shiki';
17
19
  import anchorPlugin from 'markdown-it-anchor';
18
20
  import { KatexOptions } from 'katex';
19
- import { FrontmatterPluginOptions } from '@mdit-vue/plugin-frontmatter';
20
21
  import { HeadersPluginOptions } from '@mdit-vue/plugin-headers';
21
22
  import { SfcPluginOptions } from '@mdit-vue/plugin-sfc';
22
23
  import { TocPluginOptions } from '@mdit-vue/plugin-toc';
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-hM2lXH4J.cjs';
26
+ import { P as PartialDeep$1 } from '../config-qoiMoYQY.cjs';
27
27
  import 'yargs';
28
28
  import 'medium-zoom';
29
29
  import '@vueuse/integrations/useFuse';
@@ -37,6 +37,12 @@ declare module 'vite' {
37
37
  }
38
38
  }
39
39
 
40
+ interface Options {
41
+ hasSingleTheme: boolean;
42
+ theme: ThemeOptions;
43
+ siteConfig?: SiteConfig;
44
+ }
45
+
40
46
  interface BlockItem {
41
47
  text?: string;
42
48
  icon?: string;
@@ -55,6 +61,7 @@ interface Blocks {
55
61
  info?: BlockItem;
56
62
  details?: BlockItem;
57
63
  }
64
+ type ContainerOptions = Blocks & Partial<Options>;
58
65
 
59
66
  type ThemeOptions = ThemeRegistration | BuiltinTheme | {
60
67
  light: ThemeRegistration | BuiltinTheme;
@@ -89,21 +96,21 @@ interface MarkdownOptions {
89
96
  * @example { theme: { light: 'github-light', dark: 'github-dark' } }
90
97
  *
91
98
  * You can use an existing theme.
92
- * @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#all-themes
99
+ * @see https://shiki.style/themes
93
100
  * Or add your own theme.
94
- * @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#load-custom-themes
101
+ * @see https://shiki.style/guide/load-theme
95
102
  */
96
103
  theme?: ThemeOptions;
97
104
  /**
98
105
  * Languages for syntax highlighting.
99
- * @see https://github.com/antfu/shikiji/blob/main/docs/languages.md#all-themes
106
+ * @see https://shiki.style/languages
100
107
  */
101
108
  languages?: LanguageInput[];
102
109
  /**
103
110
  * Custom language aliases.
104
111
  *
105
112
  * @example { 'my-lang': 'js' }
106
- * @see https://github.com/antfu/shikiji/tree/main#custom-language-aliases
113
+ * @see https://shiki.style/guide/load-lang#custom-language-aliases
107
114
  */
108
115
  languageAlias?: Record<string, string>;
109
116
  /**
@@ -117,22 +124,37 @@ interface MarkdownOptions {
117
124
  defaultHighlightLang?: string;
118
125
  /**
119
126
  * Transformers applied to code blocks
120
- * @see https://github.com/antfu/shikiji#hast-transformers
127
+ * @see https://shiki.style/guide/transformers
128
+ */
129
+ codeTransformers?: ShikiTransformer[];
130
+ /**
131
+ * Setup Shiki instance
132
+ */
133
+ shikiSetup?: (shiki: Highlighter) => void | Promise<void>;
134
+ /**
135
+ * Options for `@mdit-vue/plugin-headers`
136
+ * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers
121
137
  */
122
- codeTransformers?: ShikijiTransformer[];
138
+ headers?: HeadersPluginOptions | boolean;
123
139
  /**
124
- * Setup Shikiji instance
140
+ * Options for `@mdit-vue/plugin-sfc`
141
+ * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-sfc
125
142
  */
126
- shikijiSetup?: (shikiji: Highlighter) => void | Promise<void>;
127
- frontmatter?: FrontmatterPluginOptions;
128
- headers?: HeadersPluginOptions;
129
143
  sfc?: SfcPluginOptions;
144
+ /**
145
+ * Options for `@mdit-vue/plugin-toc`
146
+ * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc
147
+ */
130
148
  toc?: TocPluginOptions;
131
149
  /**
132
- * Options for `@mdit-vue/plugin-component`
133
- * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-component
150
+ * Options for `markdown-it-container`
151
+ * @see https://github.com/markdown-it/markdown-it-container
134
152
  */
135
- component?: ComponentPluginOptions;
153
+ container?: ContainerOptions;
154
+ /**
155
+ * Custom block configurations based on `markdown-it-container`
156
+ */
157
+ blocks?: Blocks;
136
158
  /**
137
159
  * @see [markdown-it-image-figures](https://www.npmjs.com/package/markdown-it-image-figures)
138
160
  */
@@ -146,10 +168,6 @@ interface MarkdownOptions {
146
168
  * @see https://katex.org/docs/options.html
147
169
  */
148
170
  katex?: KatexOptions;
149
- /**
150
- * Custom block configurations
151
- */
152
- blocks?: Blocks;
153
171
  externalLinks?: Record<string, string>;
154
172
  }
155
173
 
@@ -178,6 +196,12 @@ interface ValaxyNode {
178
196
  options: ResolvedValaxyOptions;
179
197
  }
180
198
  interface ValaxyExtendConfig {
199
+ /**
200
+ * Don't fail builds due to dead links.
201
+ *
202
+ * @default false
203
+ */
204
+ ignoreDeadLinks?: boolean | 'localhostLinks' | (string | RegExp | ((link: string) => boolean))[];
181
205
  /**
182
206
  * internal modules
183
207
  */
@@ -226,7 +250,7 @@ interface ValaxyExtendConfig {
226
250
  /**
227
251
  * for markdown
228
252
  */
229
- markdown?: MarkdownOptions;
253
+ markdown?: MarkdownOptions & Parameters<typeof Markdown>[0];
230
254
  extendMd?: (ctx: {
231
255
  route: EditableTreeNode;
232
256
  data: Readonly<Record<string, any>>;
@@ -319,6 +343,9 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
319
343
  * Collect redirect rule
320
344
  */
321
345
  redirects: RedirectItem[];
346
+ env: MarkdownEnv & {
347
+ links: string[];
348
+ };
322
349
  }
323
350
  interface ValaxyServerOptions {
324
351
  onConfigReload?: (newConfig: ValaxyNodeConfig, config: ValaxyNodeConfig, force?: boolean) => void;
@@ -3,27 +3,27 @@ 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, RedirectItem, SiteConfig, UserSiteConfig } from 'valaxy/types';
6
+ import { SiteConfig, DefaultTheme, ValaxyConfig, PartialDeep, ValaxyAddon, RuntimeConfig, RedirectItem, UserSiteConfig } from 'valaxy/types';
7
+ import { MarkdownEnv } from 'unplugin-vue-markdown/types';
7
8
  import Vue from '@vitejs/plugin-vue';
8
9
  import Components from 'unplugin-vue-components/vite';
9
10
  import Layouts from 'vite-plugin-vue-layouts';
11
+ import Markdown from 'unplugin-vue-markdown/vite';
10
12
  import Router from 'unplugin-vue-router/vite';
11
13
  import { VitePluginConfig } from 'unocss/vite';
12
14
  import { EditableTreeNode } from 'unplugin-vue-router';
13
15
  import { presetUno, presetAttributify, presetIcons, presetTypography } from 'unocss';
14
16
  import { Hookable } from 'hookable';
15
17
  import MarkdownIt from 'markdown-it';
16
- import { LanguageInput, ShikijiTransformer, Highlighter, ThemeRegistration, BuiltinTheme } from 'shikiji';
18
+ import { LanguageInput, ShikiTransformer, Highlighter, ThemeRegistration, BuiltinTheme } from 'shiki';
17
19
  import anchorPlugin from 'markdown-it-anchor';
18
20
  import { KatexOptions } from 'katex';
19
- import { FrontmatterPluginOptions } from '@mdit-vue/plugin-frontmatter';
20
21
  import { HeadersPluginOptions } from '@mdit-vue/plugin-headers';
21
22
  import { SfcPluginOptions } from '@mdit-vue/plugin-sfc';
22
23
  import { TocPluginOptions } from '@mdit-vue/plugin-toc';
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-hM2lXH4J.js';
26
+ import { P as PartialDeep$1 } from '../config-qoiMoYQY.js';
27
27
  import 'yargs';
28
28
  import 'medium-zoom';
29
29
  import '@vueuse/integrations/useFuse';
@@ -37,6 +37,12 @@ declare module 'vite' {
37
37
  }
38
38
  }
39
39
 
40
+ interface Options {
41
+ hasSingleTheme: boolean;
42
+ theme: ThemeOptions;
43
+ siteConfig?: SiteConfig;
44
+ }
45
+
40
46
  interface BlockItem {
41
47
  text?: string;
42
48
  icon?: string;
@@ -55,6 +61,7 @@ interface Blocks {
55
61
  info?: BlockItem;
56
62
  details?: BlockItem;
57
63
  }
64
+ type ContainerOptions = Blocks & Partial<Options>;
58
65
 
59
66
  type ThemeOptions = ThemeRegistration | BuiltinTheme | {
60
67
  light: ThemeRegistration | BuiltinTheme;
@@ -89,21 +96,21 @@ interface MarkdownOptions {
89
96
  * @example { theme: { light: 'github-light', dark: 'github-dark' } }
90
97
  *
91
98
  * You can use an existing theme.
92
- * @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#all-themes
99
+ * @see https://shiki.style/themes
93
100
  * Or add your own theme.
94
- * @see https://github.com/antfu/shikiji/blob/main/docs/themes.md#load-custom-themes
101
+ * @see https://shiki.style/guide/load-theme
95
102
  */
96
103
  theme?: ThemeOptions;
97
104
  /**
98
105
  * Languages for syntax highlighting.
99
- * @see https://github.com/antfu/shikiji/blob/main/docs/languages.md#all-themes
106
+ * @see https://shiki.style/languages
100
107
  */
101
108
  languages?: LanguageInput[];
102
109
  /**
103
110
  * Custom language aliases.
104
111
  *
105
112
  * @example { 'my-lang': 'js' }
106
- * @see https://github.com/antfu/shikiji/tree/main#custom-language-aliases
113
+ * @see https://shiki.style/guide/load-lang#custom-language-aliases
107
114
  */
108
115
  languageAlias?: Record<string, string>;
109
116
  /**
@@ -117,22 +124,37 @@ interface MarkdownOptions {
117
124
  defaultHighlightLang?: string;
118
125
  /**
119
126
  * Transformers applied to code blocks
120
- * @see https://github.com/antfu/shikiji#hast-transformers
127
+ * @see https://shiki.style/guide/transformers
128
+ */
129
+ codeTransformers?: ShikiTransformer[];
130
+ /**
131
+ * Setup Shiki instance
132
+ */
133
+ shikiSetup?: (shiki: Highlighter) => void | Promise<void>;
134
+ /**
135
+ * Options for `@mdit-vue/plugin-headers`
136
+ * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-headers
121
137
  */
122
- codeTransformers?: ShikijiTransformer[];
138
+ headers?: HeadersPluginOptions | boolean;
123
139
  /**
124
- * Setup Shikiji instance
140
+ * Options for `@mdit-vue/plugin-sfc`
141
+ * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-sfc
125
142
  */
126
- shikijiSetup?: (shikiji: Highlighter) => void | Promise<void>;
127
- frontmatter?: FrontmatterPluginOptions;
128
- headers?: HeadersPluginOptions;
129
143
  sfc?: SfcPluginOptions;
144
+ /**
145
+ * Options for `@mdit-vue/plugin-toc`
146
+ * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-toc
147
+ */
130
148
  toc?: TocPluginOptions;
131
149
  /**
132
- * Options for `@mdit-vue/plugin-component`
133
- * @see https://github.com/mdit-vue/mdit-vue/tree/main/packages/plugin-component
150
+ * Options for `markdown-it-container`
151
+ * @see https://github.com/markdown-it/markdown-it-container
134
152
  */
135
- component?: ComponentPluginOptions;
153
+ container?: ContainerOptions;
154
+ /**
155
+ * Custom block configurations based on `markdown-it-container`
156
+ */
157
+ blocks?: Blocks;
136
158
  /**
137
159
  * @see [markdown-it-image-figures](https://www.npmjs.com/package/markdown-it-image-figures)
138
160
  */
@@ -146,10 +168,6 @@ interface MarkdownOptions {
146
168
  * @see https://katex.org/docs/options.html
147
169
  */
148
170
  katex?: KatexOptions;
149
- /**
150
- * Custom block configurations
151
- */
152
- blocks?: Blocks;
153
171
  externalLinks?: Record<string, string>;
154
172
  }
155
173
 
@@ -178,6 +196,12 @@ interface ValaxyNode {
178
196
  options: ResolvedValaxyOptions;
179
197
  }
180
198
  interface ValaxyExtendConfig {
199
+ /**
200
+ * Don't fail builds due to dead links.
201
+ *
202
+ * @default false
203
+ */
204
+ ignoreDeadLinks?: boolean | 'localhostLinks' | (string | RegExp | ((link: string) => boolean))[];
181
205
  /**
182
206
  * internal modules
183
207
  */
@@ -226,7 +250,7 @@ interface ValaxyExtendConfig {
226
250
  /**
227
251
  * for markdown
228
252
  */
229
- markdown?: MarkdownOptions;
253
+ markdown?: MarkdownOptions & Parameters<typeof Markdown>[0];
230
254
  extendMd?: (ctx: {
231
255
  route: EditableTreeNode;
232
256
  data: Readonly<Record<string, any>>;
@@ -319,6 +343,9 @@ interface ResolvedValaxyOptions<ThemeConfig = DefaultTheme.Config> {
319
343
  * Collect redirect rule
320
344
  */
321
345
  redirects: RedirectItem[];
346
+ env: MarkdownEnv & {
347
+ links: string[];
348
+ };
322
349
  }
323
350
  interface ValaxyServerOptions {
324
351
  onConfigReload?: (newConfig: ValaxyNodeConfig, config: ValaxyNodeConfig, force?: boolean) => void;
@@ -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-YJCKNZWO.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 resolveAddonsConfig,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};
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-AQGELPBR.mjs";import"../chunk-MJRGR35B.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 resolveAddonsConfig,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};
@@ -1 +1 @@
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, );
1
+ "use strict";var _chunkRWOIGW5Mcjs = require('../chunk-RWOIGW5M.cjs');_chunkRWOIGW5Mcjs.e.call(void 0, );_chunkRWOIGW5Mcjs.e.call(void 0, );_chunkRWOIGW5Mcjs.e.call(void 0, );_chunkRWOIGW5Mcjs.e.call(void 0, );_chunkRWOIGW5Mcjs.e.call(void 0, );_chunkRWOIGW5Mcjs.e.call(void 0, );_chunkRWOIGW5Mcjs.e.call(void 0, );
@@ -1,5 +1,5 @@
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';
1
+ import { a as Post } from '../config-qoiMoYQY.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-qoiMoYQY.cjs';
3
3
  import 'medium-zoom';
4
4
  import '@vueuse/integrations/useFuse';
5
5
  import 'vanilla-lazyload';
@@ -1,5 +1,5 @@
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';
1
+ import { a as Post } from '../config-qoiMoYQY.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-qoiMoYQY.js';
3
3
  import 'medium-zoom';
4
4
  import '@vueuse/integrations/useFuse';
5
5
  import 'vanilla-lazyload';
@@ -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-R4WV6S3O.mjs";e();e();e();e();e();e();e();
2
+ import{d as e}from"../chunk-MJRGR35B.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.5",
4
+ "version": "0.18.0-beta.0",
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.28",
62
+ "@iconify-json/carbon": "^1.1.29",
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",
@@ -67,7 +67,7 @@
67
67
  "@unhead/addons": "^1.8.10",
68
68
  "@unhead/schema-org": "^1.8.10",
69
69
  "@unhead/vue": "^1.8.10",
70
- "@vitejs/plugin-vue": "^5.0.3",
70
+ "@vitejs/plugin-vue": "^5.0.4",
71
71
  "@vue/devtools-api": "^7.0.14",
72
72
  "@vueuse/core": "^10.7.2",
73
73
  "@vueuse/integrations": "^10.7.2",
@@ -88,6 +88,7 @@
88
88
  "html-to-text": "^9.0.5",
89
89
  "is-installed-globally": "^1.0.0",
90
90
  "jiti": "^1.21.0",
91
+ "js-base64": "^3.7.6",
91
92
  "katex": "^0.16.9",
92
93
  "lru-cache": "^10.2.0",
93
94
  "markdown-it": "^14.0.0",
@@ -98,6 +99,7 @@
98
99
  "markdown-it-table-of-contents": "^0.6.0",
99
100
  "markdown-it-task-lists": "^2.1.1",
100
101
  "medium-zoom": "^1.1.0",
102
+ "mermaid": "^10.8.0",
101
103
  "nprogress": "^0.2.0",
102
104
  "open": "10.0.3",
103
105
  "ora": "^8.0.1",
@@ -106,20 +108,20 @@
106
108
  "pinia": "^2.1.7",
107
109
  "qrcode": "^1.5.3",
108
110
  "sass": "^1.70.0",
109
- "shikiji": "0.9.7",
110
- "shikiji-transformers": "0.9.7",
111
+ "shiki": "^1.1.1",
111
112
  "star-markdown-css": "^0.4.2",
112
113
  "unconfig": "^0.3.11",
113
- "unocss": "^0.58.4",
114
+ "unocss": "^0.58.5",
114
115
  "unplugin-vue-components": "^0.26.0",
116
+ "unplugin-vue-markdown": "^0.26.0",
115
117
  "unplugin-vue-router": "^0.7.0",
116
- "vanilla-lazyload": "^17.8.5",
117
- "vite": "^5.0.12",
118
+ "vanilla-lazyload": "^17.8.8",
119
+ "vite": "^5.1.1",
118
120
  "vite-plugin-vue-devtools": "^7.0.14",
119
121
  "vite-plugin-vue-layouts": "0.11.0",
120
122
  "vite-ssg": "0.23.6",
121
123
  "vite-ssg-sitemap": "0.6.1",
122
- "vue": "^3.4.15",
124
+ "vue": "^3.4.18",
123
125
  "vue-i18n": "^9.9.1",
124
126
  "vue-router": "^4.2.5",
125
127
  "yargs": "^17.7.2",
package/shims.d.ts CHANGED
@@ -3,7 +3,7 @@ import 'vue-router'
3
3
  // import './client/typed-router'
4
4
 
5
5
  import type { Post } from './types'
6
- import type { Header } from './node/markdown'
6
+ import type { Header } from './node/plugins/markdown'
7
7
 
8
8
  declare module 'valaxy-addon-*'
9
9
  declare module '@docsearch/js' {
@@ -68,3 +68,9 @@ declare module '/@valaxyjs/redirects' {
68
68
 
69
69
  export const useVueRouter: boolean
70
70
  }
71
+
72
+ declare module 'mermaid/dist/mermaid.esm.mjs' {
73
+ import Mermaid from 'mermaid/dist/mermaid.d.ts'
74
+
75
+ export default Mermaid
76
+ }
package/types/config.ts CHANGED
@@ -375,14 +375,6 @@ export interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
375
375
  * generated by runtime
376
376
  */
377
377
  runtimeConfig: RuntimeConfig
378
-
379
- // other in node
380
- /**
381
- * Don't fail builds due to dead links.
382
- *
383
- * @default true
384
- */
385
- ignoreDeadLinks: boolean
386
378
  }
387
379
 
388
380
  /**
package/types/data.ts CHANGED
@@ -4,7 +4,6 @@ export type CleanUrlsMode =
4
4
  | 'disabled'
5
5
  | 'without-subfolders'
6
6
  | 'with-subfolders'
7
-
8
7
  export interface Header {
9
8
  /**
10
9
  * The level of the header