specra 0.1.14 → 0.2.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 (276) hide show
  1. package/LICENSE.MD +25 -4
  2. package/README.md +67 -58
  3. package/config/specra.config.schema.json +16 -0
  4. package/config/svelte-config.js +63 -0
  5. package/dist/api-parser.types.d.ts +59 -0
  6. package/dist/api-parser.types.js +5 -0
  7. package/dist/api.types.d.ts +137 -0
  8. package/dist/api.types.js +5 -0
  9. package/dist/category.d.ts +21 -0
  10. package/dist/category.js +48 -0
  11. package/dist/components/ConfigProvider.svelte +13 -0
  12. package/dist/components/ConfigProvider.svelte.d.ts +31 -0
  13. package/dist/components/docs/Accordion.svelte +18 -0
  14. package/dist/components/docs/Accordion.svelte.d.ts +10 -0
  15. package/dist/components/docs/AccordionItem.svelte +41 -0
  16. package/dist/components/docs/AccordionItem.svelte.d.ts +10 -0
  17. package/dist/components/docs/Badge.svelte +28 -0
  18. package/dist/components/docs/Badge.svelte.d.ts +9 -0
  19. package/dist/components/docs/Breadcrumb.svelte +80 -0
  20. package/dist/components/docs/Breadcrumb.svelte.d.ts +8 -0
  21. package/dist/components/docs/Callout.svelte +96 -0
  22. package/dist/components/docs/Callout.svelte.d.ts +10 -0
  23. package/dist/components/docs/Card.svelte +63 -0
  24. package/dist/components/docs/Card.svelte.d.ts +12 -0
  25. package/dist/components/docs/CardGrid.svelte +24 -0
  26. package/dist/components/docs/CardGrid.svelte.d.ts +8 -0
  27. package/dist/components/docs/CategoryIndex.svelte +110 -0
  28. package/dist/components/docs/CategoryIndex.svelte.d.ts +29 -0
  29. package/dist/components/docs/CodeBlock.svelte +172 -0
  30. package/dist/components/docs/CodeBlock.svelte.d.ts +8 -0
  31. package/dist/components/docs/Column.svelte +25 -0
  32. package/dist/components/docs/Column.svelte.d.ts +8 -0
  33. package/dist/components/docs/Columns.svelte +38 -0
  34. package/dist/components/docs/Columns.svelte.d.ts +13 -0
  35. package/dist/components/docs/DevModeBadge.svelte +15 -0
  36. package/dist/components/docs/DevModeBadge.svelte.d.ts +18 -0
  37. package/dist/components/docs/DocBadge.svelte +28 -0
  38. package/dist/components/docs/DocBadge.svelte.d.ts +9 -0
  39. package/dist/components/docs/DocLayout.svelte +107 -0
  40. package/dist/components/docs/DocLayout.svelte.d.ts +32 -0
  41. package/dist/components/docs/DocLoading.svelte +53 -0
  42. package/dist/components/docs/DocLoading.svelte.d.ts +18 -0
  43. package/dist/components/docs/DocMetadata.svelte +106 -0
  44. package/dist/components/docs/DocMetadata.svelte.d.ts +18 -0
  45. package/dist/components/docs/DocNavigation.svelte +56 -0
  46. package/dist/components/docs/DocNavigation.svelte.d.ts +12 -0
  47. package/dist/components/docs/DocTags.svelte +22 -0
  48. package/dist/components/docs/DocTags.svelte.d.ts +6 -0
  49. package/dist/components/docs/DraftBadge.svelte +10 -0
  50. package/dist/components/docs/DraftBadge.svelte.d.ts +18 -0
  51. package/dist/components/docs/Footer.svelte +72 -0
  52. package/dist/components/docs/Footer.svelte.d.ts +7 -0
  53. package/dist/components/docs/Frame.svelte +27 -0
  54. package/dist/components/docs/Frame.svelte.d.ts +9 -0
  55. package/dist/components/docs/Header.svelte +123 -0
  56. package/dist/components/docs/Header.svelte.d.ts +9 -0
  57. package/dist/components/docs/HeaderWithMenu.svelte +34 -0
  58. package/dist/components/docs/HeaderWithMenu.svelte.d.ts +17 -0
  59. package/dist/components/docs/HotReloadIndicator.svelte +44 -0
  60. package/dist/components/docs/HotReloadIndicator.svelte.d.ts +3 -0
  61. package/dist/components/docs/Icon.svelte +103 -0
  62. package/dist/components/docs/Icon.svelte.d.ts +11 -0
  63. package/dist/components/docs/Image.svelte +88 -0
  64. package/dist/components/docs/Image.svelte.d.ts +11 -0
  65. package/dist/components/docs/ImageCard.svelte +91 -0
  66. package/dist/components/docs/ImageCard.svelte.d.ts +12 -0
  67. package/dist/components/docs/ImageCardGrid.svelte +25 -0
  68. package/dist/components/docs/ImageCardGrid.svelte.d.ts +8 -0
  69. package/dist/components/docs/LayoutProviders.svelte +57 -0
  70. package/dist/components/docs/LayoutProviders.svelte.d.ts +9 -0
  71. package/dist/components/docs/Logo.svelte +25 -0
  72. package/dist/components/docs/Logo.svelte.d.ts +11 -0
  73. package/dist/components/docs/Math.svelte +54 -0
  74. package/dist/components/docs/Math.svelte.d.ts +7 -0
  75. package/dist/components/docs/MdxContent.svelte +41 -0
  76. package/dist/components/docs/MdxHotReload.svelte +78 -0
  77. package/dist/components/docs/MdxHotReload.svelte.d.ts +9 -0
  78. package/dist/components/docs/MdxLayout.svelte +16 -0
  79. package/dist/components/docs/MdxLayout.svelte.d.ts +6 -0
  80. package/dist/components/docs/Mermaid.svelte +88 -0
  81. package/dist/components/docs/Mermaid.svelte.d.ts +7 -0
  82. package/dist/components/docs/MobileDocLayout.svelte +211 -0
  83. package/dist/components/docs/MobileDocLayout.svelte.d.ts +35 -0
  84. package/dist/components/docs/MobileSidebar.svelte +122 -0
  85. package/dist/components/docs/MobileSidebar.svelte.d.ts +31 -0
  86. package/dist/components/docs/MobileSidebarWrapper.svelte +122 -0
  87. package/dist/components/docs/MobileSidebarWrapper.svelte.d.ts +32 -0
  88. package/dist/components/docs/NotFoundContent.svelte +40 -0
  89. package/dist/components/docs/NotFoundContent.svelte.d.ts +6 -0
  90. package/dist/components/docs/SearchHighlight.svelte +116 -0
  91. package/dist/components/docs/SearchHighlight.svelte.d.ts +3 -0
  92. package/dist/components/docs/SearchModal.svelte +239 -0
  93. package/dist/components/docs/SearchModal.svelte.d.ts +9 -0
  94. package/dist/components/docs/Sidebar.svelte +69 -0
  95. package/dist/components/docs/Sidebar.svelte.d.ts +31 -0
  96. package/dist/components/docs/SidebarMenuItems.svelte +344 -0
  97. package/dist/components/docs/SidebarMenuItems.svelte.d.ts +33 -0
  98. package/dist/components/docs/SidebarSkeleton.svelte +50 -0
  99. package/dist/components/docs/SidebarSkeleton.svelte.d.ts +18 -0
  100. package/dist/components/docs/SiteBanner.svelte +92 -0
  101. package/dist/components/docs/SiteBanner.svelte.d.ts +7 -0
  102. package/dist/components/docs/Step.svelte +44 -0
  103. package/dist/components/docs/Step.svelte.d.ts +8 -0
  104. package/dist/components/docs/Steps.svelte +15 -0
  105. package/dist/components/docs/Steps.svelte.d.ts +7 -0
  106. package/dist/components/docs/Tab.svelte +40 -0
  107. package/dist/components/docs/Tab.svelte.d.ts +8 -0
  108. package/dist/components/docs/TabGroups.svelte +183 -0
  109. package/dist/components/docs/TabGroups.svelte.d.ts +25 -0
  110. package/dist/components/docs/TableOfContents.svelte +100 -0
  111. package/dist/components/docs/TableOfContents.svelte.d.ts +9 -0
  112. package/dist/components/docs/Tabs.svelte +69 -0
  113. package/dist/components/docs/Tabs.svelte.d.ts +8 -0
  114. package/dist/components/docs/ThemeToggle.svelte +16 -0
  115. package/dist/components/docs/ThemeToggle.svelte.d.ts +18 -0
  116. package/dist/components/docs/Tooltip.svelte +44 -0
  117. package/dist/components/docs/Tooltip.svelte.d.ts +10 -0
  118. package/dist/components/docs/VersionSwitcher.svelte +95 -0
  119. package/dist/components/docs/VersionSwitcher.svelte.d.ts +7 -0
  120. package/dist/components/docs/Video.svelte +84 -0
  121. package/dist/components/docs/Video.svelte.d.ts +12 -0
  122. package/dist/components/docs/api/ApiEndpoint.svelte +61 -0
  123. package/dist/components/docs/api/ApiEndpoint.svelte.d.ts +11 -0
  124. package/dist/components/docs/api/ApiParams.svelte +80 -0
  125. package/dist/components/docs/api/ApiParams.svelte.d.ts +14 -0
  126. package/dist/components/docs/api/ApiPlayground.svelte +259 -0
  127. package/dist/components/docs/api/ApiPlayground.svelte.d.ts +16 -0
  128. package/dist/components/docs/api/ApiReference.svelte +278 -0
  129. package/dist/components/docs/api/ApiReference.svelte.d.ts +23 -0
  130. package/dist/components/docs/api/ApiResponse.svelte +66 -0
  131. package/dist/components/docs/api/ApiResponse.svelte.d.ts +9 -0
  132. package/dist/components/docs/api/index.d.ts +5 -0
  133. package/dist/components/docs/api/index.js +5 -0
  134. package/dist/components/docs/componentTextProps.d.ts +3 -0
  135. package/dist/components/docs/componentTextProps.js +61 -0
  136. package/dist/components/docs/index.d.ts +54 -0
  137. package/dist/components/docs/index.js +56 -0
  138. package/dist/components/global/VersionNotFound.svelte +48 -0
  139. package/dist/components/global/VersionNotFound.svelte.d.ts +7 -0
  140. package/dist/components/global/index.d.ts +1 -0
  141. package/dist/components/global/index.js +1 -0
  142. package/dist/components/index.d.ts +6 -822
  143. package/dist/components/index.js +11 -3857
  144. package/dist/components/ui/Badge.svelte +48 -0
  145. package/dist/components/ui/Badge.svelte.d.ts +15 -0
  146. package/dist/components/ui/Button.svelte +58 -0
  147. package/dist/components/ui/Button.svelte.d.ts +17 -0
  148. package/dist/components/ui/Dialog.svelte +16 -0
  149. package/dist/components/ui/Dialog.svelte.d.ts +9 -0
  150. package/dist/components/ui/DialogClose.svelte +16 -0
  151. package/dist/components/ui/DialogClose.svelte.d.ts +9 -0
  152. package/dist/components/ui/DialogContent.svelte +43 -0
  153. package/dist/components/ui/DialogContent.svelte.d.ts +10 -0
  154. package/dist/components/ui/DialogDescription.svelte +21 -0
  155. package/dist/components/ui/DialogDescription.svelte.d.ts +9 -0
  156. package/dist/components/ui/DialogFooter.svelte +20 -0
  157. package/dist/components/ui/DialogFooter.svelte.d.ts +9 -0
  158. package/dist/components/ui/DialogHeader.svelte +20 -0
  159. package/dist/components/ui/DialogHeader.svelte.d.ts +9 -0
  160. package/dist/components/ui/DialogTitle.svelte +21 -0
  161. package/dist/components/ui/DialogTitle.svelte.d.ts +9 -0
  162. package/dist/components/ui/Input.svelte +23 -0
  163. package/dist/components/ui/Input.svelte.d.ts +8 -0
  164. package/dist/components/ui/Textarea.svelte +19 -0
  165. package/dist/components/ui/Textarea.svelte.d.ts +7 -0
  166. package/dist/components/ui/index.d.ts +11 -0
  167. package/dist/components/ui/index.js +11 -0
  168. package/dist/config.d.ts +8 -0
  169. package/dist/config.js +9 -0
  170. package/dist/config.schema.json +471 -0
  171. package/dist/config.server.d.ts +46 -0
  172. package/dist/config.server.js +149 -0
  173. package/dist/{mdx-ColN3Cyg.d.mts → config.types.d.ts} +22 -75
  174. package/dist/config.types.js +39 -0
  175. package/dist/dev-utils.d.ts +29 -0
  176. package/dist/dev-utils.js +63 -0
  177. package/dist/index.d.ts +19 -4
  178. package/dist/index.js +25 -4864
  179. package/dist/mdx-cache.d.ts +41 -0
  180. package/dist/mdx-cache.js +160 -0
  181. package/dist/mdx-components.js +50 -1931
  182. package/dist/mdx-security.d.ts +76 -0
  183. package/dist/mdx-security.js +217 -0
  184. package/dist/mdx.d.ts +73 -0
  185. package/dist/mdx.js +1099 -0
  186. package/dist/middleware/index.d.ts +1 -0
  187. package/dist/middleware/index.js +2 -0
  188. package/dist/middleware/security.d.ts +22 -47
  189. package/dist/middleware/security.js +111 -137
  190. package/dist/parsers/base-parser.d.ts +14 -0
  191. package/dist/parsers/base-parser.js +1 -0
  192. package/dist/parsers/index.d.ts +16 -0
  193. package/dist/parsers/index.js +51 -0
  194. package/dist/parsers/openapi-parser.d.ts +18 -0
  195. package/dist/parsers/openapi-parser.js +209 -0
  196. package/dist/parsers/postman-parser.d.ts +20 -0
  197. package/dist/parsers/postman-parser.js +260 -0
  198. package/dist/parsers/specra-parser.d.ts +10 -0
  199. package/dist/parsers/specra-parser.js +18 -0
  200. package/dist/redirects.d.ts +12 -0
  201. package/dist/redirects.js +30 -0
  202. package/dist/remark-code-meta.d.ts +6 -0
  203. package/dist/remark-code-meta.js +21 -0
  204. package/dist/sidebar-utils.d.ts +59 -0
  205. package/dist/sidebar-utils.js +144 -0
  206. package/dist/stores/config.d.ts +20 -0
  207. package/dist/stores/config.js +45 -0
  208. package/dist/stores/index.d.ts +4 -0
  209. package/dist/stores/index.js +4 -0
  210. package/dist/stores/sidebar.d.ts +7 -0
  211. package/dist/stores/sidebar.js +12 -0
  212. package/dist/stores/tabs.d.ts +6 -0
  213. package/dist/stores/tabs.js +41 -0
  214. package/dist/stores/theme.d.ts +7 -0
  215. package/dist/stores/theme.js +75 -0
  216. package/dist/{styles.css → styles/globals.css} +136 -6
  217. package/dist/toc.d.ts +9 -0
  218. package/dist/toc.js +15 -0
  219. package/dist/utils.d.ts +13 -0
  220. package/dist/utils.js +30 -0
  221. package/package.json +49 -91
  222. package/dist/app/api/mdx-watch/route.d.mts +0 -10
  223. package/dist/app/api/mdx-watch/route.d.ts +0 -10
  224. package/dist/app/api/mdx-watch/route.js +0 -118
  225. package/dist/app/api/mdx-watch/route.js.map +0 -1
  226. package/dist/app/api/mdx-watch/route.mjs +0 -91
  227. package/dist/app/api/mdx-watch/route.mjs.map +0 -1
  228. package/dist/chunk-6S3EJVEO.mjs +0 -259
  229. package/dist/chunk-6S3EJVEO.mjs.map +0 -1
  230. package/dist/chunk-BE7EROIW.mjs +0 -212
  231. package/dist/chunk-BE7EROIW.mjs.map +0 -1
  232. package/dist/chunk-CWHRZHZO.mjs +0 -168
  233. package/dist/chunk-CWHRZHZO.mjs.map +0 -1
  234. package/dist/chunk-D5VDVYFY.mjs +0 -1325
  235. package/dist/chunk-D5VDVYFY.mjs.map +0 -1
  236. package/dist/chunk-WMCO2UX5.mjs +0 -585
  237. package/dist/chunk-WMCO2UX5.mjs.map +0 -1
  238. package/dist/chunk-XEMGCPZZ.mjs +0 -475
  239. package/dist/chunk-XEMGCPZZ.mjs.map +0 -1
  240. package/dist/components/index.d.mts +0 -822
  241. package/dist/components/index.js.map +0 -1
  242. package/dist/components/index.mjs +0 -3744
  243. package/dist/components/index.mjs.map +0 -1
  244. package/dist/index.d.mts +0 -4
  245. package/dist/index.js.map +0 -1
  246. package/dist/index.mjs +0 -1900
  247. package/dist/index.mjs.map +0 -1
  248. package/dist/layouts/index.d.mts +0 -34
  249. package/dist/layouts/index.d.ts +0 -34
  250. package/dist/layouts/index.js +0 -453
  251. package/dist/layouts/index.js.map +0 -1
  252. package/dist/layouts/index.mjs +0 -173
  253. package/dist/layouts/index.mjs.map +0 -1
  254. package/dist/lib/index.d.mts +0 -583
  255. package/dist/lib/index.d.ts +0 -583
  256. package/dist/lib/index.js +0 -1595
  257. package/dist/lib/index.js.map +0 -1
  258. package/dist/lib/index.mjs +0 -111
  259. package/dist/lib/index.mjs.map +0 -1
  260. package/dist/mdx-ColN3Cyg.d.ts +0 -352
  261. package/dist/mdx-components.d.mts +0 -86
  262. package/dist/mdx-components.d.ts +0 -86
  263. package/dist/mdx-components.js.map +0 -1
  264. package/dist/mdx-components.mjs +0 -206
  265. package/dist/mdx-components.mjs.map +0 -1
  266. package/dist/middleware/security.d.mts +0 -82
  267. package/dist/middleware/security.js.map +0 -1
  268. package/dist/middleware/security.mjs +0 -84
  269. package/dist/middleware/security.mjs.map +0 -1
  270. package/dist/styles.css.map +0 -1
  271. package/dist/styles.d.mts +0 -2
  272. package/dist/styles.d.ts +0 -2
  273. package/dist/styles.js +0 -2
  274. package/dist/styles.js.map +0 -1
  275. package/dist/styles.mjs +0 -1
  276. package/dist/styles.mjs.map +0 -1
@@ -0,0 +1,471 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "title": "Specra Configuration",
4
+ "description": "Configuration schema for Specra documentation system",
5
+ "type": "object",
6
+ "required": ["site"],
7
+ "properties": {
8
+ "site": {
9
+ "type": "object",
10
+ "description": "Site metadata and branding",
11
+ "required": ["title"],
12
+ "properties": {
13
+ "title": {
14
+ "type": "string",
15
+ "description": "The title of the documentation site"
16
+ },
17
+ "description": {
18
+ "type": "string",
19
+ "description": "Short description of the documentation"
20
+ },
21
+ "url": {
22
+ "type": "string",
23
+ "format": "uri",
24
+ "description": "URL where the documentation is hosted"
25
+ },
26
+ "baseUrl": {
27
+ "type": "string",
28
+ "description": "Base URL path for the documentation (e.g., '/docs')"
29
+ },
30
+ "logo": {
31
+ "description": "Path to the site logo - can be a string or an object with light/dark variants",
32
+ "oneOf": [
33
+ {
34
+ "type": "string"
35
+ },
36
+ {
37
+ "type": "object",
38
+ "properties": {
39
+ "light": {
40
+ "type": "string"
41
+ },
42
+ "dark": {
43
+ "type": "string"
44
+ }
45
+ },
46
+ "required": ["light", "dark"]
47
+ }
48
+ ]
49
+ },
50
+ "favicon": {
51
+ "type": "string",
52
+ "description": "Path to the favicon"
53
+ },
54
+ "language": {
55
+ "type": "string",
56
+ "description": "Default language for the documentation"
57
+ },
58
+ "organizationName": {
59
+ "type": "string",
60
+ "description": "Organization or author name"
61
+ },
62
+ "projectName": {
63
+ "type": "string",
64
+ "description": "Project name"
65
+ },
66
+ "activeVersion": {
67
+ "type": "string",
68
+ "description": "Active/default version for the documentation"
69
+ },
70
+ "hideTitle": {
71
+ "type": "boolean",
72
+ "description": "Whether to hide the site title in the header"
73
+ },
74
+ "hideLogo": {
75
+ "type": "boolean",
76
+ "description": "Whether to hide the site logo in the header"
77
+ }
78
+ }
79
+ },
80
+ "theme": {
81
+ "type": "object",
82
+ "description": "Theme and appearance settings",
83
+ "properties": {
84
+ "primaryColor": {
85
+ "type": "string",
86
+ "description": "Primary color for the theme"
87
+ },
88
+ "defaultMode": {
89
+ "type": "string",
90
+ "enum": ["light", "dark", "system"],
91
+ "description": "Default theme mode"
92
+ },
93
+ "respectPrefersColorScheme": {
94
+ "type": "boolean",
95
+ "description": "Whether to respect system preferences"
96
+ },
97
+ "customCss": {
98
+ "type": "string",
99
+ "description": "Custom CSS file path"
100
+ }
101
+ }
102
+ },
103
+ "navigation": {
104
+ "type": "object",
105
+ "description": "Navigation and sidebar configuration",
106
+ "properties": {
107
+ "showSidebar": {
108
+ "type": "boolean",
109
+ "description": "Whether to show the sidebar by default"
110
+ },
111
+ "collapsibleSidebar": {
112
+ "type": "boolean",
113
+ "description": "Whether the sidebar is collapsible"
114
+ },
115
+ "showBreadcrumbs": {
116
+ "type": "boolean",
117
+ "description": "Whether to show breadcrumbs"
118
+ },
119
+ "showTableOfContents": {
120
+ "type": "boolean",
121
+ "description": "Whether to show table of contents"
122
+ },
123
+ "tocPosition": {
124
+ "type": "string",
125
+ "enum": ["left", "right"],
126
+ "description": "Position of table of contents"
127
+ },
128
+ "tocMaxDepth": {
129
+ "type": "number",
130
+ "description": "Maximum depth for table of contents"
131
+ },
132
+ "tabGroups": {
133
+ "type": "array",
134
+ "description": "Tab groups for organizing documentation sections",
135
+ "items": {
136
+ "type": "object",
137
+ "required": ["id", "label"],
138
+ "properties": {
139
+ "id": {
140
+ "type": "string",
141
+ "description": "Unique identifier for the tab group"
142
+ },
143
+ "label": {
144
+ "type": "string",
145
+ "description": "Display label for the tab"
146
+ },
147
+ "icon": {
148
+ "type": "string",
149
+ "description": "Optional icon name (lucide-react icon)"
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ },
156
+ "social": {
157
+ "type": "object",
158
+ "description": "Social and external links",
159
+ "properties": {
160
+ "github": {
161
+ "type": "string",
162
+ "format": "uri",
163
+ "description": "GitHub repository URL"
164
+ },
165
+ "twitter": {
166
+ "type": "string",
167
+ "description": "Twitter/X handle or URL"
168
+ },
169
+ "discord": {
170
+ "type": "string",
171
+ "format": "uri",
172
+ "description": "Discord invite URL"
173
+ },
174
+ "linkedin": {
175
+ "type": "string",
176
+ "format": "uri",
177
+ "description": "LinkedIn profile or company page"
178
+ },
179
+ "youtube": {
180
+ "type": "string",
181
+ "format": "uri",
182
+ "description": "YouTube channel URL"
183
+ },
184
+ "custom": {
185
+ "type": "array",
186
+ "description": "Custom social links",
187
+ "items": {
188
+ "type": "object",
189
+ "required": ["label", "href"],
190
+ "properties": {
191
+ "label": {
192
+ "type": "string"
193
+ },
194
+ "href": {
195
+ "type": "string",
196
+ "format": "uri"
197
+ },
198
+ "icon": {
199
+ "type": "string"
200
+ }
201
+ }
202
+ }
203
+ }
204
+ }
205
+ },
206
+ "search": {
207
+ "type": "object",
208
+ "description": "Search configuration",
209
+ "properties": {
210
+ "enabled": {
211
+ "type": "boolean",
212
+ "description": "Enable/disable search functionality"
213
+ },
214
+ "placeholder": {
215
+ "type": "string",
216
+ "description": "Placeholder text for search input"
217
+ },
218
+ "provider": {
219
+ "type": "string",
220
+ "enum": ["meilisearch", "algolia", "local"],
221
+ "description": "Search provider type"
222
+ },
223
+ "meilisearch": {
224
+ "type": "object",
225
+ "description": "Meilisearch configuration",
226
+ "required": ["host", "indexName"],
227
+ "properties": {
228
+ "host": {
229
+ "type": "string",
230
+ "format": "uri",
231
+ "description": "Meilisearch server URL"
232
+ },
233
+ "apiKey": {
234
+ "type": "string",
235
+ "description": "API key for Meilisearch"
236
+ },
237
+ "indexName": {
238
+ "type": "string",
239
+ "description": "Index name"
240
+ }
241
+ }
242
+ }
243
+ }
244
+ },
245
+ "analytics": {
246
+ "type": "object",
247
+ "description": "Analytics configuration",
248
+ "properties": {
249
+ "googleAnalytics": {
250
+ "type": "string",
251
+ "description": "Google Analytics tracking ID"
252
+ },
253
+ "googleTagManager": {
254
+ "type": "string",
255
+ "description": "Google Tag Manager ID"
256
+ },
257
+ "plausible": {
258
+ "type": "string",
259
+ "description": "Plausible Analytics domain"
260
+ },
261
+ "custom": {
262
+ "type": "array",
263
+ "description": "Custom analytics scripts",
264
+ "items": {
265
+ "type": "object",
266
+ "required": ["src"],
267
+ "properties": {
268
+ "src": {
269
+ "type": "string",
270
+ "format": "uri"
271
+ },
272
+ "async": {
273
+ "type": "boolean"
274
+ },
275
+ "defer": {
276
+ "type": "boolean"
277
+ }
278
+ }
279
+ }
280
+ }
281
+ }
282
+ },
283
+ "footer": {
284
+ "type": "object",
285
+ "description": "Footer configuration",
286
+ "properties": {
287
+ "copyright": {
288
+ "type": "string",
289
+ "description": "Copyright text"
290
+ },
291
+ "links": {
292
+ "type": "array",
293
+ "description": "Footer links organized by columns",
294
+ "items": {
295
+ "type": "object",
296
+ "required": ["title", "items"],
297
+ "properties": {
298
+ "title": {
299
+ "type": "string"
300
+ },
301
+ "items": {
302
+ "type": "array",
303
+ "items": {
304
+ "type": "object",
305
+ "required": ["label", "href"],
306
+ "properties": {
307
+ "label": {
308
+ "type": "string"
309
+ },
310
+ "href": {
311
+ "type": "string"
312
+ }
313
+ }
314
+ }
315
+ }
316
+ }
317
+ }
318
+ },
319
+ "customContent": {
320
+ "type": "string",
321
+ "description": "Custom footer content"
322
+ },
323
+ "branding": {
324
+ "type": "object",
325
+ "description": "Branding configuration for 'Powered by' section",
326
+ "properties": {
327
+ "showBranding": {
328
+ "type": "boolean",
329
+ "description": "Whether to show the branding"
330
+ },
331
+ "logo": {
332
+ "description": "Logo for the branding - can be a string or an object with light/dark variants",
333
+ "oneOf": [
334
+ {
335
+ "type": "string"
336
+ },
337
+ {
338
+ "type": "object",
339
+ "properties": {
340
+ "light": {
341
+ "type": "string"
342
+ },
343
+ "dark": {
344
+ "type": "string"
345
+ }
346
+ },
347
+ "required": ["light", "dark"]
348
+ }
349
+ ]
350
+ },
351
+ "title": {
352
+ "type": "string",
353
+ "description": "Title text for the branding"
354
+ },
355
+ "url": {
356
+ "type": "string",
357
+ "format": "uri",
358
+ "description": "URL to link to when branding is clicked"
359
+ }
360
+ }
361
+ }
362
+ }
363
+ },
364
+ "banner": {
365
+ "type": "object",
366
+ "description": "Site-wide banner configuration",
367
+ "properties": {
368
+ "enabled": {
369
+ "type": "boolean",
370
+ "description": "Whether the banner is enabled"
371
+ },
372
+ "message": {
373
+ "type": "string",
374
+ "description": "Banner message"
375
+ },
376
+ "type": {
377
+ "type": "string",
378
+ "enum": ["info", "warning", "success", "error"],
379
+ "description": "Banner type"
380
+ },
381
+ "dismissible": {
382
+ "type": "boolean",
383
+ "description": "Whether the banner can be dismissed"
384
+ }
385
+ }
386
+ },
387
+ "features": {
388
+ "type": "object",
389
+ "description": "Documentation features",
390
+ "properties": {
391
+ "editUrl": {
392
+ "description": "Enable/disable edit this page links",
393
+ "oneOf": [
394
+ {
395
+ "type": "string",
396
+ "format": "uri"
397
+ },
398
+ {
399
+ "type": "boolean",
400
+ "enum": [false]
401
+ }
402
+ ]
403
+ },
404
+ "showLastUpdated": {
405
+ "type": "boolean",
406
+ "description": "Show last updated timestamp"
407
+ },
408
+ "showReadingTime": {
409
+ "type": "boolean",
410
+ "description": "Show reading time estimate"
411
+ },
412
+ "showAuthors": {
413
+ "type": "boolean",
414
+ "description": "Show author information"
415
+ },
416
+ "showTags": {
417
+ "type": "boolean",
418
+ "description": "Show tags"
419
+ },
420
+ "versioning": {
421
+ "type": "boolean",
422
+ "description": "Enable version dropdown"
423
+ },
424
+ "i18n": {
425
+ "type": "boolean",
426
+ "description": "Enable i18n (internationalization)"
427
+ }
428
+ }
429
+ },
430
+ "env": {
431
+ "type": "object",
432
+ "description": "Environment variables that can be used in documentation",
433
+ "additionalProperties": {
434
+ "type": "string"
435
+ },
436
+ "properties": {
437
+ "API_BASE_URL": {
438
+ "type": "string",
439
+ "description": "API base URL"
440
+ },
441
+ "API_VERSION": {
442
+ "type": "string",
443
+ "description": "API version"
444
+ },
445
+ "CDN_URL": {
446
+ "type": "string",
447
+ "description": "CDN URL"
448
+ }
449
+ }
450
+ },
451
+ "deployment": {
452
+ "type": "object",
453
+ "description": "Deployment configuration for different hosting scenarios",
454
+ "properties": {
455
+ "target": {
456
+ "type": "string",
457
+ "enum": ["vercel", "github-pages", "static", "custom-domain-static"],
458
+ "description": "Deployment target"
459
+ },
460
+ "basePath": {
461
+ "type": "string",
462
+ "description": "Base path for assets when deploying to GitHub Pages without custom domain"
463
+ },
464
+ "customDomain": {
465
+ "type": "boolean",
466
+ "description": "Whether a custom domain is configured"
467
+ }
468
+ }
469
+ }
470
+ }
471
+ }
@@ -0,0 +1,46 @@
1
+ import type { SpecraConfig } from "./config.types";
2
+ /**
3
+ * Load and parse the Specra configuration file
4
+ * Falls back to default configuration if file doesn't exist or is invalid
5
+ */
6
+ export declare function loadConfig(userConfig: Partial<SpecraConfig>): SpecraConfig;
7
+ /**
8
+ * Get a specific configuration value by path (SERVER ONLY)
9
+ * Example: getConfigValue('site.title') or getConfigValue('theme.defaultMode')
10
+ */
11
+ export declare function getConfigValue<T = any>(path: string, config?: SpecraConfig): T | undefined;
12
+ /**
13
+ * Replace environment variables in a string (SERVER ONLY)
14
+ * Supports ${ENV_VAR} and {{ENV_VAR}} syntax
15
+ */
16
+ export declare function replaceEnvVariables(text: string, config?: SpecraConfig): string;
17
+ /**
18
+ * Process content and replace all environment variables (SERVER ONLY)
19
+ */
20
+ export declare function processContentWithEnv(content: string, config?: SpecraConfig): string;
21
+ /**
22
+ * Validate configuration (basic validation) (SERVER ONLY)
23
+ */
24
+ export declare function validateConfig(config: SpecraConfig): {
25
+ valid: boolean;
26
+ errors: string[];
27
+ };
28
+ /**
29
+ * Initialize the Specra configuration
30
+ * Can be called multiple times - subsequent calls will update the config
31
+ * @param userConfig - Partial configuration to merge with defaults
32
+ * @returns The initialized configuration
33
+ */
34
+ export declare function initConfig(userConfig: Partial<SpecraConfig>): SpecraConfig;
35
+ /**
36
+ * Get the configuration instance (cached) (SERVER ONLY)
37
+ * If not initialized, returns default config
38
+ */
39
+ export declare function getConfig(): SpecraConfig;
40
+ /**
41
+ * Reload the configuration (useful for development) (SERVER ONLY)
42
+ */
43
+ export declare function reloadConfig(userConfig: Partial<SpecraConfig>): SpecraConfig;
44
+ /**
45
+ * Export the loaded config as default (SERVER ONLY)
46
+ */
@@ -0,0 +1,149 @@
1
+ import { defaultConfig } from "./config.types";
2
+ /**
3
+ * Deep merge two objects
4
+ */
5
+ function deepMerge(target, source) {
6
+ const result = { ...target };
7
+ for (const key in source) {
8
+ const sourceValue = source[key];
9
+ const targetValue = result[key];
10
+ if (sourceValue && typeof sourceValue === "object" && !Array.isArray(sourceValue)) {
11
+ result[key] = deepMerge(targetValue && typeof targetValue === "object" ? targetValue : {}, sourceValue);
12
+ }
13
+ else if (sourceValue !== undefined) {
14
+ result[key] = sourceValue;
15
+ }
16
+ }
17
+ return result;
18
+ }
19
+ /**
20
+ * Load and parse the Specra configuration file
21
+ * Falls back to default configuration if file doesn't exist or is invalid
22
+ */
23
+ export function loadConfig(userConfig) {
24
+ try {
25
+ // const userConfig = specraConfigJson as unknown as Partial<SpecraConfig>
26
+ // Merge user config with defaults
27
+ const config = deepMerge(defaultConfig, userConfig);
28
+ return config;
29
+ }
30
+ catch (error) {
31
+ console.error(`❌ Error loading configuration:`, error);
32
+ console.warn("Using default configuration.");
33
+ return defaultConfig;
34
+ }
35
+ }
36
+ /**
37
+ * Get a specific configuration value by path (SERVER ONLY)
38
+ * Example: getConfigValue('site.title') or getConfigValue('theme.defaultMode')
39
+ */
40
+ export function getConfigValue(path, config) {
41
+ const cfg = config || loadConfig({});
42
+ const keys = path.split(".");
43
+ let value = cfg;
44
+ for (const key of keys) {
45
+ if (value && typeof value === "object" && key in value) {
46
+ value = value[key];
47
+ }
48
+ else {
49
+ return undefined;
50
+ }
51
+ }
52
+ return value;
53
+ }
54
+ /**
55
+ * Replace environment variables in a string (SERVER ONLY)
56
+ * Supports ${ENV_VAR} and {{ENV_VAR}} syntax
57
+ */
58
+ export function replaceEnvVariables(text, config) {
59
+ const cfg = config || loadConfig({});
60
+ const envVars = cfg.env || {};
61
+ let result = text;
62
+ // Replace ${VAR} syntax
63
+ result = result.replace(/\$\{([^}]+)\}/g, (match, varName) => {
64
+ return envVars[varName] || match;
65
+ });
66
+ // Replace {{VAR}} syntax
67
+ result = result.replace(/\{\{([^}]+)\}\}/g, (match, varName) => {
68
+ return envVars[varName] || match;
69
+ });
70
+ return result;
71
+ }
72
+ /**
73
+ * Process content and replace all environment variables (SERVER ONLY)
74
+ */
75
+ export function processContentWithEnv(content, config) {
76
+ return replaceEnvVariables(content, config);
77
+ }
78
+ /**
79
+ * Validate configuration (basic validation) (SERVER ONLY)
80
+ */
81
+ export function validateConfig(config) {
82
+ const errors = [];
83
+ // Required fields
84
+ if (!config.site?.title) {
85
+ errors.push("site.title is required");
86
+ }
87
+ // URL validation
88
+ if (config.site?.url) {
89
+ try {
90
+ new URL(config.site.url);
91
+ }
92
+ catch {
93
+ errors.push("site.url must be a valid URL");
94
+ }
95
+ }
96
+ // Social links validation
97
+ if (config.social) {
98
+ const socialKeys = ["github", "twitter", "discord", "linkedin", "youtube"];
99
+ for (const key of socialKeys) {
100
+ const url = config.social[key];
101
+ if (url) {
102
+ try {
103
+ new URL(url);
104
+ }
105
+ catch {
106
+ errors.push(`social.${key} must be a valid URL`);
107
+ }
108
+ }
109
+ }
110
+ }
111
+ return {
112
+ valid: errors.length === 0,
113
+ errors,
114
+ };
115
+ }
116
+ // Singleton instance
117
+ let configInstance = null;
118
+ /**
119
+ * Initialize the Specra configuration
120
+ * Can be called multiple times - subsequent calls will update the config
121
+ * @param userConfig - Partial configuration to merge with defaults
122
+ * @returns The initialized configuration
123
+ */
124
+ export function initConfig(userConfig) {
125
+ configInstance = loadConfig(userConfig);
126
+ return configInstance;
127
+ }
128
+ /**
129
+ * Get the configuration instance (cached) (SERVER ONLY)
130
+ * If not initialized, returns default config
131
+ */
132
+ export function getConfig() {
133
+ if (!configInstance) {
134
+ // Auto-initialize with defaults if not already initialized
135
+ configInstance = loadConfig({});
136
+ }
137
+ return configInstance;
138
+ }
139
+ /**
140
+ * Reload the configuration (useful for development) (SERVER ONLY)
141
+ */
142
+ export function reloadConfig(userConfig) {
143
+ configInstance = loadConfig(userConfig);
144
+ return configInstance;
145
+ }
146
+ /**
147
+ * Export the loaded config as default (SERVER ONLY)
148
+ */
149
+ // export default getConfig()