@bagelink/blox 1.13.4 → 1.13.5

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/ssg/cli.cjs CHANGED
@@ -30,6 +30,7 @@ async function resolveApiBase(mode) {
30
30
  return { apiBase: "https://localhost:8000" };
31
31
  }
32
32
  async function main() {
33
+ var _a;
33
34
  const argv = process.argv.slice(2);
34
35
  const extraPaths = [];
35
36
  let crawl = false;
@@ -84,9 +85,20 @@ Environment:
84
85
  redirects = siteData.redirects;
85
86
  console.log(` Found ${paths.length} CMS routes`);
86
87
  if (redirects.length > 0) console.log(` Found ${redirects.length} redirects`);
87
- if (siteData.collections.length > 0) {
88
- console.log(` Pre-fetching ${siteData.collections.length} datastore collection(s)…`);
89
- for (const ref of siteData.collections) {
88
+ const allCollectionRefs = [...siteData.collections];
89
+ const extraCollections = (_a = process.env.BLOX_SSG_COLLECTIONS) == null ? void 0 : _a.trim();
90
+ if (extraCollections) {
91
+ for (const entry of extraCollections.split(",")) {
92
+ const parts = entry.trim().split("/");
93
+ if (parts.length === 2 && parts[0] && parts[1]) {
94
+ const already = allCollectionRefs.some((r) => r.store === parts[0] && r.collection === parts[1]);
95
+ if (!already) allCollectionRefs.push({ store: parts[0], collection: parts[1] });
96
+ }
97
+ }
98
+ }
99
+ if (allCollectionRefs.length > 0) {
100
+ console.log(` Pre-fetching ${allCollectionRefs.length} datastore collection(s)…`);
101
+ for (const ref of allCollectionRefs) {
90
102
  try {
91
103
  const url = `${apiBase}/datastore/${ref.store}/collections/${ref.collection}?limit=500`;
92
104
  const res = await fetch(url);
package/dist/ssg/cli.mjs CHANGED
@@ -29,6 +29,7 @@ async function resolveApiBase(mode) {
29
29
  return { apiBase: "https://localhost:8000" };
30
30
  }
31
31
  async function main() {
32
+ var _a;
32
33
  const argv = process.argv.slice(2);
33
34
  const extraPaths = [];
34
35
  let crawl = false;
@@ -83,9 +84,20 @@ Environment:
83
84
  redirects = siteData.redirects;
84
85
  console.log(` Found ${paths.length} CMS routes`);
85
86
  if (redirects.length > 0) console.log(` Found ${redirects.length} redirects`);
86
- if (siteData.collections.length > 0) {
87
- console.log(` Pre-fetching ${siteData.collections.length} datastore collection(s)…`);
88
- for (const ref of siteData.collections) {
87
+ const allCollectionRefs = [...siteData.collections];
88
+ const extraCollections = (_a = process.env.BLOX_SSG_COLLECTIONS) == null ? void 0 : _a.trim();
89
+ if (extraCollections) {
90
+ for (const entry of extraCollections.split(",")) {
91
+ const parts = entry.trim().split("/");
92
+ if (parts.length === 2 && parts[0] && parts[1]) {
93
+ const already = allCollectionRefs.some((r) => r.store === parts[0] && r.collection === parts[1]);
94
+ if (!already) allCollectionRefs.push({ store: parts[0], collection: parts[1] });
95
+ }
96
+ }
97
+ }
98
+ if (allCollectionRefs.length > 0) {
99
+ console.log(` Pre-fetching ${allCollectionRefs.length} datastore collection(s)…`);
100
+ for (const ref of allCollectionRefs) {
89
101
  try {
90
102
  const url = `${apiBase}/datastore/${ref.store}/collections/${ref.collection}?limit=500`;
91
103
  const res = await fetch(url);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/blox",
3
3
  "type": "module",
4
- "version": "1.13.4",
4
+ "version": "1.13.5",
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",