@bagelink/blox 1.15.595 → 1.15.597

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-DGFLLFbj.cjs");
29
+ const llmArtifacts = require("./validate-output-CMA83qq8.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-DGFLLFbj.cjs")).then((n) => n.llmArtifacts);
169
+ const { mergeLlmParts } = await Promise.resolve().then(() => require("./validate-output-CMA83qq8.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-C4uRifzC.js";
5
+ import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-ThZHvbfr.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-C4uRifzC.js").then((n) => n.A);
145
+ const { mergeLlmParts } = await import("./validate-output-ThZHvbfr.js").then((n) => n.A);
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-DGFLLFbj.cjs");
6
+ const llmArtifacts = require("../validate-output-CMA83qq8.cjs");
7
7
  function installFetchTimeout() {
8
8
  const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
9
9
  const original = globalThis.fetch;
@@ -141,7 +141,7 @@ Environment:
141
141
  if (shardsOpt !== null || routesCmd) {
142
142
  const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
143
143
  const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
144
- const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-BzcFJpLT.cjs"));
144
+ const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-CrkuNTho.cjs"));
145
145
  const code = await runSharded({
146
146
  shards: shardsOpt ?? "auto",
147
147
  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, a as prerender } from "../validate-output-C4uRifzC.js";
5
+ import { v as validateSsgOutput, u as uploadBloxManifest, p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../validate-output-ThZHvbfr.js";
6
6
  function installFetchTimeout() {
7
7
  const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
8
8
  const original = globalThis.fetch;
@@ -140,7 +140,7 @@ Environment:
140
140
  if (shardsOpt !== null || routesCmd) {
141
141
  const { apiBase: apiBase2, websiteName: configWebsiteName2 } = await resolveApiBase(mode);
142
142
  const websiteName2 = process.env.WEBSITE_NAME ?? configWebsiteName2 ?? "default";
143
- const { runSharded } = await import("../shard-runner-DHVf6Vgk.js");
143
+ const { runSharded } = await import("../shard-runner-CuzlaTUr.js");
144
144
  const code = await runSharded({
145
145
  shards: shardsOpt ?? "auto",
146
146
  mode,
@@ -1 +1 @@
1
- {"version":3,"file":"cms-routes.d.ts","sourceRoot":"","sources":["../../src/ssg/cms-routes.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAoB9D,2EAA2E;AAC3E,MAAM,WAAW,aAAa;IAC7B,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,WAAW,WAAW;IAC3B,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,WAAW,CAAA;IACpB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,6DAA6D;IAC7D,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,EAAE,aAAa,EAAE,CAAA;IAC1B,oEAAoE;IACpE,WAAW,EAAE,aAAa,EAAE,CAAA;CAC5B;AAYD;;;GAGG;AACH,wBAAgB,iBAAiB,CAChC,KAAK,EAAE,MAAM,EAAE,EACf,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,MAAM,EAAE,GACxB,MAAM,EAAE,CASV;AA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HtB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,cAAc,GAAE,uBAA4B,GAC1C,OAAO,CAAC,MAAM,EAAE,CAAC,CAGnB"}
@@ -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-DGFLLFbj.cjs");
25
+ const llmArtifacts = require("../validate-output-CMA83qq8.cjs");
26
26
  const ssg_buildGrant = require("./build-grant.cjs");
27
27
  const ssg_client = require("./client.cjs");
28
28
  const vue = require("vue");
@@ -1,5 +1,5 @@
1
- import { b as buildPageHead, c as primaryContextEntry, d as buildJsonLd, e as extractPageText, B as BloxBuildResponseError, h as bloxBuildJson } from "../validate-output-C4uRifzC.js";
2
- import { i, j, k, f, l, m, n, o, g, q, r, s, t, w, x, p, a, y, z, u, v } from "../validate-output-C4uRifzC.js";
1
+ import { b as buildPageHead, c as primaryContextEntry, d as buildJsonLd, e as extractPageText, B as BloxBuildResponseError, h as bloxBuildJson } from "../validate-output-ThZHvbfr.js";
2
+ import { i, j, k, f, l, m, n, o, g, q, r, s, t, w, x, p, a, y, z, u, v } from "../validate-output-ThZHvbfr.js";
3
3
  import { parseBloxBuildGrantBody, resolveBloxBuildGrant } from "./build-grant.mjs";
4
4
  import { BLOX_STATE_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs";
5
5
  import { BLOX_DATA_WINDOW_KEY } from "./client.mjs";
@@ -100,40 +100,38 @@ function localizePath(slug, locale, defaultLocale) {
100
100
  const s = slug === "" || slug === "/" ? "" : slug;
101
101
  return `/${locale}${s}`;
102
102
  }
103
- function expandLocalePaths(paths, defaultLocale, supportedLocales) {
104
- const locales = supportedLocales.length > 0 ? supportedLocales : [defaultLocale];
105
- const out = [];
106
- for (const slug of paths) {
107
- for (const loc of locales) {
108
- out.push(localizePath(slug, loc, defaultLocale));
109
- }
110
- }
111
- return [...new Set(out)];
112
- }
113
103
  async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
114
104
  var _a, _b, _c;
115
105
  const websiteId = requestOptions.websiteId ?? (typeof process !== "undefined" ? (_b = (_a = process.env) == null ? void 0 : _a.BLOX_WEBSITE_ID) == null ? void 0 : _b.trim() : void 0);
116
106
  if (websiteId) {
117
- const bundle = await bloxBuildJson(
107
+ const baseBundle = await bloxBuildJson(
118
108
  `${apiBase}/blox-build/websites/${websiteId}/published`,
119
109
  {},
120
110
  requestOptions
121
111
  );
122
- const website2 = bundle.website;
112
+ const website2 = baseBundle.website;
123
113
  const defaultLocale2 = website2.default_locale || "en";
124
- const paths2 = await expandRoutes(apiBase, bundle.pages, requestOptions, defaultLocale2);
125
- const localizedPaths = expandLocalePaths(
126
- paths2,
127
- defaultLocale2,
128
- website2.supported_locales ?? [defaultLocale2]
129
- );
114
+ const supportedLocales2 = Array.isArray(website2.supported_locales) && website2.supported_locales.length > 0 ? website2.supported_locales : [defaultLocale2];
115
+ const localizedBundles = await Promise.all(supportedLocales2.map(async (locale) => {
116
+ const bundle = locale === defaultLocale2 ? baseBundle : await bloxBuildJson(
117
+ `${apiBase}/blox-build/websites/${websiteId}/published?locale=${encodeURIComponent(locale)}`,
118
+ {},
119
+ requestOptions
120
+ );
121
+ const localePaths = await expandRoutes(apiBase, bundle.pages, requestOptions, locale);
122
+ return {
123
+ locale,
124
+ bundle,
125
+ paths: localePaths.map((path2) => localizePath(path2, locale, defaultLocale2))
126
+ };
127
+ }));
130
128
  return {
131
129
  websiteId,
132
130
  website: website2,
133
- paths: localizedPaths,
134
- pageSlugs: [...new Set(bundle.pages.flatMap((page) => page.slug ? [page.slug] : []))],
135
- redirects: bundle.redirects.filter((redirect) => redirect.from_path && redirect.to_path),
136
- collections: extractCollectionRefs(bundle.pages)
131
+ paths: [...new Set(localizedBundles.flatMap((result) => result.paths))],
132
+ pageSlugs: [...new Set(localizedBundles.flatMap((result) => result.bundle.pages.flatMap((page) => page.slug ? [page.slug] : [])))],
133
+ redirects: baseBundle.redirects.filter((redirect) => redirect.from_path && redirect.to_path),
134
+ collections: extractCollectionRefs(localizedBundles.flatMap((result) => result.bundle.pages))
137
135
  };
138
136
  }
139
137
  const site = await bloxBuildJson(
@@ -77,40 +77,38 @@ function localizePath(slug, locale, defaultLocale) {
77
77
  const s = slug === "" || slug === "/" ? "" : slug;
78
78
  return `/${locale}${s}`;
79
79
  }
80
- function expandLocalePaths(paths, defaultLocale, supportedLocales) {
81
- const locales = supportedLocales.length > 0 ? supportedLocales : [defaultLocale];
82
- const out = [];
83
- for (const slug of paths) {
84
- for (const loc of locales) {
85
- out.push(localizePath(slug, loc, defaultLocale));
86
- }
87
- }
88
- return [...new Set(out)];
89
- }
90
80
  async function fetchCmsSiteData(apiBase, websiteName, requestOptions = {}) {
91
81
  var _a, _b, _c;
92
82
  const websiteId = requestOptions.websiteId ?? (typeof process !== "undefined" ? (_b = (_a = process.env) == null ? void 0 : _a.BLOX_WEBSITE_ID) == null ? void 0 : _b.trim() : void 0);
93
83
  if (websiteId) {
94
- const bundle = await bloxBuildJson(
84
+ const baseBundle = await bloxBuildJson(
95
85
  `${apiBase}/blox-build/websites/${websiteId}/published`,
96
86
  {},
97
87
  requestOptions
98
88
  );
99
- const website2 = bundle.website;
89
+ const website2 = baseBundle.website;
100
90
  const defaultLocale2 = website2.default_locale || "en";
101
- const paths2 = await expandRoutes(apiBase, bundle.pages, requestOptions, defaultLocale2);
102
- const localizedPaths = expandLocalePaths(
103
- paths2,
104
- defaultLocale2,
105
- website2.supported_locales ?? [defaultLocale2]
106
- );
91
+ const supportedLocales2 = Array.isArray(website2.supported_locales) && website2.supported_locales.length > 0 ? website2.supported_locales : [defaultLocale2];
92
+ const localizedBundles = await Promise.all(supportedLocales2.map(async (locale) => {
93
+ const bundle = locale === defaultLocale2 ? baseBundle : await bloxBuildJson(
94
+ `${apiBase}/blox-build/websites/${websiteId}/published?locale=${encodeURIComponent(locale)}`,
95
+ {},
96
+ requestOptions
97
+ );
98
+ const localePaths = await expandRoutes(apiBase, bundle.pages, requestOptions, locale);
99
+ return {
100
+ locale,
101
+ bundle,
102
+ paths: localePaths.map((path2) => localizePath(path2, locale, defaultLocale2))
103
+ };
104
+ }));
107
105
  return {
108
106
  websiteId,
109
107
  website: website2,
110
- paths: localizedPaths,
111
- pageSlugs: [...new Set(bundle.pages.flatMap((page) => page.slug ? [page.slug] : []))],
112
- redirects: bundle.redirects.filter((redirect) => redirect.from_path && redirect.to_path),
113
- collections: extractCollectionRefs(bundle.pages)
108
+ paths: [...new Set(localizedBundles.flatMap((result) => result.paths))],
109
+ pageSlugs: [...new Set(localizedBundles.flatMap((result) => result.bundle.pages.flatMap((page) => page.slug ? [page.slug] : [])))],
110
+ redirects: baseBundle.redirects.filter((redirect) => redirect.from_path && redirect.to_path),
111
+ collections: extractCollectionRefs(localizedBundles.flatMap((result) => result.bundle.pages))
114
112
  };
115
113
  }
116
114
  const site = await bloxBuildJson(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.15.595",
4
+ "version": "1.15.597",
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",