nuxt-ai-ready 0.0.2 → 0.0.3
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/module.json +1 -1
- package/dist/module.mjs +8 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -289,7 +289,10 @@ Returns JSONL (newline-delimited JSON) with all indexed content.`
|
|
|
289
289
|
let bulkStreamEntries = 0;
|
|
290
290
|
nitro.hooks.hook("prerender:route", async (route) => {
|
|
291
291
|
const isHtml = route.fileName?.endsWith(".html") && route.contents.startsWith("<!DOCTYPE html");
|
|
292
|
-
if (!isHtml || !route.
|
|
292
|
+
if (!isHtml || !route.contents) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
if (typeof route._sitemap !== "undefined" && !route._sitemap) {
|
|
293
296
|
return;
|
|
294
297
|
}
|
|
295
298
|
let title = "";
|
|
@@ -329,8 +332,10 @@ Returns JSONL (newline-delimited JSON) with all indexed content.`
|
|
|
329
332
|
bulkStream = createWriteStream(bulkPath);
|
|
330
333
|
logger.info(`Bulk JSONL stream created at ${relative(nuxt.options.rootDir, bulkPath)}`);
|
|
331
334
|
}
|
|
335
|
+
logger.debug(`Processing chunks for route: ${route.route}`);
|
|
332
336
|
let idx = 0;
|
|
333
|
-
for (const chunk of chunksStream) {
|
|
337
|
+
for await (const chunk of chunksStream) {
|
|
338
|
+
logger.debug(` Chunk ${idx}: ${chunk.content.length} chars, headers: ${JSON.stringify(chunk.metadata?.headers)}`);
|
|
334
339
|
const bulkChunk = {
|
|
335
340
|
id: generateVectorId(route.route, idx),
|
|
336
341
|
route: route.route,
|
|
@@ -353,6 +358,7 @@ Returns JSONL (newline-delimited JSON) with all indexed content.`
|
|
|
353
358
|
bulkStreamEntries++;
|
|
354
359
|
idx++;
|
|
355
360
|
}
|
|
361
|
+
logger.debug(`Completed ${idx} chunks for ${route.route}`);
|
|
356
362
|
});
|
|
357
363
|
nitro.hooks.hook("prerender:done", () => {
|
|
358
364
|
if (bulkStream) {
|