@riebeckite/honox 0.0.42 → 0.0.44
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/index.js +38 -18
- package/dist/server.js +4 -4
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -166,7 +166,7 @@ async function loadRiebeckiteConfig(options) {
|
|
|
166
166
|
bundle: true,
|
|
167
167
|
platform: "node",
|
|
168
168
|
format: "esm",
|
|
169
|
-
external: options.workspaceRoot ? [] : ["@riebeckite/core", ...siteRiebeckiteExternals(options.configRoot)],
|
|
169
|
+
external: options.workspaceRoot ? ["@riebeckite/og-image"] : ["@riebeckite/core", ...siteRiebeckiteExternals(options.configRoot)],
|
|
170
170
|
banner: {
|
|
171
171
|
js: 'import { createRequire as __riebeckiteCreateRequire } from "node:module"; const require = __riebeckiteCreateRequire(import.meta.url);'
|
|
172
172
|
},
|
|
@@ -1456,11 +1456,14 @@ async function saveOutputCacheEntries(directory, outputDirectory, outputs, final
|
|
|
1456
1456
|
if (existing.cachePath !== outputCacheEntryName(outputPath) || !isChecksum(existing.checksum)) {
|
|
1457
1457
|
throw new Error(`Invalid SSG output cache entry: ${outputPath}`);
|
|
1458
1458
|
}
|
|
1459
|
-
|
|
1459
|
+
const cached = await existingOutputCacheEntry(
|
|
1460
1460
|
existing,
|
|
1461
1461
|
join4(directory, existing.cachePath)
|
|
1462
1462
|
);
|
|
1463
|
-
|
|
1463
|
+
if (cached) {
|
|
1464
|
+
entries[outputPath] = cached;
|
|
1465
|
+
continue;
|
|
1466
|
+
}
|
|
1464
1467
|
}
|
|
1465
1468
|
const source = resolveOutputCacheFile(outputDirectory, outputPath);
|
|
1466
1469
|
const cachePath = outputCacheEntryName(outputPath);
|
|
@@ -1490,6 +1493,11 @@ async function withOutputCacheEntryStat(entry, path12) {
|
|
|
1490
1493
|
if (!info?.isFile() || info.isSymbolicLink()) return entry;
|
|
1491
1494
|
return { ...entry, size: info.size, modifiedAtMs: info.mtimeMs };
|
|
1492
1495
|
}
|
|
1496
|
+
async function existingOutputCacheEntry(entry, path12) {
|
|
1497
|
+
const info = await lstat2(path12).catch(() => void 0);
|
|
1498
|
+
if (!info?.isFile() || info.isSymbolicLink()) return void 0;
|
|
1499
|
+
return { ...entry, size: info.size, modifiedAtMs: info.mtimeMs };
|
|
1500
|
+
}
|
|
1493
1501
|
async function validateOutputCacheEntries(outputCachePath, entries, timingsMs) {
|
|
1494
1502
|
try {
|
|
1495
1503
|
const directory = outputCacheEntriesPath(outputCachePath);
|
|
@@ -1926,7 +1934,11 @@ function createFrameworkResolutionPlugin() {
|
|
|
1926
1934
|
}
|
|
1927
1935
|
};
|
|
1928
1936
|
}
|
|
1929
|
-
var runtimeExternalPackages = /* @__PURE__ */ new Set([
|
|
1937
|
+
var runtimeExternalPackages = /* @__PURE__ */ new Set([
|
|
1938
|
+
"@d2lang/d2",
|
|
1939
|
+
"@marp-team/marp-core",
|
|
1940
|
+
"@riebeckite/og-image"
|
|
1941
|
+
]);
|
|
1930
1942
|
function createRuntimeExternalPlugin() {
|
|
1931
1943
|
return {
|
|
1932
1944
|
name: "riebeckite-ssg-runtime-externals",
|
|
@@ -2243,12 +2255,14 @@ function riebeckiteSsg(options = {}) {
|
|
|
2243
2255
|
"outputWrite",
|
|
2244
2256
|
() => writer.write(fileName, data)
|
|
2245
2257
|
);
|
|
2246
|
-
|
|
2258
|
+
const checksum = fingerprintOutputContent(data);
|
|
2259
|
+
outputChecksums.set(fileName, checksum);
|
|
2247
2260
|
metrics.emittedOutputCount += 1;
|
|
2248
|
-
nextOutputCache.outputs[fileName] =
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2261
|
+
nextOutputCache.outputs[fileName] = outputCacheEntryFor(
|
|
2262
|
+
previousOutputCache,
|
|
2263
|
+
fileName,
|
|
2264
|
+
checksum
|
|
2265
|
+
);
|
|
2252
2266
|
}
|
|
2253
2267
|
})
|
|
2254
2268
|
);
|
|
@@ -2280,15 +2294,14 @@ function riebeckiteSsg(options = {}) {
|
|
|
2280
2294
|
"outputWrite",
|
|
2281
2295
|
() => writer.write(asset.fileName, asset.source)
|
|
2282
2296
|
);
|
|
2283
|
-
|
|
2297
|
+
const checksum = fingerprintOutputContent(asset.source);
|
|
2298
|
+
outputChecksums.set(asset.fileName, checksum);
|
|
2299
|
+
metrics.emittedOutputCount += 1;
|
|
2300
|
+
nextOutputCache.outputs[asset.fileName] = outputCacheEntryFor(
|
|
2301
|
+
previousOutputCache,
|
|
2284
2302
|
asset.fileName,
|
|
2285
|
-
|
|
2303
|
+
checksum
|
|
2286
2304
|
);
|
|
2287
|
-
metrics.emittedOutputCount += 1;
|
|
2288
|
-
nextOutputCache.outputs[asset.fileName] = {
|
|
2289
|
-
cachePath: "",
|
|
2290
|
-
checksum: ""
|
|
2291
|
-
};
|
|
2292
2305
|
},
|
|
2293
2306
|
canUseIncremental ? new Set(
|
|
2294
2307
|
(outputChangeSet?.affected ?? []).filter((output) => output.kind === "generated").map((output) => output.path)
|
|
@@ -2563,6 +2576,10 @@ function assertRequiredOutputsWereGenerated(comparison) {
|
|
|
2563
2576
|
`SSG did not generate required output: ${comparison.missingInDist.join(", ")}`
|
|
2564
2577
|
);
|
|
2565
2578
|
}
|
|
2579
|
+
function outputCacheEntryFor(previous, path12, checksum) {
|
|
2580
|
+
const cached = previous?.outputs[path12];
|
|
2581
|
+
return cached?.checksum === checksum ? cached : { cachePath: "", checksum: "" };
|
|
2582
|
+
}
|
|
2566
2583
|
async function emitGeneratedOutputs(module, emit, affectedPaths, shadowedPaths, onShadowed) {
|
|
2567
2584
|
const content = module.content;
|
|
2568
2585
|
if (!content) return 0;
|
|
@@ -3115,8 +3132,11 @@ async function resolveHonoxApplication(options) {
|
|
|
3115
3132
|
}
|
|
3116
3133
|
async function findWorkspaceRoot2(configRoot) {
|
|
3117
3134
|
try {
|
|
3118
|
-
const workspaceConfig =
|
|
3119
|
-
|
|
3135
|
+
const workspaceConfig = await fs7.readFile(
|
|
3136
|
+
path10.join(configRoot, "pnpm-workspace.yaml"),
|
|
3137
|
+
"utf8"
|
|
3138
|
+
);
|
|
3139
|
+
return /^packages\s*:/m.test(workspaceConfig) ? configRoot : void 0;
|
|
3120
3140
|
} catch {
|
|
3121
3141
|
return void 0;
|
|
3122
3142
|
}
|
package/dist/server.js
CHANGED
|
@@ -114,7 +114,7 @@ function isDynamicRoute(path) {
|
|
|
114
114
|
}
|
|
115
115
|
function normalizeRequestPath(pathname) {
|
|
116
116
|
const trailingSlash = pathname.length > 1 && pathname.endsWith("/");
|
|
117
|
-
const segments = pathname.split("/").filter(Boolean).map(
|
|
117
|
+
const segments = pathname.split("/").filter(Boolean).map(encodeSegment);
|
|
118
118
|
const path = `/${segments.join("/")}`;
|
|
119
119
|
return trailingSlash ? `${path}/` : path;
|
|
120
120
|
}
|
|
@@ -131,11 +131,11 @@ function redirectSsgPaths(manifest) {
|
|
|
131
131
|
function routeOutputPath(pathname) {
|
|
132
132
|
return htmlOutputPath(pathname);
|
|
133
133
|
}
|
|
134
|
-
function
|
|
134
|
+
function encodeSegment(segment) {
|
|
135
135
|
try {
|
|
136
|
-
return decodeURIComponent(segment);
|
|
136
|
+
return encodeURIComponent(decodeURIComponent(segment));
|
|
137
137
|
} catch {
|
|
138
|
-
return segment;
|
|
138
|
+
return encodeURIComponent(segment);
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/honox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"hono": "^4.12.25",
|
|
45
45
|
"honox": "0.1.62",
|
|
46
46
|
"vite": "^8.3.5",
|
|
47
|
-
"@riebeckite/
|
|
48
|
-
"@riebeckite/core": "0.0.
|
|
49
|
-
"@riebeckite/
|
|
50
|
-
"@riebeckite/
|
|
51
|
-
"@riebeckite/
|
|
52
|
-
"@riebeckite/
|
|
47
|
+
"@riebeckite/spa": "0.0.44",
|
|
48
|
+
"@riebeckite/core": "0.0.44",
|
|
49
|
+
"@riebeckite/ui": "0.0.44",
|
|
50
|
+
"@riebeckite/plugin-color-mode": "0.0.44",
|
|
51
|
+
"@riebeckite/dev-inspector": "0.0.44",
|
|
52
|
+
"@riebeckite/node": "0.0.44"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@d2lang/d2": "^0.1.34",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@hono/vite-build": "^1.11.1",
|
|
58
58
|
"@marp-team/marp-core": "^4.4.0",
|
|
59
59
|
"tsx": "^4.22.4",
|
|
60
|
-
"@riebeckite/
|
|
61
|
-
"@riebeckite/
|
|
60
|
+
"@riebeckite/test": "0.0.44",
|
|
61
|
+
"@riebeckite/plugin-bases": "0.0.44"
|
|
62
62
|
},
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"access": "public"
|