@aravindc26/velu 0.11.11 → 0.11.13
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 +1 -1
- package/src/cli.ts +23 -0
- package/src/validate.ts +1 -1
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -334,6 +334,24 @@ function collectMarkdownPaths(distDir: string): string[] {
|
|
|
334
334
|
return Array.from(markdownPaths).sort((a, b) => a.localeCompare(b));
|
|
335
335
|
}
|
|
336
336
|
|
|
337
|
+
function addLlmsTextAliases(distDir: string): number {
|
|
338
|
+
const mappings: Array<{ source: string; target: string }> = [
|
|
339
|
+
{ source: "llms-file", target: "llms.txt" },
|
|
340
|
+
{ source: "llms-full-file", target: "llms-full.txt" },
|
|
341
|
+
];
|
|
342
|
+
|
|
343
|
+
let added = 0;
|
|
344
|
+
for (const { source, target } of mappings) {
|
|
345
|
+
const sourcePath = join(distDir, source);
|
|
346
|
+
const targetPath = join(distDir, target);
|
|
347
|
+
if (!existsSync(sourcePath) || existsSync(targetPath)) continue;
|
|
348
|
+
copyFileSync(sourcePath, targetPath);
|
|
349
|
+
added += 1;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return added;
|
|
353
|
+
}
|
|
354
|
+
|
|
337
355
|
function addStaticRouteCompatibility(outDir: string) {
|
|
338
356
|
const distDir = join(outDir, "dist");
|
|
339
357
|
if (!existsSync(distDir)) return;
|
|
@@ -419,6 +437,11 @@ function addStaticRouteCompatibility(outDir: string) {
|
|
|
419
437
|
console.log(`📄 Added inline markdown headers for ${mdPaths.length} .md routes`);
|
|
420
438
|
}
|
|
421
439
|
|
|
440
|
+
const llmsAliasesAdded = addLlmsTextAliases(distDir);
|
|
441
|
+
if (llmsAliasesAdded > 0) {
|
|
442
|
+
console.log(`🤖 Added ${llmsAliasesAdded} llms text aliases (.txt)`);
|
|
443
|
+
}
|
|
444
|
+
|
|
422
445
|
console.log(`🔁 Added static compatibility for ${routes.length} routes (${aliasCount} .html aliases, ${redirectAdded} redirects)`);
|
|
423
446
|
}
|
|
424
447
|
|