@opensaas/stack-cli 0.5.0 → 0.6.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 (54) hide show
  1. package/README.md +76 -0
  2. package/dist/commands/migrate.d.ts.map +1 -1
  3. package/dist/commands/migrate.js +94 -268
  4. package/dist/commands/migrate.js.map +1 -1
  5. package/package.json +7 -2
  6. package/.turbo/turbo-build.log +0 -4
  7. package/CHANGELOG.md +0 -462
  8. package/CLAUDE.md +0 -298
  9. package/src/commands/__snapshots__/generate.test.ts.snap +0 -413
  10. package/src/commands/dev.test.ts +0 -215
  11. package/src/commands/dev.ts +0 -48
  12. package/src/commands/generate.test.ts +0 -282
  13. package/src/commands/generate.ts +0 -182
  14. package/src/commands/init.ts +0 -34
  15. package/src/commands/mcp.ts +0 -135
  16. package/src/commands/migrate.ts +0 -534
  17. package/src/generator/__snapshots__/context.test.ts.snap +0 -361
  18. package/src/generator/__snapshots__/prisma.test.ts.snap +0 -174
  19. package/src/generator/__snapshots__/types.test.ts.snap +0 -1702
  20. package/src/generator/context.test.ts +0 -139
  21. package/src/generator/context.ts +0 -227
  22. package/src/generator/index.ts +0 -7
  23. package/src/generator/lists.test.ts +0 -335
  24. package/src/generator/lists.ts +0 -140
  25. package/src/generator/plugin-types.ts +0 -147
  26. package/src/generator/prisma-config.ts +0 -46
  27. package/src/generator/prisma-extensions.ts +0 -159
  28. package/src/generator/prisma.test.ts +0 -211
  29. package/src/generator/prisma.ts +0 -161
  30. package/src/generator/types.test.ts +0 -268
  31. package/src/generator/types.ts +0 -537
  32. package/src/index.ts +0 -46
  33. package/src/mcp/lib/documentation-provider.ts +0 -710
  34. package/src/mcp/lib/features/catalog.ts +0 -301
  35. package/src/mcp/lib/generators/feature-generator.ts +0 -598
  36. package/src/mcp/lib/types.ts +0 -89
  37. package/src/mcp/lib/wizards/migration-wizard.ts +0 -584
  38. package/src/mcp/lib/wizards/wizard-engine.ts +0 -427
  39. package/src/mcp/server/index.ts +0 -361
  40. package/src/mcp/server/stack-mcp-server.ts +0 -544
  41. package/src/migration/generators/migration-generator.ts +0 -675
  42. package/src/migration/introspectors/index.ts +0 -12
  43. package/src/migration/introspectors/keystone-introspector.ts +0 -296
  44. package/src/migration/introspectors/nextjs-introspector.ts +0 -209
  45. package/src/migration/introspectors/prisma-introspector.ts +0 -233
  46. package/src/migration/types.ts +0 -92
  47. package/tests/introspectors/keystone-introspector.test.ts +0 -255
  48. package/tests/introspectors/nextjs-introspector.test.ts +0 -302
  49. package/tests/introspectors/prisma-introspector.test.ts +0 -268
  50. package/tests/migration-generator.test.ts +0 -592
  51. package/tests/migration-wizard.test.ts +0 -442
  52. package/tsconfig.json +0 -13
  53. package/tsconfig.tsbuildinfo +0 -1
  54. package/vitest.config.ts +0 -26
@@ -1,301 +0,0 @@
1
- /**
2
- * Feature catalog - Defines all available features with their configuration wizards
3
- */
4
-
5
- import type { Feature } from '../types.js'
6
-
7
- export const AUTHENTICATION_FEATURE: Feature = {
8
- id: 'authentication',
9
- name: 'User Authentication',
10
- description: 'Complete authentication system with sessions, sign-up/sign-in, and access control',
11
- category: 'authentication',
12
- includes: [
13
- 'User list with email, password, name, and optional fields',
14
- 'Better-auth integration with session management',
15
- 'Sign-up and sign-in pages with form validation',
16
- 'Access control helpers (isAuthenticated, isAdmin, isOwner)',
17
- 'OAuth providers (optional)',
18
- 'Email verification (optional)',
19
- ],
20
- questions: [
21
- {
22
- id: 'auth-methods',
23
- text: 'Which authentication methods do you want to support?',
24
- type: 'multiselect',
25
- required: true,
26
- options: ['Email & Password', 'Google OAuth', 'GitHub OAuth', 'Magic Links'],
27
- defaultValue: ['Email & Password'],
28
- },
29
- {
30
- id: 'user-roles',
31
- text: 'Do you need user roles for access control?',
32
- type: 'boolean',
33
- required: true,
34
- defaultValue: true,
35
- followUp: {
36
- if: true,
37
- ask: 'What roles do you need? (Enter comma-separated, e.g., admin,editor,user)',
38
- type: 'text',
39
- },
40
- },
41
- {
42
- id: 'user-fields',
43
- text: 'Select additional user profile fields',
44
- type: 'multiselect',
45
- required: false,
46
- options: ['Avatar', 'Bio', 'Phone', 'Location', 'Website'],
47
- defaultValue: [],
48
- },
49
- {
50
- id: 'email-verification',
51
- text: 'Require email verification for new accounts?',
52
- type: 'boolean',
53
- required: true,
54
- defaultValue: false,
55
- },
56
- ],
57
- }
58
-
59
- export const BLOG_FEATURE: Feature = {
60
- id: 'blog',
61
- name: 'Blog System',
62
- description: 'Complete blog with posts, authors, and rich content editing',
63
- category: 'content',
64
- includes: [
65
- 'Post list with title, content, and metadata',
66
- 'Author relationship to User',
67
- 'Draft/publish workflow with status field',
68
- 'Access control (authors can edit own posts)',
69
- 'Rich text editor or markdown support',
70
- 'SEO-friendly slugs',
71
- ],
72
- dependsOn: ['authentication'],
73
- questions: [
74
- {
75
- id: 'content-editor',
76
- text: 'How should users write posts?',
77
- type: 'select',
78
- required: true,
79
- options: ['Rich text editor (Tiptap)', 'Markdown', 'Plain text'],
80
- defaultValue: 'Rich text editor (Tiptap)',
81
- },
82
- {
83
- id: 'post-status',
84
- text: 'Enable draft/publish workflow?',
85
- type: 'boolean',
86
- required: true,
87
- defaultValue: true,
88
- },
89
- {
90
- id: 'taxonomy',
91
- text: 'Add categories or tags for organizing posts?',
92
- type: 'multiselect',
93
- required: false,
94
- options: ['Categories', 'Tags'],
95
- defaultValue: [],
96
- },
97
- {
98
- id: 'post-fields',
99
- text: 'Select additional post fields',
100
- type: 'multiselect',
101
- required: false,
102
- options: [
103
- 'Featured image',
104
- 'Excerpt/summary',
105
- 'SEO metadata (title, description)',
106
- 'Published date',
107
- 'Reading time estimate',
108
- ],
109
- defaultValue: ['Featured image', 'Excerpt/summary'],
110
- },
111
- {
112
- id: 'comments-enabled',
113
- text: 'Enable comments on blog posts?',
114
- type: 'boolean',
115
- required: false,
116
- defaultValue: false,
117
- },
118
- ],
119
- }
120
-
121
- export const COMMENTS_FEATURE: Feature = {
122
- id: 'comments',
123
- name: 'Comments System',
124
- description: 'Add threaded comments to your content with moderation',
125
- category: 'content',
126
- includes: [
127
- 'Comment list with content and author',
128
- 'Relationship to commentable content',
129
- 'Nested replies support (optional)',
130
- 'Moderation workflow',
131
- 'Access control for comment management',
132
- ],
133
- dependsOn: ['authentication'],
134
- questions: [
135
- {
136
- id: 'comment-targets',
137
- text: 'What content types can users comment on?',
138
- type: 'multiselect',
139
- required: true,
140
- options: ['Posts', 'Products', 'Other'],
141
- defaultValue: ['Posts'],
142
- },
143
- {
144
- id: 'nested-replies',
145
- text: 'Allow nested/threaded replies?',
146
- type: 'boolean',
147
- required: true,
148
- defaultValue: true,
149
- },
150
- {
151
- id: 'moderation',
152
- text: 'Comment moderation approach?',
153
- type: 'select',
154
- required: true,
155
- options: [
156
- 'Auto-approve all comments',
157
- 'Require admin approval',
158
- 'Auto-approve for verified users only',
159
- ],
160
- defaultValue: 'Auto-approve all comments',
161
- },
162
- {
163
- id: 'comment-features',
164
- text: 'Additional comment features?',
165
- type: 'multiselect',
166
- required: false,
167
- options: ['Upvotes/downvotes', 'Report/flag comments', 'Markdown support'],
168
- defaultValue: [],
169
- },
170
- ],
171
- }
172
-
173
- export const FILE_UPLOAD_FEATURE: Feature = {
174
- id: 'file-upload',
175
- name: 'File Uploads',
176
- description: 'Upload and manage files with cloud storage integration',
177
- category: 'storage',
178
- includes: [
179
- 'File list with name, URL, size, and type',
180
- 'Storage plugin integration',
181
- 'Upload UI components',
182
- 'Access control for files',
183
- 'Image optimization (optional)',
184
- ],
185
- questions: [
186
- {
187
- id: 'storage-provider',
188
- text: 'Which storage provider do you want to use?',
189
- type: 'select',
190
- required: true,
191
- options: ['AWS S3', 'Cloudflare R2', 'Vercel Blob', 'Local filesystem (development only)'],
192
- defaultValue: 'Vercel Blob',
193
- },
194
- {
195
- id: 'file-associations',
196
- text: 'Where will files be used?',
197
- type: 'multiselect',
198
- required: true,
199
- options: ['User avatars', 'Post featured images', 'General attachments', 'Product images'],
200
- defaultValue: ['User avatars'],
201
- },
202
- {
203
- id: 'file-types',
204
- text: 'What file types should be allowed?',
205
- type: 'multiselect',
206
- required: true,
207
- options: ['Images (jpg, png, webp)', 'PDFs', 'Videos', 'Any file type'],
208
- defaultValue: ['Images (jpg, png, webp)'],
209
- },
210
- {
211
- id: 'image-processing',
212
- text: 'Enable automatic image optimization and resizing?',
213
- type: 'boolean',
214
- required: false,
215
- defaultValue: true,
216
- dependsOn: {
217
- questionId: 'file-types',
218
- value: 'Images (jpg, png, webp)',
219
- },
220
- },
221
- ],
222
- }
223
-
224
- export const SEMANTIC_SEARCH_FEATURE: Feature = {
225
- id: 'semantic-search',
226
- name: 'Semantic Search',
227
- description: 'AI-powered search using RAG (Retrieval Augmented Generation)',
228
- category: 'search',
229
- includes: [
230
- 'RAG plugin integration',
231
- 'Automatic embeddings generation',
232
- 'Search API endpoint',
233
- 'Search UI component',
234
- 'Relevance scoring',
235
- ],
236
- questions: [
237
- {
238
- id: 'searchable-content',
239
- text: 'What content should be searchable?',
240
- type: 'multiselect',
241
- required: true,
242
- options: ['Posts', 'Products', 'Documentation', 'User profiles'],
243
- defaultValue: ['Posts'],
244
- },
245
- {
246
- id: 'embedding-provider',
247
- text: 'Which embedding provider?',
248
- type: 'select',
249
- required: true,
250
- options: ['OpenAI (text-embedding-3-small)', 'Cohere', 'Anthropic'],
251
- defaultValue: 'OpenAI (text-embedding-3-small)',
252
- },
253
- {
254
- id: 'search-fields',
255
- text: 'Which fields should be indexed for search?',
256
- type: 'multiselect',
257
- required: true,
258
- options: ['Title', 'Content/body', 'Excerpt', 'Tags/categories'],
259
- defaultValue: ['Title', 'Content/body'],
260
- },
261
- {
262
- id: 'real-time-indexing',
263
- text: 'Update search index in real-time when content changes?',
264
- type: 'boolean',
265
- required: true,
266
- defaultValue: true,
267
- },
268
- ],
269
- }
270
-
271
- /**
272
- * Feature catalog - maps feature IDs to feature definitions
273
- */
274
- export const FeatureCatalog = new Map<string, Feature>([
275
- ['authentication', AUTHENTICATION_FEATURE],
276
- ['blog', BLOG_FEATURE],
277
- ['comments', COMMENTS_FEATURE],
278
- ['file-upload', FILE_UPLOAD_FEATURE],
279
- ['semantic-search', SEMANTIC_SEARCH_FEATURE],
280
- ])
281
-
282
- /**
283
- * Get feature by ID
284
- */
285
- export function getFeature(featureId: string): Feature | undefined {
286
- return FeatureCatalog.get(featureId)
287
- }
288
-
289
- /**
290
- * Get all available features
291
- */
292
- export function getAllFeatures(): Feature[] {
293
- return Array.from(FeatureCatalog.values())
294
- }
295
-
296
- /**
297
- * Get features by category
298
- */
299
- export function getFeaturesByCategory(category: Feature['category']): Feature[] {
300
- return getAllFeatures().filter((f) => f.category === category)
301
- }