@bagelink/blox 1.15.215 → 1.15.220
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.
|
@@ -63,20 +63,24 @@ async function expandRoutes(apiBase, pages) {
|
|
|
63
63
|
const b = binding;
|
|
64
64
|
if (b.adapter === "datastore" && b.collection != null && b.collection !== "" && b.store != null && b.store !== "" && b.bind_by != null && b.bind_by !== "") {
|
|
65
65
|
try {
|
|
66
|
+
const q = b.filter ? `&q=${encodeURIComponent(b.filter)}` : "";
|
|
66
67
|
const itemsRes = await fetch(
|
|
67
|
-
`${apiBase}/datastore/${b.store}/collections/${b.collection}?limit=200`
|
|
68
|
+
`${apiBase}/datastore/${b.store}/collections/${b.collection}?limit=200${q}`
|
|
68
69
|
);
|
|
69
70
|
const itemsData = await itemsRes.json();
|
|
70
71
|
const items = Array.isArray(itemsData) ? itemsData : itemsData.data ?? [];
|
|
71
72
|
for (const item of items) {
|
|
72
73
|
const bindValue = item[b.bind_by];
|
|
73
|
-
if (bindValue
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
if (typeof bindValue !== "string" || bindValue === "") continue;
|
|
75
|
+
const concrete = slug.replace(
|
|
76
|
+
/:([a-z_]+)/g,
|
|
77
|
+
(_m, p) => {
|
|
78
|
+
const v = p === b.bind_by ? bindValue : item[p];
|
|
79
|
+
return typeof v === "string" ? v : "";
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
if (concrete.includes("//") || concrete.endsWith("/")) continue;
|
|
83
|
+
routes.push(concrete);
|
|
80
84
|
}
|
|
81
85
|
} catch (e) {
|
|
82
86
|
console.warn(` [blox-ssg] Could not expand ${slug}: ${e.message}`);
|
|
@@ -597,6 +601,7 @@ function discoverInternalLinks(html) {
|
|
|
597
601
|
while ((m = hrefRe.exec(html)) !== null) {
|
|
598
602
|
const raw = (m[1] ?? m[2] ?? "").trim();
|
|
599
603
|
if (!raw) continue;
|
|
604
|
+
if (raw.includes("[object Object]") || raw.includes("undefined") || raw.includes("/null")) continue;
|
|
600
605
|
if (raw.startsWith("mailto:") || raw.startsWith("tel:") || raw.startsWith("javascript:") || raw.startsWith("#")) {
|
|
601
606
|
continue;
|
|
602
607
|
}
|
|
@@ -86,20 +86,24 @@ async function expandRoutes(apiBase, pages) {
|
|
|
86
86
|
const b = binding;
|
|
87
87
|
if (b.adapter === "datastore" && b.collection != null && b.collection !== "" && b.store != null && b.store !== "" && b.bind_by != null && b.bind_by !== "") {
|
|
88
88
|
try {
|
|
89
|
+
const q = b.filter ? `&q=${encodeURIComponent(b.filter)}` : "";
|
|
89
90
|
const itemsRes = await fetch(
|
|
90
|
-
`${apiBase}/datastore/${b.store}/collections/${b.collection}?limit=200`
|
|
91
|
+
`${apiBase}/datastore/${b.store}/collections/${b.collection}?limit=200${q}`
|
|
91
92
|
);
|
|
92
93
|
const itemsData = await itemsRes.json();
|
|
93
94
|
const items = Array.isArray(itemsData) ? itemsData : itemsData.data ?? [];
|
|
94
95
|
for (const item of items) {
|
|
95
96
|
const bindValue = item[b.bind_by];
|
|
96
|
-
if (bindValue
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
if (typeof bindValue !== "string" || bindValue === "") continue;
|
|
98
|
+
const concrete = slug.replace(
|
|
99
|
+
/:([a-z_]+)/g,
|
|
100
|
+
(_m, p) => {
|
|
101
|
+
const v = p === b.bind_by ? bindValue : item[p];
|
|
102
|
+
return typeof v === "string" ? v : "";
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
if (concrete.includes("//") || concrete.endsWith("/")) continue;
|
|
106
|
+
routes.push(concrete);
|
|
103
107
|
}
|
|
104
108
|
} catch (e) {
|
|
105
109
|
console.warn(` [blox-ssg] Could not expand ${slug}: ${e.message}`);
|
|
@@ -620,6 +624,7 @@ function discoverInternalLinks(html) {
|
|
|
620
624
|
while ((m = hrefRe.exec(html)) !== null) {
|
|
621
625
|
const raw = (m[1] ?? m[2] ?? "").trim();
|
|
622
626
|
if (!raw) continue;
|
|
627
|
+
if (raw.includes("[object Object]") || raw.includes("undefined") || raw.includes("/null")) continue;
|
|
623
628
|
if (raw.startsWith("mailto:") || raw.startsWith("tel:") || raw.startsWith("javascript:") || raw.startsWith("#")) {
|
|
624
629
|
continue;
|
|
625
630
|
}
|
package/dist/ssg/cli.cjs
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
"use strict";
|
|
3
3
|
const process = require("node:process");
|
|
4
|
-
const prerender = require("../prerender-
|
|
4
|
+
const prerender = require("../prerender-DQfXe7gk.cjs");
|
|
5
|
+
function installFetchTimeout() {
|
|
6
|
+
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
7
|
+
const original = globalThis.fetch;
|
|
8
|
+
const wrapped = async (input, init) => {
|
|
9
|
+
if (init == null ? void 0 : init.signal) return original(input, init);
|
|
10
|
+
return original(input, { ...init, signal: AbortSignal.timeout(ms) });
|
|
11
|
+
};
|
|
12
|
+
globalThis.fetch = Object.assign(wrapped, original);
|
|
13
|
+
}
|
|
5
14
|
async function resolveApiBase(mode) {
|
|
6
15
|
if (process.env.BAGELINK_API_URL != null && process.env.BAGELINK_API_URL !== "") {
|
|
7
16
|
return { apiBase: process.env.BAGELINK_API_URL };
|
|
@@ -31,6 +40,7 @@ async function resolveApiBase(mode) {
|
|
|
31
40
|
}
|
|
32
41
|
async function main() {
|
|
33
42
|
var _a;
|
|
43
|
+
installFetchTimeout();
|
|
34
44
|
const argv = process.argv.slice(2);
|
|
35
45
|
const extraPaths = [];
|
|
36
46
|
let crawl = false;
|
|
@@ -129,6 +139,9 @@ Environment:
|
|
|
129
139
|
crawl,
|
|
130
140
|
excludePaths,
|
|
131
141
|
maxPages: 5e3,
|
|
142
|
+
// Bounded concurrency — configurable so we don't overwhelm a small
|
|
143
|
+
// staging box. Defaults conservative; bump for beefy prod builds.
|
|
144
|
+
concurrency: Number(process.env.BLOX_SSG_CONCURRENCY) || 4,
|
|
132
145
|
mode: "file",
|
|
133
146
|
website,
|
|
134
147
|
websiteId,
|
package/dist/ssg/cli.mjs
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import process from "node:process";
|
|
3
|
-
import { p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../prerender-
|
|
3
|
+
import { p as polyfillBloxSsgGlobals, f as fetchCmsSiteData, a as prerender } from "../prerender-CDlP5pQU.js";
|
|
4
|
+
function installFetchTimeout() {
|
|
5
|
+
const ms = Number(process.env.BLOX_SSG_FETCH_TIMEOUT_MS) || 2e4;
|
|
6
|
+
const original = globalThis.fetch;
|
|
7
|
+
const wrapped = async (input, init) => {
|
|
8
|
+
if (init == null ? void 0 : init.signal) return original(input, init);
|
|
9
|
+
return original(input, { ...init, signal: AbortSignal.timeout(ms) });
|
|
10
|
+
};
|
|
11
|
+
globalThis.fetch = Object.assign(wrapped, original);
|
|
12
|
+
}
|
|
4
13
|
async function resolveApiBase(mode) {
|
|
5
14
|
if (process.env.BAGELINK_API_URL != null && process.env.BAGELINK_API_URL !== "") {
|
|
6
15
|
return { apiBase: process.env.BAGELINK_API_URL };
|
|
@@ -30,6 +39,7 @@ async function resolveApiBase(mode) {
|
|
|
30
39
|
}
|
|
31
40
|
async function main() {
|
|
32
41
|
var _a;
|
|
42
|
+
installFetchTimeout();
|
|
33
43
|
const argv = process.argv.slice(2);
|
|
34
44
|
const extraPaths = [];
|
|
35
45
|
let crawl = false;
|
|
@@ -128,6 +138,9 @@ Environment:
|
|
|
128
138
|
crawl,
|
|
129
139
|
excludePaths,
|
|
130
140
|
maxPages: 5e3,
|
|
141
|
+
// Bounded concurrency — configurable so we don't overwhelm a small
|
|
142
|
+
// staging box. Defaults conservative; bump for beefy prod builds.
|
|
143
|
+
concurrency: Number(process.env.BLOX_SSG_CONCURRENCY) || 4,
|
|
131
144
|
mode: "file",
|
|
132
145
|
website,
|
|
133
146
|
websiteId,
|
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 prerender = require("../prerender-
|
|
25
|
+
const prerender = require("../prerender-DQfXe7gk.cjs");
|
|
26
26
|
const ssg_client = require("./client.cjs");
|
|
27
27
|
const pinia = require("pinia");
|
|
28
28
|
const vue = require("vue");
|
package/dist/ssg/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as buildPageHead } from "../prerender-
|
|
2
|
-
import { c, d, f, g, e, h, i, p, a } from "../prerender-
|
|
1
|
+
import { b as buildPageHead } from "../prerender-CDlP5pQU.js";
|
|
2
|
+
import { c, d, f, g, e, h, i, p, a } from "../prerender-CDlP5pQU.js";
|
|
3
3
|
import { BLOX_STATE_WINDOW_KEY, BLOX_COLLECTIONS_WINDOW_KEY, BLOX_WEBSITE_ID_WINDOW_KEY } from "./client.mjs";
|
|
4
4
|
import { BLOX_DATA_WINDOW_KEY, BLOX_PAGE_SEO_WINDOW_KEY, getCollectionCache, getEmbeddedWebsiteId, installBloxStateCache, installCollectionCache } from "./client.mjs";
|
|
5
5
|
import { createPinia } from "pinia";
|
package/package.json
CHANGED