@ruan-cat/vitepress-preset-config 0.4.1 → 0.6.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.
- package/dist/config.mjs +1 -1
- package/dist/theme.css +6 -0
- package/dist/theme.mjs +0 -4
- package/package.json +10 -5
- package/src/.vitepress/theme/index.ts +1 -0
- package/src/config.mts +1 -1
- package/src/index.css +6 -0
- package/src/theme.ts +13 -5
package/dist/config.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { defineConfig } from "vitepress";
|
|
3
3
|
import { generateSidebar } from "vitepress-sidebar";
|
|
4
4
|
import { GitChangelog, GitChangelogMarkdownSection } from "@nolebase/vitepress-plugin-git-changelog/vite";
|
|
5
|
-
import { vitepressDemoPlugin } from "
|
|
5
|
+
import { vitepressDemoPlugin } from "vitepress-demo-plugin";
|
|
6
6
|
import { merge, isUndefined, cloneDeep } from "lodash-es";
|
|
7
7
|
import consola from "consola";
|
|
8
8
|
import { addChangelog2doc, hasChangelogMd } from "@ruan-cat/utils/node-esm";
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
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 */
|
package/dist/theme.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
// src/theme.ts
|
|
2
2
|
import { h } from "vue";
|
|
3
3
|
import DefaultTheme from "vitepress/theme";
|
|
4
|
-
import { VitepressDemoBox, VitepressDemoPlaceholder } from "@ruan-cat/vitepress-demo-plugin";
|
|
5
|
-
import "@ruan-cat/vitepress-demo-plugin/dist/index.css";
|
|
6
4
|
import { NolebaseBreadcrumbs } from "@nolebase/vitepress-plugin-breadcrumbs/client";
|
|
7
5
|
import {
|
|
8
6
|
NolebaseEnhancedReadabilitiesMenu,
|
|
@@ -45,8 +43,6 @@ function defineRuancatPresetTheme(params) {
|
|
|
45
43
|
}
|
|
46
44
|
}
|
|
47
45
|
});
|
|
48
|
-
app.component("VitepressDemoBox", VitepressDemoBox);
|
|
49
|
-
app.component("VitepressDemoPlaceholder", VitepressDemoPlaceholder);
|
|
50
46
|
(_a = params == null ? void 0 : params.enhanceAppCallBack) == null ? void 0 : _a.call(params, { app, router, siteData });
|
|
51
47
|
}
|
|
52
48
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ruan-cat/vitepress-preset-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "用于给大多数的vitepress项目提供一个预设的配置文件。",
|
|
5
5
|
"homepage": "https://vitepress-preset.ruancat6312.top",
|
|
6
6
|
"types": "./src/config.mts",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"consola": "^3.4.0",
|
|
15
15
|
"js-yaml": "^4.1.0",
|
|
16
16
|
"lodash-es": "^4.17.21",
|
|
17
|
+
"vitepress-demo-plugin": "^1.3.1",
|
|
17
18
|
"vitepress-sidebar": "^1.31.1",
|
|
18
19
|
"vue": "^3.5.13",
|
|
19
|
-
"@ruan-cat/utils": "^4.2.1"
|
|
20
|
-
"@ruan-cat/vitepress-demo-plugin": "^0.1.0"
|
|
20
|
+
"@ruan-cat/utils": "^4.2.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/lodash-es": "^4.17.12",
|
|
@@ -25,11 +25,15 @@
|
|
|
25
25
|
"vitepress": "^1.6.3"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"vitepress": "^1.6.x"
|
|
28
|
+
"vitepress": "^1.6.x",
|
|
29
|
+
"vitepress-demo-plugin": "^1"
|
|
29
30
|
},
|
|
30
31
|
"peerDependenciesMeta": {
|
|
31
32
|
"vitepress": {
|
|
32
33
|
"optional": true
|
|
34
|
+
},
|
|
35
|
+
"vitepress-demo-plugin": {
|
|
36
|
+
"optional": false
|
|
33
37
|
}
|
|
34
38
|
},
|
|
35
39
|
"bugs": {
|
|
@@ -48,7 +52,8 @@
|
|
|
48
52
|
"./theme": {
|
|
49
53
|
"import": "./dist/theme.mjs",
|
|
50
54
|
"types": "./src/theme.ts"
|
|
51
|
-
}
|
|
55
|
+
},
|
|
56
|
+
"./theme.css": "./dist/theme.css"
|
|
52
57
|
},
|
|
53
58
|
"keywords": [
|
|
54
59
|
"vitepress"
|
package/src/config.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { generateSidebar, withSidebar } from "vitepress-sidebar";
|
|
|
4
4
|
export { defineConfig };
|
|
5
5
|
|
|
6
6
|
import { GitChangelog, GitChangelogMarkdownSection } from "@nolebase/vitepress-plugin-git-changelog/vite";
|
|
7
|
-
import { vitepressDemoPlugin } from "
|
|
7
|
+
import { vitepressDemoPlugin } from "vitepress-demo-plugin";
|
|
8
8
|
|
|
9
9
|
import { merge, isUndefined, cloneDeep } from "lodash-es";
|
|
10
10
|
import consola from "consola";
|
package/src/index.css
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/* 放弃二次封装该库 在生产环境内使用peer对等依赖 */
|
|
2
|
+
/* @import "@ruan-cat/vitepress-demo-plugin/dist/index.css"; */
|
|
3
|
+
@import "@nolebase/vitepress-plugin-enhanced-readabilities/client/style.css";
|
|
4
|
+
@import "@nolebase/vitepress-plugin-highlight-targeted-heading/client/style.css";
|
|
5
|
+
@import "@nolebase/vitepress-plugin-git-changelog/client/style.css";
|
|
6
|
+
@import "@shikijs/vitepress-twoslash/style.css";
|
package/src/theme.ts
CHANGED
|
@@ -3,8 +3,12 @@ import { h } from "vue";
|
|
|
3
3
|
import type { Theme, EnhanceAppContext } from "vitepress";
|
|
4
4
|
import DefaultTheme from "vitepress/theme";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
import "
|
|
6
|
+
// 将全部的样式集中在专门的文件内 在tsup内被打包出去
|
|
7
|
+
import "./index.css";
|
|
8
|
+
|
|
9
|
+
// 警告 放弃内部处理该库 直接使用peer对等依赖 不再考虑包装封装该库
|
|
10
|
+
// import { VitepressDemoBox, VitepressDemoPlaceholder } from "@ruan-cat/vitepress-demo-plugin";
|
|
11
|
+
// import "@ruan-cat/vitepress-demo-plugin/dist/index.css";
|
|
8
12
|
|
|
9
13
|
import { NolebaseBreadcrumbs } from "@nolebase/vitepress-plugin-breadcrumbs/client";
|
|
10
14
|
|
|
@@ -65,9 +69,13 @@ export function defineRuancatPresetTheme(params?: DefineRuancatPresetThemeParams
|
|
|
65
69
|
},
|
|
66
70
|
},
|
|
67
71
|
} as Options);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 放弃全局注册demo展示组件
|
|
75
|
+
* 在生产环境内使用peer对等依赖
|
|
76
|
+
*/
|
|
77
|
+
// app.component("VitepressDemoBox", VitepressDemoBox);
|
|
78
|
+
// app.component("VitepressDemoPlaceholder", VitepressDemoPlaceholder);
|
|
71
79
|
|
|
72
80
|
params?.enhanceAppCallBack?.({ app, router, siteData });
|
|
73
81
|
},
|