radiant-docs-validator 0.1.6 → 0.1.8

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 (2) hide show
  1. package/dist/index.js +14 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2490,7 +2490,7 @@ async function validateNavigation(navigation) {
2490
2490
  const navValue = navigation[navKey];
2491
2491
  if (navKey === "menu") {
2492
2492
  await validateNavMenu(navValue, ["navigation", "menu"]);
2493
- } else {
2493
+ } else if (navKey === "pages") {
2494
2494
  checkType(
2495
2495
  navValue,
2496
2496
  "array",
@@ -2507,6 +2507,15 @@ async function validateNavigation(navigation) {
2507
2507
  await validateNavigationNode(item, itemPath);
2508
2508
  }
2509
2509
  }
2510
+ } else if (typeof navValue === "string") {
2511
+ await validateOpenApiFile(navValue, ["navigation", "openapi"]);
2512
+ } else if (navValue && typeof navValue === "object" && !Array.isArray(navValue)) {
2513
+ await validateNavOpenApi(navValue, ["navigation", "openapi"]);
2514
+ } else {
2515
+ throwConfigError(
2516
+ "OpenAPI must be either a string (file path or hosted file) or an object.",
2517
+ ["navigation", "openapi"]
2518
+ );
2510
2519
  }
2511
2520
  }
2512
2521
  async function validateConfig(config) {
@@ -2929,6 +2938,10 @@ async function validateMdxContent() {
2929
2938
  const linkIndex = buildDocsLinkIndex(config, files);
2930
2939
  for (const file of files) {
2931
2940
  const relativePath = path.relative(DOCS_DIR, file);
2941
+ const normalizedFilePath = normalizeDocsFilePath(relativePath);
2942
+ if (!linkIndex.routableDocsFilePaths.has(normalizedFilePath)) {
2943
+ continue;
2944
+ }
2932
2945
  try {
2933
2946
  const content = fs.readFileSync(file, "utf-8");
2934
2947
  const match = content.match(/^---\n([\s\S]*?)\n---/);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "radiant-docs-validator",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Shared validation for Radiant documentation repositories",
5
5
  "type": "module",
6
6
  "scripts": {