nuxt-llms 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -16,7 +16,7 @@ Nuxt LLMs automatically generates [`llms.txt` markdown documentation](https://ll
16
16
  ## Features
17
17
 
18
18
  - Generates & prerenders `/llms.txt` automatically
19
- - Generate & prerenders `/llms_full.txt` when enabled
19
+ - Generate & prerenders `/llms-full.txt` when enabled
20
20
  - Customizable sections directly from your `nuxt.config.ts`
21
21
  - Integrates with Nuxt modules and your application via the runtime hooks system
22
22
 
@@ -84,9 +84,9 @@ That's it! You can visit `/llms.txt` to see the generated documentation ✨
84
84
  - `description`: The description of the link
85
85
  - `href`(required): The href of the link
86
86
  - `notes`: The notes of the documentation. Notes are a special section which always appears at the end of the documentation. Notes are useful to add any information about the application or documentation itself.
87
- - `full`: The `llms_full.txt` configuration. Setting this option will enable the `llms_full.txt` route.
88
- - `title`: The title of the llms_full documentation
89
- - `description`: The description of the llms_full documentation
87
+ - `full`: The `llms-full.txt` configuration. Setting this option will enable the `llms-full.txt` route.
88
+ - `title`: The title of the llms-full documentation
89
+ - `description`: The description of the llms-full documentation
90
90
 
91
91
  ## Documentation Formats
92
92
 
@@ -101,11 +101,11 @@ The `/llms.txt` route generates a concise, structured documentation that follows
101
101
  - Links with titles, descriptions, and URLs
102
102
  - Optional notes section
103
103
 
104
- ### llms_full.txt
104
+ ### llms-full.txt
105
105
 
106
- The `/llms_full.txt` route provides a more detailed, free-form documentation format. This is useful to reduce crawler traffic on your application and provide a more detailed documentation to your users and LLMs.
106
+ The `/llms-full.txt` route provides a more detailed, free-form documentation format. This is useful to reduce crawler traffic on your application and provide a more detailed documentation to your users and LLMs.
107
107
 
108
- By default module does not generate the `llms_full.txt` route, you need to enable it by setting `full.title` and `full.description` in your `nuxt.config.ts`.
108
+ By default module does not generate the `llms-full.txt` route, you need to enable it by setting `full.title` and `full.description` in your `nuxt.config.ts`.
109
109
 
110
110
  ```ts
111
111
  export default defineNuxtConfig({
@@ -135,9 +135,9 @@ This hook is called for every request to `/llms.txt`. Use this hook to modify th
135
135
  - `options`: ModuleOptions - The module options that you can modify to add sections, links, etc.
136
136
 
137
137
 
138
- #### `llms:generate:llms_full(event, options, contents)`
138
+ #### `llms:generate:llms-full(event, options, contents)`
139
139
 
140
- This hook is called for every request to `/llms_full.txt`. It allows you to add custom content sections in any format.
140
+ This hook is called for every request to `/llms-full.txt`. It allows you to add custom content sections in any format.
141
141
 
142
142
  **Parameters:**
143
143
  - `event`: H3Event - The current request event
@@ -169,7 +169,7 @@ export default defineNitroPlugin((nitroApp) => {
169
169
 
170
170
  // Method 2: Using the helper function
171
171
  nitroApp.hooks.hook('llms:generate:full', (event, options, contents) => {
172
- // Add detailed documentation to llms_full.txt
172
+ // Add detailed documentation to llms-full.txt
173
173
  contents.push(`## API Authentication
174
174
 
175
175
  ### Bearer Token
@@ -225,7 +225,7 @@ export default defineNuxtModule({
225
225
 
226
226
  ### Nuxt Content
227
227
 
228
- Nuxt Content ^3.2.0 comes with built-in support for LLMs documentation. You can use `nuxt-llms` with `@nuxt/content` to efficiently write content and documentation for your website and generate LLM-friendly documentation without extra effort. Content module uses `nuxt-llms` hooks and automatically adds all your contents into `llms.txt` and `llms_full.txt` documentation.
228
+ Nuxt Content ^3.2.0 comes with built-in support for LLMs documentation. You can use `nuxt-llms` with `@nuxt/content` to efficiently write content and documentation for your website and generate LLM-friendly documentation without extra effort. Content module uses `nuxt-llms` hooks and automatically adds all your contents into `llms.txt` and `llms-full.txt` documentation.
229
229
 
230
230
  All you need is to install both modules and write your content files in the `content` directory.
231
231
 
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "Nuxt LLMS",
3
3
  "configKey": "llms",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.8.4",
7
7
  "unbuild": "2.0.0"
package/dist/module.mjs CHANGED
@@ -30,12 +30,12 @@ const module = defineNuxtModule({
30
30
  {
31
31
  title: options.full.title,
32
32
  description: options.full.description,
33
- href: `${options.domain}/llms_full.txt`
33
+ href: `${options.domain}/llms-full.txt`
34
34
  }
35
35
  ]
36
36
  });
37
- addServerHandler({ route: "/llms_full.txt", handler: resolve("./runtime/server/routes/llms_full.txt.get") });
38
- addPrerenderRoutes("/llms_full.txt");
37
+ addServerHandler({ route: "/llms-full.txt", handler: resolve("./runtime/server/routes/llms-full.txt.get") });
38
+ addPrerenderRoutes("/llms-full.txt");
39
39
  }
40
40
  }
41
41
  });
@@ -7,6 +7,6 @@ export default eventHandler(async (event) => {
7
7
  const llms = JSON.parse(JSON.stringify(options));
8
8
  await useNitroApp().hooks.callHook("llms:generate:full", event, llms, contents);
9
9
  await llmsHooks.callHook("generate:full", event, llms, contents);
10
- setHeader(event, "Content-Type", "text/plain");
10
+ setHeader(event, "Content-Type", "text/plain; charset=utf-8");
11
11
  return contents.join("\n\n");
12
12
  });
@@ -19,7 +19,7 @@ export default eventHandler(async (event) => {
19
19
  }
20
20
  document.push(
21
21
  section.links?.map((link) => {
22
- return `- [${link.title}](${link.href}): ${link.description}`;
22
+ return link.description ? `- [${link.title}](${link.href}): ${link.description}` : `- [${link.title}](${link.href})`;
23
23
  }).join("\n") || ""
24
24
  );
25
25
  }
@@ -29,6 +29,6 @@ export default eventHandler(async (event) => {
29
29
  (options.notes || []).map((note) => `- ${note}`).join("\n")
30
30
  );
31
31
  }
32
- setHeader(event, "Content-Type", "text/plain");
32
+ setHeader(event, "Content-Type", "text/plain; charset=utf-8");
33
33
  return document.join("\n\n");
34
34
  });
@@ -2,7 +2,11 @@ import { createHooks } from "hookable";
2
2
  import { useNitroApp } from "#imports";
3
3
  export const llmsHooks = createHooks();
4
4
  llmsHooks.beforeEach(() => {
5
- console.warn("[nuxt-llms] `llmsHooks` are deprecated and will be removed in future versions. Use `useNitroApp().hooks.hook('llms:generate', (event, options) => {})` instead");
5
+ const hooks = Object.values(llmsHooks._hooks || {});
6
+ const hasRegisteredHook = hooks.some((hooksList) => Array.isArray(hooksList) && hooksList.length > 0);
7
+ if (hasRegisteredHook) {
8
+ console.warn("[nuxt-llms] `llmsHooks` are deprecated and will be removed in future versions. Use `useNitroApp().hooks.hook('llms:generate', (event, options) => {})` instead");
9
+ }
6
10
  });
7
11
  export function onLLMsGenerate(cb) {
8
12
  return useNitroApp().hooks.hook("llms:generate", cb);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-llms",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Generate llms.txt documentation for your Nuxt application",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,22 +39,22 @@
39
39
  "verify": "npm run dev:prepare && npm run lint && npm run test && npm run typecheck"
40
40
  },
41
41
  "dependencies": {
42
- "@nuxt/kit": "^3.15.4"
42
+ "@nuxt/kit": "^3.16.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "nuxt-llms": "link:.",
46
- "@nuxt/devtools": "^2.1.0",
47
- "@nuxt/eslint-config": "^1.1.0",
46
+ "@nuxt/devtools": "^2.3.1",
47
+ "@nuxt/eslint-config": "^1.2.0",
48
48
  "@nuxt/module-builder": "^0.8.4",
49
- "@nuxt/schema": "^3.15.4",
50
- "@nuxt/test-utils": "^3.15.4",
49
+ "@nuxt/schema": "^3.16.1",
50
+ "@nuxt/test-utils": "^3.17.2",
51
51
  "@types/node": "latest",
52
- "changelogen": "^0.5.7",
53
- "eslint": "^9.20.1",
54
- "nuxt": "^3.15.4",
52
+ "changelogen": "^0.6.1",
53
+ "eslint": "^9.23.0",
54
+ "nuxt": "^3.16.1",
55
55
  "typescript": "~5.6.0",
56
- "vitest": "^3.0.6",
56
+ "vitest": "^3.0.9",
57
57
  "vue-tsc": "^2.2.2"
58
58
  },
59
- "packageManager": "pnpm@10.4.1"
59
+ "packageManager": "pnpm@10.6.5"
60
60
  }