@monkeyplus/flow 6.0.88 → 6.0.90
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/package.json
CHANGED
|
@@ -75,6 +75,32 @@ async function fetchContent(route, queryParams) {
|
|
|
75
75
|
}
|
|
76
76
|
const localFetch = getGlobalFetch();
|
|
77
77
|
const relativeTarget = withQuery(joinUrl(apiBase, route), query);
|
|
78
|
+
if (typeof window === "undefined") {
|
|
79
|
+
try {
|
|
80
|
+
if (!localFetch) {
|
|
81
|
+
let queryModule;
|
|
82
|
+
try {
|
|
83
|
+
queryModule = await import("../../modules/content/query.mjs");
|
|
84
|
+
} catch (tsErr) {
|
|
85
|
+
console.error("[queryContent] Error loading .ts:", tsErr);
|
|
86
|
+
queryModule = await import("../../modules/content/query.js");
|
|
87
|
+
}
|
|
88
|
+
const { findContentEntries, buildContentTree, findContentTree, readContentEntries, processContentQuery } = queryModule;
|
|
89
|
+
let entries = await readContentEntries();
|
|
90
|
+
const isTreeRequest = route.endsWith("/tree") || query.tree === true || query.tree === "true" || query.tree === "1";
|
|
91
|
+
if (isTreeRequest) {
|
|
92
|
+
const tree = buildContentTree(entries);
|
|
93
|
+
return findContentTree(tree, query.path);
|
|
94
|
+
}
|
|
95
|
+
if (query.path) {
|
|
96
|
+
entries = findContentEntries(entries, query.path);
|
|
97
|
+
}
|
|
98
|
+
return processContentQuery(entries, query, await readContentEntries());
|
|
99
|
+
}
|
|
100
|
+
} catch (e) {
|
|
101
|
+
console.error("[queryContent] Bypass failed:", e);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
78
104
|
const fetchFn = typeof window === "undefined" ? localFetch || fetch : fetch;
|
|
79
105
|
let targetToFetch = typeof window === "undefined" && localFetch ? relativeTarget : relativeTarget;
|
|
80
106
|
if (typeof window === "undefined" && !localFetch && targetToFetch.startsWith("/")) {
|