@ruan-cat/vitepress-preset-config 0.8.0 → 0.9.1
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/theme.d.mts +1 -26
- package/dist/theme.mjs +4 -2
- package/package.json +3 -4
- package/src/.vitepress/config.mts +1 -1
- package/src/.vitepress/theme/index.ts +0 -3
- package/src/theme.ts +12 -8
- package/dist/theme.css +0 -6
package/dist/theme.d.mts
CHANGED
|
@@ -12,31 +12,6 @@ interface EnhanceAppCallBack {
|
|
|
12
12
|
interface DefineRuancatPresetThemeParams {
|
|
13
13
|
enhanceAppCallBack?: EnhanceAppCallBack;
|
|
14
14
|
}
|
|
15
|
-
/**
|
|
16
|
-
* 默认布局配置
|
|
17
|
-
* @description
|
|
18
|
-
*/
|
|
19
|
-
declare const defaultLayoutConfig: {
|
|
20
|
-
"doc-before": () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
21
|
-
[key: string]: any;
|
|
22
|
-
}>;
|
|
23
|
-
"nav-bar-content-after": () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
24
|
-
[key: string]: any;
|
|
25
|
-
}>;
|
|
26
|
-
"nav-screen-content-after": () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
27
|
-
[key: string]: any;
|
|
28
|
-
}>;
|
|
29
|
-
"layout-top": () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
30
|
-
[key: string]: any;
|
|
31
|
-
}>[];
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* 默认 enhanceApp 预设
|
|
35
|
-
* @description
|
|
36
|
-
* 这个函数预期应该作为一个内部函数 不应该对外暴露使用
|
|
37
|
-
* @private
|
|
38
|
-
*/
|
|
39
|
-
declare function defaultEnhanceAppPreset({ app, router, siteData }: EnhanceAppContext): void;
|
|
40
15
|
/** 默认主题配置 */
|
|
41
16
|
declare const defaultTheme: {
|
|
42
17
|
extends: {
|
|
@@ -62,4 +37,4 @@ declare function defineRuancatPresetTheme(params?: DefineRuancatPresetThemeParam
|
|
|
62
37
|
}>;
|
|
63
38
|
};
|
|
64
39
|
|
|
65
|
-
export { type DefineRuancatPresetThemeParams, type EnhanceAppCallBack,
|
|
40
|
+
export { type DefineRuancatPresetThemeParams, type EnhanceAppCallBack, defaultTheme, defineRuancatPresetTheme };
|
package/dist/theme.mjs
CHANGED
|
@@ -8,9 +8,13 @@ import {
|
|
|
8
8
|
InjectionKey,
|
|
9
9
|
LayoutMode
|
|
10
10
|
} from "@nolebase/vitepress-plugin-enhanced-readabilities/client";
|
|
11
|
+
import "@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css";
|
|
11
12
|
import { NolebaseHighlightTargetedHeading } from "@nolebase/vitepress-plugin-highlight-targeted-heading/client";
|
|
13
|
+
import "@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css";
|
|
12
14
|
import { NolebaseGitChangelogPlugin } from "@nolebase/vitepress-plugin-git-changelog/client";
|
|
15
|
+
import "@nolebase/vitepress-plugin-git-changelog/client/style.css";
|
|
13
16
|
import TwoslashFloatingVue from "@shikijs/vitepress-twoslash/client";
|
|
17
|
+
import "@shikijs/vitepress-twoslash/style.css";
|
|
14
18
|
var defaultLayoutConfig = {
|
|
15
19
|
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
|
16
20
|
"doc-before": () => h(NolebaseBreadcrumbs),
|
|
@@ -54,8 +58,6 @@ function defineRuancatPresetTheme(params) {
|
|
|
54
58
|
};
|
|
55
59
|
}
|
|
56
60
|
export {
|
|
57
|
-
defaultEnhanceAppPreset,
|
|
58
|
-
defaultLayoutConfig,
|
|
59
61
|
defaultTheme,
|
|
60
62
|
defineRuancatPresetTheme
|
|
61
63
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruan-cat/vitepress-preset-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "用于给大多数的vitepress项目提供一个预设的配置文件。",
|
|
5
5
|
"homepage": "https://vitepress-preset.ruancat6312.top",
|
|
6
6
|
"types": "./src/config.mts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"vitepress-demo-plugin": "^1.3.1",
|
|
18
18
|
"vitepress-sidebar": "^1.31.1",
|
|
19
19
|
"vue": "^3.5.13",
|
|
20
|
-
"@ruan-cat/utils": "^4.2.
|
|
20
|
+
"@ruan-cat/utils": "^4.2.2"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"bugs": {
|
|
44
|
-
"url": "https://github.com/ruan-cat/
|
|
44
|
+
"url": "https://github.com/ruan-cat/monorepo/issues"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|
|
@@ -57,7 +57,6 @@
|
|
|
57
57
|
"import": "./src/theme.ts",
|
|
58
58
|
"types": "./src/theme.ts"
|
|
59
59
|
},
|
|
60
|
-
"./theme.css": "./dist/theme.css",
|
|
61
60
|
"./src/*": "./src/*"
|
|
62
61
|
},
|
|
63
62
|
"keywords": [
|
|
@@ -21,7 +21,7 @@ const thisDocUserConfig = setUserConfig({
|
|
|
21
21
|
socialLinks: [
|
|
22
22
|
{
|
|
23
23
|
icon: "github",
|
|
24
|
-
link: "https://github.com/ruan-cat/
|
|
24
|
+
link: "https://github.com/ruan-cat/monorepo/tree/main/packages/vitepress-preset-config",
|
|
25
25
|
},
|
|
26
26
|
],
|
|
27
27
|
},
|
package/src/theme.ts
CHANGED
|
@@ -3,8 +3,11 @@ import { h } from "vue";
|
|
|
3
3
|
import type { Theme, EnhanceAppContext } from "vitepress";
|
|
4
4
|
import DefaultTheme from "vitepress/theme";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
/**
|
|
7
|
+
* 警告 将全部的样式集中在专门的文件内 在tsup内被打包出去
|
|
8
|
+
* 不再对外提供专门的样式
|
|
9
|
+
*/
|
|
10
|
+
// import "./index.css";
|
|
8
11
|
|
|
9
12
|
// 警告 放弃内部处理该库 直接使用peer对等依赖 不再考虑包装封装该库
|
|
10
13
|
// import { VitepressDemoBox, VitepressDemoPlaceholder } from "@ruan-cat/vitepress-demo-plugin";
|
|
@@ -20,16 +23,16 @@ import {
|
|
|
20
23
|
type Options,
|
|
21
24
|
LayoutMode,
|
|
22
25
|
} from "@nolebase/vitepress-plugin-enhanced-readabilities/client";
|
|
23
|
-
|
|
26
|
+
import "@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css";
|
|
24
27
|
|
|
25
28
|
import { NolebaseHighlightTargetedHeading } from "@nolebase/vitepress-plugin-highlight-targeted-heading/client";
|
|
26
|
-
|
|
29
|
+
import "@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css";
|
|
27
30
|
|
|
28
31
|
import { NolebaseGitChangelogPlugin } from "@nolebase/vitepress-plugin-git-changelog/client";
|
|
29
|
-
|
|
32
|
+
import "@nolebase/vitepress-plugin-git-changelog/client/style.css";
|
|
30
33
|
|
|
31
34
|
import TwoslashFloatingVue from "@shikijs/vitepress-twoslash/client";
|
|
32
|
-
|
|
35
|
+
import "@shikijs/vitepress-twoslash/style.css";
|
|
33
36
|
|
|
34
37
|
/**
|
|
35
38
|
* 一个回调函数 用来暴露变量 实现注册
|
|
@@ -47,8 +50,9 @@ export interface DefineRuancatPresetThemeParams {
|
|
|
47
50
|
/**
|
|
48
51
|
* 默认布局配置
|
|
49
52
|
* @description
|
|
53
|
+
* @private
|
|
50
54
|
*/
|
|
51
|
-
|
|
55
|
+
const defaultLayoutConfig = {
|
|
52
56
|
// https://vitepress.dev/guide/extending-default-theme#layout-slots
|
|
53
57
|
"doc-before": () => h(NolebaseBreadcrumbs),
|
|
54
58
|
"nav-bar-content-after": () => h(NolebaseEnhancedReadabilitiesMenu),
|
|
@@ -63,7 +67,7 @@ export const defaultLayoutConfig = {
|
|
|
63
67
|
* 这个函数预期应该作为一个内部函数 不应该对外暴露使用
|
|
64
68
|
* @private
|
|
65
69
|
*/
|
|
66
|
-
|
|
70
|
+
function defaultEnhanceAppPreset({ app, router, siteData }: EnhanceAppContext) {
|
|
67
71
|
app.use(NolebaseGitChangelogPlugin);
|
|
68
72
|
app.use(TwoslashFloatingVue);
|
|
69
73
|
app.provide(InjectionKey, {
|
package/dist/theme.css
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
@import "@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css";
|
|
2
|
-
@import "@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css";
|
|
3
|
-
@import "@nolebase/vitepress-plugin-git-changelog/client/style.css";
|
|
4
|
-
@import "@shikijs/vitepress-twoslash/style.css";
|
|
5
|
-
|
|
6
|
-
/* src/index.css */
|