create-specra 0.1.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 (39) hide show
  1. package/LICENSE.MD +21 -0
  2. package/README.md +137 -0
  3. package/package.json +42 -0
  4. package/templates/minimal/README.md +132 -0
  5. package/templates/minimal/app/api/mdx-watch/route.ts +80 -0
  6. package/templates/minimal/app/docs/[version]/[...slug]/loading.tsx +7 -0
  7. package/templates/minimal/app/docs/[version]/[...slug]/page.tsx +212 -0
  8. package/templates/minimal/app/docs/[version]/not-found.tsx +10 -0
  9. package/templates/minimal/app/docs/[version]/page.tsx +27 -0
  10. package/templates/minimal/app/globals.css +1 -0
  11. package/templates/minimal/app/layout.tsx +89 -0
  12. package/templates/minimal/app/page.tsx +185 -0
  13. package/templates/minimal/docs/v1.0.0/about.mdx +57 -0
  14. package/templates/minimal/docs/v1.0.0/components/_category_.json +8 -0
  15. package/templates/minimal/docs/v1.0.0/components/callout.mdx +83 -0
  16. package/templates/minimal/docs/v1.0.0/components/code-block.mdx +103 -0
  17. package/templates/minimal/docs/v1.0.0/components/index.mdx +8 -0
  18. package/templates/minimal/docs/v1.0.0/components/tabs.mdx +92 -0
  19. package/templates/minimal/docs/v1.0.0/configuration.mdx +322 -0
  20. package/templates/minimal/docs/v1.0.0/features.mdx +197 -0
  21. package/templates/minimal/docs/v1.0.0/getting-started.mdx +183 -0
  22. package/templates/minimal/docs/v1.0.0/index.mdx +29 -0
  23. package/templates/minimal/middleware.ts +23 -0
  24. package/templates/minimal/next.config.default.mjs +36 -0
  25. package/templates/minimal/next.config.export.mjs +62 -0
  26. package/templates/minimal/next.config.mjs +18 -0
  27. package/templates/minimal/package-lock.json +7338 -0
  28. package/templates/minimal/package.json +32 -0
  29. package/templates/minimal/postcss.config.mjs +8 -0
  30. package/templates/minimal/public/api-specs/openapi-example.json +259 -0
  31. package/templates/minimal/public/api-specs/postman-example.json +205 -0
  32. package/templates/minimal/public/api-specs/test-api.json +256 -0
  33. package/templates/minimal/public/api-specs/users-api.json +264 -0
  34. package/templates/minimal/scripts/generate-redirects.mjs +88 -0
  35. package/templates/minimal/scripts/index-search.ts +159 -0
  36. package/templates/minimal/scripts/test-search.ts +83 -0
  37. package/templates/minimal/specra.config.json +124 -0
  38. package/templates/minimal/tsconfig.json +41 -0
  39. package/templates/minimal/yarn.lock +3909 -0
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "my-docs",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "dev": "next dev",
7
+ "build": "npm run generate:redirects && NEXT_BUILD_MODE=default next build",
8
+ "build:export": "npm run generate:redirects && NEXT_BUILD_MODE=export next build",
9
+ "start": "next start",
10
+ "lint": "eslint .",
11
+ "generate:redirects": "node scripts/generate-redirects.mjs",
12
+ "index:search": "tsx scripts/index-search.ts",
13
+ "test:search": "tsx scripts/test-search.ts"
14
+ },
15
+ "dependencies": {
16
+ "lucide-react": "^0.454.0",
17
+ "next": "^16.1.0",
18
+ "react": "^19.2.3",
19
+ "react-dom": "^19.2.3",
20
+ "specra": "^0.1.0"
21
+ },
22
+ "devDependencies": {
23
+ "@tailwindcss/postcss": "^4.1.9",
24
+ "@tailwindcss/typography": "^0.5.19",
25
+ "@types/node": "^22",
26
+ "@types/react": "^19",
27
+ "@types/react-dom": "^19",
28
+ "postcss": "^8.5",
29
+ "tailwindcss": "^4.1.9",
30
+ "typescript": "^5"
31
+ }
32
+ }
@@ -0,0 +1,8 @@
1
+ /** @type {import('postcss-load-config').Config} */
2
+ const config = {
3
+ plugins: {
4
+ '@tailwindcss/postcss': {},
5
+ },
6
+ }
7
+
8
+ export default config
@@ -0,0 +1,259 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "User Management API",
5
+ "version": "1.0.0",
6
+ "description": "A simple API for managing users (OpenAPI format example)"
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "https://api.example.com/v1",
11
+ "description": "Production server"
12
+ }
13
+ ],
14
+ "components": {
15
+ "securitySchemes": {
16
+ "bearerAuth": {
17
+ "type": "http",
18
+ "scheme": "bearer",
19
+ "description": "JWT Bearer token authentication"
20
+ }
21
+ },
22
+ "schemas": {
23
+ "User": {
24
+ "type": "object",
25
+ "properties": {
26
+ "id": {
27
+ "type": "string",
28
+ "example": "user_123"
29
+ },
30
+ "name": {
31
+ "type": "string",
32
+ "example": "John Doe"
33
+ },
34
+ "email": {
35
+ "type": "string",
36
+ "format": "email",
37
+ "example": "john@example.com"
38
+ },
39
+ "createdAt": {
40
+ "type": "string",
41
+ "format": "date-time",
42
+ "example": "2024-01-15T10:30:00Z"
43
+ }
44
+ }
45
+ },
46
+ "Error": {
47
+ "type": "object",
48
+ "properties": {
49
+ "error": {
50
+ "type": "string"
51
+ },
52
+ "code": {
53
+ "type": "string"
54
+ }
55
+ }
56
+ }
57
+ }
58
+ },
59
+ "security": [
60
+ {
61
+ "bearerAuth": []
62
+ }
63
+ ],
64
+ "paths": {
65
+ "/users": {
66
+ "get": {
67
+ "summary": "List all users",
68
+ "description": "Retrieve a paginated list of all users",
69
+ "operationId": "listUsers",
70
+ "parameters": [
71
+ {
72
+ "name": "page",
73
+ "in": "query",
74
+ "description": "Page number for pagination",
75
+ "schema": {
76
+ "type": "integer",
77
+ "default": 1,
78
+ "example": 1
79
+ }
80
+ },
81
+ {
82
+ "name": "limit",
83
+ "in": "query",
84
+ "description": "Number of items per page",
85
+ "schema": {
86
+ "type": "integer",
87
+ "default": 10,
88
+ "example": 10
89
+ }
90
+ }
91
+ ],
92
+ "responses": {
93
+ "200": {
94
+ "description": "List of users retrieved successfully",
95
+ "content": {
96
+ "application/json": {
97
+ "schema": {
98
+ "type": "array",
99
+ "items": {
100
+ "$ref": "#/components/schemas/User"
101
+ }
102
+ },
103
+ "example": [
104
+ {
105
+ "id": "user_123",
106
+ "name": "John Doe",
107
+ "email": "john@example.com",
108
+ "createdAt": "2024-01-15T10:30:00Z"
109
+ },
110
+ {
111
+ "id": "user_456",
112
+ "name": "Jane Smith",
113
+ "email": "jane@example.com",
114
+ "createdAt": "2024-01-16T14:20:00Z"
115
+ }
116
+ ]
117
+ }
118
+ }
119
+ }
120
+ }
121
+ },
122
+ "post": {
123
+ "summary": "Create a new user",
124
+ "description": "Create a new user account",
125
+ "operationId": "createUser",
126
+ "requestBody": {
127
+ "description": "User data to create",
128
+ "required": true,
129
+ "content": {
130
+ "application/json": {
131
+ "schema": {
132
+ "type": "object",
133
+ "required": ["name", "email"],
134
+ "properties": {
135
+ "name": {
136
+ "type": "string",
137
+ "example": "John Doe"
138
+ },
139
+ "email": {
140
+ "type": "string",
141
+ "format": "email",
142
+ "example": "john@example.com"
143
+ }
144
+ }
145
+ }
146
+ }
147
+ }
148
+ },
149
+ "responses": {
150
+ "201": {
151
+ "description": "User created successfully",
152
+ "content": {
153
+ "application/json": {
154
+ "schema": {
155
+ "$ref": "#/components/schemas/User"
156
+ }
157
+ }
158
+ }
159
+ },
160
+ "400": {
161
+ "description": "Invalid request data",
162
+ "content": {
163
+ "application/json": {
164
+ "schema": {
165
+ "$ref": "#/components/schemas/Error"
166
+ },
167
+ "example": {
168
+ "error": "Email already exists",
169
+ "code": "DUPLICATE_EMAIL"
170
+ }
171
+ }
172
+ }
173
+ }
174
+ }
175
+ }
176
+ },
177
+ "/users/{id}": {
178
+ "get": {
179
+ "summary": "Get user by ID",
180
+ "description": "Retrieve a single user by their unique identifier",
181
+ "operationId": "getUserById",
182
+ "parameters": [
183
+ {
184
+ "name": "id",
185
+ "in": "path",
186
+ "required": true,
187
+ "description": "The user's unique identifier",
188
+ "schema": {
189
+ "type": "string",
190
+ "example": "user_123"
191
+ }
192
+ }
193
+ ],
194
+ "responses": {
195
+ "200": {
196
+ "description": "User retrieved successfully",
197
+ "content": {
198
+ "application/json": {
199
+ "schema": {
200
+ "$ref": "#/components/schemas/User"
201
+ }
202
+ }
203
+ }
204
+ },
205
+ "404": {
206
+ "description": "User not found",
207
+ "content": {
208
+ "application/json": {
209
+ "schema": {
210
+ "$ref": "#/components/schemas/Error"
211
+ },
212
+ "example": {
213
+ "error": "User not found",
214
+ "code": "USER_NOT_FOUND"
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ },
221
+ "delete": {
222
+ "summary": "Delete a user",
223
+ "description": "Permanently delete a user account",
224
+ "operationId": "deleteUser",
225
+ "parameters": [
226
+ {
227
+ "name": "id",
228
+ "in": "path",
229
+ "required": true,
230
+ "description": "The user's unique identifier",
231
+ "schema": {
232
+ "type": "string",
233
+ "example": "user_123"
234
+ }
235
+ }
236
+ ],
237
+ "responses": {
238
+ "204": {
239
+ "description": "User deleted successfully"
240
+ },
241
+ "404": {
242
+ "description": "User not found",
243
+ "content": {
244
+ "application/json": {
245
+ "schema": {
246
+ "$ref": "#/components/schemas/Error"
247
+ },
248
+ "example": {
249
+ "error": "User not found",
250
+ "code": "USER_NOT_FOUND"
251
+ }
252
+ }
253
+ }
254
+ }
255
+ }
256
+ }
257
+ }
258
+ }
259
+ }
@@ -0,0 +1,205 @@
1
+ {
2
+ "info": {
3
+ "name": "Product API",
4
+ "description": "API for managing products in an e-commerce system (Postman Collection example)",
5
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
6
+ "version": "1.0.0"
7
+ },
8
+ "auth": {
9
+ "type": "bearer"
10
+ },
11
+ "variable": [
12
+ {
13
+ "key": "baseUrl",
14
+ "value": "https://api.store.com/v1",
15
+ "type": "string"
16
+ }
17
+ ],
18
+ "item": [
19
+ {
20
+ "name": "Products",
21
+ "item": [
22
+ {
23
+ "name": "Get All Products",
24
+ "request": {
25
+ "method": "GET",
26
+ "header": [
27
+ {
28
+ "key": "Accept",
29
+ "value": "application/json"
30
+ }
31
+ ],
32
+ "url": {
33
+ "raw": "{{baseUrl}}/products?category=electronics&limit=10",
34
+ "host": ["{{baseUrl}}"],
35
+ "path": ["products"],
36
+ "query": [
37
+ {
38
+ "key": "category",
39
+ "value": "electronics",
40
+ "description": "Filter by product category"
41
+ },
42
+ {
43
+ "key": "limit",
44
+ "value": "10",
45
+ "description": "Maximum number of products to return"
46
+ }
47
+ ]
48
+ },
49
+ "description": "Retrieve a list of products with optional filtering"
50
+ },
51
+ "response": [
52
+ {
53
+ "name": "Success Response",
54
+ "code": 200,
55
+ "body": "[\n {\n \"id\": \"prod_123\",\n \"name\": \"Laptop\",\n \"price\": 999.99,\n \"category\": \"electronics\",\n \"inStock\": true\n },\n {\n \"id\": \"prod_456\",\n \"name\": \"Mouse\",\n \"price\": 29.99,\n \"category\": \"electronics\",\n \"inStock\": true\n }\n]"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ "name": "Get Product by ID",
61
+ "request": {
62
+ "method": "GET",
63
+ "header": [
64
+ {
65
+ "key": "Accept",
66
+ "value": "application/json"
67
+ }
68
+ ],
69
+ "url": {
70
+ "raw": "{{baseUrl}}/products/:id",
71
+ "host": ["{{baseUrl}}"],
72
+ "path": ["products", ":id"],
73
+ "variable": [
74
+ {
75
+ "key": "id",
76
+ "value": "prod_123",
77
+ "description": "Product ID"
78
+ }
79
+ ]
80
+ },
81
+ "description": "Get a single product by its ID"
82
+ },
83
+ "response": [
84
+ {
85
+ "name": "Success",
86
+ "code": 200,
87
+ "body": "{\n \"id\": \"prod_123\",\n \"name\": \"Laptop\",\n \"price\": 999.99,\n \"category\": \"electronics\",\n \"description\": \"High-performance laptop\",\n \"inStock\": true\n}"
88
+ },
89
+ {
90
+ "name": "Not Found",
91
+ "code": 404,
92
+ "body": "{\n \"error\": \"Product not found\",\n \"code\": \"PRODUCT_NOT_FOUND\"\n}"
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ "name": "Create Product",
98
+ "request": {
99
+ "method": "POST",
100
+ "header": [
101
+ {
102
+ "key": "Content-Type",
103
+ "value": "application/json"
104
+ },
105
+ {
106
+ "key": "Accept",
107
+ "value": "application/json"
108
+ }
109
+ ],
110
+ "body": {
111
+ "mode": "raw",
112
+ "raw": "{\n \"name\": \"Wireless Keyboard\",\n \"price\": 79.99,\n \"category\": \"electronics\",\n \"description\": \"Ergonomic wireless keyboard\",\n \"inStock\": true\n}"
113
+ },
114
+ "url": {
115
+ "raw": "{{baseUrl}}/products",
116
+ "host": ["{{baseUrl}}"],
117
+ "path": ["products"]
118
+ },
119
+ "description": "Create a new product in the catalog"
120
+ },
121
+ "response": [
122
+ {
123
+ "name": "Created",
124
+ "code": 201,
125
+ "body": "{\n \"id\": \"prod_789\",\n \"name\": \"Wireless Keyboard\",\n \"price\": 79.99,\n \"category\": \"electronics\",\n \"description\": \"Ergonomic wireless keyboard\",\n \"inStock\": true,\n \"createdAt\": \"2024-01-15T10:30:00Z\"\n}"
126
+ },
127
+ {
128
+ "name": "Validation Error",
129
+ "code": 400,
130
+ "body": "{\n \"error\": \"Invalid product data\",\n \"details\": {\n \"price\": \"Price must be a positive number\"\n }\n}"
131
+ }
132
+ ]
133
+ },
134
+ {
135
+ "name": "Update Product",
136
+ "request": {
137
+ "method": "PATCH",
138
+ "header": [
139
+ {
140
+ "key": "Content-Type",
141
+ "value": "application/json"
142
+ }
143
+ ],
144
+ "body": {
145
+ "mode": "raw",
146
+ "raw": "{\n \"price\": 89.99,\n \"inStock\": false\n}"
147
+ },
148
+ "url": {
149
+ "raw": "{{baseUrl}}/products/:id",
150
+ "host": ["{{baseUrl}}"],
151
+ "path": ["products", ":id"],
152
+ "variable": [
153
+ {
154
+ "key": "id",
155
+ "value": "prod_123",
156
+ "description": "Product ID to update"
157
+ }
158
+ ]
159
+ },
160
+ "description": "Update specific fields of a product"
161
+ },
162
+ "response": [
163
+ {
164
+ "name": "Updated",
165
+ "code": 200,
166
+ "body": "{\n \"id\": \"prod_123\",\n \"name\": \"Laptop\",\n \"price\": 89.99,\n \"category\": \"electronics\",\n \"description\": \"High-performance laptop\",\n \"inStock\": false,\n \"updatedAt\": \"2024-01-16T15:45:00Z\"\n}"
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "name": "Delete Product",
172
+ "request": {
173
+ "method": "DELETE",
174
+ "header": [],
175
+ "url": {
176
+ "raw": "{{baseUrl}}/products/:id",
177
+ "host": ["{{baseUrl}}"],
178
+ "path": ["products", ":id"],
179
+ "variable": [
180
+ {
181
+ "key": "id",
182
+ "value": "prod_123",
183
+ "description": "Product ID to delete"
184
+ }
185
+ ]
186
+ },
187
+ "description": "Delete a product from the catalog"
188
+ },
189
+ "response": [
190
+ {
191
+ "name": "Deleted",
192
+ "code": 204,
193
+ "body": ""
194
+ },
195
+ {
196
+ "name": "Not Found",
197
+ "code": 404,
198
+ "body": "{\n \"error\": \"Product not found\"\n}"
199
+ }
200
+ ]
201
+ }
202
+ ]
203
+ }
204
+ ]
205
+ }