@xingwangzhe/stalux 1.35.13 → 1.35.15
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xingwangzhe/stalux",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.15",
|
|
4
4
|
"description": "A powerful, modern Astro blog theme — use as template or install as plugin",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"astro",
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"dev": "bun run styles:build && node scripts/dev.ts",
|
|
73
|
-
"build": "bun run styles:build && astro build && node scripts/verify-build.ts",
|
|
73
|
+
"build": "bun run styles:build && astro build --timings && node scripts/verify-build.ts",
|
|
74
74
|
"preview": "astro preview",
|
|
75
75
|
"astro": "astro",
|
|
76
76
|
"init": "node scripts/cli.ts init",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"validate": "bun run styles:build && bun run check && bun run node:check && bun run astro:check && bun run knip && bun run test:coverage && bun run build && bun run build:cli",
|
|
93
93
|
"prepare": "git config core.hooksPath scripts/git-hooks",
|
|
94
94
|
"dev:debug": "STALUX_DEBUG=1 astro dev --verbose",
|
|
95
|
-
"build:debug": "STALUX_DEBUG=1 astro build --verbose && node scripts/verify-build.ts",
|
|
95
|
+
"build:debug": "STALUX_DEBUG=1 astro build --timings --verbose && node scripts/verify-build.ts",
|
|
96
96
|
"styles:build": "node scripts/build-styles.ts && node scripts/build-style-names.ts",
|
|
97
97
|
"styles:watch": "node scripts/build-styles.ts --watch",
|
|
98
98
|
"benchmark:performance": "node scripts/benchmark-performance.ts",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"@types/node": "^26.6.5",
|
|
135
135
|
"@unocss/astro": "^66.11.0",
|
|
136
136
|
"@vitest/coverage-v8": "^5.0.4",
|
|
137
|
-
"astro": "^7.
|
|
137
|
+
"astro": "^7.4.0",
|
|
138
138
|
"knip": "^6.41.0",
|
|
139
139
|
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
140
140
|
"unocss": "^66.11.0",
|
|
@@ -142,6 +142,6 @@
|
|
|
142
142
|
"vitest": "^5.0.4"
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
145
|
-
"astro": "^7.
|
|
145
|
+
"astro": "^7.4.0"
|
|
146
146
|
}
|
|
147
147
|
}
|
package/src/index.ts
CHANGED
|
@@ -41,6 +41,7 @@ import { findHtmlImages } from "./internal/html-images";
|
|
|
41
41
|
import { createHtmlMutationEmitter } from "./internal/html-output";
|
|
42
42
|
import { type ImageDimensions, updateLocalImageDimensions } from "./internal/image-dimensions";
|
|
43
43
|
import { createInjectedRoutes } from "./internal/injected-routes";
|
|
44
|
+
import { markdownPropagationPlugin } from "./internal/markdown-propagation";
|
|
44
45
|
import { createPageOutputCache } from "./internal/page-output-cache";
|
|
45
46
|
import { syncBackgroundSvgs, syncFontAssets } from "./internal/public-assets";
|
|
46
47
|
import { createRuntimeCacheKey } from "./internal/runtime-cache-key";
|
|
@@ -161,7 +162,9 @@ export function stalux(options: StaluxOptions = {}): AstroIntegration[] {
|
|
|
161
162
|
alias: createViteAliases(srcDir),
|
|
162
163
|
},
|
|
163
164
|
plugins: [
|
|
164
|
-
...(command === "build"
|
|
165
|
+
...(command === "build"
|
|
166
|
+
? [markdownPropagationPlugin(), compactStylesPlugin(srcDir)]
|
|
167
|
+
: []),
|
|
165
168
|
staluxComponentsAlias(opt.components, logger.fork("stalux/components")),
|
|
166
169
|
],
|
|
167
170
|
define: {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import astroPackage from "astro/package.json" with { type: "json" };
|
|
2
|
+
import type { Plugin } from "vite";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Astro 7 loads Markdown before replacing its propagated-assets module with
|
|
6
|
+
* imports of the real content module. That throwaway load renders the same
|
|
7
|
+
* document twice. The propagation transform ignores its input entirely.
|
|
8
|
+
*
|
|
9
|
+
* Only skip this internal forwarding module, never the real content module,
|
|
10
|
+
* direct imports, Markdown pages, or MDX (which owns a different pipeline).
|
|
11
|
+
* The internal transform has been verified on 7.4.0 only. Future Astro versions
|
|
12
|
+
* use the ordinary pipeline until their propagation contract is rechecked.
|
|
13
|
+
*/
|
|
14
|
+
export function markdownPropagationPlugin(): Plugin {
|
|
15
|
+
return {
|
|
16
|
+
name: "stalux:markdown-propagation",
|
|
17
|
+
enforce: "pre",
|
|
18
|
+
apply: (_, environment) =>
|
|
19
|
+
environment.command === "build" && astroPackage.version === "7.4.0",
|
|
20
|
+
load: {
|
|
21
|
+
order: "pre",
|
|
22
|
+
filter: { id: /\.(?:md|markdown)\?astroPropagatedAssets$/u },
|
|
23
|
+
handler() {
|
|
24
|
+
return "";
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
@@ -267,6 +267,9 @@ const analysisCache = new Map<string, Promise<FeatureFlagsResult>>();
|
|
|
267
267
|
|
|
268
268
|
function getFeatureFlagsProcessor() {
|
|
269
269
|
processorPromise ??= createSatteriMarkdownProcessor({
|
|
270
|
+
// Statistics consume AST metadata only. Highlighting every code block here
|
|
271
|
+
// duplicates Expressive Code work and repeats in each prerender worker.
|
|
272
|
+
syntaxHighlight: false,
|
|
270
273
|
mdastPlugins: [featureFlagsMdast],
|
|
271
274
|
hastPlugins: [featureFlagsHast],
|
|
272
275
|
features: { math: true },
|