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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=4.0.0"
5
5
  },
6
6
  "configKey": "aiReady",
7
- "version": "0.0.2",
7
+ "version": "0.0.3",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
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._sitemap || !route.contents) {
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) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-ai-ready",
3
3
  "type": "module",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "description": "Best practice AI & LLM discoverability for Nuxt sites.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",