radiant-docs 0.1.59 → 0.1.61

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.
Files changed (40) hide show
  1. package/package.json +1 -1
  2. package/template/astro.config.mjs +24 -2
  3. package/template/package-lock.json +121 -508
  4. package/template/package.json +3 -2
  5. package/template/scripts/generate-og-images.mjs +338 -6
  6. package/template/scripts/generate-og-metadata.mjs +29 -0
  7. package/template/src/components/Footer.astro +1 -1
  8. package/template/src/components/Header.astro +3 -10
  9. package/template/src/components/OpenApiPage.astro +181 -843
  10. package/template/src/components/SidebarGroup.astro +1 -1
  11. package/template/src/components/ThemeSwitcher.astro +5 -15
  12. package/template/src/components/chat/AssistantEmbedPanel.tsx +18 -7
  13. package/template/src/components/endpoint/PlaygroundBar.astro +54 -9
  14. package/template/src/components/endpoint/PlaygroundField.astro +1 -1
  15. package/template/src/components/endpoint/PlaygroundForm.astro +9 -5
  16. package/template/src/components/endpoint/RequestSnippets.astro +6 -1
  17. package/template/src/components/endpoint/ResponseFieldTree.astro +17 -13
  18. package/template/src/components/endpoint/ResponseFields.astro +4 -6
  19. package/template/src/components/endpoint/ResponseSnippets.astro +6 -1
  20. package/template/src/components/sidebar/SidebarEndpointLink.astro +9 -12
  21. package/template/src/components/sidebar/SidebarOpenApi.astro +3 -9
  22. package/template/src/components/ui/Field.astro +18 -15
  23. package/template/src/components/ui/Tag.astro +16 -2
  24. package/template/src/layouts/Layout.astro +6 -12
  25. package/template/src/lib/ai-artifacts.ts +792 -0
  26. package/template/src/lib/mdx/remark-resolve-internal-links.ts +22 -8
  27. package/template/src/lib/oas.ts +5 -1
  28. package/template/src/lib/openapi/operation-doc.ts +1150 -0
  29. package/template/src/lib/page-description.ts +20 -0
  30. package/template/src/lib/routes.ts +73 -18
  31. package/template/src/lib/utils.ts +11 -0
  32. package/template/src/pages/[...slug]/index.md.ts +35 -0
  33. package/template/src/pages/[...spec].json.ts +33 -0
  34. package/template/src/pages/[...spec].yaml.ts +33 -0
  35. package/template/src/pages/[...spec].yml.ts +33 -0
  36. package/template/src/pages/index.md.ts +17 -0
  37. package/template/src/pages/llms-full.txt.ts +11 -0
  38. package/template/src/pages/llms.txt.ts +11 -0
  39. package/template/src/styles/global.css +18 -15
  40. package/template/src/styles/vaul.css +0 -255
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "radiant-docs",
3
- "version": "0.1.59",
3
+ "version": "0.1.61",
4
4
  "description": "CLI tool for previewing Radiant documentation locally",
5
5
  "type": "module",
6
6
  "bin": {
@@ -92,11 +92,20 @@ function copyContentAssets() {
92
92
  const CWD = process.cwd();
93
93
  const DOCS_DIR = path.join(CWD, "src/content/docs");
94
94
  const PUBLIC_DIR = path.join(CWD, "public");
95
+ const RESERVED_AI_ARTIFACT_PATHS = new Set(["llms.txt", "llms-full.txt"]);
95
96
 
96
97
  function shouldCopyFile(filePath) {
97
98
  return isPublishableStaticAssetPath(filePath);
98
99
  }
99
100
 
101
+ function toPosixRelativePath(baseDir, filePath) {
102
+ return path.relative(baseDir, filePath).replace(/\\/g, "/");
103
+ }
104
+
105
+ function isReservedAiArtifactPath(relativePath) {
106
+ return RESERVED_AI_ARTIFACT_PATHS.has(relativePath.replace(/^\/+/, ""));
107
+ }
108
+
100
109
  // Build a set of all publishable asset paths in src/content/docs
101
110
  function collectAssetPaths(dir, baseDir, pathSet) {
102
111
  if (!fs.existsSync(dir)) return;
@@ -113,8 +122,9 @@ function copyContentAssets() {
113
122
  collectAssetPaths(entryPath, baseDir, pathSet);
114
123
  } else if (entry.isFile() && shouldCopyFile(entryPath)) {
115
124
  // Store relative path from baseDir
116
- const relativePath = path.relative(baseDir, entryPath);
117
- pathSet.add(relativePath.replace(/\\/g, "/")); // Normalize path separators
125
+ const relativePath = toPosixRelativePath(baseDir, entryPath);
126
+ if (isReservedAiArtifactPath(relativePath)) continue;
127
+ pathSet.add(relativePath); // Normalize path separators
118
128
  }
119
129
  }
120
130
  }
@@ -144,6 +154,9 @@ function copyContentAssets() {
144
154
  }
145
155
  }
146
156
  } else if (entry.isFile() && shouldCopyFile(srcPath)) {
157
+ const relativePath = toPosixRelativePath(DOCS_DIR, srcPath);
158
+ if (isReservedAiArtifactPath(relativePath)) continue;
159
+
147
160
  // Ensure destination directory exists before copying
148
161
  if (!fs.existsSync(destDir)) {
149
162
  fs.mkdirSync(destDir, { recursive: true });
@@ -215,6 +228,13 @@ function copyContentAssets() {
215
228
 
216
229
  // Step 4: Clean up empty directories
217
230
  cleanupEmptyDirs(PUBLIC_DIR, PUBLIC_DIR);
231
+
232
+ for (const reservedPath of RESERVED_AI_ARTIFACT_PATHS) {
233
+ const publicPath = path.join(PUBLIC_DIR, reservedPath);
234
+ if (fs.existsSync(publicPath)) {
235
+ fs.unlinkSync(publicPath);
236
+ }
237
+ }
218
238
  }
219
239
 
220
240
  return {
@@ -239,6 +259,8 @@ function copyContentAssets() {
239
259
  path.join(CWD, "src/content/docs"),
240
260
  file,
241
261
  );
262
+ if (isReservedAiArtifactPath(relativePath)) return;
263
+
242
264
  const destPath = path.join(PUBLIC_DIR, relativePath);
243
265
  const destDir = path.dirname(destPath);
244
266