@bagelink/blox 1.15.543 → 1.15.547
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.
|
@@ -29,6 +29,7 @@ const process = require("node:process");
|
|
|
29
29
|
const llmArtifacts = require("./validate-output-Dku8tCir.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
|
+
const SEQUENTIAL_SHARDS = process.env.BLOX_SSG_SEQUENTIAL === "1";
|
|
32
33
|
function resolveShardCount(shards) {
|
|
33
34
|
if (shards === "auto") {
|
|
34
35
|
const cores = os.cpus().length || 4;
|
|
@@ -127,7 +128,18 @@ async function runSharded(opts) {
|
|
|
127
128
|
appPaths: routerPaths
|
|
128
129
|
}), "utf8");
|
|
129
130
|
const start = Date.now();
|
|
130
|
-
|
|
131
|
+
let codes;
|
|
132
|
+
if (total === 1) {
|
|
133
|
+
codes = [await runShard(0, 1, [], opts, llmPartsDir, routePartsDir, siteDataFile)];
|
|
134
|
+
} else if (SEQUENTIAL_SHARDS) {
|
|
135
|
+
codes = [];
|
|
136
|
+
for (let index = 0; index < total; index++) {
|
|
137
|
+
codes.push(await runShard(index, total, [], opts, llmPartsDir, routePartsDir, siteDataFile));
|
|
138
|
+
if (codes[index] !== 0) break;
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
codes = await Promise.all(Array.from({ length: total }, (_, i) => runShard(i, total, [], opts, llmPartsDir, routePartsDir, siteDataFile)));
|
|
142
|
+
}
|
|
131
143
|
const failed = codes.map((code, index) => ({ code, index })).filter(({ code }) => code !== 0);
|
|
132
144
|
if (failed.length) {
|
|
133
145
|
console.error(
|
|
@@ -5,6 +5,7 @@ import process from "node:process";
|
|
|
5
5
|
import { f as fetchCmsSiteData, g as generateSitemapArtifacts } from "./validate-output-XdxaXjgE.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
|
+
const SEQUENTIAL_SHARDS = process.env.BLOX_SSG_SEQUENTIAL === "1";
|
|
8
9
|
function resolveShardCount(shards) {
|
|
9
10
|
if (shards === "auto") {
|
|
10
11
|
const cores = os.cpus().length || 4;
|
|
@@ -103,7 +104,18 @@ async function runSharded(opts) {
|
|
|
103
104
|
appPaths: routerPaths
|
|
104
105
|
}), "utf8");
|
|
105
106
|
const start = Date.now();
|
|
106
|
-
|
|
107
|
+
let codes;
|
|
108
|
+
if (total === 1) {
|
|
109
|
+
codes = [await runShard(0, 1, [], opts, llmPartsDir, routePartsDir, siteDataFile)];
|
|
110
|
+
} else if (SEQUENTIAL_SHARDS) {
|
|
111
|
+
codes = [];
|
|
112
|
+
for (let index = 0; index < total; index++) {
|
|
113
|
+
codes.push(await runShard(index, total, [], opts, llmPartsDir, routePartsDir, siteDataFile));
|
|
114
|
+
if (codes[index] !== 0) break;
|
|
115
|
+
}
|
|
116
|
+
} else {
|
|
117
|
+
codes = await Promise.all(Array.from({ length: total }, (_, i) => runShard(i, total, [], opts, llmPartsDir, routePartsDir, siteDataFile)));
|
|
118
|
+
}
|
|
107
119
|
const failed = codes.map((code, index) => ({ code, index })).filter(({ code }) => code !== 0);
|
|
108
120
|
if (failed.length) {
|
|
109
121
|
console.error(
|
package/dist/ssg/cli.cjs
CHANGED
|
@@ -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-
|
|
144
|
+
const { runSharded } = await Promise.resolve().then(() => require("../shard-runner-Bg091Bud.cjs"));
|
|
145
145
|
const code = await runSharded({
|
|
146
146
|
shards: shardsOpt ?? "auto",
|
|
147
147
|
mode,
|
package/dist/ssg/cli.mjs
CHANGED
|
@@ -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-
|
|
143
|
+
const { runSharded } = await import("../shard-runner-DY4hpGdP.js");
|
|
144
144
|
const code = await runSharded({
|
|
145
145
|
shards: shardsOpt ?? "auto",
|
|
146
146
|
mode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shard-runner.d.ts","sourceRoot":"","sources":["../../src/ssg/shard-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAI9D,MAAM,WAAW,kBAAkB;IAClC,qDAAqD;IACrD,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,YAAY,CAAC,EAAE,uBAAuB,CAAA;IACtC,iFAAiF;IACjF,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,8FAA8F;IAC9F,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;
|
|
1
|
+
{"version":3,"file":"shard-runner.d.ts","sourceRoot":"","sources":["../../src/ssg/shard-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAQH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAI9D,MAAM,WAAW,kBAAkB;IAClC,qDAAqD;IACrD,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,0DAA0D;IAC1D,IAAI,EAAE,MAAM,CAAA;IACZ,uDAAuD;IACvD,OAAO,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,YAAY,CAAC,EAAE,uBAAuB,CAAA;IACtC,iFAAiF;IACjF,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,8FAA8F;IAC9F,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CAClB;AA+ED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA6I1E"}
|
package/package.json
CHANGED