@xingwangzhe/stalux 1.3.4 → 1.3.6
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
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingwangzhe/stalux",
|
|
3
|
-
"version": "1.3.
|
|
4
|
-
"description": "A powerful, modern Astro blog theme
|
|
3
|
+
"version": "1.3.6",
|
|
4
|
+
"description": "A powerful, modern Astro blog theme \u2014 use as template or install as plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
7
7
|
"astro-integration",
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
".": "./src/index.ts",
|
|
48
48
|
"./config": "./src/config.ts",
|
|
49
49
|
"./schemas": "./src/schemas/config.ts",
|
|
50
|
+
"./schemas/collections": "./src/schemas/collections.ts",
|
|
50
51
|
"./components/*": "./src/components/*",
|
|
51
52
|
"./layouts/*": "./src/layouts/*",
|
|
52
53
|
"./pages/*": "./src/pages/*",
|
package/scripts/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* npm run init # 或通过 npm script
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import { existsSync, mkdirSync, cpSync, readdirSync, statSync
|
|
12
|
+
import { existsSync, mkdirSync, cpSync, readdirSync, statSync } from "node:fs";
|
|
13
13
|
import { join, resolve, dirname } from "node:path";
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
15
|
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
* 基于 Astro 7.1.3 Integration API(astro:config:setup / injectRoute / injectScript)
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { resolve } from "node:path";
|
|
12
11
|
import path from "node:path";
|
|
13
12
|
import { fileURLToPath } from "node:url";
|
|
14
13
|
|
|
@@ -142,7 +141,7 @@ export function stalux(options: StaluxOptions = {}): AstroIntegration {
|
|
|
142
141
|
injectScript,
|
|
143
142
|
updateConfig,
|
|
144
143
|
addDevToolbarApp,
|
|
145
|
-
|
|
144
|
+
_config,
|
|
146
145
|
logger,
|
|
147
146
|
}) => {
|
|
148
147
|
const srcDir = fileURLToPath(new URL(".", import.meta.url));
|
|
@@ -163,17 +163,8 @@ const wordCharsCache = new Map<string, string>();
|
|
|
163
163
|
function collectCommonChars(projectRoot: string): string {
|
|
164
164
|
const chars = new Set(ALWAYS_INCLUDE_CHARS);
|
|
165
165
|
|
|
166
|
-
|
|
167
|
-
"src/i18n/*.json",
|
|
168
|
-
"src/components/stalux/**/*.astro",
|
|
169
|
-
"src/layouts/**/*.astro",
|
|
170
|
-
"src/pages/**/*.astro",
|
|
171
|
-
"src/pages/**/*.ts",
|
|
172
|
-
];
|
|
173
|
-
|
|
174
|
-
// Since we can't use glob here easily, scan specific known files
|
|
166
|
+
// Scan all source directories for UI text characters
|
|
175
167
|
const srcDir = resolve(projectRoot, "src");
|
|
176
|
-
const scanDirs = ["i18n", "components/stalux", "layouts", "pages"];
|
|
177
168
|
|
|
178
169
|
function scanDir(dir: string) {
|
|
179
170
|
if (!existsSync(dir)) return;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { satteri } from "@astrojs/markdown-satteri";
|
|
2
2
|
import sitemap from "@astrojs/sitemap";
|
|
3
|
-
import {
|
|
3
|
+
import { mermaidHast } from "@xingwangzhe/satteri-mermaid";
|
|
4
4
|
import { photoswipe } from "@xingwangzhe/satteri-photoswipe";
|
|
5
5
|
import expressiveCode from "astro-expressive-code";
|
|
6
6
|
import { defineConfig } from "astro/config";
|
|
7
|
-
import stalux from "stalux";
|
|
7
|
+
import stalux from "@xingwangzhe/stalux";
|
|
8
8
|
|
|
9
9
|
// https://astro.build/config
|
|
10
10
|
export default defineConfig({
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 使用 stalux 包提供的 defineCollections 快速配置。
|
|
5
5
|
* 如需自定义内容路径,修改 contentDir 参数即可。
|
|
6
6
|
*/
|
|
7
|
-
import { defineCollections } from "stalux/schemas";
|
|
7
|
+
import { defineCollections } from "@xingwangzhe/stalux/schemas/collections";
|
|
8
8
|
|
|
9
9
|
export const collections = defineCollections({
|
|
10
10
|
contentDir: "stalux",
|