@aravindc26/velu 0.12.15 → 0.12.17
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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aravindc26/velu",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.17",
|
|
4
4
|
"description": "A modern documentation site generator powered by Markdown and JSON configuration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"dev": "tsx src/cli.ts run"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@tailwindcss/postcss": "
|
|
31
|
+
"@tailwindcss/postcss": "~4.1.18",
|
|
32
32
|
"@types/mdx": "^2.0.13",
|
|
33
33
|
"@types/node": "^22.0.0",
|
|
34
34
|
"@types/react": "^19.2.13",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"react": "^19.2.4",
|
|
47
47
|
"react-dom": "^19.2.4",
|
|
48
48
|
"shiki": "^3.22.0",
|
|
49
|
-
"tailwindcss": "
|
|
49
|
+
"tailwindcss": "~4.1.18",
|
|
50
50
|
"tsx": "^4.19.0",
|
|
51
51
|
"typescript": "^5.9.3",
|
|
52
52
|
"yaml": "^2.8.2"
|
|
@@ -1,7 +1,30 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
|
+
import { readFileSync, writeFileSync } from 'node:fs';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
2
4
|
import { generateSessionContent } from '@/lib/preview-content';
|
|
3
5
|
import { verifyApiSecret, unauthorizedResponse } from '@/lib/preview-auth';
|
|
4
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Toggle a comment in source.config.ts to force fumadocs-mdx to restart
|
|
9
|
+
* and rescan the content directory. Fire-and-forget — don't wait for completion.
|
|
10
|
+
*
|
|
11
|
+
* This is needed because on Cloud Run (gVisor), neither inotify nor chokidar
|
|
12
|
+
* polling reliably detects new files in the content directory.
|
|
13
|
+
*/
|
|
14
|
+
function triggerMdxRescan(): void {
|
|
15
|
+
try {
|
|
16
|
+
const configPath = resolve(process.cwd(), 'source.config.ts');
|
|
17
|
+
const marker = '\n// __RELOAD__\n';
|
|
18
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
19
|
+
const newContent = content.includes(marker)
|
|
20
|
+
? content.replace(marker, '\n')
|
|
21
|
+
: content + marker;
|
|
22
|
+
writeFileSync(configPath, newContent, 'utf-8');
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.warn('[PREVIEW] Failed to trigger MDX rescan:', e);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
5
28
|
export async function POST(
|
|
6
29
|
request: NextRequest,
|
|
7
30
|
{ params }: { params: Promise<{ sessionId: string }> },
|
|
@@ -13,6 +36,10 @@ export async function POST(
|
|
|
13
36
|
try {
|
|
14
37
|
const result = generateSessionContent(sessionId);
|
|
15
38
|
|
|
39
|
+
// Fire-and-forget: trigger fumadocs-mdx to discover new content.
|
|
40
|
+
// The subsequent page request will wait for Turbopack recompilation.
|
|
41
|
+
triggerMdxRescan();
|
|
42
|
+
|
|
16
43
|
return Response.json({
|
|
17
44
|
status: 'ready',
|
|
18
45
|
url: `/${sessionId}/`,
|