@bagelink/blox 1.15.649 → 1.15.651
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/{shard-runner-DElB_rGY.cjs → shard-runner-CTCqpTrW.cjs} +2 -2
- package/dist/{shard-runner-UWTanGn2.js → shard-runner-PsawGL3I.js} +2 -2
- package/dist/ssg/cli.cjs +13 -3
- package/dist/ssg/cli.mjs +13 -3
- package/dist/ssg/index.cjs +2 -1
- package/dist/ssg/index.d.ts +1 -1
- package/dist/ssg/index.d.ts.map +1 -1
- package/dist/ssg/index.mjs +17 -16
- package/dist/ssg/validate-output.d.ts +9 -0
- package/dist/ssg/validate-output.d.ts.map +1 -1
- package/dist/{validate-output-CT_gD7Dl.cjs → validate-output-DUqTdLHI.cjs} +18 -0
- package/dist/{validate-output-CD1Eq_Jy.js → validate-output-DcEQIZns.js} +38 -20
- package/package.json +1 -1
|
@@ -26,7 +26,7 @@ const node_child_process = require("node:child_process");
|
|
|
26
26
|
const os = require("node:os");
|
|
27
27
|
const path = require("node:path");
|
|
28
28
|
const process = require("node:process");
|
|
29
|
-
const llmArtifacts = require("./validate-output-
|
|
29
|
+
const llmArtifacts = require("./validate-output-DUqTdLHI.cjs");
|
|
30
30
|
const AUTO_SHARD_CAP = Number(process.env.BLOX_SSG_SHARD_CAP) || 6;
|
|
31
31
|
const PREFETCH_BUDGET = Number(process.env.BLOX_SSG_PREFETCH_BUDGET) || 24;
|
|
32
32
|
const SEQUENTIAL_SHARDS = process.env.BLOX_SSG_SEQUENTIAL === "1";
|
|
@@ -166,7 +166,7 @@ async function runSharded(opts) {
|
|
|
166
166
|
}
|
|
167
167
|
if (process.env.BLOX_SSG_LLM !== "0") {
|
|
168
168
|
try {
|
|
169
|
-
const { mergeLlmParts } = await Promise.resolve().then(() => require("./validate-output-
|
|
169
|
+
const { mergeLlmParts } = await Promise.resolve().then(() => require("./validate-output-DUqTdLHI.cjs")).then((n) => n.llmArtifacts);
|
|
170
170
|
const mergeWebsite = website;
|
|
171
171
|
const partFiles = Array.from({ length: total }, (_, i) => path.join(llmPartsDir, `part.${i}.json`));
|
|
172
172
|
const { pages } = await mergeLlmParts({
|
|
@@ -2,7 +2,7 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import process from "node:process";
|
|
5
|
-
import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-
|
|
5
|
+
import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-DcEQIZns.js";
|
|
6
6
|
const AUTO_SHARD_CAP = Number(process.env.BLOX_SSG_SHARD_CAP) || 6;
|
|
7
7
|
const PREFETCH_BUDGET = Number(process.env.BLOX_SSG_PREFETCH_BUDGET) || 24;
|
|
8
8
|
const SEQUENTIAL_SHARDS = process.env.BLOX_SSG_SEQUENTIAL === "1";
|
|
@@ -142,7 +142,7 @@ async function runSharded(opts) {
|
|
|
142
142
|
}
|
|
143
143
|
if (process.env.BLOX_SSG_LLM !== "0") {
|
|
144
144
|
try {
|
|
145
|
-
const { mergeLlmParts } = await import("./validate-output-
|
|
145
|
+
const { mergeLlmParts } = await import("./validate-output-DcEQIZns.js").then((n) => n.C);
|
|
146
146
|
const mergeWebsite = website;
|
|
147
147
|
const partFiles = Array.from({ length: total }, (_, i) => path.join(llmPartsDir, `part.${i}.json`));
|
|
148
148
|
const { pages } = await mergeLlmParts({
|
package/dist/ssg/cli.cjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const process = require("node:process");
|
|
4
4
|
const fs = require("node:fs/promises");
|
|
5
5
|
const ssg_buildGrant = require("./build-grant.cjs");
|
|
6
|
-
const llmArtifacts = require("../validate-output-
|
|
6
|
+
const llmArtifacts = require("../validate-output-DUqTdLHI.cjs");
|
|
7
7
|
function installFetchTimeout() {
|
|
8
8
|
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
9
9
|
const original = globalThis.fetch;
|
|
@@ -58,6 +58,7 @@ async function main() {
|
|
|
58
58
|
let routesCmd = "";
|
|
59
59
|
let siteDataFile = "";
|
|
60
60
|
let validateOutDir = "";
|
|
61
|
+
let validateOutput = process.env.BLOX_SSG_VALIDATE !== "0";
|
|
61
62
|
const passthroughArgs = [];
|
|
62
63
|
const excludePaths = ["/_blox_preview"];
|
|
63
64
|
for (const a of argv) {
|
|
@@ -77,6 +78,8 @@ async function main() {
|
|
|
77
78
|
validateOutDir = "dist";
|
|
78
79
|
} else if (a.startsWith("--validate=")) {
|
|
79
80
|
validateOutDir = a.slice("--validate=".length);
|
|
81
|
+
} else if (a === "--no-validate") {
|
|
82
|
+
validateOutput = false;
|
|
80
83
|
} else if (a.startsWith("--shard=")) {
|
|
81
84
|
const [i, n] = a.slice("--shard=".length).split("/").map(Number);
|
|
82
85
|
if (Number.isInteger(i) && Number.isInteger(n) && n > 0 && i >= 0 && i < n) {
|
|
@@ -101,7 +104,10 @@ Options:
|
|
|
101
104
|
--shard=<i/n> (internal) Render only this shard's slice — set by --shards.
|
|
102
105
|
--routes-cmd=<cmd> Shell command whose stdout (whitespace-separated) is the
|
|
103
106
|
route list. For router-driven sites with no CMS pages.
|
|
104
|
-
--validate[=dir] Validate generated SSG assets (default directory: dist)
|
|
107
|
+
--validate[=dir] Validate generated SSG assets (default directory: dist)
|
|
108
|
+
and exit without prerendering.
|
|
109
|
+
--no-validate Skip the automatic output validation a normal build runs.
|
|
110
|
+
(Also: BLOX_SSG_VALIDATE=0.)
|
|
105
111
|
--help, -h Show this help
|
|
106
112
|
|
|
107
113
|
Environment:
|
|
@@ -141,7 +147,7 @@ Environment:
|
|
|
141
147
|
if (shardsOpt !== null || routesCmd) {
|
|
142
148
|
const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
|
|
143
149
|
const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
|
|
144
|
-
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-
|
|
150
|
+
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-CTCqpTrW.cjs"));
|
|
145
151
|
const code = await runSharded({
|
|
146
152
|
shards: shardsOpt ?? "auto",
|
|
147
153
|
mode,
|
|
@@ -280,6 +286,10 @@ ${"=".repeat(60)}`);
|
|
|
280
286
|
process.exitCode = 1;
|
|
281
287
|
}
|
|
282
288
|
}
|
|
289
|
+
if (validateOutput && shardTotal === 1) {
|
|
290
|
+
await llmArtifacts.validateInternalLinks("dist");
|
|
291
|
+
console.log("[blox-ssg] validated internal links");
|
|
292
|
+
}
|
|
283
293
|
if (productionBuild && shardTotal === 1) {
|
|
284
294
|
const uploadWebsiteId = ((_b = process.env.BLOX_WEBSITE_ID) == null ? void 0 : _b.trim()) || websiteId;
|
|
285
295
|
const manifestExists = await fs.stat("dist/.blox-manifest.json").then(() => true, () => false);
|
package/dist/ssg/cli.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import fs from "node:fs/promises";
|
|
4
4
|
import { resolveBloxBuildGrant } from "./build-grant.mjs";
|
|
5
|
-
import { v as validateSsgOutput, u as uploadBloxManifest, p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, b as buildCollectionResolver, a as prerender } from "../validate-output-
|
|
5
|
+
import { v as validateSsgOutput, u as uploadBloxManifest, p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, b as buildCollectionResolver, a as prerender, c as validateInternalLinks } from "../validate-output-DcEQIZns.js";
|
|
6
6
|
function installFetchTimeout() {
|
|
7
7
|
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
8
8
|
const original = globalThis.fetch;
|
|
@@ -57,6 +57,7 @@ async function main() {
|
|
|
57
57
|
let routesCmd = "";
|
|
58
58
|
let siteDataFile = "";
|
|
59
59
|
let validateOutDir = "";
|
|
60
|
+
let validateOutput = process.env.BLOX_SSG_VALIDATE !== "0";
|
|
60
61
|
const passthroughArgs = [];
|
|
61
62
|
const excludePaths = ["/_blox_preview"];
|
|
62
63
|
for (const a of argv) {
|
|
@@ -76,6 +77,8 @@ async function main() {
|
|
|
76
77
|
validateOutDir = "dist";
|
|
77
78
|
} else if (a.startsWith("--validate=")) {
|
|
78
79
|
validateOutDir = a.slice("--validate=".length);
|
|
80
|
+
} else if (a === "--no-validate") {
|
|
81
|
+
validateOutput = false;
|
|
79
82
|
} else if (a.startsWith("--shard=")) {
|
|
80
83
|
const [i, n] = a.slice("--shard=".length).split("/").map(Number);
|
|
81
84
|
if (Number.isInteger(i) && Number.isInteger(n) && n > 0 && i >= 0 && i < n) {
|
|
@@ -100,7 +103,10 @@ Options:
|
|
|
100
103
|
--shard=<i/n> (internal) Render only this shard's slice — set by --shards.
|
|
101
104
|
--routes-cmd=<cmd> Shell command whose stdout (whitespace-separated) is the
|
|
102
105
|
route list. For router-driven sites with no CMS pages.
|
|
103
|
-
--validate[=dir] Validate generated SSG assets (default directory: dist)
|
|
106
|
+
--validate[=dir] Validate generated SSG assets (default directory: dist)
|
|
107
|
+
and exit without prerendering.
|
|
108
|
+
--no-validate Skip the automatic output validation a normal build runs.
|
|
109
|
+
(Also: BLOX_SSG_VALIDATE=0.)
|
|
104
110
|
--help, -h Show this help
|
|
105
111
|
|
|
106
112
|
Environment:
|
|
@@ -140,7 +146,7 @@ Environment:
|
|
|
140
146
|
if (shardsOpt !== null || routesCmd) {
|
|
141
147
|
const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
|
|
142
148
|
const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
|
|
143
|
-
const { runSharded } = await import("../shard-runner-
|
|
149
|
+
const { runSharded } = await import("../shard-runner-PsawGL3I.js");
|
|
144
150
|
const code = await runSharded({
|
|
145
151
|
shards: shardsOpt ?? "auto",
|
|
146
152
|
mode,
|
|
@@ -279,6 +285,10 @@ ${"=".repeat(60)}`);
|
|
|
279
285
|
process.exitCode = 1;
|
|
280
286
|
}
|
|
281
287
|
}
|
|
288
|
+
if (validateOutput && shardTotal === 1) {
|
|
289
|
+
await validateInternalLinks("dist");
|
|
290
|
+
console.log("[blox-ssg] validated internal links");
|
|
291
|
+
}
|
|
282
292
|
if (productionBuild && shardTotal === 1) {
|
|
283
293
|
const uploadWebsiteId = ((_b = process.env.BLOX_WEBSITE_ID) == null ? void 0 : _b.trim()) || websiteId;
|
|
284
294
|
const manifestExists = await fs.stat("dist/.blox-manifest.json").then(() => true, () => false);
|
package/dist/ssg/index.cjs
CHANGED
|
@@ -22,7 +22,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
-
const llmArtifacts = require("../validate-output-
|
|
25
|
+
const llmArtifacts = require("../validate-output-DUqTdLHI.cjs");
|
|
26
26
|
const ssg_buildGrant = require("./build-grant.cjs");
|
|
27
27
|
const ssg_client = require("../client-AoDTJJXJ.cjs");
|
|
28
28
|
const vue = require("vue");
|
|
@@ -445,6 +445,7 @@ exports.prerender = llmArtifacts.prerender;
|
|
|
445
445
|
exports.resolveManifestProvenance = llmArtifacts.resolveManifestProvenance;
|
|
446
446
|
exports.splitSitemapPathsByLocale = llmArtifacts.splitSitemapPathsByLocale;
|
|
447
447
|
exports.uploadBloxManifest = llmArtifacts.uploadBloxManifest;
|
|
448
|
+
exports.validateInternalLinks = llmArtifacts.validateInternalLinks;
|
|
448
449
|
exports.validateSsgOutput = llmArtifacts.validateSsgOutput;
|
|
449
450
|
exports.parseBloxBuildGrantBody = ssg_buildGrant.parseBloxBuildGrantBody;
|
|
450
451
|
exports.resolveBloxBuildGrant = ssg_buildGrant.resolveBloxBuildGrant;
|
package/dist/ssg/index.d.ts
CHANGED
|
@@ -31,6 +31,6 @@ export { buildJsonLd, extractPageText, generateLlmsFullTxt, generateLlmsTxt, mer
|
|
|
31
31
|
export type { LlmArtifactsConfig, LlmPageEntry } from './llm-artifacts';
|
|
32
32
|
export { resolveManifestProvenance, uploadBloxManifest } from './manifest-upload';
|
|
33
33
|
export type { ManifestProvenance, ManifestUpload } from './manifest-upload';
|
|
34
|
-
export { validateSsgOutput } from './validate-output';
|
|
34
|
+
export { validateInternalLinks, validateSsgOutput } from './validate-output';
|
|
35
35
|
export type { ValidateSsgOutputOptions } from './validate-output';
|
|
36
36
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/ssg/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ssg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC9D,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AACrH,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAA;AAC9E,YAAY,EAAE,cAAc,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAA;AACjF,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAC9D;;;;;;;;;;GAUG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,YAAY,EAAE,YAAY,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAClG,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAC9F,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,O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kBAAkB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC3E,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC5E,YAAY,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA"}
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { d as buildPageHead, e as primaryContextEntry, h as buildJsonLd, i as extractPageText, B as BloxBuildResponseError, j as bloxBuildJson } from "../validate-output-DcEQIZns.js";
|
|
2
|
+
import { k, l, f, m, n, o, q, g, r, s, t, w, x, y, p, a, z, A, u, c, v } from "../validate-output-DcEQIZns.js";
|
|
3
3
|
import { parseBloxBuildGrantBody, resolveBloxBuildGrant } from "./build-grant.mjs";
|
|
4
4
|
import { a as BLOX_HYDRATION_WINDOW_KEY } from "../client-Ce9fRCGH.js";
|
|
5
5
|
import { createSSRApp, h, Suspense } from "vue";
|
|
@@ -402,34 +402,35 @@ export {
|
|
|
402
402
|
BLOX_HYDRATION_WINDOW_KEY,
|
|
403
403
|
BloxBuildResponseError,
|
|
404
404
|
bloxBuildJson,
|
|
405
|
-
|
|
405
|
+
k as bloxBuildRequest,
|
|
406
406
|
buildJsonLd,
|
|
407
407
|
buildPageHead,
|
|
408
|
-
|
|
408
|
+
l as buildSiteHead,
|
|
409
409
|
createBloxSSREntry,
|
|
410
410
|
extractPageText,
|
|
411
411
|
f as fetchCmsSiteData,
|
|
412
412
|
fetchDatastoreSnapshot,
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
413
|
+
m as generateLlmsFullTxt,
|
|
414
|
+
n as generateLlmsTxt,
|
|
415
|
+
o as generateNetlifyRedirects,
|
|
416
|
+
q as generateRobotsTxt,
|
|
417
417
|
g as generateSitemapArtifacts,
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
418
|
+
r as generateSitemapIndexXml,
|
|
419
|
+
s as generateSitemapXml,
|
|
420
|
+
t as getBloxBuildRequestOptions,
|
|
421
|
+
w as getSiteIconFlags,
|
|
422
|
+
x as localeSitemapPath,
|
|
423
|
+
y as mergeLlmParts,
|
|
424
424
|
parseBloxBuildGrantBody,
|
|
425
425
|
p as polyfillBloxSsgGlobals,
|
|
426
426
|
a as prerender,
|
|
427
427
|
querySnapshotRows,
|
|
428
428
|
renderBloxSsgPage,
|
|
429
429
|
resolveBloxBuildGrant,
|
|
430
|
-
|
|
430
|
+
z as resolveManifestProvenance,
|
|
431
431
|
snapshotRows,
|
|
432
|
-
|
|
432
|
+
A as splitSitemapPathsByLocale,
|
|
433
433
|
u as uploadBloxManifest,
|
|
434
|
+
c as validateInternalLinks,
|
|
434
435
|
v as validateSsgOutput
|
|
435
436
|
};
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fail when any prerendered page contains a relative internal link.
|
|
3
|
+
*
|
|
4
|
+
* A prerendered site is a tree of static files, so `<a href="contact">` on
|
|
5
|
+
* `/about` resolves to `/about/contact` for the browser — navigation silently
|
|
6
|
+
* breaks. This is the one check a normal build runs automatically (see
|
|
7
|
+
* `cli.ts`); the fuller `validateSsgOutput` stays opt-in via `--validate`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function validateInternalLinks(outDir: string): Promise<void>;
|
|
1
10
|
export interface ValidateSsgOutputOptions {
|
|
2
11
|
outDir: string;
|
|
3
12
|
requireFiles?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-output.d.ts","sourceRoot":"","sources":["../../src/ssg/validate-output.ts"],"names":[],"mappings":"AASA,MAAM,WAAW,wBAAwB;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAOD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2DxF"}
|
|
1
|
+
{"version":3,"file":"validate-output.d.ts","sourceRoot":"","sources":["../../src/ssg/validate-output.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBzE;AAED,MAAM,WAAW,wBAAwB;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;IACvB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAOD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2DxF"}
|
|
@@ -1320,6 +1320,23 @@ const sitemapIndexEntry = /<sitemap>\s*<loc>[^<]+<\/loc>/gm;
|
|
|
1320
1320
|
const sitemapLoc = /<loc>([^<]+)<\/loc>/;
|
|
1321
1321
|
const loadingShell = /class=["'][^"']*\bblox-initial-loading\b/;
|
|
1322
1322
|
const embeddedCmsState = /\b__BLOX_HYDRATION__\b/;
|
|
1323
|
+
async function validateInternalLinks(outDir) {
|
|
1324
|
+
const root = path.resolve(outDir);
|
|
1325
|
+
const failures = [];
|
|
1326
|
+
for (const file of await collectHtmlFiles(root)) {
|
|
1327
|
+
const name = path.relative(root, file);
|
|
1328
|
+
const html = await fs.readFile(file, "utf8");
|
|
1329
|
+
for (const href of relativeInternalLinks(html)) {
|
|
1330
|
+
failures.push(
|
|
1331
|
+
`${name}: relative internal link "${href}" — resolves against this page (e.g. "/about" + "contact" → "/about/contact"). Use a root-relative path ("/contact") or an absolute URL.`
|
|
1332
|
+
);
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
if (failures.length) {
|
|
1336
|
+
throw new Error(`Invalid Blox SSG output:
|
|
1337
|
+
${failures.map((item) => ` - ${item}`).join("\n")}`);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1323
1340
|
const anchorHref = /<a\b[^>]*\shref=["']([^"']*)["']/gi;
|
|
1324
1341
|
const ABSOLUTE_OR_SPECIAL = /^(?:[a-z][a-z0-9+.-]*:|\/\/|\/|#|\?|$)/i;
|
|
1325
1342
|
async function validateSsgOutput(options) {
|
|
@@ -1451,4 +1468,5 @@ exports.primaryContextEntry = primaryContextEntry;
|
|
|
1451
1468
|
exports.resolveManifestProvenance = resolveManifestProvenance;
|
|
1452
1469
|
exports.splitSitemapPathsByLocale = splitSitemapPathsByLocale;
|
|
1453
1470
|
exports.uploadBloxManifest = uploadBloxManifest;
|
|
1471
|
+
exports.validateInternalLinks = validateInternalLinks;
|
|
1454
1472
|
exports.validateSsgOutput = validateSsgOutput;
|
|
@@ -1297,6 +1297,23 @@ const sitemapIndexEntry = /<sitemap>\s*<loc>[^<]+<\/loc>/gm;
|
|
|
1297
1297
|
const sitemapLoc = /<loc>([^<]+)<\/loc>/;
|
|
1298
1298
|
const loadingShell = /class=["'][^"']*\bblox-initial-loading\b/;
|
|
1299
1299
|
const embeddedCmsState = /\b__BLOX_HYDRATION__\b/;
|
|
1300
|
+
async function validateInternalLinks(outDir) {
|
|
1301
|
+
const root = path.resolve(outDir);
|
|
1302
|
+
const failures = [];
|
|
1303
|
+
for (const file of await collectHtmlFiles(root)) {
|
|
1304
|
+
const name = path.relative(root, file);
|
|
1305
|
+
const html = await fs.readFile(file, "utf8");
|
|
1306
|
+
for (const href of relativeInternalLinks(html)) {
|
|
1307
|
+
failures.push(
|
|
1308
|
+
`${name}: relative internal link "${href}" — resolves against this page (e.g. "/about" + "contact" → "/about/contact"). Use a root-relative path ("/contact") or an absolute URL.`
|
|
1309
|
+
);
|
|
1310
|
+
}
|
|
1311
|
+
}
|
|
1312
|
+
if (failures.length) {
|
|
1313
|
+
throw new Error(`Invalid Blox SSG output:
|
|
1314
|
+
${failures.map((item) => ` - ${item}`).join("\n")}`);
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1300
1317
|
const anchorHref = /<a\b[^>]*\shref=["']([^"']*)["']/gi;
|
|
1301
1318
|
const ABSOLUTE_OR_SPECIAL = /^(?:[a-z][a-z0-9+.-]*:|\/\/|\/|#|\?|$)/i;
|
|
1302
1319
|
async function validateSsgOutput(options) {
|
|
@@ -1402,32 +1419,33 @@ async function validateSitemap(outDir, content) {
|
|
|
1402
1419
|
return failures;
|
|
1403
1420
|
}
|
|
1404
1421
|
export {
|
|
1405
|
-
|
|
1422
|
+
splitSitemapPathsByLocale as A,
|
|
1406
1423
|
BloxBuildResponseError as B,
|
|
1424
|
+
llmArtifacts as C,
|
|
1407
1425
|
prerender as a,
|
|
1408
1426
|
buildCollectionResolver as b,
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1427
|
+
validateInternalLinks as c,
|
|
1428
|
+
buildPageHead as d,
|
|
1429
|
+
primaryContextEntry as e,
|
|
1412
1430
|
fetchCmsSiteData as f,
|
|
1413
1431
|
generateSitemapArtifacts as g,
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1432
|
+
buildJsonLd as h,
|
|
1433
|
+
extractPageText as i,
|
|
1434
|
+
bloxBuildJson as j,
|
|
1435
|
+
bloxBuildRequest as k,
|
|
1436
|
+
buildSiteHead as l,
|
|
1437
|
+
generateLlmsFullTxt as m,
|
|
1438
|
+
generateLlmsTxt as n,
|
|
1439
|
+
generateNetlifyRedirects as o,
|
|
1422
1440
|
polyfillBloxSsgGlobals as p,
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1441
|
+
generateRobotsTxt as q,
|
|
1442
|
+
generateSitemapIndexXml as r,
|
|
1443
|
+
generateSitemapXml as s,
|
|
1444
|
+
getBloxBuildRequestOptions as t,
|
|
1427
1445
|
uploadBloxManifest as u,
|
|
1428
1446
|
validateSsgOutput as v,
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1447
|
+
getSiteIconFlags as w,
|
|
1448
|
+
localeSitemapPath as x,
|
|
1449
|
+
mergeLlmParts as y,
|
|
1450
|
+
resolveManifestProvenance as z
|
|
1433
1451
|
};
|
package/package.json
CHANGED