vitepress 0.20.2 → 0.20.3
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/dist/client/index.d.ts
CHANGED
|
@@ -1,28 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export declare
|
|
22
|
-
app: App;
|
|
23
|
-
router: Router;
|
|
24
|
-
siteData: Ref<SiteData>;
|
|
25
|
-
}
|
|
1
|
+
import { AliasOptions } from 'vite';
|
|
2
|
+
import anchor from 'markdown-it-anchor';
|
|
3
|
+
import { BuildOptions } from 'vite';
|
|
4
|
+
import MarkdownIt from 'markdown-it';
|
|
5
|
+
import { Options } from '@vitejs/plugin-vue';
|
|
6
|
+
import { ServerOptions } from 'vite';
|
|
7
|
+
import { UserConfig as UserConfig_2 } from 'vite';
|
|
8
|
+
import { ViteDevServer } from 'vite';
|
|
9
|
+
|
|
10
|
+
export declare function build(root: string, buildOptions?: BuildOptions & {
|
|
11
|
+
mpa?: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
|
|
14
|
+
export declare const createMarkdownRenderer: (srcDir: string, options?: MarkdownOptions) => MarkdownRenderer;
|
|
15
|
+
|
|
16
|
+
export declare function createServer(root?: string, serverOptions?: ServerOptions): Promise<ViteDevServer>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Type config helper
|
|
20
|
+
*/
|
|
21
|
+
export declare function defineConfig(config: RawConfigExports): RawConfigExports;
|
|
26
22
|
|
|
27
23
|
export declare type HeadConfig =
|
|
28
24
|
| [string, Record<string, string>]
|
|
@@ -34,8 +30,6 @@ export declare interface Header {
|
|
|
34
30
|
slug: string
|
|
35
31
|
}
|
|
36
32
|
|
|
37
|
-
export declare const inBrowser: boolean;
|
|
38
|
-
|
|
39
33
|
export declare interface LocaleConfig {
|
|
40
34
|
lang: string
|
|
41
35
|
title?: string
|
|
@@ -45,24 +39,64 @@ export declare interface LocaleConfig {
|
|
|
45
39
|
selectText?: string
|
|
46
40
|
}
|
|
47
41
|
|
|
48
|
-
export declare interface
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
42
|
+
export declare interface MarkdownOptions extends MarkdownIt.Options {
|
|
43
|
+
lineNumbers?: boolean;
|
|
44
|
+
config?: (md: MarkdownIt) => void;
|
|
45
|
+
anchor?: {
|
|
46
|
+
permalink?: anchor.AnchorOptions['permalink'];
|
|
47
|
+
};
|
|
48
|
+
attrs?: {
|
|
49
|
+
leftDelimiter?: string;
|
|
50
|
+
rightDelimiter?: string;
|
|
51
|
+
allowedAttributes?: string[];
|
|
52
|
+
};
|
|
53
|
+
toc?: any;
|
|
54
|
+
externalLinks?: Record<string, string>;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
export declare interface
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
export declare interface MarkdownParsedData {
|
|
58
|
+
hoistedTags?: string[];
|
|
59
|
+
links?: string[];
|
|
60
|
+
headers?: Header[];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
export declare interface
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
export declare interface MarkdownRenderer {
|
|
64
|
+
__data: MarkdownParsedData;
|
|
65
|
+
render: (src: string, env?: any) => {
|
|
66
|
+
html: string;
|
|
67
|
+
data: any;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export declare type RawConfigExports = UserConfig | Promise<UserConfig> | (() => UserConfig | Promise<UserConfig>);
|
|
72
|
+
|
|
73
|
+
export declare function resolveConfig(root?: string, command?: 'serve' | 'build', mode?: string): Promise<SiteConfig>;
|
|
74
|
+
|
|
75
|
+
export declare function resolveSiteData(root: string, userConfig?: UserConfig, command?: 'serve' | 'build', mode?: string): Promise<SiteData>;
|
|
76
|
+
|
|
77
|
+
export declare function resolveSiteDataByRoute(siteData: SiteData, route: string): SiteData;
|
|
78
|
+
|
|
79
|
+
export declare function serve(options?: ServeOptions): Promise<void>;
|
|
80
|
+
|
|
81
|
+
export declare interface ServeOptions {
|
|
82
|
+
root?: string;
|
|
83
|
+
port?: number;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export declare interface SiteConfig<ThemeConfig = any> {
|
|
87
|
+
root: string;
|
|
88
|
+
srcDir: string;
|
|
89
|
+
site: SiteData<ThemeConfig>;
|
|
90
|
+
configPath: string | undefined;
|
|
91
|
+
themeDir: string;
|
|
92
|
+
outDir: string;
|
|
93
|
+
tempDir: string;
|
|
94
|
+
alias: AliasOptions;
|
|
95
|
+
pages: string[];
|
|
96
|
+
markdown: MarkdownOptions | undefined;
|
|
97
|
+
vue: Options | undefined;
|
|
98
|
+
vite: UserConfig_2 | undefined;
|
|
99
|
+
mpa: boolean;
|
|
66
100
|
}
|
|
67
101
|
|
|
68
102
|
export declare interface SiteData<ThemeConfig = any> {
|
|
@@ -99,29 +133,31 @@ export declare interface SiteData<ThemeConfig = any> {
|
|
|
99
133
|
>
|
|
100
134
|
}
|
|
101
135
|
|
|
102
|
-
export declare interface
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
136
|
+
export declare interface UserConfig<ThemeConfig = any> {
|
|
137
|
+
extends?: RawConfigExports;
|
|
138
|
+
lang?: string;
|
|
139
|
+
base?: string;
|
|
140
|
+
title?: string;
|
|
141
|
+
description?: string;
|
|
142
|
+
head?: HeadConfig[];
|
|
143
|
+
themeConfig?: ThemeConfig;
|
|
144
|
+
locales?: Record<string, LocaleConfig>;
|
|
145
|
+
markdown?: MarkdownOptions;
|
|
146
|
+
/**
|
|
147
|
+
* Opitons to pass on to `@vitejs/plugin-vue`
|
|
148
|
+
*/
|
|
149
|
+
vue?: Options;
|
|
150
|
+
/**
|
|
151
|
+
* Vite config
|
|
152
|
+
*/
|
|
153
|
+
vite?: UserConfig_2;
|
|
154
|
+
srcDir?: string;
|
|
155
|
+
srcExclude?: string[];
|
|
156
|
+
/**
|
|
157
|
+
* Enable MPA / zero-JS mode
|
|
158
|
+
* @experimental
|
|
159
|
+
*/
|
|
160
|
+
mpa?: boolean;
|
|
123
161
|
}
|
|
124
162
|
|
|
125
|
-
export declare function withBase(path: string): string;
|
|
126
|
-
|
|
127
163
|
export { }
|
package/dist/node/cli.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var serve = require('./serve-
|
|
3
|
+
var serve = require('./serve-f83deb60.js');
|
|
4
|
+
require('fs');
|
|
5
|
+
require('path');
|
|
6
|
+
require('url');
|
|
4
7
|
require('vite');
|
|
5
8
|
require('readline');
|
|
6
9
|
require('assert');
|
|
@@ -8,11 +11,8 @@ require('events');
|
|
|
8
11
|
require('stream');
|
|
9
12
|
require('util');
|
|
10
13
|
require('buffer');
|
|
11
|
-
require('path');
|
|
12
|
-
require('fs');
|
|
13
14
|
require('punycode');
|
|
14
15
|
require('prismjs');
|
|
15
|
-
require('url');
|
|
16
16
|
require('querystring');
|
|
17
17
|
require('tty');
|
|
18
18
|
require('net');
|
package/dist/node/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var serve = require('./serve-
|
|
5
|
+
var serve = require('./serve-f83deb60.js');
|
|
6
6
|
require('vite');
|
|
7
7
|
require('readline');
|
|
8
8
|
require('assert');
|
|
@@ -26,6 +26,7 @@ require('http');
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
exports.build = serve.build;
|
|
29
|
+
exports.createMarkdownRenderer = serve.createMarkdownRenderer;
|
|
29
30
|
exports.createServer = serve.createServer;
|
|
30
31
|
exports.defineConfig = serve.defineConfig;
|
|
31
32
|
exports.resolveConfig = serve.resolveConfig;
|
|
@@ -65020,6 +65020,7 @@ async function serve(options = {}) {
|
|
|
65020
65020
|
}
|
|
65021
65021
|
|
|
65022
65022
|
exports.build = build;
|
|
65023
|
+
exports.createMarkdownRenderer = createMarkdownRenderer;
|
|
65023
65024
|
exports.createServer = createServer;
|
|
65024
65025
|
exports.defineConfig = defineConfig;
|
|
65025
65026
|
exports.resolveConfig = resolveConfig;
|
|
@@ -11,6 +11,8 @@ export declare function build(root: string, buildOptions?: BuildOptions & {
|
|
|
11
11
|
mpa?: string;
|
|
12
12
|
}): Promise<void>;
|
|
13
13
|
|
|
14
|
+
export declare const createMarkdownRenderer: (srcDir: string, options?: MarkdownOptions) => MarkdownRenderer;
|
|
15
|
+
|
|
14
16
|
export declare function createServer(root?: string, serverOptions?: ServerOptions): Promise<ViteDevServer>;
|
|
15
17
|
|
|
16
18
|
/**
|
|
@@ -22,6 +24,12 @@ export declare type HeadConfig =
|
|
|
22
24
|
| [string, Record<string, string>]
|
|
23
25
|
| [string, Record<string, string>, string]
|
|
24
26
|
|
|
27
|
+
export declare interface Header {
|
|
28
|
+
level: number
|
|
29
|
+
title: string
|
|
30
|
+
slug: string
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
export declare interface LocaleConfig {
|
|
26
34
|
lang: string
|
|
27
35
|
title?: string
|
|
@@ -46,6 +54,20 @@ export declare interface MarkdownOptions extends MarkdownIt.Options {
|
|
|
46
54
|
externalLinks?: Record<string, string>;
|
|
47
55
|
}
|
|
48
56
|
|
|
57
|
+
export declare interface MarkdownParsedData {
|
|
58
|
+
hoistedTags?: string[];
|
|
59
|
+
links?: string[];
|
|
60
|
+
headers?: Header[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export declare interface MarkdownRenderer {
|
|
64
|
+
__data: MarkdownParsedData;
|
|
65
|
+
render: (src: string, env?: any) => {
|
|
66
|
+
html: string;
|
|
67
|
+
data: any;
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
49
71
|
export declare type RawConfigExports = UserConfig | Promise<UserConfig> | (() => UserConfig | Promise<UserConfig>);
|
|
50
72
|
|
|
51
73
|
export declare function resolveConfig(root?: string, command?: 'serve' | 'build', mode?: string): Promise<SiteConfig>;
|