nuxt-ai-ready 1.5.3 → 1.5.4
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
package/dist/module.mjs
CHANGED
|
@@ -262,7 +262,10 @@ async function prerenderRoute(nitro, route) {
|
|
|
262
262
|
await writeFile(filePath, data, "utf8");
|
|
263
263
|
const _route = {
|
|
264
264
|
route,
|
|
265
|
-
fileName
|
|
265
|
+
// fileName is relative to the output public dir (nitro core convention);
|
|
266
|
+
// presets key overrides/route exclusions off it, so an absolute path here
|
|
267
|
+
// breaks e.g. the Vercel config.json overrides map.
|
|
268
|
+
fileName: route,
|
|
266
269
|
generateTimeMS: Date.now() - start
|
|
267
270
|
};
|
|
268
271
|
nitro._prerenderedRoutes.push(_route);
|
|
@@ -392,6 +395,7 @@ function setupPrerenderHandler(options, dbPath, siteInfo, llmsTxtConfig, indexNo
|
|
|
392
395
|
}
|
|
393
396
|
const llmsStats = await prerenderRoute(nitro, "/llms.txt");
|
|
394
397
|
const llmsFullStats = await stat(state.llmsFullTxtPath);
|
|
398
|
+
nitro._prerenderedRoutes.push({ route: "/llms-full.txt", fileName: "/llms-full.txt" });
|
|
395
399
|
const kb = (b) => (b / 1024).toFixed(1);
|
|
396
400
|
const totalKb = kb(llmsStats.size + llmsFullStats.size);
|
|
397
401
|
const dim = (s) => colorize("dim", s);
|
|
@@ -15,8 +15,8 @@ async function ensureWritableDir(dir) {
|
|
|
15
15
|
await rm(probe, { force: true }).catch(() => null);
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return err.code === "EROFS" || err.code === "EACCES";
|
|
18
|
+
function isRecoverable(err) {
|
|
19
|
+
return err.code === "EROFS" || err.code === "EACCES" || err.code === "ENOENT" || err.code === "ENOTDIR";
|
|
20
20
|
}
|
|
21
21
|
export async function resolveWritableDbPath(dbPath) {
|
|
22
22
|
const cached = resolved.get(dbPath);
|
|
@@ -28,19 +28,19 @@ export async function resolveWritableDbPath(dbPath) {
|
|
|
28
28
|
resolved.set(dbPath, dbPath);
|
|
29
29
|
return dbPath;
|
|
30
30
|
}
|
|
31
|
-
if (!
|
|
31
|
+
if (!isRecoverable(err))
|
|
32
32
|
throw err;
|
|
33
33
|
const key = createHash("sha256").update(resolve(dbPath)).digest("hex").slice(0, 16);
|
|
34
34
|
const fallbackDir = join(tmpdir(), `ai-ready-${key}`);
|
|
35
35
|
const fallbackErr = await ensureWritableDir(fallbackDir);
|
|
36
36
|
if (fallbackErr) {
|
|
37
37
|
throw new Error(
|
|
38
|
-
`[ai-ready] Database directory '${dir}' is
|
|
38
|
+
`[ai-ready] Database directory '${dir}' is not writable (${err.code}) and the temp dir fallback ('${fallbackDir}') also failed: ${fallbackErr.message}. Set database.filename to a writable path, or use a serverless driver: database.type 'd1' (Cloudflare), 'neon' (Vercel/Postgres), or 'libsql' (Turso).`
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
const fallback = join(fallbackDir, "pages.db");
|
|
42
42
|
logger.warn(
|
|
43
|
-
`[ai-ready] Database directory '${dir}' is
|
|
43
|
+
`[ai-ready] Database directory '${dir}' is not writable (${err.code}); falling back to '${fallback}'. This database is ephemeral and reseeded on cold start. Set database.filename to a writable persistent path (or a volume) to silence this warning.`
|
|
44
44
|
);
|
|
45
45
|
resolved.set(dbPath, fallback);
|
|
46
46
|
return fallback;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-ai-ready",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.4",
|
|
5
5
|
"description": "Best practice AI & LLM discoverability for Nuxt sites.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"drizzle-orm": "^0.45.2",
|
|
66
66
|
"mdream": "^1.4.1",
|
|
67
67
|
"nuxt-site-config": "^4.1.1",
|
|
68
|
-
"nuxtseo-shared": "^5.3.
|
|
68
|
+
"nuxtseo-shared": "^5.3.2",
|
|
69
69
|
"pathe": "^2.0.3",
|
|
70
70
|
"pkg-types": "^2.3.1",
|
|
71
71
|
"site-config-stack": "^4.1.1",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@antfu/eslint-config": "^9.1.0",
|
|
77
77
|
"@arethetypeswrong/cli": "^0.18.4",
|
|
78
78
|
"@libsql/client": "^0.17.4",
|
|
79
|
-
"@nuxt/content": "^3.
|
|
79
|
+
"@nuxt/content": "^3.15.0",
|
|
80
80
|
"@nuxt/module-builder": "^1.0.2",
|
|
81
81
|
"@nuxt/test-utils": "^4.0.3",
|
|
82
82
|
"@nuxtjs/eslint-config-typescript": "^12.1.0",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@nuxtjs/robots": "^6.1.2",
|
|
85
85
|
"@nuxtjs/sitemap": "^8.2.2",
|
|
86
86
|
"@types/better-sqlite3": "^7.6.13",
|
|
87
|
-
"@vitest/coverage-v8": "^4.1.
|
|
87
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
88
88
|
"@vue/test-utils": "^2.4.11",
|
|
89
89
|
"@vueuse/nuxt": "^14.3.0",
|
|
90
90
|
"better-sqlite3": "^12.11.1",
|
|
@@ -96,17 +96,17 @@
|
|
|
96
96
|
"nitropack": "^2.13.4",
|
|
97
97
|
"nuxt": "^4.4.8",
|
|
98
98
|
"nuxt-site-config": "^4.1.1",
|
|
99
|
-
"nuxtseo-layer-devtools": "^5.3.
|
|
99
|
+
"nuxtseo-layer-devtools": "^5.3.2",
|
|
100
100
|
"playwright": "^1.61.1",
|
|
101
101
|
"playwright-core": "^1.61.1",
|
|
102
102
|
"tinyglobby": "^0.2.17",
|
|
103
103
|
"typescript": "^6.0.3",
|
|
104
104
|
"unbuild": "^3.6.1",
|
|
105
|
-
"vitest": "^4.1.
|
|
105
|
+
"vitest": "^4.1.10",
|
|
106
106
|
"vue": "^3.5.39",
|
|
107
107
|
"vue-router": "^5.1.0",
|
|
108
|
-
"vue-tsc": "^3.3.
|
|
109
|
-
"wrangler": "^4.
|
|
108
|
+
"vue-tsc": "^3.3.6",
|
|
109
|
+
"wrangler": "^4.107.0",
|
|
110
110
|
"zod": "^4.4.3"
|
|
111
111
|
},
|
|
112
112
|
"scripts": {
|