vitepress 0.19.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/app/router.js +16 -4
- package/dist/client/index.d.ts +100 -64
- package/dist/client/theme-default/Layout.vue +16 -12
- package/dist/client/theme-default/components/AlgoliaSearchBox.vue +29 -12
- package/dist/client/theme-default/composables/navLink.js +1 -1
- package/dist/client/theme-default/styles/code.css +1 -1
- package/dist/node/cli.js +8 -6
- package/dist/node/index.js +3 -3
- package/dist/node/{serve-5d08e165.js → serve-f83deb60.js} +11006 -382
- package/dist/{node/index.d.ts → vitepress.d.ts} +32 -7
- package/package.json +36 -36
- package/CHANGELOG.md +0 -625
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AliasOptions } from 'vite';
|
|
2
|
-
import
|
|
2
|
+
import anchor from 'markdown-it-anchor';
|
|
3
3
|
import { BuildOptions } from 'vite';
|
|
4
4
|
import MarkdownIt from 'markdown-it';
|
|
5
5
|
import { Options } from '@vitejs/plugin-vue';
|
|
@@ -11,12 +11,25 @@ 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
|
|
|
18
|
+
/**
|
|
19
|
+
* Type config helper
|
|
20
|
+
*/
|
|
21
|
+
export declare function defineConfig(config: RawConfigExports): RawConfigExports;
|
|
22
|
+
|
|
16
23
|
export declare type HeadConfig =
|
|
17
24
|
| [string, Record<string, string>]
|
|
18
25
|
| [string, Record<string, string>, string]
|
|
19
26
|
|
|
27
|
+
export declare interface Header {
|
|
28
|
+
level: number
|
|
29
|
+
title: string
|
|
30
|
+
slug: string
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
export declare interface LocaleConfig {
|
|
21
34
|
lang: string
|
|
22
35
|
title?: string
|
|
@@ -30,7 +43,7 @@ export declare interface MarkdownOptions extends MarkdownIt.Options {
|
|
|
30
43
|
lineNumbers?: boolean;
|
|
31
44
|
config?: (md: MarkdownIt) => void;
|
|
32
45
|
anchor?: {
|
|
33
|
-
permalink?: AnchorOptions['permalink'];
|
|
46
|
+
permalink?: anchor.AnchorOptions['permalink'];
|
|
34
47
|
};
|
|
35
48
|
attrs?: {
|
|
36
49
|
leftDelimiter?: string;
|
|
@@ -41,16 +54,28 @@ export declare interface MarkdownOptions extends MarkdownIt.Options {
|
|
|
41
54
|
externalLinks?: Record<string, string>;
|
|
42
55
|
}
|
|
43
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
|
+
|
|
44
71
|
export declare type RawConfigExports = UserConfig | Promise<UserConfig> | (() => UserConfig | Promise<UserConfig>);
|
|
45
72
|
|
|
46
|
-
export declare function resolveConfig(root?: string): Promise<SiteConfig>;
|
|
73
|
+
export declare function resolveConfig(root?: string, command?: 'serve' | 'build', mode?: string): Promise<SiteConfig>;
|
|
47
74
|
|
|
48
|
-
export declare function resolveSiteData(root: string, userConfig?: UserConfig): Promise<SiteData>;
|
|
75
|
+
export declare function resolveSiteData(root: string, userConfig?: UserConfig, command?: 'serve' | 'build', mode?: string): Promise<SiteData>;
|
|
49
76
|
|
|
50
77
|
export declare function resolveSiteDataByRoute(siteData: SiteData, route: string): SiteData;
|
|
51
78
|
|
|
52
|
-
export declare function resolveUserConfig(root: string): Promise<UserConfig>;
|
|
53
|
-
|
|
54
79
|
export declare function serve(options?: ServeOptions): Promise<void>;
|
|
55
80
|
|
|
56
81
|
export declare interface ServeOptions {
|
|
@@ -62,7 +87,7 @@ export declare interface SiteConfig<ThemeConfig = any> {
|
|
|
62
87
|
root: string;
|
|
63
88
|
srcDir: string;
|
|
64
89
|
site: SiteData<ThemeConfig>;
|
|
65
|
-
configPath: string;
|
|
90
|
+
configPath: string | undefined;
|
|
66
91
|
themeDir: string;
|
|
67
92
|
outDir: string;
|
|
68
93
|
tempDir: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vitepress",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.3",
|
|
4
4
|
"description": "Vite & Vue powered static site generator",
|
|
5
5
|
"main": "dist/node/index.js",
|
|
6
6
|
"typings": "types/index.d.ts",
|
|
@@ -12,32 +12,6 @@
|
|
|
12
12
|
"dist",
|
|
13
13
|
"types"
|
|
14
14
|
],
|
|
15
|
-
"scripts": {
|
|
16
|
-
"dev": "yarn dev-shared && yarn dev-start",
|
|
17
|
-
"dev-start": "run-p dev-client dev-node dev-watch",
|
|
18
|
-
"dev-client": "tsc -w -p src/client",
|
|
19
|
-
"dev-node": "tsc -w -p src/node",
|
|
20
|
-
"dev-shared": "node scripts/copyShared",
|
|
21
|
-
"dev-watch": "node scripts/watchAndCopy",
|
|
22
|
-
"prebuild": "rimraf -rf dist && node scripts/copyShared",
|
|
23
|
-
"build": "run-s build-client build-node build-types",
|
|
24
|
-
"build-client": "tsc -p src/client && node scripts/copyClient",
|
|
25
|
-
"build-node": "rollup -c scripts/rollup.config.js",
|
|
26
|
-
"build-types": "run-s build-types-client build-types-node",
|
|
27
|
-
"build-types-client": "tsc -p src/client --declaration --emitDeclarationOnly --outDir dist/temp && api-extractor run -c api-extractor.client.json && rimraf dist/temp",
|
|
28
|
-
"build-types-node": "tsc -p src/node --declaration --emitDeclarationOnly --outDir dist/temp && api-extractor run -c api-extractor.node.json && rimraf dist/temp",
|
|
29
|
-
"lint": "yarn lint:js && yarn lint:ts",
|
|
30
|
-
"lint:js": "prettier --check --write \"{bin,docs,scripts,src}/**/*.js\"",
|
|
31
|
-
"lint:ts": "prettier --check --write --parser typescript \"{__tests__,src,docs,types}/**/*.ts\"",
|
|
32
|
-
"test": "jest",
|
|
33
|
-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
34
|
-
"release": "node scripts/release.js",
|
|
35
|
-
"docs": "run-p dev docs-dev",
|
|
36
|
-
"docs-dev": "node ./bin/vitepress dev docs",
|
|
37
|
-
"docs-debug": "node --inspect-brk ./bin/vitepress dev docs",
|
|
38
|
-
"docs-build": "yarn build && node ./bin/vitepress build docs",
|
|
39
|
-
"docs-serve": "node ./bin/vitepress serve docs"
|
|
40
|
-
},
|
|
41
15
|
"engines": {
|
|
42
16
|
"node": ">=12.0.0"
|
|
43
17
|
},
|
|
@@ -68,12 +42,12 @@
|
|
|
68
42
|
"url": "https://github.com/vuejs/vitepress/issues"
|
|
69
43
|
},
|
|
70
44
|
"dependencies": {
|
|
71
|
-
"@docsearch/css": "^
|
|
72
|
-
"@docsearch/js": "^
|
|
73
|
-
"@vitejs/plugin-vue": "^1.
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
45
|
+
"@docsearch/css": "^3.0.0-alpha.41",
|
|
46
|
+
"@docsearch/js": "^3.0.0-alpha.41",
|
|
47
|
+
"@vitejs/plugin-vue": "^1.10.1",
|
|
48
|
+
"prismjs": "^1.25.0",
|
|
49
|
+
"vite": "^2.7.0-beta.8",
|
|
50
|
+
"vue": "^3.2.24"
|
|
77
51
|
},
|
|
78
52
|
"devDependencies": {
|
|
79
53
|
"@microsoft/api-extractor": "^7.18.9",
|
|
@@ -91,7 +65,6 @@
|
|
|
91
65
|
"@types/markdown-it": "^12.0.1",
|
|
92
66
|
"@types/node": "^15.6.1",
|
|
93
67
|
"@types/polka": "^0.5.3",
|
|
94
|
-
"@types/postcss-load-config": "^3.0.1",
|
|
95
68
|
"chalk": "^4.1.1",
|
|
96
69
|
"chokidar": "^3.5.1",
|
|
97
70
|
"compression": "^1.7.4",
|
|
@@ -99,7 +72,7 @@
|
|
|
99
72
|
"debug": "^4.3.2",
|
|
100
73
|
"diacritics": "^1.3.0",
|
|
101
74
|
"enquirer": "^2.3.6",
|
|
102
|
-
"esbuild": "^0.
|
|
75
|
+
"esbuild": "^0.13.4",
|
|
103
76
|
"escape-html": "^1.0.3",
|
|
104
77
|
"execa": "^5.0.0",
|
|
105
78
|
"fs-extra": "^10.0.0",
|
|
@@ -127,5 +100,32 @@
|
|
|
127
100
|
"ts-jest": "^27.0.1",
|
|
128
101
|
"typescript": "^4.3.2",
|
|
129
102
|
"yorkie": "^2.0.0"
|
|
103
|
+
},
|
|
104
|
+
"scripts": {
|
|
105
|
+
"dev": "run-s dev-shared dev-start",
|
|
106
|
+
"dev-start": "run-p dev-client dev-node dev-watch",
|
|
107
|
+
"dev-client": "tsc -w -p src/client",
|
|
108
|
+
"dev-node": "tsc -w -p src/node",
|
|
109
|
+
"dev-shared": "node scripts/copyShared",
|
|
110
|
+
"dev-watch": "node scripts/watchAndCopy",
|
|
111
|
+
"build": "run-s build-prepare build-client build-node build-types",
|
|
112
|
+
"build-prepare": "rimraf -rf dist && node scripts/copyShared",
|
|
113
|
+
"build-client": "tsc -p src/client && node scripts/copyClient",
|
|
114
|
+
"build-node": "rollup -c scripts/rollup.config.js",
|
|
115
|
+
"build-types": "run-s build-types-client build-types-node",
|
|
116
|
+
"build-types-client": "tsc -p src/client --declaration --emitDeclarationOnly --outDir dist/temp && api-extractor run -c api-extractor.client.json && rimraf dist/temp",
|
|
117
|
+
"build-types-node": "tsc -p src/node --declaration --emitDeclarationOnly --outDir dist/temp && api-extractor run -c api-extractor.node.json && rimraf dist/temp",
|
|
118
|
+
"lint": "run-s lint:js lint:ts",
|
|
119
|
+
"lint:js": "prettier --check --write \"{bin,docs,scripts,src}/**/*.js\"",
|
|
120
|
+
"lint:ts": "prettier --check --write --parser typescript \"{__tests__,src,docs,types}/**/*.ts\"",
|
|
121
|
+
"test": "jest",
|
|
122
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
123
|
+
"release": "node scripts/release.js",
|
|
124
|
+
"docs": "run-p dev docs-dev",
|
|
125
|
+
"docs-dev": "node ./bin/vitepress dev docs",
|
|
126
|
+
"docs-debug": "node --inspect-brk ./bin/vitepress dev docs",
|
|
127
|
+
"docs-build": "npm run build && node ./bin/vitepress build docs",
|
|
128
|
+
"docs-serve": "node ./bin/vitepress serve docs",
|
|
129
|
+
"ci-docs": "run-s build docs-build"
|
|
130
130
|
}
|
|
131
|
-
}
|
|
131
|
+
}
|