@xingwangzhe/stalux 1.8.0 → 1.10.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/package.json +12 -10
- package/src/expressive-code.ts +31 -0
- package/src/index.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingwangzhe/stalux",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "A powerful, modern Astro blog theme — use as template or install as plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"src/index.ts",
|
|
27
27
|
"src/config.ts",
|
|
28
|
+
"src/expressive-code.ts",
|
|
28
29
|
"src/components/**/*.astro",
|
|
29
30
|
"src/components/**/*.ts",
|
|
30
31
|
"src/layouts/**/*.astro",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"exports": {
|
|
46
47
|
".": "./src/index.ts",
|
|
47
48
|
"./config": "./src/config.ts",
|
|
49
|
+
"./expressive-code": "./src/expressive-code.ts",
|
|
48
50
|
"./schemas": "./src/schemas/config.ts",
|
|
49
51
|
"./schemas/collections": "./src/schemas/collections.ts",
|
|
50
52
|
"./components/*": "./src/components/*",
|
|
@@ -75,12 +77,12 @@
|
|
|
75
77
|
"@astrojs/rss": "^4.0.19",
|
|
76
78
|
"@astrojs/sitemap": "^3.7.3",
|
|
77
79
|
"@expressive-code/plugin-line-numbers": "^0.44.1",
|
|
78
|
-
"@lucide/astro": "^1.
|
|
80
|
+
"@lucide/astro": "^1.28.0",
|
|
79
81
|
"@pagefind/component-ui": "^1.5.2",
|
|
80
82
|
"@waline/client": "^3.15.2",
|
|
81
|
-
"@xingwangzhe/satteri-mermaid": "0.7.
|
|
82
|
-
"@xingwangzhe/satteri-photoswipe": "^0.2.
|
|
83
|
-
"@xingwangzhe/tags-cloud": "^1.2.
|
|
83
|
+
"@xingwangzhe/satteri-mermaid": "0.7.3",
|
|
84
|
+
"@xingwangzhe/satteri-photoswipe": "^0.2.2",
|
|
85
|
+
"@xingwangzhe/tags-cloud": "^1.2.5",
|
|
84
86
|
"animejs": "^4.5.0",
|
|
85
87
|
"astro-expressive-code": "^0.44.1",
|
|
86
88
|
"astro-seo": "^1.1.0",
|
|
@@ -89,16 +91,16 @@
|
|
|
89
91
|
"pagefind": "^1.5.2",
|
|
90
92
|
"photoswipe": "^5.4.4",
|
|
91
93
|
"satteri": "^0.9.5",
|
|
92
|
-
"simple-icons": "^16.
|
|
94
|
+
"simple-icons": "^16.28.0",
|
|
93
95
|
"subset-font": "^2.5.0",
|
|
94
|
-
"temml": "^0.13.
|
|
96
|
+
"temml": "^0.13.4"
|
|
95
97
|
},
|
|
96
98
|
"devDependencies": {
|
|
97
99
|
"@types/node": "^26.1.2",
|
|
98
|
-
"knip": "^6.
|
|
100
|
+
"knip": "^6.31.0",
|
|
99
101
|
"license-checker-rseidelsohn": "5.0.1",
|
|
100
|
-
"oxfmt": "^0.
|
|
101
|
-
"oxlint": "^1.
|
|
102
|
+
"oxfmt": "^0.62.0",
|
|
103
|
+
"oxlint": "^1.77.0",
|
|
102
104
|
"typescript": "^7.0.2"
|
|
103
105
|
},
|
|
104
106
|
"peerDependencies": {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stalux 封装的 Expressive Code 集成 —— 默认启用代码块行号。
|
|
3
|
+
*
|
|
4
|
+
* 插件模式下直接从包导入,无需单独安装 @expressive-code/plugin-line-numbers:
|
|
5
|
+
* ```js
|
|
6
|
+
* import { expressiveCode } from "@xingwangzhe/stalux";
|
|
7
|
+
*
|
|
8
|
+
* export default defineConfig({
|
|
9
|
+
* integrations: [stalux({ contentDir: "stalux" }), expressiveCode({ themes: [...] })],
|
|
10
|
+
* });
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* 行号插件是 Expressive Code 引擎级插件(必须通过 expressiveCode() 的 plugins 选项传入,
|
|
14
|
+
* 无法由 stalux 集成自动注入),因此这里把 pluginLineNumbers 与用户配置合并,
|
|
15
|
+
* 让行号成为默认行为。
|
|
16
|
+
*/
|
|
17
|
+
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
|
|
18
|
+
import expressiveCodeBase from "astro-expressive-code";
|
|
19
|
+
|
|
20
|
+
type ExpressiveCodeOptions = NonNullable<Parameters<typeof expressiveCodeBase>[0]>;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 创建带默认行号插件的 Expressive Code 集成。
|
|
24
|
+
* @param options - 透传 astro-expressive-code 的选项;用户传入的 plugins 会追加在行号插件之后
|
|
25
|
+
*/
|
|
26
|
+
export function expressiveCode(options: ExpressiveCodeOptions = {}) {
|
|
27
|
+
const plugins = [pluginLineNumbers(), ...(options.plugins ?? [])];
|
|
28
|
+
return expressiveCodeBase({ ...options, plugins });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default expressiveCode;
|
package/src/index.ts
CHANGED