@riebeckite/honox 0.0.39 → 0.0.41
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
CHANGED
|
@@ -368,7 +368,11 @@ async function computeBundleFingerprint(root, configFile) {
|
|
|
368
368
|
return hash.digest("hex");
|
|
369
369
|
}
|
|
370
370
|
async function fingerprintDirectory(directory) {
|
|
371
|
-
|
|
371
|
+
return fingerprintOutputInventory(
|
|
372
|
+
await fingerprintOutputDirectory(directory)
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
function fingerprintOutputInventory(inventory) {
|
|
372
376
|
const hash = createHash("sha256");
|
|
373
377
|
for (const [path12, checksum] of Object.entries(inventory).sort(
|
|
374
378
|
([left], [right]) => left.localeCompare(right)
|
|
@@ -377,7 +381,10 @@ async function fingerprintDirectory(directory) {
|
|
|
377
381
|
}
|
|
378
382
|
return hash.digest("hex");
|
|
379
383
|
}
|
|
380
|
-
|
|
384
|
+
function fingerprintOutputContent(content) {
|
|
385
|
+
return createHash("sha256").update(content).digest("hex");
|
|
386
|
+
}
|
|
387
|
+
async function fingerprintOutputDirectory(directory, relativeDirectory = "", metrics, knownChecksums) {
|
|
381
388
|
const entries = await readdir(directory, { withFileTypes: true }).catch(
|
|
382
389
|
(error) => {
|
|
383
390
|
if (isMissingDirectoryError(error)) return void 0;
|
|
@@ -395,14 +402,24 @@ async function fingerprintOutputDirectory(directory, relativeDirectory = "", met
|
|
|
395
402
|
if (entry.isDirectory()) {
|
|
396
403
|
Object.assign(
|
|
397
404
|
inventory,
|
|
398
|
-
await fingerprintOutputDirectory(
|
|
405
|
+
await fingerprintOutputDirectory(
|
|
406
|
+
file,
|
|
407
|
+
relativePath,
|
|
408
|
+
metrics,
|
|
409
|
+
knownChecksums
|
|
410
|
+
)
|
|
399
411
|
);
|
|
400
412
|
continue;
|
|
401
413
|
}
|
|
402
414
|
if (entry.isFile()) {
|
|
415
|
+
const knownChecksum = knownChecksums?.get(relativePath);
|
|
416
|
+
if (knownChecksum !== void 0) {
|
|
417
|
+
inventory[relativePath] = knownChecksum;
|
|
418
|
+
continue;
|
|
419
|
+
}
|
|
403
420
|
const hashedAt = performance.now();
|
|
404
421
|
const content = await readFile(file);
|
|
405
|
-
inventory[relativePath] =
|
|
422
|
+
inventory[relativePath] = fingerprintOutputContent(content);
|
|
406
423
|
if (metrics) {
|
|
407
424
|
metrics.outputHashValidationDurationMs += performance.now() - hashedAt;
|
|
408
425
|
metrics.outputFilesHashed += 1;
|
|
@@ -740,6 +757,7 @@ import { constants } from "node:fs";
|
|
|
740
757
|
import {
|
|
741
758
|
copyFile,
|
|
742
759
|
cp,
|
|
760
|
+
link,
|
|
743
761
|
lstat,
|
|
744
762
|
mkdir,
|
|
745
763
|
readFile as readFile2,
|
|
@@ -783,14 +801,18 @@ async function createBuildArtifactWriter(input) {
|
|
|
783
801
|
ensureOpen(completed);
|
|
784
802
|
const target = resolveArtifactPath(stagingDirectory, path12);
|
|
785
803
|
await mkdir(dirname2(target), { recursive: true });
|
|
786
|
-
await
|
|
804
|
+
await replaceArtifactFile(target, data);
|
|
787
805
|
},
|
|
788
806
|
async copyFileFrom(source, path12) {
|
|
789
807
|
ensureOpen(completed);
|
|
790
808
|
const target = resolveArtifactPath(stagingDirectory, path12);
|
|
791
809
|
await mkdir(dirname2(target), { recursive: true });
|
|
792
810
|
await rm(target, { force: true });
|
|
793
|
-
|
|
811
|
+
try {
|
|
812
|
+
await link(source, target);
|
|
813
|
+
} catch {
|
|
814
|
+
await copyFile(source, target, constants.COPYFILE_FICLONE);
|
|
815
|
+
}
|
|
794
816
|
},
|
|
795
817
|
async publish() {
|
|
796
818
|
ensureOpen(completed);
|
|
@@ -807,6 +829,21 @@ async function createBuildArtifactWriter(input) {
|
|
|
807
829
|
function ensureOpen(completed) {
|
|
808
830
|
if (completed) throw new Error("Build artifact writer is already closed.");
|
|
809
831
|
}
|
|
832
|
+
async function replaceArtifactFile(target, data) {
|
|
833
|
+
const temporaryPath = `${target}.${randomUUID()}.tmp`;
|
|
834
|
+
try {
|
|
835
|
+
await writeFile(temporaryPath, data);
|
|
836
|
+
try {
|
|
837
|
+
await rename(temporaryPath, target);
|
|
838
|
+
} catch {
|
|
839
|
+
await rm(target, { force: true });
|
|
840
|
+
await rename(temporaryPath, target);
|
|
841
|
+
}
|
|
842
|
+
} catch (error) {
|
|
843
|
+
await rm(temporaryPath, { force: true }).catch(() => void 0);
|
|
844
|
+
throw error;
|
|
845
|
+
}
|
|
846
|
+
}
|
|
810
847
|
function resolveArtifactPath(directory, path12) {
|
|
811
848
|
return resolveWithinDirectory(directory, path12, "Build artifact path");
|
|
812
849
|
}
|
|
@@ -1244,17 +1281,33 @@ async function verifyNoChangeFastPath(input) {
|
|
|
1244
1281
|
)) {
|
|
1245
1282
|
return { used: false, blockReason: "output-cache-incomplete" };
|
|
1246
1283
|
}
|
|
1284
|
+
const knownChecksums = await matchingOutputChecksums(
|
|
1285
|
+
input.outputDirectory,
|
|
1286
|
+
cache.finalOutputInventory,
|
|
1287
|
+
cache.finalOutputStats
|
|
1288
|
+
);
|
|
1247
1289
|
const inventoryStartedAt = performance3.now();
|
|
1248
1290
|
const currentInventory = await fingerprintOutputDirectory(
|
|
1249
1291
|
input.outputDirectory,
|
|
1250
1292
|
"",
|
|
1251
|
-
input.metrics
|
|
1293
|
+
input.metrics,
|
|
1294
|
+
knownChecksums
|
|
1252
1295
|
);
|
|
1253
1296
|
if (input.metrics)
|
|
1254
1297
|
input.metrics.outputInventoryValidationDurationMs += performance3.now() - inventoryStartedAt;
|
|
1255
1298
|
if (!inventoriesEqual(cache.finalOutputInventory, currentInventory)) {
|
|
1256
1299
|
return { used: false, blockReason: "output-inventory-mismatch" };
|
|
1257
1300
|
}
|
|
1301
|
+
const currentStats = await collectOutputFileStats(
|
|
1302
|
+
input.outputDirectory,
|
|
1303
|
+
cache.finalOutputInventory
|
|
1304
|
+
);
|
|
1305
|
+
if (!outputStatsEqual(cache.finalOutputStats, currentStats)) {
|
|
1306
|
+
await saveFastPathCache(fastPathCachePath(outputCachePath), {
|
|
1307
|
+
...cache,
|
|
1308
|
+
finalOutputStats: currentStats
|
|
1309
|
+
}).catch(() => void 0);
|
|
1310
|
+
}
|
|
1258
1311
|
return { used: true };
|
|
1259
1312
|
}
|
|
1260
1313
|
async function loadOutputCacheMetadata(path12, timingsMs, log = () => {
|
|
@@ -1349,7 +1402,7 @@ async function saveOutputCache(path12, state, outputDirectory, timingsMs) {
|
|
|
1349
1402
|
if (state.finalOutputInventory && state.configFile) {
|
|
1350
1403
|
await saveFastPathCache(
|
|
1351
1404
|
fastPathCachePath(path12),
|
|
1352
|
-
createFastPathCacheState(state, checksum),
|
|
1405
|
+
await createFastPathCacheState(state, checksum, outputDirectory),
|
|
1353
1406
|
timingsMs
|
|
1354
1407
|
);
|
|
1355
1408
|
}
|
|
@@ -1374,14 +1427,22 @@ function isOutputInventory(value) {
|
|
|
1374
1427
|
([outputPath, checksum]) => isSafeLogicalOutputPath(outputPath) && isChecksum(checksum)
|
|
1375
1428
|
);
|
|
1376
1429
|
}
|
|
1430
|
+
function isOutputFileStats(value) {
|
|
1431
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) && Object.entries(value).every(
|
|
1432
|
+
([outputPath, stats]) => isSafeLogicalOutputPath(outputPath) && typeof stats === "object" && stats !== null && isOptionalNonNegativeNumber(stats.size) && stats.size !== void 0 && isOptionalNonNegativeNumber(stats.modifiedAtMs) && stats.modifiedAtMs !== void 0
|
|
1433
|
+
);
|
|
1434
|
+
}
|
|
1377
1435
|
function isOutputCacheEntries(value) {
|
|
1378
1436
|
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
1379
1437
|
return false;
|
|
1380
1438
|
}
|
|
1381
1439
|
return Object.entries(value).every(
|
|
1382
|
-
([outputPath, entry]) => isSafeLogicalOutputPath(outputPath) && typeof entry === "object" && entry !== null && typeof entry.cachePath === "string" && entry.cachePath === outputCacheEntryName(outputPath) && isChecksum(entry.checksum)
|
|
1440
|
+
([outputPath, entry]) => isSafeLogicalOutputPath(outputPath) && typeof entry === "object" && entry !== null && typeof entry.cachePath === "string" && entry.cachePath === outputCacheEntryName(outputPath) && isChecksum(entry.checksum) && isOptionalNonNegativeNumber(entry.size) && isOptionalNonNegativeNumber(entry.modifiedAtMs)
|
|
1383
1441
|
);
|
|
1384
1442
|
}
|
|
1443
|
+
function isOptionalNonNegativeNumber(value) {
|
|
1444
|
+
return value === void 0 || typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
1445
|
+
}
|
|
1385
1446
|
function outputCacheEntriesPath(outputCachePath) {
|
|
1386
1447
|
return outputCachePath.replace(/\.json$/, ".entries");
|
|
1387
1448
|
}
|
|
@@ -1395,7 +1456,10 @@ async function saveOutputCacheEntries(directory, outputDirectory, outputs, final
|
|
|
1395
1456
|
if (existing.cachePath !== outputCacheEntryName(outputPath) || !isChecksum(existing.checksum)) {
|
|
1396
1457
|
throw new Error(`Invalid SSG output cache entry: ${outputPath}`);
|
|
1397
1458
|
}
|
|
1398
|
-
entries[outputPath] =
|
|
1459
|
+
entries[outputPath] = await withOutputCacheEntryStat(
|
|
1460
|
+
existing,
|
|
1461
|
+
join4(directory, existing.cachePath)
|
|
1462
|
+
);
|
|
1399
1463
|
continue;
|
|
1400
1464
|
}
|
|
1401
1465
|
const source = resolveOutputCacheFile(outputDirectory, outputPath);
|
|
@@ -1408,13 +1472,24 @@ async function saveOutputCacheEntries(directory, outputDirectory, outputs, final
|
|
|
1408
1472
|
if (!cachedChecksum) {
|
|
1409
1473
|
throw new Error(`Could not checksum cached output: ${outputPath}`);
|
|
1410
1474
|
}
|
|
1411
|
-
entries[outputPath] =
|
|
1475
|
+
entries[outputPath] = await withOutputCacheEntryStat(
|
|
1476
|
+
{ cachePath, checksum: cachedChecksum },
|
|
1477
|
+
destination
|
|
1478
|
+
);
|
|
1412
1479
|
continue;
|
|
1413
1480
|
}
|
|
1414
|
-
entries[outputPath] =
|
|
1481
|
+
entries[outputPath] = await withOutputCacheEntryStat(
|
|
1482
|
+
{ cachePath, checksum },
|
|
1483
|
+
destination
|
|
1484
|
+
);
|
|
1415
1485
|
}
|
|
1416
1486
|
return entries;
|
|
1417
1487
|
}
|
|
1488
|
+
async function withOutputCacheEntryStat(entry, path12) {
|
|
1489
|
+
const info = await lstat2(path12).catch(() => void 0);
|
|
1490
|
+
if (!info?.isFile() || info.isSymbolicLink()) return entry;
|
|
1491
|
+
return { ...entry, size: info.size, modifiedAtMs: info.mtimeMs };
|
|
1492
|
+
}
|
|
1418
1493
|
async function validateOutputCacheEntries(outputCachePath, entries, timingsMs) {
|
|
1419
1494
|
try {
|
|
1420
1495
|
const directory = outputCacheEntriesPath(outputCachePath);
|
|
@@ -1432,16 +1507,24 @@ async function validateOutputCacheEntries(outputCachePath, entries, timingsMs) {
|
|
|
1432
1507
|
return;
|
|
1433
1508
|
}
|
|
1434
1509
|
const path12 = resolveOutputCacheFile(directory, entry.cachePath);
|
|
1435
|
-
|
|
1510
|
+
const info = await lstat2(path12).catch(() => void 0);
|
|
1511
|
+
if (!info?.isFile() || info.isSymbolicLink()) {
|
|
1436
1512
|
valid = false;
|
|
1437
1513
|
return;
|
|
1438
1514
|
}
|
|
1515
|
+
if (entry.size === info.size && entry.modifiedAtMs === info.mtimeMs) {
|
|
1516
|
+
continue;
|
|
1517
|
+
}
|
|
1439
1518
|
if (await measure(
|
|
1440
1519
|
timingsMs,
|
|
1441
1520
|
"outputCacheEntryChecksum",
|
|
1442
1521
|
() => checksumFile(path12)
|
|
1443
|
-
) !== entry.checksum)
|
|
1522
|
+
) !== entry.checksum) {
|
|
1444
1523
|
valid = false;
|
|
1524
|
+
return;
|
|
1525
|
+
}
|
|
1526
|
+
entry.size = info.size;
|
|
1527
|
+
entry.modifiedAtMs = info.mtimeMs;
|
|
1445
1528
|
}
|
|
1446
1529
|
};
|
|
1447
1530
|
await Promise.all(
|
|
@@ -1463,7 +1546,7 @@ async function validateOutputCacheEntries(outputCachePath, entries, timingsMs) {
|
|
|
1463
1546
|
function fastPathCachePath(outputCachePath) {
|
|
1464
1547
|
return outputCachePath.replace(/\.json$/, ".fast-path.json");
|
|
1465
1548
|
}
|
|
1466
|
-
function createFastPathCacheState(state, outputCacheChecksum) {
|
|
1549
|
+
async function createFastPathCacheState(state, outputCacheChecksum, outputDirectory) {
|
|
1467
1550
|
if (!state.finalOutputInventory || !state.configFile) {
|
|
1468
1551
|
throw new Error("SSG output cache is missing fast-path validation data.");
|
|
1469
1552
|
}
|
|
@@ -1472,12 +1555,65 @@ function createFastPathCacheState(state, outputCacheChecksum) {
|
|
|
1472
1555
|
outputCacheChecksum,
|
|
1473
1556
|
appFingerprint: state.appFingerprint,
|
|
1474
1557
|
finalOutputInventory: state.finalOutputInventory,
|
|
1558
|
+
finalOutputStats: await collectOutputFileStats(
|
|
1559
|
+
outputDirectory,
|
|
1560
|
+
state.finalOutputInventory
|
|
1561
|
+
),
|
|
1475
1562
|
publicDirectory: state.publicDirectory,
|
|
1476
1563
|
publicFingerprint: state.publicFingerprint,
|
|
1477
1564
|
configFile: state.configFile,
|
|
1478
1565
|
outputPaths: Object.keys(state.outputs).sort()
|
|
1479
1566
|
};
|
|
1480
1567
|
}
|
|
1568
|
+
async function matchingOutputChecksums(outputDirectory, inventory, stats) {
|
|
1569
|
+
const checksums = /* @__PURE__ */ new Map();
|
|
1570
|
+
if (!stats) return checksums;
|
|
1571
|
+
for (const [outputPath, checksum] of Object.entries(inventory)) {
|
|
1572
|
+
const expected = stats[outputPath];
|
|
1573
|
+
if (!expected) continue;
|
|
1574
|
+
const info = await lstat2(
|
|
1575
|
+
resolveWithinDirectory(
|
|
1576
|
+
outputDirectory,
|
|
1577
|
+
outputPath,
|
|
1578
|
+
"SSG fast-path output path"
|
|
1579
|
+
)
|
|
1580
|
+
).catch(() => void 0);
|
|
1581
|
+
if (info?.isFile() && !info.isSymbolicLink() && outputFileStatMatches(info, expected)) {
|
|
1582
|
+
checksums.set(outputPath, checksum);
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
return checksums;
|
|
1586
|
+
}
|
|
1587
|
+
async function collectOutputFileStats(outputDirectory, inventory) {
|
|
1588
|
+
const stats = {};
|
|
1589
|
+
for (const outputPath of Object.keys(inventory)) {
|
|
1590
|
+
const info = await lstat2(
|
|
1591
|
+
resolveWithinDirectory(
|
|
1592
|
+
outputDirectory,
|
|
1593
|
+
outputPath,
|
|
1594
|
+
"SSG fast-path output path"
|
|
1595
|
+
)
|
|
1596
|
+
).catch(() => void 0);
|
|
1597
|
+
if (info?.isFile() && !info.isSymbolicLink()) {
|
|
1598
|
+
stats[outputPath] = {
|
|
1599
|
+
size: info.size,
|
|
1600
|
+
modifiedAtMs: info.mtimeMs
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
}
|
|
1604
|
+
return stats;
|
|
1605
|
+
}
|
|
1606
|
+
function outputFileStatMatches(info, expected) {
|
|
1607
|
+
return info.size === expected.size && info.mtimeMs === expected.modifiedAtMs;
|
|
1608
|
+
}
|
|
1609
|
+
function outputStatsEqual(left, right) {
|
|
1610
|
+
if (!left) return false;
|
|
1611
|
+
const paths = Object.keys(left);
|
|
1612
|
+
if (paths.length !== Object.keys(right).length) return false;
|
|
1613
|
+
return paths.every(
|
|
1614
|
+
(path12) => right[path12] !== void 0 && left[path12]?.size === right[path12].size && left[path12]?.modifiedAtMs === right[path12].modifiedAtMs
|
|
1615
|
+
);
|
|
1616
|
+
}
|
|
1481
1617
|
async function saveFastPathCache(path12, state, timingsMs) {
|
|
1482
1618
|
const directory = dirname4(path12);
|
|
1483
1619
|
await mkdir3(directory, { recursive: true });
|
|
@@ -1518,7 +1654,7 @@ async function loadFastPathCache(path12) {
|
|
|
1518
1654
|
function isFastPathCacheState(value) {
|
|
1519
1655
|
if (typeof value !== "object" || value === null) return false;
|
|
1520
1656
|
const candidate = value;
|
|
1521
|
-
return candidate.version === 1 && typeof candidate.outputCacheChecksum === "string" && (candidate.appFingerprint === void 0 || typeof candidate.appFingerprint === "string") && isOutputInventory(candidate.finalOutputInventory) && (candidate.publicDirectory === void 0 || typeof candidate.publicDirectory === "string") && (candidate.publicFingerprint === void 0 || typeof candidate.publicFingerprint === "string") && typeof candidate.configFile === "string" && Array.isArray(candidate.outputPaths) && candidate.outputPaths.every(isSafeLogicalOutputPath) && candidate.outputPaths.every(
|
|
1657
|
+
return candidate.version === 1 && typeof candidate.outputCacheChecksum === "string" && (candidate.appFingerprint === void 0 || typeof candidate.appFingerprint === "string") && isOutputInventory(candidate.finalOutputInventory) && (candidate.finalOutputStats === void 0 || isOutputFileStats(candidate.finalOutputStats)) && (candidate.publicDirectory === void 0 || typeof candidate.publicDirectory === "string") && (candidate.publicFingerprint === void 0 || typeof candidate.publicFingerprint === "string") && typeof candidate.configFile === "string" && Array.isArray(candidate.outputPaths) && candidate.outputPaths.every(isSafeLogicalOutputPath) && candidate.outputPaths.every(
|
|
1522
1658
|
(path12, index, paths) => index === 0 || paths[index - 1] < path12
|
|
1523
1659
|
);
|
|
1524
1660
|
}
|
|
@@ -1684,7 +1820,8 @@ async function runSsg(options) {
|
|
|
1684
1820
|
{
|
|
1685
1821
|
dir: options.outDir,
|
|
1686
1822
|
plugins: [redirectPlugin(), ...options.plugins ?? []],
|
|
1687
|
-
extensionMap: options.extensionMap ?? defaultExtensionMap
|
|
1823
|
+
extensionMap: options.extensionMap ?? defaultExtensionMap,
|
|
1824
|
+
...options.concurrency === void 0 ? {} : { concurrency: options.concurrency }
|
|
1688
1825
|
}
|
|
1689
1826
|
)
|
|
1690
1827
|
);
|
|
@@ -1793,6 +1930,7 @@ function riebeckiteSsg(options = {}) {
|
|
|
1793
1930
|
let artifactWriter;
|
|
1794
1931
|
let pendingOutputCache;
|
|
1795
1932
|
let clientBuildArtifacts;
|
|
1933
|
+
const outputChecksums = /* @__PURE__ */ new Map();
|
|
1796
1934
|
return {
|
|
1797
1935
|
name: "riebeckite-ssg",
|
|
1798
1936
|
apply: (_config, env) => env.command === "build",
|
|
@@ -1820,6 +1958,7 @@ function riebeckiteSsg(options = {}) {
|
|
|
1820
1958
|
async buildStart() {
|
|
1821
1959
|
const config = resolvedConfig;
|
|
1822
1960
|
if (!config || config.mode === "client") return;
|
|
1961
|
+
outputChecksums.clear();
|
|
1823
1962
|
if (!publicationOutputDirectory) {
|
|
1824
1963
|
throw new Error(
|
|
1825
1964
|
"Riebeckite SSG could not resolve the publication output directory."
|
|
@@ -2036,6 +2175,7 @@ function riebeckiteSsg(options = {}) {
|
|
|
2036
2175
|
incremental: canUseIncremental,
|
|
2037
2176
|
plugins: options.plugins,
|
|
2038
2177
|
extensionMap: options.extensionMap,
|
|
2178
|
+
...options.concurrency === void 0 ? {} : { concurrency: options.concurrency },
|
|
2039
2179
|
write: async (filePath, data) => {
|
|
2040
2180
|
const fileName = relative4(outDir, filePath).replaceAll("\\", "/");
|
|
2041
2181
|
if (!inventoryPaths.has(fileName)) {
|
|
@@ -2067,6 +2207,7 @@ function riebeckiteSsg(options = {}) {
|
|
|
2067
2207
|
"outputWrite",
|
|
2068
2208
|
() => writer.write(fileName, data)
|
|
2069
2209
|
);
|
|
2210
|
+
outputChecksums.set(fileName, fingerprintOutputContent(data));
|
|
2070
2211
|
metrics.emittedOutputCount += 1;
|
|
2071
2212
|
nextOutputCache.outputs[fileName] = {
|
|
2072
2213
|
cachePath: "",
|
|
@@ -2103,6 +2244,10 @@ function riebeckiteSsg(options = {}) {
|
|
|
2103
2244
|
"outputWrite",
|
|
2104
2245
|
() => writer.write(asset.fileName, asset.source)
|
|
2105
2246
|
);
|
|
2247
|
+
outputChecksums.set(
|
|
2248
|
+
asset.fileName,
|
|
2249
|
+
fingerprintOutputContent(asset.source)
|
|
2250
|
+
);
|
|
2106
2251
|
metrics.emittedOutputCount += 1;
|
|
2107
2252
|
nextOutputCache.outputs[asset.fileName] = {
|
|
2108
2253
|
cachePath: "",
|
|
@@ -2142,6 +2287,7 @@ function riebeckiteSsg(options = {}) {
|
|
|
2142
2287
|
path12
|
|
2143
2288
|
)
|
|
2144
2289
|
);
|
|
2290
|
+
outputChecksums.set(path12, cached.checksum);
|
|
2145
2291
|
metrics.emittedOutputCount += 1;
|
|
2146
2292
|
metrics.reusedOutputCount += 1;
|
|
2147
2293
|
nextOutputCache.outputs[path12] = cached;
|
|
@@ -2260,9 +2406,15 @@ function riebeckiteSsg(options = {}) {
|
|
|
2260
2406
|
outputCache.state.finalOutputInventory = await measure(
|
|
2261
2407
|
outputCache.timingsMs,
|
|
2262
2408
|
"outputInventory",
|
|
2263
|
-
() => fingerprintOutputDirectory(
|
|
2409
|
+
() => fingerprintOutputDirectory(
|
|
2410
|
+
outputCache.outDir,
|
|
2411
|
+
"",
|
|
2412
|
+
void 0,
|
|
2413
|
+
outputChecksums
|
|
2414
|
+
)
|
|
2264
2415
|
);
|
|
2265
2416
|
const finalOutputInventory = outputCache.state.finalOutputInventory;
|
|
2417
|
+
const artifactFingerprint = fingerprintOutputInventory(finalOutputInventory);
|
|
2266
2418
|
if (outputCache.provenance && outputCache.content) {
|
|
2267
2419
|
await outputCache.content.attachFinalOutputArtifacts(
|
|
2268
2420
|
outputCache.provenance.buildId,
|
|
@@ -2332,6 +2484,7 @@ function riebeckiteSsg(options = {}) {
|
|
|
2332
2484
|
root: resolvedConfig.root,
|
|
2333
2485
|
outputDirectory,
|
|
2334
2486
|
publicationFingerprint: outputCache.publicationFingerprint,
|
|
2487
|
+
artifactFingerprint,
|
|
2335
2488
|
warn: (message) => this.warn(message)
|
|
2336
2489
|
});
|
|
2337
2490
|
} finally {
|
|
@@ -2406,6 +2559,7 @@ async function writePublicationMarker(input) {
|
|
|
2406
2559
|
createBuildOutputMarker({
|
|
2407
2560
|
outputDirectory: input.outputDirectory,
|
|
2408
2561
|
...input.publicationFingerprint === void 0 ? {} : { publicationFingerprint: input.publicationFingerprint },
|
|
2562
|
+
...input.artifactFingerprint === void 0 ? {} : { artifactFingerprint: input.artifactFingerprint },
|
|
2409
2563
|
completedAt: /* @__PURE__ */ new Date()
|
|
2410
2564
|
})
|
|
2411
2565
|
),
|
|
@@ -2,5 +2,7 @@ import type { NoChangeFastPathOutputMetrics } from "./types.js";
|
|
|
2
2
|
export declare function computeAppFingerprint(root: string, configFile: string | undefined): Promise<string>;
|
|
3
3
|
export declare function computeBundleFingerprint(root: string, configFile: string | undefined): Promise<string>;
|
|
4
4
|
export declare function fingerprintDirectory(directory: string): Promise<string>;
|
|
5
|
-
export declare function
|
|
5
|
+
export declare function fingerprintOutputInventory(inventory: Readonly<Record<string, string>>): string;
|
|
6
|
+
export declare function fingerprintOutputContent(content: string | Uint8Array): string;
|
|
7
|
+
export declare function fingerprintOutputDirectory(directory: string, relativeDirectory?: string, metrics?: NoChangeFastPathOutputMetrics, knownChecksums?: ReadonlyMap<string, string>): Promise<Record<string, string>>;
|
|
6
8
|
export declare function inventoriesEqual(left: Record<string, string>, right: Record<string, string>): boolean;
|
package/dist/src/ssg/runner.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type SsgRunnerOptions = {
|
|
|
6
6
|
readonly write: (path: string, data: string | Uint8Array) => Promise<void>;
|
|
7
7
|
readonly plugins?: ToSsgOptions["plugins"];
|
|
8
8
|
readonly extensionMap?: Record<string, string>;
|
|
9
|
+
readonly concurrency?: number;
|
|
9
10
|
readonly incremental: boolean;
|
|
10
11
|
};
|
|
11
12
|
export declare function runSsg(options: SsgRunnerOptions): Promise<import("hono/ssg").ToSSGResult>;
|
package/dist/src/ssg_plugin.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type RiebeckiteSsgOptions = {
|
|
|
8
8
|
entry?: string;
|
|
9
9
|
plugins?: ToSsgOptions["plugins"];
|
|
10
10
|
extensionMap?: Record<string, string>;
|
|
11
|
+
concurrency?: number;
|
|
11
12
|
};
|
|
12
13
|
export declare function riebeckiteSsg(options?: RiebeckiteSsgOptions): Plugin;
|
|
13
14
|
export declare function shouldApplyRiebeckiteSsg(_config: unknown, env: ConfigEnv): boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riebeckite/honox",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@babel/parser": "^7.29.3",
|
|
43
|
-
"@riebeckite/core": "0.0.
|
|
44
|
-
"@riebeckite/dev-inspector": "0.0.
|
|
45
|
-
"@riebeckite/node": "0.0.
|
|
46
|
-
"@riebeckite/plugin-color-mode": "0.0.
|
|
47
|
-
"@riebeckite/spa": "0.0.
|
|
48
|
-
"@riebeckite/ui": "0.0.
|
|
43
|
+
"@riebeckite/core": "0.0.41",
|
|
44
|
+
"@riebeckite/dev-inspector": "0.0.41",
|
|
45
|
+
"@riebeckite/node": "0.0.41",
|
|
46
|
+
"@riebeckite/plugin-color-mode": "0.0.41",
|
|
47
|
+
"@riebeckite/spa": "0.0.41",
|
|
48
|
+
"@riebeckite/ui": "0.0.41",
|
|
49
49
|
"esbuild": "^0.28.2",
|
|
50
50
|
"hono": "^4.12.25",
|
|
51
51
|
"honox": "0.1.62",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@d2lang/d2": "^0.1.34",
|
|
56
56
|
"@marp-team/marp-core": "^4.4.0",
|
|
57
|
-
"@riebeckite/test": "0.0.
|
|
57
|
+
"@riebeckite/test": "0.0.41",
|
|
58
58
|
"tsx": "^4.22.4"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|