@bagelink/blox 1.15.651 → 1.15.653

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.
@@ -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-DUqTdLHI.cjs");
29
+ const llmArtifacts = require("./validate-output-BdzD7fIN.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-DUqTdLHI.cjs")).then((n) => n.llmArtifacts);
169
+ const { mergeLlmParts } = await Promise.resolve().then(() => require("./validate-output-BdzD7fIN.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-DcEQIZns.js";
5
+ import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-CgacFje9.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-DcEQIZns.js").then((n) => n.C);
145
+ const { mergeLlmParts } = await import("./validate-output-CgacFje9.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-DUqTdLHI.cjs");
6
+ const llmArtifacts = require("../validate-output-BdzD7fIN.cjs");
7
7
  function installFetchTimeout() {
8
8
  const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
9
9
  const original = globalThis.fetch;
@@ -147,7 +147,7 @@ Environment:
147
147
  if (shardsOpt !== null || routesCmd) {
148
148
  const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
149
149
  const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
150
- const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-CTCqpTrW.cjs"));
150
+ const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-C4JE4ywf.cjs"));
151
151
  const code = await runSharded({
152
152
  shards: shardsOpt ?? "auto",
153
153
  mode,
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, c as validateInternalLinks } from "../validate-output-DcEQIZns.js";
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-CgacFje9.js";
6
6
  function installFetchTimeout() {
7
7
  const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
8
8
  const original = globalThis.fetch;
@@ -146,7 +146,7 @@ Environment:
146
146
  if (shardsOpt !== null || routesCmd) {
147
147
  const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
148
148
  const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
149
- const { runSharded } = await import("../shard-runner-PsawGL3I.js");
149
+ const { runSharded } = await import("../shard-runner-CtJLkov_.js");
150
150
  const code = await runSharded({
151
151
  shards: shardsOpt ?? "auto",
152
152
  mode,
@@ -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-DUqTdLHI.cjs");
25
+ const llmArtifacts = require("../validate-output-BdzD7fIN.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");
@@ -1,5 +1,5 @@
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";
1
+ import { d as buildPageHead, e as primaryContextEntry, h as buildJsonLd, i as extractPageText, B as BloxBuildResponseError, j as bloxBuildJson } from "../validate-output-CgacFje9.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-CgacFje9.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";
@@ -1 +1 @@
1
- {"version":3,"file":"prerender.d.ts","sourceRoot":"","sources":["../../src/ssg/prerender.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAiBvE,KAAK,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,CAAA;AAEhE,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,YAAY,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,CAAA;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,yDAAyD;IACzD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,6FAA6F;IAC7F,0BAA0B,CAAC,EAAE,MAAM,CAAA;IACnC,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,iFAAiF;IACjF,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACrB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,CAAA;IA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],"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"}
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;AAqBD,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmExF"}
@@ -924,7 +924,7 @@ async function prerender({
924
924
  redirects = [],
925
925
  llm = {}
926
926
  } = {}) {
927
- var _a, _b, _c;
927
+ var _a, _b, _c, _d, _e, _f;
928
928
  const absRoot = path.resolve(root);
929
929
  const absClient = path.resolve(absRoot, clientOutDir);
930
930
  const absServerEntry = path.resolve(absRoot, serverEntry);
@@ -1079,7 +1079,7 @@ async function prerender({
1079
1079
  const canonicalBase = (((_a = website == null ? void 0 : website.seo) == null ? void 0 : _a.canonical_base_url) || (website == null ? void 0 : website.domain) || "").replace(/\/$/, "");
1080
1080
  if (writeSharedAssets) {
1081
1081
  const sitemapPaths = rendered.filter((p) => !noindexPaths.has(p));
1082
- if (canonicalBase && sitemapPaths.length > 0) {
1082
+ if (!((_b = website == null ? void 0 : website.seo) == null ? void 0 : _b.noindex) && canonicalBase && sitemapPaths.length > 0) {
1083
1083
  const artifacts = generateSitemapArtifacts({
1084
1084
  routes: sitemapPaths.map((routePath) => ({
1085
1085
  path: routePath,
@@ -1088,7 +1088,7 @@ async function prerender({
1088
1088
  canonicalBase,
1089
1089
  defaultLocale: (website == null ? void 0 : website.default_locale) ?? "en",
1090
1090
  supportedLocales: (website == null ? void 0 : website.supported_locales) ?? [(website == null ? void 0 : website.default_locale) ?? "en"],
1091
- splitByLocale: (_b = website == null ? void 0 : website.seo) == null ? void 0 : _b.sitemap_split_by_locale
1091
+ splitByLocale: (_c = website == null ? void 0 : website.seo) == null ? void 0 : _c.sitemap_split_by_locale
1092
1092
  });
1093
1093
  for (const artifact of artifacts) {
1094
1094
  await fs.writeFile(
@@ -1103,10 +1103,28 @@ async function prerender({
1103
1103
  const robotsTxt = generateRobotsTxt({
1104
1104
  robotsTxt: website == null ? void 0 : website.robots_txt,
1105
1105
  canonicalBase,
1106
- noindex: (_c = website == null ? void 0 : website.seo) == null ? void 0 : _c.noindex
1106
+ noindex: (_d = website == null ? void 0 : website.seo) == null ? void 0 : _d.noindex
1107
1107
  });
1108
1108
  await fs.writeFile(path.join(absClient, "robots.txt"), robotsTxt, "utf8");
1109
1109
  console.log(" Generated robots.txt");
1110
+ if ((_e = website == null ? void 0 : website.seo) == null ? void 0 : _e.noindex) {
1111
+ const headersPath = path.join(absClient, "_headers");
1112
+ let existing = "";
1113
+ try {
1114
+ existing = await fs.readFile(headersPath, "utf8");
1115
+ } catch {
1116
+ }
1117
+ if (!existing.includes("X-Robots-Tag")) {
1118
+ await fs.writeFile(
1119
+ headersPath,
1120
+ `/*
1121
+ X-Robots-Tag: noindex, nofollow
1122
+ ${existing}`,
1123
+ "utf8"
1124
+ );
1125
+ console.log(" Generated _headers (X-Robots-Tag: noindex)");
1126
+ }
1127
+ }
1110
1128
  if (redirects.length > 0) {
1111
1129
  const redirectsContent = generateNetlifyRedirects(redirects);
1112
1130
  const redirectsPath = path.join(absClient, "_redirects");
@@ -1118,7 +1136,7 @@ async function prerender({
1118
1136
  await fs.writeFile(redirectsPath, redirectsContent + existing, "utf8");
1119
1137
  console.log(` Generated _redirects (${redirects.length} rules)`);
1120
1138
  }
1121
- if (llmEnabled && llm.writeIndex !== false && llmPages.length > 0) {
1139
+ if (!((_f = website == null ? void 0 : website.seo) == null ? void 0 : _f.noindex) && llmEnabled && llm.writeIndex !== false && llmPages.length > 0) {
1122
1140
  const indexable = llmPages.filter((p) => !noindexPaths.has(p.url));
1123
1141
  const llmsTxt = generateLlmsTxt({ website, pages: indexable, config: llm });
1124
1142
  await fs.writeFile(path.join(absClient, "llms.txt"), llmsTxt, "utf8");
@@ -1339,6 +1357,14 @@ ${failures.map((item) => ` - ${item}`).join("\n")}`);
1339
1357
  }
1340
1358
  const anchorHref = /<a\b[^>]*\shref=["']([^"']*)["']/gi;
1341
1359
  const ABSOLUTE_OR_SPECIAL = /^(?:[a-z][a-z0-9+.-]*:|\/\/|\/|#|\?|$)/i;
1360
+ async function readSiteNoindex(outDir) {
1361
+ try {
1362
+ const robots = await fs.readFile(path.join(outDir, "robots.txt"), "utf8");
1363
+ return /^\s*Disallow:\s*\/\s*$/im.test(robots);
1364
+ } catch {
1365
+ return false;
1366
+ }
1367
+ }
1342
1368
  async function validateSsgOutput(options) {
1343
1369
  const outDir = path.resolve(options.outDir);
1344
1370
  const failures = [];
@@ -1374,10 +1400,13 @@ async function validateSsgOutput(options) {
1374
1400
  }
1375
1401
  if (!htmlFiles.length) failures.push("output contains no HTML files");
1376
1402
  if (!hydratedFiles) failures.push("output contains no prerendered Blox hydration state");
1403
+ const siteNoindex = await readSiteNoindex(outDir);
1404
+ const optionalWhenNoindex = /* @__PURE__ */ new Set(["sitemap.xml", "llms.txt", "llms-full.txt"]);
1377
1405
  for (const required of requiredFiles) {
1406
+ if (siteNoindex && optionalWhenNoindex.has(required)) continue;
1378
1407
  try {
1379
1408
  const content = await fs.readFile(path.join(outDir, required), "utf8");
1380
- if (required === "robots.txt" && /^Disallow:\s*\/\s*$/im.test(content)) {
1409
+ if (required === "robots.txt" && !siteNoindex && /^Disallow:\s*\/\s*$/im.test(content)) {
1381
1410
  failures.push("robots.txt blocks the entire site");
1382
1411
  }
1383
1412
  if (required === "llms.txt" && !/^- \[[^\]]+\]\([^)]+\)/m.test(content)) {
@@ -901,7 +901,7 @@ async function prerender({
901
901
  redirects = [],
902
902
  llm = {}
903
903
  } = {}) {
904
- var _a, _b, _c;
904
+ var _a, _b, _c, _d, _e, _f;
905
905
  const absRoot = path.resolve(root);
906
906
  const absClient = path.resolve(absRoot, clientOutDir);
907
907
  const absServerEntry = path.resolve(absRoot, serverEntry);
@@ -1056,7 +1056,7 @@ async function prerender({
1056
1056
  const canonicalBase = (((_a = website == null ? void 0 : website.seo) == null ? void 0 : _a.canonical_base_url) || (website == null ? void 0 : website.domain) || "").replace(/\/$/, "");
1057
1057
  if (writeSharedAssets) {
1058
1058
  const sitemapPaths = rendered.filter((p) => !noindexPaths.has(p));
1059
- if (canonicalBase && sitemapPaths.length > 0) {
1059
+ if (!((_b = website == null ? void 0 : website.seo) == null ? void 0 : _b.noindex) && canonicalBase && sitemapPaths.length > 0) {
1060
1060
  const artifacts = generateSitemapArtifacts({
1061
1061
  routes: sitemapPaths.map((routePath) => ({
1062
1062
  path: routePath,
@@ -1065,7 +1065,7 @@ async function prerender({
1065
1065
  canonicalBase,
1066
1066
  defaultLocale: (website == null ? void 0 : website.default_locale) ?? "en",
1067
1067
  supportedLocales: (website == null ? void 0 : website.supported_locales) ?? [(website == null ? void 0 : website.default_locale) ?? "en"],
1068
- splitByLocale: (_b = website == null ? void 0 : website.seo) == null ? void 0 : _b.sitemap_split_by_locale
1068
+ splitByLocale: (_c = website == null ? void 0 : website.seo) == null ? void 0 : _c.sitemap_split_by_locale
1069
1069
  });
1070
1070
  for (const artifact of artifacts) {
1071
1071
  await fs.writeFile(
@@ -1080,10 +1080,28 @@ async function prerender({
1080
1080
  const robotsTxt = generateRobotsTxt({
1081
1081
  robotsTxt: website == null ? void 0 : website.robots_txt,
1082
1082
  canonicalBase,
1083
- noindex: (_c = website == null ? void 0 : website.seo) == null ? void 0 : _c.noindex
1083
+ noindex: (_d = website == null ? void 0 : website.seo) == null ? void 0 : _d.noindex
1084
1084
  });
1085
1085
  await fs.writeFile(path.join(absClient, "robots.txt"), robotsTxt, "utf8");
1086
1086
  console.log(" Generated robots.txt");
1087
+ if ((_e = website == null ? void 0 : website.seo) == null ? void 0 : _e.noindex) {
1088
+ const headersPath = path.join(absClient, "_headers");
1089
+ let existing = "";
1090
+ try {
1091
+ existing = await fs.readFile(headersPath, "utf8");
1092
+ } catch {
1093
+ }
1094
+ if (!existing.includes("X-Robots-Tag")) {
1095
+ await fs.writeFile(
1096
+ headersPath,
1097
+ `/*
1098
+ X-Robots-Tag: noindex, nofollow
1099
+ ${existing}`,
1100
+ "utf8"
1101
+ );
1102
+ console.log(" Generated _headers (X-Robots-Tag: noindex)");
1103
+ }
1104
+ }
1087
1105
  if (redirects.length > 0) {
1088
1106
  const redirectsContent = generateNetlifyRedirects(redirects);
1089
1107
  const redirectsPath = path.join(absClient, "_redirects");
@@ -1095,7 +1113,7 @@ async function prerender({
1095
1113
  await fs.writeFile(redirectsPath, redirectsContent + existing, "utf8");
1096
1114
  console.log(` Generated _redirects (${redirects.length} rules)`);
1097
1115
  }
1098
- if (llmEnabled && llm.writeIndex !== false && llmPages.length > 0) {
1116
+ if (!((_f = website == null ? void 0 : website.seo) == null ? void 0 : _f.noindex) && llmEnabled && llm.writeIndex !== false && llmPages.length > 0) {
1099
1117
  const indexable = llmPages.filter((p) => !noindexPaths.has(p.url));
1100
1118
  const llmsTxt = generateLlmsTxt({ website, pages: indexable, config: llm });
1101
1119
  await fs.writeFile(path.join(absClient, "llms.txt"), llmsTxt, "utf8");
@@ -1316,6 +1334,14 @@ ${failures.map((item) => ` - ${item}`).join("\n")}`);
1316
1334
  }
1317
1335
  const anchorHref = /<a\b[^>]*\shref=["']([^"']*)["']/gi;
1318
1336
  const ABSOLUTE_OR_SPECIAL = /^(?:[a-z][a-z0-9+.-]*:|\/\/|\/|#|\?|$)/i;
1337
+ async function readSiteNoindex(outDir) {
1338
+ try {
1339
+ const robots = await fs.readFile(path.join(outDir, "robots.txt"), "utf8");
1340
+ return /^\s*Disallow:\s*\/\s*$/im.test(robots);
1341
+ } catch {
1342
+ return false;
1343
+ }
1344
+ }
1319
1345
  async function validateSsgOutput(options) {
1320
1346
  const outDir = path.resolve(options.outDir);
1321
1347
  const failures = [];
@@ -1351,10 +1377,13 @@ async function validateSsgOutput(options) {
1351
1377
  }
1352
1378
  if (!htmlFiles.length) failures.push("output contains no HTML files");
1353
1379
  if (!hydratedFiles) failures.push("output contains no prerendered Blox hydration state");
1380
+ const siteNoindex = await readSiteNoindex(outDir);
1381
+ const optionalWhenNoindex = /* @__PURE__ */ new Set(["sitemap.xml", "llms.txt", "llms-full.txt"]);
1354
1382
  for (const required of requiredFiles) {
1383
+ if (siteNoindex && optionalWhenNoindex.has(required)) continue;
1355
1384
  try {
1356
1385
  const content = await fs.readFile(path.join(outDir, required), "utf8");
1357
- if (required === "robots.txt" && /^Disallow:\s*\/\s*$/im.test(content)) {
1386
+ if (required === "robots.txt" && !siteNoindex && /^Disallow:\s*\/\s*$/im.test(content)) {
1358
1387
  failures.push("robots.txt blocks the entire site");
1359
1388
  }
1360
1389
  if (required === "llms.txt" && !/^- \[[^\]]+\]\([^)]+\)/m.test(content)) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.15.651",
4
+ "version": "1.15.653",
5
5
  "description": "Blox page builder library for drag-and-drop page building and static data management",
6
6
  "author": {
7
7
  "name": "Bagel Studio",