specra-cli 0.3.0

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 (172) hide show
  1. package/LICENSE.MD +33 -0
  2. package/README.md +246 -0
  3. package/dist/api-client-VHQARPDT.js +15 -0
  4. package/dist/api-client-VHQARPDT.js.map +1 -0
  5. package/dist/chunk-5765WX4D.js +192 -0
  6. package/dist/chunk-5765WX4D.js.map +1 -0
  7. package/dist/chunk-72RDEJR2.js +94 -0
  8. package/dist/chunk-72RDEJR2.js.map +1 -0
  9. package/dist/chunk-SQ2MMFUZ.js +102 -0
  10. package/dist/chunk-SQ2MMFUZ.js.map +1 -0
  11. package/dist/cli.d.ts +2 -0
  12. package/dist/cli.js +242 -0
  13. package/dist/cli.js.map +1 -0
  14. package/dist/deploy-V4JO2D6B.js +179 -0
  15. package/dist/deploy-V4JO2D6B.js.map +1 -0
  16. package/dist/doctor-ICALAJ4N.js +309 -0
  17. package/dist/doctor-ICALAJ4N.js.map +1 -0
  18. package/dist/login-UG3WU7DY.js +92 -0
  19. package/dist/login-UG3WU7DY.js.map +1 -0
  20. package/dist/logout-WJKHJZT6.js +24 -0
  21. package/dist/logout-WJKHJZT6.js.map +1 -0
  22. package/dist/logs-BLUJPWNO.js +77 -0
  23. package/dist/logs-BLUJPWNO.js.map +1 -0
  24. package/dist/projects-LJ57GK3D.js +49 -0
  25. package/dist/projects-LJ57GK3D.js.map +1 -0
  26. package/package.json +50 -0
  27. package/templates/book-docs/.env.sample +1 -0
  28. package/templates/book-docs/docs/v1.0.0/concepts.mdx +89 -0
  29. package/templates/book-docs/docs/v1.0.0/content/_category_.json +7 -0
  30. package/templates/book-docs/docs/v1.0.0/content/formatting.mdx +128 -0
  31. package/templates/book-docs/docs/v1.0.0/content/reusable-content.mdx +116 -0
  32. package/templates/book-docs/docs/v1.0.0/content/structure.mdx +92 -0
  33. package/templates/book-docs/docs/v1.0.0/customization/_category_.json +7 -0
  34. package/templates/book-docs/docs/v1.0.0/customization/branding.mdx +115 -0
  35. package/templates/book-docs/docs/v1.0.0/customization/themes.mdx +81 -0
  36. package/templates/book-docs/docs/v1.0.0/introduction.mdx +38 -0
  37. package/templates/book-docs/docs/v1.0.0/quickstart.mdx +112 -0
  38. package/templates/book-docs/docs/v2.0.0/concepts.mdx +89 -0
  39. package/templates/book-docs/docs/v2.0.0/content/_category_.json +7 -0
  40. package/templates/book-docs/docs/v2.0.0/content/formatting.mdx +128 -0
  41. package/templates/book-docs/docs/v2.0.0/content/reusable-content.mdx +116 -0
  42. package/templates/book-docs/docs/v2.0.0/content/structure.mdx +92 -0
  43. package/templates/book-docs/docs/v2.0.0/customization/_category_.json +7 -0
  44. package/templates/book-docs/docs/v2.0.0/customization/branding.mdx +115 -0
  45. package/templates/book-docs/docs/v2.0.0/customization/themes.mdx +81 -0
  46. package/templates/book-docs/docs/v2.0.0/introduction.mdx +39 -0
  47. package/templates/book-docs/docs/v2.0.0/quickstart.mdx +112 -0
  48. package/templates/book-docs/gitignore +7 -0
  49. package/templates/book-docs/package.json +28 -0
  50. package/templates/book-docs/postcss.config.mjs +8 -0
  51. package/templates/book-docs/public/api-specs/openapi-example.json +259 -0
  52. package/templates/book-docs/public/api-specs/postman-example.json +205 -0
  53. package/templates/book-docs/public/api-specs/test-api.json +256 -0
  54. package/templates/book-docs/public/api-specs/users-api.json +264 -0
  55. package/templates/book-docs/specra.config.json +77 -0
  56. package/templates/book-docs/src/app.css +86 -0
  57. package/templates/book-docs/src/app.html +17 -0
  58. package/templates/book-docs/src/params/product.ts +7 -0
  59. package/templates/book-docs/src/routes/+layout.server.ts +14 -0
  60. package/templates/book-docs/src/routes/+layout.svelte +21 -0
  61. package/templates/book-docs/src/routes/+page.server.ts +9 -0
  62. package/templates/book-docs/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  63. package/templates/book-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  64. package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  65. package/templates/book-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  66. package/templates/book-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
  67. package/templates/book-docs/src/routes/docs/[version]/+page.server.ts +27 -0
  68. package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  69. package/templates/book-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  70. package/templates/book-docs/static/favicon.svg +4 -0
  71. package/templates/book-docs/svelte.config.js +13 -0
  72. package/templates/book-docs/tsconfig.json +12 -0
  73. package/templates/book-docs/vite.config.ts +6 -0
  74. package/templates/jbrains-docs/.env.sample +1 -0
  75. package/templates/jbrains-docs/docs/v1.0.0/advanced/_category_.json +8 -0
  76. package/templates/jbrains-docs/docs/v1.0.0/advanced/async.mdx +95 -0
  77. package/templates/jbrains-docs/docs/v1.0.0/advanced/generics.mdx +126 -0
  78. package/templates/jbrains-docs/docs/v1.0.0/basics/_category_.json +8 -0
  79. package/templates/jbrains-docs/docs/v1.0.0/basics/control-flow.mdx +106 -0
  80. package/templates/jbrains-docs/docs/v1.0.0/basics/syntax.mdx +129 -0
  81. package/templates/jbrains-docs/docs/v1.0.0/basics/types.mdx +135 -0
  82. package/templates/jbrains-docs/docs/v1.0.0/getting-started.mdx +111 -0
  83. package/templates/jbrains-docs/docs/v1.0.0/home.mdx +37 -0
  84. package/templates/jbrains-docs/docs/v1.0.0/tools/_category_.json +8 -0
  85. package/templates/jbrains-docs/docs/v1.0.0/tools/build-tools.mdx +165 -0
  86. package/templates/jbrains-docs/docs/v1.0.0/tools/testing.mdx +112 -0
  87. package/templates/jbrains-docs/docs/v2.0.0/advanced/_category_.json +8 -0
  88. package/templates/jbrains-docs/docs/v2.0.0/advanced/async.mdx +95 -0
  89. package/templates/jbrains-docs/docs/v2.0.0/advanced/generics.mdx +126 -0
  90. package/templates/jbrains-docs/docs/v2.0.0/basics/_category_.json +8 -0
  91. package/templates/jbrains-docs/docs/v2.0.0/basics/control-flow.mdx +106 -0
  92. package/templates/jbrains-docs/docs/v2.0.0/basics/syntax.mdx +129 -0
  93. package/templates/jbrains-docs/docs/v2.0.0/basics/types.mdx +135 -0
  94. package/templates/jbrains-docs/docs/v2.0.0/getting-started.mdx +111 -0
  95. package/templates/jbrains-docs/docs/v2.0.0/home.mdx +37 -0
  96. package/templates/jbrains-docs/docs/v2.0.0/tools/_category_.json +8 -0
  97. package/templates/jbrains-docs/docs/v2.0.0/tools/build-tools.mdx +165 -0
  98. package/templates/jbrains-docs/docs/v2.0.0/tools/testing.mdx +112 -0
  99. package/templates/jbrains-docs/gitignore +7 -0
  100. package/templates/jbrains-docs/package.json +28 -0
  101. package/templates/jbrains-docs/postcss.config.mjs +8 -0
  102. package/templates/jbrains-docs/public/api-specs/openapi-example.json +259 -0
  103. package/templates/jbrains-docs/public/api-specs/postman-example.json +205 -0
  104. package/templates/jbrains-docs/public/api-specs/test-api.json +256 -0
  105. package/templates/jbrains-docs/public/api-specs/users-api.json +264 -0
  106. package/templates/jbrains-docs/specra.config.json +80 -0
  107. package/templates/jbrains-docs/src/app.css +86 -0
  108. package/templates/jbrains-docs/src/app.html +17 -0
  109. package/templates/jbrains-docs/src/params/product.ts +7 -0
  110. package/templates/jbrains-docs/src/routes/+layout.server.ts +14 -0
  111. package/templates/jbrains-docs/src/routes/+layout.svelte +21 -0
  112. package/templates/jbrains-docs/src/routes/+page.server.ts +9 -0
  113. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  114. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  115. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  116. package/templates/jbrains-docs/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  117. package/templates/jbrains-docs/src/routes/docs/[version]/+layout.server.ts +42 -0
  118. package/templates/jbrains-docs/src/routes/docs/[version]/+page.server.ts +27 -0
  119. package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  120. package/templates/jbrains-docs/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  121. package/templates/jbrains-docs/static/favicon.svg +4 -0
  122. package/templates/jbrains-docs/svelte.config.js +13 -0
  123. package/templates/jbrains-docs/tsconfig.json +12 -0
  124. package/templates/jbrains-docs/vite.config.ts +6 -0
  125. package/templates/minimal/.env.sample +1 -0
  126. package/templates/minimal/docs/v1.0.0/about.mdx +57 -0
  127. package/templates/minimal/docs/v1.0.0/components/_category_.json +8 -0
  128. package/templates/minimal/docs/v1.0.0/components/callout.mdx +83 -0
  129. package/templates/minimal/docs/v1.0.0/components/code-block.mdx +103 -0
  130. package/templates/minimal/docs/v1.0.0/components/index.mdx +8 -0
  131. package/templates/minimal/docs/v1.0.0/components/tabs.mdx +92 -0
  132. package/templates/minimal/docs/v1.0.0/configuration.mdx +322 -0
  133. package/templates/minimal/docs/v1.0.0/features.mdx +197 -0
  134. package/templates/minimal/docs/v1.0.0/getting-started.mdx +183 -0
  135. package/templates/minimal/docs/v2.0.0/about.mdx +57 -0
  136. package/templates/minimal/docs/v2.0.0/components/_category_.json +8 -0
  137. package/templates/minimal/docs/v2.0.0/components/callout.mdx +83 -0
  138. package/templates/minimal/docs/v2.0.0/components/code-block.mdx +103 -0
  139. package/templates/minimal/docs/v2.0.0/components/index.mdx +8 -0
  140. package/templates/minimal/docs/v2.0.0/components/tabs.mdx +92 -0
  141. package/templates/minimal/docs/v2.0.0/configuration.mdx +322 -0
  142. package/templates/minimal/docs/v2.0.0/features.mdx +197 -0
  143. package/templates/minimal/docs/v2.0.0/getting-started.mdx +183 -0
  144. package/templates/minimal/gitignore +7 -0
  145. package/templates/minimal/package.json +29 -0
  146. package/templates/minimal/postcss.config.mjs +8 -0
  147. package/templates/minimal/specra.config.json +91 -0
  148. package/templates/minimal/src/app.css +86 -0
  149. package/templates/minimal/src/app.html +17 -0
  150. package/templates/minimal/src/hooks.server.ts +8 -0
  151. package/templates/minimal/src/params/product.ts +7 -0
  152. package/templates/minimal/src/routes/+error.svelte +10 -0
  153. package/templates/minimal/src/routes/+layout.server.ts +14 -0
  154. package/templates/minimal/src/routes/+layout.svelte +21 -0
  155. package/templates/minimal/src/routes/+page.server.ts +9 -0
  156. package/templates/minimal/src/routes/+page.svelte +149 -0
  157. package/templates/minimal/src/routes/docs/[product=product]/[version]/+layout.server.ts +40 -0
  158. package/templates/minimal/src/routes/docs/[product=product]/[version]/+page.server.ts +24 -0
  159. package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.server.ts +131 -0
  160. package/templates/minimal/src/routes/docs/[product=product]/[version]/[...slug]/+page.svelte +180 -0
  161. package/templates/minimal/src/routes/docs/[version]/+layout.server.ts +42 -0
  162. package/templates/minimal/src/routes/docs/[version]/+page.server.ts +27 -0
  163. package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.server.ts +106 -0
  164. package/templates/minimal/src/routes/docs/[version]/[...slug]/+page.svelte +172 -0
  165. package/templates/minimal/static/api-specs/openapi-example.json +259 -0
  166. package/templates/minimal/static/api-specs/postman-example.json +205 -0
  167. package/templates/minimal/static/api-specs/test-api.json +256 -0
  168. package/templates/minimal/static/api-specs/users-api.json +264 -0
  169. package/templates/minimal/static/favicon.svg +4 -0
  170. package/templates/minimal/svelte.config.js +13 -0
  171. package/templates/minimal/tsconfig.json +12 -0
  172. package/templates/minimal/vite.config.ts +6 -0
@@ -0,0 +1,264 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "title": "Users API",
4
+ "description": "Complete API reference for managing users in the system",
5
+ "baseUrl": "https://api.example.com/v1",
6
+ "env": {
7
+ "AUTH_TOKEN": "your_api_token_here"
8
+ },
9
+ "auth": {
10
+ "type": "bearer",
11
+ "description": "All requests require a valid API token in the Authorization header",
12
+ "tokenPrefix": "Bearer"
13
+ },
14
+ "globalHeaders": [
15
+ {
16
+ "name": "Authorization",
17
+ "value": "Bearer {AUTH_TOKEN}",
18
+ "description": "Your API authentication token"
19
+ },
20
+ {
21
+ "name": "Content-Type",
22
+ "value": "application/json"
23
+ }
24
+ ],
25
+ "endpoints": [
26
+ {
27
+ "title": "Get User by ID",
28
+ "method": "GET",
29
+ "path": "/users/:id",
30
+ "description": "Retrieve detailed information about a specific user",
31
+ "pathParams": [
32
+ {
33
+ "name": "id",
34
+ "type": "string",
35
+ "required": true,
36
+ "description": "The unique identifier of the user",
37
+ "example": "user_123"
38
+ }
39
+ ],
40
+ "queryParams": [
41
+ {
42
+ "name": "fields",
43
+ "type": "string",
44
+ "description": "Comma-separated list of fields to include",
45
+ "example": "name,email,created_at"
46
+ },
47
+ {
48
+ "name": "include_metadata",
49
+ "type": "boolean",
50
+ "description": "Include additional metadata in the response",
51
+ "default": false
52
+ }
53
+ ],
54
+ "successResponse": {
55
+ "status": 200,
56
+ "description": "User retrieved successfully",
57
+ "example": {
58
+ "id": "user_123",
59
+ "name": "John Doe",
60
+ "email": "john@example.com",
61
+ "role": "admin",
62
+ "created_at": "2024-01-15T10:30:00Z",
63
+ "updated_at": "2024-01-20T14:22:00Z"
64
+ }
65
+ },
66
+ "errorResponses": [
67
+ {
68
+ "status": 404,
69
+ "description": "User not found",
70
+ "example": {
71
+ "error": "User not found",
72
+ "code": "USER_NOT_FOUND",
73
+ "message": "No user exists with the provided ID"
74
+ }
75
+ },
76
+ {
77
+ "status": 401,
78
+ "description": "Unauthorized",
79
+ "example": {
80
+ "error": "Unauthorized",
81
+ "code": "UNAUTHORIZED",
82
+ "message": "Invalid or missing authentication token"
83
+ }
84
+ }
85
+ ],
86
+ "examples": [
87
+ {
88
+ "title": "cURL",
89
+ "language": "bash",
90
+ "code": "curl -X GET \"https://api.example.com/v1/users/user_123\" \\\n -H \"Authorization: Bearer your_api_token_here\""
91
+ },
92
+ {
93
+ "title": "JavaScript (fetch)",
94
+ "language": "javascript",
95
+ "code": "const response = await fetch('https://api.example.com/v1/users/user_123', {\n headers: {\n 'Authorization': 'Bearer your_api_token_here'\n }\n});\nconst user = await response.json();"
96
+ }
97
+ ]
98
+ },
99
+ {
100
+ "title": "List All Users",
101
+ "method": "GET",
102
+ "path": "/users",
103
+ "description": "Retrieve a paginated list of all users",
104
+ "queryParams": [
105
+ {
106
+ "name": "page",
107
+ "type": "number",
108
+ "description": "Page number for pagination",
109
+ "default": 1
110
+ },
111
+ {
112
+ "name": "limit",
113
+ "type": "number",
114
+ "description": "Number of users per page",
115
+ "default": 20
116
+ },
117
+ {
118
+ "name": "role",
119
+ "type": "string",
120
+ "description": "Filter users by role",
121
+ "example": "admin"
122
+ }
123
+ ],
124
+ "successResponse": {
125
+ "status": 200,
126
+ "description": "List of users retrieved successfully",
127
+ "example": {
128
+ "data": [
129
+ {
130
+ "id": "user_123",
131
+ "name": "John Doe",
132
+ "email": "john@example.com",
133
+ "role": "admin"
134
+ },
135
+ {
136
+ "id": "user_124",
137
+ "name": "Jane Smith",
138
+ "email": "jane@example.com",
139
+ "role": "user"
140
+ }
141
+ ],
142
+ "pagination": {
143
+ "page": 1,
144
+ "limit": 20,
145
+ "total": 42,
146
+ "pages": 3
147
+ }
148
+ }
149
+ }
150
+ },
151
+ {
152
+ "title": "Create New User",
153
+ "method": "POST",
154
+ "path": "/users",
155
+ "description": "Create a new user account",
156
+ "body": {
157
+ "description": "User data to create",
158
+ "example": {
159
+ "name": "Alice Johnson",
160
+ "email": "alice@example.com",
161
+ "role": "user",
162
+ "password": "secure_password_123"
163
+ }
164
+ },
165
+ "successResponse": {
166
+ "status": 201,
167
+ "description": "User created successfully",
168
+ "example": {
169
+ "id": "user_125",
170
+ "name": "Alice Johnson",
171
+ "email": "alice@example.com",
172
+ "role": "user",
173
+ "created_at": "2024-01-21T09:15:00Z"
174
+ }
175
+ },
176
+ "errorResponses": [
177
+ {
178
+ "status": 400,
179
+ "description": "Validation error",
180
+ "example": {
181
+ "error": "Validation failed",
182
+ "code": "VALIDATION_ERROR",
183
+ "details": {
184
+ "email": "Email address already exists"
185
+ }
186
+ }
187
+ }
188
+ ],
189
+ "examples": [
190
+ {
191
+ "title": "cURL",
192
+ "language": "bash",
193
+ "code": "curl -X POST \"https://api.example.com/v1/users\" \\\n -H \"Authorization: Bearer your_api_token_here\" \\\n -H \"Content-Type: application/json\" \\\n -d '{\n \"name\": \"Alice Johnson\",\n \"email\": \"alice@example.com\",\n \"role\": \"user\",\n \"password\": \"secure_password_123\"\n }'"
194
+ }
195
+ ]
196
+ },
197
+ {
198
+ "title": "Update User",
199
+ "method": "PATCH",
200
+ "path": "/users/:id",
201
+ "description": "Update user information",
202
+ "pathParams": [
203
+ {
204
+ "name": "id",
205
+ "type": "string",
206
+ "required": true,
207
+ "description": "User ID to update"
208
+ }
209
+ ],
210
+ "body": {
211
+ "description": "Fields to update (all optional)",
212
+ "example": {
213
+ "name": "John Updated",
214
+ "email": "john.updated@example.com",
215
+ "role": "moderator"
216
+ }
217
+ },
218
+ "successResponse": {
219
+ "status": 200,
220
+ "description": "User updated successfully",
221
+ "example": {
222
+ "id": "user_123",
223
+ "name": "John Updated",
224
+ "email": "john.updated@example.com",
225
+ "role": "moderator",
226
+ "updated_at": "2024-01-21T10:00:00Z"
227
+ }
228
+ }
229
+ },
230
+ {
231
+ "title": "Delete User",
232
+ "method": "DELETE",
233
+ "path": "/users/:id",
234
+ "description": "Permanently delete a user account",
235
+ "pathParams": [
236
+ {
237
+ "name": "id",
238
+ "type": "string",
239
+ "required": true,
240
+ "description": "User ID to delete"
241
+ }
242
+ ],
243
+ "successResponse": {
244
+ "status": 204,
245
+ "description": "User deleted successfully"
246
+ },
247
+ "errorResponses": [
248
+ {
249
+ "status": 404,
250
+ "description": "User not found"
251
+ },
252
+ {
253
+ "status": 403,
254
+ "description": "Forbidden - Cannot delete this user",
255
+ "example": {
256
+ "error": "Forbidden",
257
+ "code": "CANNOT_DELETE_ADMIN",
258
+ "message": "Cannot delete the primary admin account"
259
+ }
260
+ }
261
+ ]
262
+ }
263
+ ]
264
+ }
@@ -0,0 +1,77 @@
1
+ {
2
+ "$schema": "./node_modules/specra/config/specra.config.schema.json",
3
+ "site": {
4
+ "title": "My Docs",
5
+ "description": "Documentation for my project",
6
+ "url": "http://localhost:5173",
7
+ "baseUrl": "/",
8
+ "language": "en",
9
+ "organizationName": "my-org",
10
+ "projectName": "my-project",
11
+ "activeVersion": "v1.0.0"
12
+ },
13
+ "theme": {
14
+ "defaultMode": "dark",
15
+ "respectPrefersColorScheme": true
16
+ },
17
+ "navigation": {
18
+ "showSidebar": true,
19
+ "collapsibleSidebar": true,
20
+ "sidebarStyle": "flush",
21
+ "showBreadcrumbs": true,
22
+ "showTableOfContents": true,
23
+ "tocPosition": "right",
24
+ "tocMaxDepth": 3
25
+ },
26
+ "social": {
27
+ "github": "https://github.com/your-org/your-repo"
28
+ },
29
+ "search": {
30
+ "enabled": false
31
+ },
32
+ "banner": {
33
+ "enabled": true,
34
+ "message": "Welcome to our docs — we're actively improving them!",
35
+ "type": "info",
36
+ "dismissible": true
37
+ },
38
+ "footer": {
39
+ "copyright": "Copyright © 2025 My Project. All rights reserved.",
40
+ "branding": {
41
+ "showBranding": true
42
+ },
43
+ "links": [
44
+ {
45
+ "title": "Documentation",
46
+ "items": [
47
+ {
48
+ "label": "Introduction",
49
+ "href": "/docs/v1.0.0/introduction"
50
+ },
51
+ {
52
+ "label": "Quick Start",
53
+ "href": "/docs/v1.0.0/quickstart"
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ "title": "Community",
59
+ "items": [
60
+ {
61
+ "label": "GitHub",
62
+ "href": "https://github.com/your-org/your-repo"
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ },
68
+ "features": {
69
+ "showLastUpdated": true,
70
+ "showReadingTime": true,
71
+ "showAuthors": false,
72
+ "showTags": true,
73
+ "versioning": true,
74
+ "showVersionBadge": true,
75
+ "i18n": false
76
+ }
77
+ }
@@ -0,0 +1,86 @@
1
+ @import "specra/styles";
2
+ @source "./**/*.{js,ts,svelte}";
3
+
4
+ @theme inline {
5
+ --font-sans: "Geist", "Geist Fallback", system-ui, sans-serif;
6
+ --font-mono: "Geist Mono", "Geist Mono Fallback", monospace;
7
+ }
8
+
9
+ /* =============================================
10
+ THEME OVERRIDES
11
+ Uncomment a :root block for light theme and/or
12
+ a .dark block for dark theme. Mix and match!
13
+ ============================================= */
14
+
15
+ /* ─── Mint Light ─── */
16
+ /* :root {
17
+ --primary: oklch(0.45 0.18 162);
18
+ --primary-foreground: oklch(0.98 0 0);
19
+ --ring: oklch(0.45 0.18 162);
20
+ } */
21
+
22
+ /* ─── Ocean Light ─── */
23
+ /* :root {
24
+ --primary: oklch(0.45 0.18 240);
25
+ --primary-foreground: oklch(0.98 0 0);
26
+ --ring: oklch(0.45 0.18 240);
27
+ } */
28
+
29
+ /* ─── Rose Light ─── */
30
+ /* :root {
31
+ --primary: oklch(0.50 0.20 350);
32
+ --primary-foreground: oklch(0.98 0 0);
33
+ --ring: oklch(0.50 0.20 350);
34
+ } */
35
+
36
+ /* ─── Amber Light ─── */
37
+ /* :root {
38
+ --primary: oklch(0.55 0.16 70);
39
+ --primary-foreground: oklch(0.98 0 0);
40
+ --ring: oklch(0.55 0.16 70);
41
+ } */
42
+
43
+ /* ─── Violet Light ─── */
44
+ /* :root {
45
+ --primary: oklch(0.48 0.22 290);
46
+ --primary-foreground: oklch(0.98 0 0);
47
+ --ring: oklch(0.48 0.22 290);
48
+ } */
49
+
50
+ /* ─── Mint Dark ─── */
51
+ /* .dark {
52
+ --primary: oklch(0.72 0.18 162);
53
+ --primary-foreground: oklch(0.10 0.03 160);
54
+ --ring: oklch(0.72 0.18 162);
55
+ } */
56
+
57
+ /* ─── Ocean Dark ─── */
58
+ /* .dark {
59
+ --primary: oklch(0.68 0.16 240);
60
+ --primary-foreground: oklch(0.98 0 0);
61
+ --ring: oklch(0.68 0.16 240);
62
+ } */
63
+
64
+ /* ─── Rose Dark ─── */
65
+ /* .dark {
66
+ --primary: oklch(0.70 0.18 350);
67
+ --primary-foreground: oklch(0.98 0 0);
68
+ --ring: oklch(0.70 0.18 350);
69
+ } */
70
+
71
+ /* ─── Amber Dark ─── */
72
+ /* .dark {
73
+ --primary: oklch(0.75 0.16 70);
74
+ --primary-foreground: oklch(0.10 0.03 70);
75
+ --ring: oklch(0.75 0.16 70);
76
+ } */
77
+
78
+ /* ─── Violet Dark ─── */
79
+ /* .dark {
80
+ --primary: oklch(0.70 0.20 290);
81
+ --primary-foreground: oklch(0.98 0 0);
82
+ --ring: oklch(0.70 0.20 290);
83
+ } */
84
+
85
+ /* For full theme customization (backgrounds, borders, sidebar, etc.)
86
+ see: https://specra-docs.com/docs/v1.0.0/configuration/theming */
@@ -0,0 +1,17 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <link rel="icon" href="%sveltekit.assets%/favicon.svg" type="image/svg+xml" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link
10
+ href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@100..900&family=Geist:wght@100..900&display=swap"
11
+ rel="stylesheet">
12
+ %sveltekit.head%
13
+ </head>
14
+ <body data-sveltekit-preload-data="hover" class="font-sans antialiased">
15
+ <div style="display: contents">%sveltekit.body%</div>
16
+ </body>
17
+ </html>
@@ -0,0 +1,7 @@
1
+ /**
2
+ * SvelteKit param matcher for product slugs.
3
+ * Matches any string that does NOT look like a version (e.g., v1.0.0).
4
+ */
5
+ export function match(param: string): boolean {
6
+ return !/^v\d/.test(param);
7
+ }
@@ -0,0 +1,14 @@
1
+ import { getConfig, initConfig } from 'specra';
2
+ import specraConfig from '../../specra.config.json';
3
+ import type { LayoutServerLoad } from './$types';
4
+ import type { SpecraConfig } from 'specra';
5
+
6
+ initConfig(specraConfig as unknown as Partial<SpecraConfig>);
7
+
8
+ export const prerender = true;
9
+ export const trailingSlash = 'never';
10
+
11
+ export const load: LayoutServerLoad = async () => {
12
+ const config = getConfig();
13
+ return { config };
14
+ };
@@ -0,0 +1,21 @@
1
+ <script lang="ts">
2
+ import '../app.css';
3
+ import { LayoutProviders } from 'specra/components';
4
+ import type { Snippet } from 'svelte';
5
+ import type { LayoutData } from './$types';
6
+
7
+ let { data, children }: { data: LayoutData; children: Snippet } = $props();
8
+ </script>
9
+
10
+ <svelte:head>
11
+ <title>{data?.config?.site?.title || 'Documentation'}</title>
12
+ <meta name="description" content={data?.config?.site?.description || 'Modern documentation platform'} />
13
+ </svelte:head>
14
+
15
+ {#if data?.config}
16
+ <LayoutProviders config={data.config}>
17
+ {@render children?.()}
18
+ </LayoutProviders>
19
+ {:else}
20
+ {@render children?.()}
21
+ {/if}
@@ -0,0 +1,9 @@
1
+ import { redirect } from '@sveltejs/kit';
2
+ import { getConfig } from 'specra';
3
+ import type { PageServerLoad } from './$types';
4
+
5
+ export const load: PageServerLoad = async () => {
6
+ const config = getConfig();
7
+ const activeVersion = config.site?.activeVersion || 'v1.0.0';
8
+ redirect(302, `/docs/${activeVersion}/introduction`);
9
+ };
@@ -0,0 +1,40 @@
1
+ import { getCachedVersions, getCachedAllDocs, getEffectiveConfig, getI18nConfig, getVersionsMeta, getProducts, loadVersionConfig } from 'specra';
2
+ import { redirect } from '@sveltejs/kit';
3
+ import type { LayoutServerLoad } from './$types';
4
+
5
+ export const load: LayoutServerLoad = async ({ params }) => {
6
+ const { product, version } = params;
7
+
8
+ // Verify this is a valid product — if not, fall through to 404
9
+ const products = getProducts();
10
+ const matchedProduct = products.find(p => p.slug === product);
11
+ if (!matchedProduct) {
12
+ return {};
13
+ }
14
+
15
+ const i18nConfig = getI18nConfig();
16
+ const defaultLocale = i18nConfig?.defaultLocale || 'en';
17
+
18
+ // Block access to hidden versions — redirect to product's active version
19
+ const currentVersionConfig = loadVersionConfig(version, product);
20
+ if (currentVersionConfig?.hidden) {
21
+ const config = getEffectiveConfig(version, product);
22
+ const activeVersion = matchedProduct.config.activeVersion || config.site?.activeVersion || 'v1.0.0';
23
+ throw redirect(302, `/docs/${product}/${activeVersion}`);
24
+ }
25
+
26
+ const allDocs = await getCachedAllDocs(version, defaultLocale, product);
27
+ const versions = getCachedVersions(product);
28
+ const config = getEffectiveConfig(version, product);
29
+ const versionsMeta = getVersionsMeta(versions, product);
30
+
31
+ return {
32
+ allDocs,
33
+ versions,
34
+ versionsMeta,
35
+ config,
36
+ product,
37
+ products,
38
+ versionBanner: currentVersionConfig?.banner,
39
+ };
40
+ };
@@ -0,0 +1,24 @@
1
+ import { redirect } from '@sveltejs/kit';
2
+ import { getCachedAllDocs, getProducts } from 'specra';
3
+ import type { PageServerLoad } from './$types';
4
+
5
+ export const load: PageServerLoad = async ({ params }) => {
6
+ const { product, version } = params;
7
+
8
+ // Verify product exists
9
+ const products = getProducts();
10
+ const matchedProduct = products.find(p => p.slug === product);
11
+ if (!matchedProduct) {
12
+ return {};
13
+ }
14
+
15
+ const docs = await getCachedAllDocs(version, undefined, product);
16
+
17
+ if (docs.length === 0) {
18
+ const activeVersion = matchedProduct.config.activeVersion || 'v1.0.0';
19
+ redirect(302, `/docs/${product}/${activeVersion}`);
20
+ }
21
+
22
+ // Redirect to first doc in this product's version
23
+ redirect(302, `/docs/${product}/${version}/${docs[0].slug}`);
24
+ };