@zudojs/docs 0.0.1

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 (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +38 -0
  3. package/dist/docsTypes/documentationContent.d.ts +80 -0
  4. package/dist/docsTypes/documentationContent.d.ts.map +1 -0
  5. package/dist/docsTypes/documentationContent.js +8 -0
  6. package/dist/docsTypes/documentationContent.js.map +1 -0
  7. package/dist/docsTypes/documentationDocument.d.ts +29 -0
  8. package/dist/docsTypes/documentationDocument.d.ts.map +1 -0
  9. package/dist/docsTypes/documentationDocument.js +8 -0
  10. package/dist/docsTypes/documentationDocument.js.map +1 -0
  11. package/dist/docsTypes/documentationMetadata.d.ts +60 -0
  12. package/dist/docsTypes/documentationMetadata.d.ts.map +1 -0
  13. package/dist/docsTypes/documentationMetadata.js +5 -0
  14. package/dist/docsTypes/documentationMetadata.js.map +1 -0
  15. package/dist/docsTypes/documentationNavigation.d.ts +34 -0
  16. package/dist/docsTypes/documentationNavigation.d.ts.map +1 -0
  17. package/dist/docsTypes/documentationNavigation.js +8 -0
  18. package/dist/docsTypes/documentationNavigation.js.map +1 -0
  19. package/dist/docsTypes/documentationProvider.d.ts +21 -0
  20. package/dist/docsTypes/documentationProvider.d.ts.map +1 -0
  21. package/dist/docsTypes/documentationProvider.js +8 -0
  22. package/dist/docsTypes/documentationProvider.js.map +1 -0
  23. package/dist/docsTypes/index.d.ts +11 -0
  24. package/dist/docsTypes/index.d.ts.map +1 -0
  25. package/dist/docsTypes/index.js +7 -0
  26. package/dist/docsTypes/index.js.map +1 -0
  27. package/dist/document/documentBuilder.core.d.ts +50 -0
  28. package/dist/document/documentBuilder.core.d.ts.map +1 -0
  29. package/dist/document/documentBuilder.core.js +78 -0
  30. package/dist/document/documentBuilder.core.js.map +1 -0
  31. package/dist/document/index.d.ts +8 -0
  32. package/dist/document/index.d.ts.map +1 -0
  33. package/dist/document/index.js +7 -0
  34. package/dist/document/index.js.map +1 -0
  35. package/dist/examples/examples.core.d.ts +38 -0
  36. package/dist/examples/examples.core.d.ts.map +1 -0
  37. package/dist/examples/examples.core.js +56 -0
  38. package/dist/examples/examples.core.js.map +1 -0
  39. package/dist/examples/index.d.ts +8 -0
  40. package/dist/examples/index.d.ts.map +1 -0
  41. package/dist/examples/index.js +7 -0
  42. package/dist/examples/index.js.map +1 -0
  43. package/dist/frontmatter/frontmatter.core.d.ts +7 -0
  44. package/dist/frontmatter/frontmatter.core.d.ts.map +1 -0
  45. package/dist/frontmatter/frontmatter.core.js +6 -0
  46. package/dist/frontmatter/frontmatter.core.js.map +1 -0
  47. package/dist/frontmatter/frontmatter.parser.d.ts +15 -0
  48. package/dist/frontmatter/frontmatter.parser.d.ts.map +1 -0
  49. package/dist/frontmatter/frontmatter.parser.js +82 -0
  50. package/dist/frontmatter/frontmatter.parser.js.map +1 -0
  51. package/dist/frontmatter/frontmatter.serializer.d.ts +9 -0
  52. package/dist/frontmatter/frontmatter.serializer.d.ts.map +1 -0
  53. package/dist/frontmatter/frontmatter.serializer.js +31 -0
  54. package/dist/frontmatter/frontmatter.serializer.js.map +1 -0
  55. package/dist/frontmatter/frontmatter.types.d.ts +26 -0
  56. package/dist/frontmatter/frontmatter.types.d.ts.map +1 -0
  57. package/dist/frontmatter/frontmatter.types.js +5 -0
  58. package/dist/frontmatter/frontmatter.types.js.map +1 -0
  59. package/dist/frontmatter/index.d.ts +8 -0
  60. package/dist/frontmatter/index.d.ts.map +1 -0
  61. package/dist/frontmatter/index.js +7 -0
  62. package/dist/frontmatter/index.js.map +1 -0
  63. package/dist/generator/generator.types.d.ts +11 -0
  64. package/dist/generator/generator.types.d.ts.map +1 -0
  65. package/dist/generator/generator.types.js +5 -0
  66. package/dist/generator/generator.types.js.map +1 -0
  67. package/dist/generator/generatorJson.core.d.ts +13 -0
  68. package/dist/generator/generatorJson.core.d.ts.map +1 -0
  69. package/dist/generator/generatorJson.core.js +36 -0
  70. package/dist/generator/generatorJson.core.js.map +1 -0
  71. package/dist/generator/generatorMarkdown.core.d.ts +10 -0
  72. package/dist/generator/generatorMarkdown.core.d.ts.map +1 -0
  73. package/dist/generator/generatorMarkdown.core.js +72 -0
  74. package/dist/generator/generatorMarkdown.core.js.map +1 -0
  75. package/dist/generator/generatorMarkdownNodes.d.ts +9 -0
  76. package/dist/generator/generatorMarkdownNodes.d.ts.map +1 -0
  77. package/dist/generator/generatorMarkdownNodes.js +64 -0
  78. package/dist/generator/generatorMarkdownNodes.js.map +1 -0
  79. package/dist/generator/index.d.ts +10 -0
  80. package/dist/generator/index.d.ts.map +1 -0
  81. package/dist/generator/index.js +9 -0
  82. package/dist/generator/index.js.map +1 -0
  83. package/dist/index.d.ts +19 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +28 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/navigation/index.d.ts +7 -0
  88. package/dist/navigation/index.d.ts.map +1 -0
  89. package/dist/navigation/index.js +7 -0
  90. package/dist/navigation/index.js.map +1 -0
  91. package/dist/navigation/navigation.core.d.ts +25 -0
  92. package/dist/navigation/navigation.core.d.ts.map +1 -0
  93. package/dist/navigation/navigation.core.js +85 -0
  94. package/dist/navigation/navigation.core.js.map +1 -0
  95. package/dist/registry/index.d.ts +7 -0
  96. package/dist/registry/index.d.ts.map +1 -0
  97. package/dist/registry/index.js +7 -0
  98. package/dist/registry/index.js.map +1 -0
  99. package/dist/registry/registry.core.d.ts +62 -0
  100. package/dist/registry/registry.core.d.ts.map +1 -0
  101. package/dist/registry/registry.core.js +90 -0
  102. package/dist/registry/registry.core.js.map +1 -0
  103. package/dist/utils/index.d.ts +7 -0
  104. package/dist/utils/index.d.ts.map +1 -0
  105. package/dist/utils/index.js +7 -0
  106. package/dist/utils/index.js.map +1 -0
  107. package/dist/utils/utils.helper.d.ts +34 -0
  108. package/dist/utils/utils.helper.d.ts.map +1 -0
  109. package/dist/utils/utils.helper.js +82 -0
  110. package/dist/utils/utils.helper.js.map +1 -0
  111. package/dist/validator/index.d.ts +11 -0
  112. package/dist/validator/index.d.ts.map +1 -0
  113. package/dist/validator/index.js +10 -0
  114. package/dist/validator/index.js.map +1 -0
  115. package/dist/validator/validator.types.d.ts +20 -0
  116. package/dist/validator/validator.types.d.ts.map +1 -0
  117. package/dist/validator/validator.types.js +5 -0
  118. package/dist/validator/validator.types.js.map +1 -0
  119. package/dist/validator/validatorAll/index.d.ts +8 -0
  120. package/dist/validator/validatorAll/index.d.ts.map +1 -0
  121. package/dist/validator/validatorAll/index.js +8 -0
  122. package/dist/validator/validatorAll/index.js.map +1 -0
  123. package/dist/validator/validatorAll/validatorAll.core.d.ts +10 -0
  124. package/dist/validator/validatorAll/validatorAll.core.d.ts.map +1 -0
  125. package/dist/validator/validatorAll/validatorAll.core.js +31 -0
  126. package/dist/validator/validatorAll/validatorAll.core.js.map +1 -0
  127. package/dist/validator/validatorAll/validatorNavigation.core.d.ts +10 -0
  128. package/dist/validator/validatorAll/validatorNavigation.core.d.ts.map +1 -0
  129. package/dist/validator/validatorAll/validatorNavigation.core.js +29 -0
  130. package/dist/validator/validatorAll/validatorNavigation.core.js.map +1 -0
  131. package/dist/validator/validatorDocument.core.d.ts +10 -0
  132. package/dist/validator/validatorDocument.core.d.ts.map +1 -0
  133. package/dist/validator/validatorDocument.core.js +45 -0
  134. package/dist/validator/validatorDocument.core.js.map +1 -0
  135. package/dist/validator/validatorDuplicates.core.d.ts +10 -0
  136. package/dist/validator/validatorDuplicates.core.d.ts.map +1 -0
  137. package/dist/validator/validatorDuplicates.core.js +28 -0
  138. package/dist/validator/validatorDuplicates.core.js.map +1 -0
  139. package/dist/validator/validatorLinks.core.d.ts +10 -0
  140. package/dist/validator/validatorLinks.core.d.ts.map +1 -0
  141. package/dist/validator/validatorLinks.core.js +56 -0
  142. package/dist/validator/validatorLinks.core.js.map +1 -0
  143. package/package.json +49 -0
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Validates an entire documentation set.
3
+ */
4
+ import type { DocumentationDocument, DocumentationNavigationItem } from "../../docsTypes/index.js";
5
+ import type { ValidationResult } from "../validator.types.js";
6
+ /**
7
+ * Validates all documents and optionally a navigation tree.
8
+ */
9
+ export declare function validateAll(documents: readonly DocumentationDocument[], navigation?: readonly DocumentationNavigationItem[]): ValidationResult;
10
+ //# sourceMappingURL=validatorAll.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorAll.core.d.ts","sourceRoot":"","sources":["../../../src/validator/validatorAll/validatorAll.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,uBAAuB,CAAC;AAM/E;;GAEG;AACH,wBAAgB,WAAW,CACzB,SAAS,EAAE,SAAS,qBAAqB,EAAE,EAC3C,UAAU,CAAC,EAAE,SAAS,2BAA2B,EAAE,GAClD,gBAAgB,CAyBlB"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Validates an entire documentation set.
3
+ */
4
+ import { validateDocument } from "../validatorDocument.core.js";
5
+ import { validateNoDuplicateIds } from "../validatorDuplicates.core.js";
6
+ import { validateLinks } from "../validatorLinks.core.js";
7
+ import { validateNavigation } from "./validatorNavigation.core.js";
8
+ /**
9
+ * Validates all documents and optionally a navigation tree.
10
+ */
11
+ export function validateAll(documents, navigation) {
12
+ const allIssues = [];
13
+ const idResult = validateNoDuplicateIds(documents);
14
+ allIssues.push(...idResult.issues);
15
+ const registeredIds = new Set(documents.map((d) => d.id));
16
+ for (const doc of documents) {
17
+ const docResult = validateDocument(doc);
18
+ allIssues.push(...docResult.issues);
19
+ const linkResult = validateLinks(doc, registeredIds);
20
+ allIssues.push(...linkResult.issues);
21
+ }
22
+ if (navigation) {
23
+ const navResult = validateNavigation(navigation, registeredIds);
24
+ allIssues.push(...navResult.issues);
25
+ }
26
+ return {
27
+ valid: allIssues.filter((i) => i.severity === "error").length === 0,
28
+ issues: allIssues,
29
+ };
30
+ }
31
+ //# sourceMappingURL=validatorAll.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorAll.core.js","sourceRoot":"","sources":["../../../src/validator/validatorAll/validatorAll.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAOH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE;;GAEG;AACH,MAAM,UAAU,WAAW,CACzB,SAA2C,EAC3C,UAAmD;IAEnD,MAAM,SAAS,GAAsB,EAAE,CAAC;IAExC,MAAM,QAAQ,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACnD,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEnC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAE1D,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC;QACxC,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;QAEpC,MAAM,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QACrD,SAAS,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,UAAU,EAAE,CAAC;QACf,MAAM,SAAS,GAAG,kBAAkB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;QAChE,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IAED,OAAO;QACL,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC;QACnE,MAAM,EAAE,SAAS;KAClB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Validates navigation tree references against registered documents.
3
+ */
4
+ import type { DocumentationNavigationItem } from "../../docsTypes/index.js";
5
+ import type { ValidationResult } from "../validator.types.js";
6
+ /**
7
+ * Validates navigation tree references.
8
+ */
9
+ export declare function validateNavigation(items: readonly DocumentationNavigationItem[], registeredIds: ReadonlySet<string>): ValidationResult;
10
+ //# sourceMappingURL=validatorNavigation.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorNavigation.core.d.ts","sourceRoot":"","sources":["../../../src/validator/validatorAll/validatorNavigation.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,uBAAuB,CAAC;AAE/E;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,2BAA2B,EAAE,EAC7C,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,gBAAgB,CAyBlB"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Validates navigation tree references against registered documents.
3
+ */
4
+ /**
5
+ * Validates navigation tree references.
6
+ */
7
+ export function validateNavigation(items, registeredIds) {
8
+ const issues = [];
9
+ function walk(nodes) {
10
+ for (const node of nodes) {
11
+ if (node.documentId && !registeredIds.has(node.documentId)) {
12
+ issues.push({
13
+ severity: "error",
14
+ code: "NAVIGATION_UNKNOWN_DOCUMENT",
15
+ message: `Navigation item "${node.title}" references unknown document "${node.documentId}".`,
16
+ });
17
+ }
18
+ if (node.children) {
19
+ walk(node.children);
20
+ }
21
+ }
22
+ }
23
+ walk(items);
24
+ return {
25
+ valid: issues.length === 0,
26
+ issues,
27
+ };
28
+ }
29
+ //# sourceMappingURL=validatorNavigation.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorNavigation.core.js","sourceRoot":"","sources":["../../../src/validator/validatorAll/validatorNavigation.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,KAA6C,EAC7C,aAAkC;IAElC,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,SAAS,IAAI,CAAC,KAA6C;QACzD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;gBAC3D,MAAM,CAAC,IAAI,CAAC;oBACV,QAAQ,EAAE,OAAO;oBACjB,IAAI,EAAE,6BAA6B;oBACnC,OAAO,EAAE,oBAAoB,IAAI,CAAC,KAAK,kCAAkC,IAAI,CAAC,UAAU,IAAI;iBAC7F,CAAC,CAAC;YACL,CAAC;YAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,CAAC;IAEZ,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Validates a single document for structural correctness.
3
+ */
4
+ import type { DocumentationDocument } from "../docsTypes/index.js";
5
+ import type { ValidationResult } from "./validator.types.js";
6
+ /**
7
+ * Validates a single document.
8
+ */
9
+ export declare function validateDocument(document: DocumentationDocument): ValidationResult;
10
+ //# sourceMappingURL=validatorDocument.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorDocument.core.d.ts","sourceRoot":"","sources":["../../src/validator/validatorDocument.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AAE9E;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,qBAAqB,GAC9B,gBAAgB,CA0ClB"}
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Validates a single document for structural correctness.
3
+ */
4
+ /**
5
+ * Validates a single document.
6
+ */
7
+ export function validateDocument(document) {
8
+ const issues = [];
9
+ if (!document.id || document.id.trim().length === 0) {
10
+ issues.push({
11
+ severity: "error",
12
+ code: "MISSING_ID",
13
+ message: "Document ID is required.",
14
+ });
15
+ }
16
+ if (!document.title || document.title.trim().length === 0) {
17
+ issues.push({
18
+ severity: "error",
19
+ code: "MISSING_TITLE",
20
+ message: `Document "${document.id}" is missing a title.`,
21
+ documentId: document.id,
22
+ });
23
+ }
24
+ if (!document.content) {
25
+ issues.push({
26
+ severity: "error",
27
+ code: "MISSING_CONTENT",
28
+ message: `Document "${document.id}" is missing content.`,
29
+ documentId: document.id,
30
+ });
31
+ }
32
+ if (document.deprecated && !document.deprecatedMessage) {
33
+ issues.push({
34
+ severity: "warning",
35
+ code: "DEPRECATED_WITHOUT_MESSAGE",
36
+ message: `Document "${document.id}" is deprecated but has no deprecation message.`,
37
+ documentId: document.id,
38
+ });
39
+ }
40
+ return {
41
+ valid: issues.filter((i) => i.severity === "error").length === 0,
42
+ issues,
43
+ };
44
+ }
45
+ //# sourceMappingURL=validatorDocument.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorDocument.core.js","sourceRoot":"","sources":["../../src/validator/validatorDocument.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,MAAM,UAAU,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,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC;QAChE,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Validates that no documents share the same ID.
3
+ */
4
+ import type { DocumentationDocument } from "../docsTypes/index.js";
5
+ import type { ValidationResult } from "./validator.types.js";
6
+ /**
7
+ * Validates no duplicate IDs exist in a collection of documents.
8
+ */
9
+ export declare function validateNoDuplicateIds(documents: readonly DocumentationDocument[]): ValidationResult;
10
+ //# sourceMappingURL=validatorDuplicates.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorDuplicates.core.d.ts","sourceRoot":"","sources":["../../src/validator/validatorDuplicates.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AAE9E;;GAEG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,qBAAqB,EAAE,GAC1C,gBAAgB,CAqBlB"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Validates that no documents share the same ID.
3
+ */
4
+ /**
5
+ * Validates no duplicate IDs exist in a collection of documents.
6
+ */
7
+ export function validateNoDuplicateIds(documents) {
8
+ const seen = new Map();
9
+ const issues = [];
10
+ for (const doc of documents) {
11
+ if (seen.has(doc.id)) {
12
+ issues.push({
13
+ severity: "error",
14
+ code: "DUPLICATE_ID",
15
+ message: `Duplicate document ID: "${doc.id}".`,
16
+ documentId: doc.id,
17
+ });
18
+ }
19
+ else {
20
+ seen.set(doc.id, doc.title);
21
+ }
22
+ }
23
+ return {
24
+ valid: issues.length === 0,
25
+ issues,
26
+ };
27
+ }
28
+ //# sourceMappingURL=validatorDuplicates.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorDuplicates.core.js","sourceRoot":"","sources":["../../src/validator/validatorDuplicates.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,MAAM,UAAU,sBAAsB,CACpC,SAA2C;IAE3C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkB,CAAC;IACvC,MAAM,MAAM,GAAsB,EAAE,CAAC;IAErC,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE,CAAC;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YACrB,MAAM,CAAC,IAAI,CAAC;gBACV,QAAQ,EAAE,OAAO;gBACjB,IAAI,EAAE,cAAc;gBACpB,OAAO,EAAE,2BAA2B,GAAG,CAAC,EAAE,IAAI;gBAC9C,UAAU,EAAE,GAAG,CAAC,EAAE;aACnB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Validates internal links within markdown documentation.
3
+ */
4
+ import type { DocumentationDocument } from "../docsTypes/index.js";
5
+ import type { ValidationResult } from "./validator.types.js";
6
+ /**
7
+ * Validates internal links in a document's markdown content.
8
+ */
9
+ export declare function validateLinks(document: DocumentationDocument, registeredIds: ReadonlySet<string>): ValidationResult;
10
+ //# sourceMappingURL=validatorLinks.core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorLinks.core.d.ts","sourceRoot":"","sources":["../../src/validator/validatorLinks.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,KAAK,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AAE9E;;GAEG;AACH,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,WAAW,CAAC,MAAM,CAAC,GACjC,gBAAgB,CA+DlB"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Validates internal links within markdown documentation.
3
+ */
4
+ /**
5
+ * Validates internal links in a document's markdown content.
6
+ */
7
+ export function validateLinks(document, registeredIds) {
8
+ const issues = [];
9
+ if (document.content.type !== "markdown") {
10
+ return { valid: true, issues: [] };
11
+ }
12
+ const content = document.content.value;
13
+ if (content.length > 100_000) {
14
+ return { valid: true, issues: [] };
15
+ }
16
+ let pos = 0;
17
+ while (pos < content.length) {
18
+ const openBracket = content.indexOf("[", pos);
19
+ if (openBracket === -1)
20
+ break;
21
+ const closeBracket = content.indexOf("]", openBracket + 1);
22
+ if (closeBracket === -1)
23
+ break;
24
+ if (content[closeBracket + 1] !== "(") {
25
+ pos = closeBracket + 1;
26
+ continue;
27
+ }
28
+ const closeParen = content.indexOf(")", closeBracket + 2);
29
+ if (closeParen === -1)
30
+ break;
31
+ const target = content.slice(closeBracket + 2, closeParen);
32
+ if (!target) {
33
+ pos = closeParen + 1;
34
+ continue;
35
+ }
36
+ if (target.startsWith("http://") || target.startsWith("https://")) {
37
+ pos = closeParen + 1;
38
+ continue;
39
+ }
40
+ const cleanTarget = target.replace(/\.md$/, "").replace(/^\.\//, "");
41
+ if (!registeredIds.has(cleanTarget)) {
42
+ issues.push({
43
+ severity: "warning",
44
+ code: "BROKEN_LINK",
45
+ message: `Document "${document.id}" links to "${target}" which is not registered.`,
46
+ documentId: document.id,
47
+ });
48
+ }
49
+ pos = closeParen + 1;
50
+ }
51
+ return {
52
+ valid: issues.length === 0,
53
+ issues,
54
+ };
55
+ }
56
+ //# sourceMappingURL=validatorLinks.core.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatorLinks.core.js","sourceRoot":"","sources":["../../src/validator/validatorLinks.core.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG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GAAG,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QAED,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAClE,GAAG,GAAG,UAAU,GAAG,CAAC,CAAC;YACrB,SAAS;QACX,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAErE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC;gBACV,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,aAAa;gBACnB,OAAO,EAAE,aAAa,QAAQ,CAAC,EAAE,eAAe,MAAM,4BAA4B;gBAClF,UAAU,EAAE,QAAQ,CAAC,EAAE;aACxB,CAAC,CAAC;QACL,CAAC;QAED,GAAG,GAAG,UAAU,GAAG,CAAC,CAAC;IACvB,CAAC;IAED,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC;QAC1B,MAAM;KACP,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@zudojs/docs",
3
+ "version": "0.0.1",
4
+ "description": "Documentation infrastructure with structured document model, registry, validation, navigation, and generation.",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "types": "./dist/index.d.ts"
11
+ }
12
+ },
13
+ "dependencies": {
14
+ "@zudojs/errors": "0.0.1"
15
+ },
16
+ "devDependencies": {
17
+ "typescript": "^5.7.0",
18
+ "vitest": "^3.2.0"
19
+ },
20
+ "license": "MIT",
21
+ "type": "module",
22
+ "files": [
23
+ "dist"
24
+ ],
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "engines": {
29
+ "node": ">=24.0.0"
30
+ },
31
+ "module": "./dist/index.js",
32
+ "keywords": [
33
+ "zudojs",
34
+ "docs",
35
+ "documentation",
36
+ "markdown"
37
+ ],
38
+ "homepage": "https://github.com/oyinlola-tech/zudo#readme",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "https://github.com/oyinlola-tech/zudo"
42
+ },
43
+ "scripts": {
44
+ "build": "tsc -p tsconfig.json",
45
+ "typecheck": "tsc -p tsconfig.json --noEmit",
46
+ "test": "vitest run",
47
+ "test:watch": "vitest"
48
+ }
49
+ }