@opensaas/stack-cli 0.1.7 ā 0.4.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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +348 -0
- package/CLAUDE.md +60 -12
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +13 -13
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/mcp.d.ts +6 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +116 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/generator/context.d.ts.map +1 -1
- package/dist/generator/context.js +40 -7
- package/dist/generator/context.js.map +1 -1
- package/dist/generator/index.d.ts +4 -1
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +4 -1
- package/dist/generator/index.js.map +1 -1
- package/dist/generator/lists.d.ts +31 -0
- package/dist/generator/lists.d.ts.map +1 -0
- package/dist/generator/lists.js +123 -0
- package/dist/generator/lists.js.map +1 -0
- package/dist/generator/plugin-types.d.ts +10 -0
- package/dist/generator/plugin-types.d.ts.map +1 -0
- package/dist/generator/plugin-types.js +122 -0
- package/dist/generator/plugin-types.js.map +1 -0
- package/dist/generator/prisma-config.d.ts +17 -0
- package/dist/generator/prisma-config.d.ts.map +1 -0
- package/dist/generator/prisma-config.js +40 -0
- package/dist/generator/prisma-config.js.map +1 -0
- package/dist/generator/prisma-extensions.d.ts +11 -0
- package/dist/generator/prisma-extensions.d.ts.map +1 -0
- package/dist/generator/prisma-extensions.js +134 -0
- package/dist/generator/prisma-extensions.js.map +1 -0
- package/dist/generator/prisma.d.ts.map +1 -1
- package/dist/generator/prisma.js +5 -2
- package/dist/generator/prisma.js.map +1 -1
- package/dist/generator/types.d.ts.map +1 -1
- package/dist/generator/types.js +201 -17
- package/dist/generator/types.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/lib/documentation-provider.d.ts +43 -0
- package/dist/mcp/lib/documentation-provider.d.ts.map +1 -0
- package/dist/mcp/lib/documentation-provider.js +163 -0
- package/dist/mcp/lib/documentation-provider.js.map +1 -0
- package/dist/mcp/lib/features/catalog.d.ts +26 -0
- package/dist/mcp/lib/features/catalog.d.ts.map +1 -0
- package/dist/mcp/lib/features/catalog.js +291 -0
- package/dist/mcp/lib/features/catalog.js.map +1 -0
- package/dist/mcp/lib/generators/feature-generator.d.ts +35 -0
- package/dist/mcp/lib/generators/feature-generator.d.ts.map +1 -0
- package/dist/mcp/lib/generators/feature-generator.js +546 -0
- package/dist/mcp/lib/generators/feature-generator.js.map +1 -0
- package/dist/mcp/lib/types.d.ts +80 -0
- package/dist/mcp/lib/types.d.ts.map +1 -0
- package/dist/mcp/lib/types.js +5 -0
- package/dist/mcp/lib/types.js.map +1 -0
- package/dist/mcp/lib/wizards/wizard-engine.d.ts +71 -0
- package/dist/mcp/lib/wizards/wizard-engine.d.ts.map +1 -0
- package/dist/mcp/lib/wizards/wizard-engine.js +356 -0
- package/dist/mcp/lib/wizards/wizard-engine.js.map +1 -0
- package/dist/mcp/server/index.d.ts +8 -0
- package/dist/mcp/server/index.d.ts.map +1 -0
- package/dist/mcp/server/index.js +202 -0
- package/dist/mcp/server/index.js.map +1 -0
- package/dist/mcp/server/stack-mcp-server.d.ts +92 -0
- package/dist/mcp/server/stack-mcp-server.d.ts.map +1 -0
- package/dist/mcp/server/stack-mcp-server.js +265 -0
- package/dist/mcp/server/stack-mcp-server.js.map +1 -0
- package/package.json +10 -8
- package/src/commands/__snapshots__/generate.test.ts.snap +145 -38
- package/src/commands/dev.test.ts +0 -1
- package/src/commands/generate.test.ts +18 -8
- package/src/commands/generate.ts +20 -19
- package/src/commands/mcp.ts +135 -0
- package/src/generator/__snapshots__/context.test.ts.snap +63 -18
- package/src/generator/__snapshots__/prisma.test.ts.snap +8 -16
- package/src/generator/__snapshots__/types.test.ts.snap +1267 -95
- package/src/generator/context.test.ts +15 -8
- package/src/generator/context.ts +40 -7
- package/src/generator/index.ts +4 -1
- package/src/generator/lists.test.ts +335 -0
- package/src/generator/lists.ts +140 -0
- package/src/generator/plugin-types.ts +147 -0
- package/src/generator/prisma-config.ts +46 -0
- package/src/generator/prisma-extensions.ts +159 -0
- package/src/generator/prisma.test.ts +0 -10
- package/src/generator/prisma.ts +6 -2
- package/src/generator/types.test.ts +0 -12
- package/src/generator/types.ts +257 -17
- package/src/index.ts +4 -0
- package/src/mcp/lib/documentation-provider.ts +203 -0
- package/src/mcp/lib/features/catalog.ts +301 -0
- package/src/mcp/lib/generators/feature-generator.ts +598 -0
- package/src/mcp/lib/types.ts +89 -0
- package/src/mcp/lib/wizards/wizard-engine.ts +427 -0
- package/src/mcp/server/index.ts +240 -0
- package/src/mcp/server/stack-mcp-server.ts +301 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/generator/type-patcher.d.ts +0 -13
- package/dist/generator/type-patcher.d.ts.map +0 -1
- package/dist/generator/type-patcher.js +0 -68
- package/dist/generator/type-patcher.js.map +0 -1
- package/src/generator/type-patcher.ts +0 -93
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,353 @@
|
|
|
1
1
|
# @opensaas/stack-cli
|
|
2
2
|
|
|
3
|
+
## 0.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#170](https://github.com/OpenSaasAU/stack/pull/170) [`3c4db9d`](https://github.com/OpenSaasAU/stack/commit/3c4db9d8318fc73d291991d8bdfa4f607c3a50ea) Thanks [@list({](https://github.com/list({)! - Add support for virtual fields with proper TypeScript type generation
|
|
8
|
+
|
|
9
|
+
Virtual fields are computed fields that don't exist in the database but are added to query results at runtime. This feature enables derived or computed values to be included in your API responses with full type safety.
|
|
10
|
+
|
|
11
|
+
**New Features:**
|
|
12
|
+
- Added `virtual()` field type for defining computed fields in your schema
|
|
13
|
+
- Virtual fields are automatically excluded from database schema and input types
|
|
14
|
+
- Virtual fields appear in output types with full TypeScript autocomplete
|
|
15
|
+
- Virtual fields support `resolveOutput` hooks for custom computation logic
|
|
16
|
+
|
|
17
|
+
**Type System Improvements:**
|
|
18
|
+
- Generated Context type now properly extends AccessContext from core
|
|
19
|
+
- Separate Input and Output types (e.g., `UserOutput` includes virtual fields, `UserCreateInput` does not)
|
|
20
|
+
- UI components now accept `AccessContext<any>` for better compatibility with custom context types
|
|
21
|
+
- Type aliases provide convenience (e.g., `User = UserOutput`)
|
|
22
|
+
|
|
23
|
+
**Example Usage:**
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { list, text, virtual } from '@opensaas/stack-core'
|
|
27
|
+
|
|
28
|
+
export default config({
|
|
29
|
+
lists: {
|
|
30
|
+
|
|
31
|
+
fields: {
|
|
32
|
+
name: text(),
|
|
33
|
+
email: text(),
|
|
34
|
+
displayName: virtual({
|
|
35
|
+
type: 'string',
|
|
36
|
+
hooks: {
|
|
37
|
+
resolveOutput: async ({ item }) => {
|
|
38
|
+
return `${item.name} (${item.email})`
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The `displayName` field will automatically appear in query results with full TypeScript support, but won't be part of create/update operations or the database schema.
|
|
49
|
+
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- [#154](https://github.com/OpenSaasAU/stack/pull/154) [`edf1e5f`](https://github.com/OpenSaasAU/stack/commit/edf1e5fa4cfefcb7bc09bf45d4702260e6d0d3aa) Thanks [@renovate](https://github.com/apps/renovate)! - Update dependency chokidar to v5
|
|
53
|
+
|
|
54
|
+
- [#172](https://github.com/OpenSaasAU/stack/pull/172) [`929a2a9`](https://github.com/OpenSaasAU/stack/commit/929a2a9a2dfa80b1d973d259dd87828d644ea58d) Thanks [@list<Lists.User.TypeInfo>({](https://github.com/list<Lists.User.TypeInfo>({), [@list<Lists.User.TypeInfo>({](https://github.com/list<Lists.User.TypeInfo>({)! - Improve TypeScript type inference for field configs and list-level hooks by automatically passing TypeInfo from list level down
|
|
55
|
+
|
|
56
|
+
This change eliminates the need to manually specify type parameters on field builders when using features like virtual fields, and fixes a critical bug where list-level hooks weren't receiving properly typed parameters.
|
|
57
|
+
|
|
58
|
+
## Field Type Inference Improvements
|
|
59
|
+
|
|
60
|
+
Previously, users had to write `virtual<Lists.User.TypeInfo>({...})` to get proper type inference. Now TypeScript automatically infers the correct types from the list-level type parameter.
|
|
61
|
+
|
|
62
|
+
**Example:**
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
// Before
|
|
66
|
+
|
|
67
|
+
fields: {
|
|
68
|
+
displayName: virtual<Lists.User.TypeInfo>({
|
|
69
|
+
type: 'string',
|
|
70
|
+
hooks: {
|
|
71
|
+
resolveOutput: ({ item }) => `${item.name} (${item.email})`,
|
|
72
|
+
},
|
|
73
|
+
}),
|
|
74
|
+
},
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
// After
|
|
78
|
+
|
|
79
|
+
fields: {
|
|
80
|
+
displayName: virtual({
|
|
81
|
+
type: 'string',
|
|
82
|
+
hooks: {
|
|
83
|
+
resolveOutput: ({ item }) => `${item.name} (${item.email})`,
|
|
84
|
+
},
|
|
85
|
+
}),
|
|
86
|
+
},
|
|
87
|
+
})
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## List-Level Hooks Type Inference Fix
|
|
91
|
+
|
|
92
|
+
Fixed a critical type parameter mismatch where `Hooks<TTypeInfo>` was passing the entire TypeInfo object as the first parameter instead of properly destructuring it into three required parameters:
|
|
93
|
+
1. `TOutput` - The item type (what's stored in DB)
|
|
94
|
+
2. `TCreateInput` - Prisma create input type
|
|
95
|
+
3. `TUpdateInput` - Prisma update input type
|
|
96
|
+
|
|
97
|
+
**Impact:**
|
|
98
|
+
- `resolveInput` now receives proper Prisma input types (e.g., `PostCreateInput`, `PostUpdateInput`)
|
|
99
|
+
- `validateInput` has access to properly typed input data
|
|
100
|
+
- `beforeOperation` and `afterOperation` have correct item types
|
|
101
|
+
- All list-level hook callbacks now get full IntelliSense and type checking
|
|
102
|
+
|
|
103
|
+
**Example:**
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
Post: list<Lists.Post.TypeInfo>({
|
|
107
|
+
fields: { title: text(), content: text() },
|
|
108
|
+
hooks: {
|
|
109
|
+
resolveInput: async ({ operation, resolvedData }) => {
|
|
110
|
+
// ā
resolvedData is now properly typed as PostCreateInput or PostUpdateInput
|
|
111
|
+
// ā
Full autocomplete for title, content, etc.
|
|
112
|
+
if (operation === 'create') {
|
|
113
|
+
console.log(resolvedData.title) // TypeScript knows this is string | undefined
|
|
114
|
+
}
|
|
115
|
+
return resolvedData
|
|
116
|
+
},
|
|
117
|
+
beforeOperation: async ({ operation, item }) => {
|
|
118
|
+
// ā
item is now properly typed as Post with all fields
|
|
119
|
+
if (operation === 'update' && item) {
|
|
120
|
+
console.log(item.title) // TypeScript knows this is string
|
|
121
|
+
console.log(item.createdAt) // TypeScript knows this is Date
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
})
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Breaking Changes
|
|
129
|
+
- Field types now accept full `TTypeInfo extends TypeInfo` instead of just `TItem`
|
|
130
|
+
- `FieldsWithItemType` utility replaced with `FieldsWithTypeInfo`
|
|
131
|
+
- All field builders updated to use new type signature
|
|
132
|
+
- List-level hooks now receive properly typed parameters (may reveal existing type errors)
|
|
133
|
+
|
|
134
|
+
## Benefits
|
|
135
|
+
- ⨠Cleaner code without manual type parameter repetition
|
|
136
|
+
- šÆ Better type inference in both field-level and list-level hooks
|
|
137
|
+
- š Consistent type flow from list configuration down to individual fields
|
|
138
|
+
- š”ļø Maintained full type safety with improved DX
|
|
139
|
+
- š” Full IntelliSense support in all hook callbacks
|
|
140
|
+
|
|
141
|
+
- Updated dependencies [[`527b677`](https://github.com/OpenSaasAU/stack/commit/527b677ab598070185e23d163a9e99bc20f03c49), [`929a2a9`](https://github.com/OpenSaasAU/stack/commit/929a2a9a2dfa80b1d973d259dd87828d644ea58d), [`3c4db9d`](https://github.com/OpenSaasAU/stack/commit/3c4db9d8318fc73d291991d8bdfa4f607c3a50ea)]:
|
|
142
|
+
- @opensaas/stack-core@0.4.0
|
|
143
|
+
|
|
144
|
+
## 0.3.0
|
|
145
|
+
|
|
146
|
+
### Patch Changes
|
|
147
|
+
|
|
148
|
+
- Updated dependencies []:
|
|
149
|
+
- @opensaas/stack-core@0.3.0
|
|
150
|
+
|
|
151
|
+
## 0.2.0
|
|
152
|
+
|
|
153
|
+
### Minor Changes
|
|
154
|
+
|
|
155
|
+
- [#107](https://github.com/OpenSaasAU/stack/pull/107) [`f4f3966`](https://github.com/OpenSaasAU/stack/commit/f4f3966faedba07d2cf412fab826d81e30c63a6c) Thanks [@borisno2](https://github.com/borisno2)! - # Add MCP Server for AI-Assisted Development
|
|
156
|
+
|
|
157
|
+
## New Features
|
|
158
|
+
|
|
159
|
+
### CLI Package (@opensaas/stack-cli)
|
|
160
|
+
- **New `opensaas mcp` command group** for AI-assisted development:
|
|
161
|
+
- `opensaas mcp install` - Install MCP server in Claude Code
|
|
162
|
+
- `opensaas mcp uninstall` - Remove MCP server from Claude Code
|
|
163
|
+
- `opensaas mcp start` - Start MCP server directly (for debugging)
|
|
164
|
+
- **Feature-driven development tools**:
|
|
165
|
+
- Interactive feature implementation wizards (authentication, blog, comments, file-upload, semantic-search)
|
|
166
|
+
- Live documentation search from stack.opensaas.au
|
|
167
|
+
- Code generation following OpenSaaS best practices
|
|
168
|
+
- Smart feature suggestions based on your current app
|
|
169
|
+
- Config validation
|
|
170
|
+
- **MCP tools available in Claude Code**:
|
|
171
|
+
- `opensaas_implement_feature` - Start feature wizard
|
|
172
|
+
- `opensaas_feature_docs` - Search documentation
|
|
173
|
+
- `opensaas_list_features` - Browse available features
|
|
174
|
+
- `opensaas_suggest_features` - Get personalized recommendations
|
|
175
|
+
- `opensaas_validate_feature` - Validate implementations
|
|
176
|
+
|
|
177
|
+
### create-opensaas-app
|
|
178
|
+
- **Interactive MCP setup prompt** during project creation
|
|
179
|
+
- Option to enable AI development tools automatically
|
|
180
|
+
- Automatic installation of MCP server if user opts in
|
|
181
|
+
- Helpful instructions if MCP installation is declined or fails
|
|
182
|
+
|
|
183
|
+
## Installation
|
|
184
|
+
|
|
185
|
+
Enable AI development tools for an existing project:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npx @opensaas/stack-cli mcp install
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Or during project creation:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
npm create opensaas-app@latest my-app
|
|
195
|
+
# When prompted: Enable AI development tools? ā yes
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Benefits
|
|
199
|
+
- **Build apps faster**: Describe what you want to build, get complete implementations
|
|
200
|
+
- **Feature-driven development**: Work with high-level features instead of low-level config
|
|
201
|
+
- **Best practices baked in**: Generated code follows OpenSaaS Stack patterns
|
|
202
|
+
- **Live documentation**: Always up-to-date docs from the official site
|
|
203
|
+
- **Single toolkit**: All developer commands in one CLI
|
|
204
|
+
|
|
205
|
+
## Example Usage
|
|
206
|
+
|
|
207
|
+
With Claude Code installed and the MCP server enabled, you can:
|
|
208
|
+
|
|
209
|
+
```
|
|
210
|
+
You: "I want to build a food tracking app"
|
|
211
|
+
|
|
212
|
+
Claude Code uses MCP tools to:
|
|
213
|
+
1. Ask clarifying questions about requirements
|
|
214
|
+
2. Implement authentication feature (wizard)
|
|
215
|
+
3. Create custom Food and FoodLog lists
|
|
216
|
+
4. Generate complete code with UI and access control
|
|
217
|
+
5. Provide testing and deployment guidance
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
- [#132](https://github.com/OpenSaasAU/stack/pull/132) [`fcf5cb8`](https://github.com/OpenSaasAU/stack/commit/fcf5cb8bbd55d802350b8d97e342dd7f6368163b) Thanks [@borisno2](https://github.com/borisno2)! - Upgrade to Prisma 7 with database adapter support
|
|
221
|
+
|
|
222
|
+
## Breaking Changes
|
|
223
|
+
|
|
224
|
+
### Required `prismaClientConstructor`
|
|
225
|
+
|
|
226
|
+
Prisma 7 requires database adapters. All configs must now include `prismaClientConstructor`:
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
import { PrismaBetterSQLite3 } from '@prisma/adapter-better-sqlite3'
|
|
230
|
+
import Database from 'better-sqlite3'
|
|
231
|
+
|
|
232
|
+
export default config({
|
|
233
|
+
db: {
|
|
234
|
+
provider: 'sqlite',
|
|
235
|
+
prismaClientConstructor: (PrismaClient) => {
|
|
236
|
+
const db = new Database(process.env.DATABASE_URL || './dev.db')
|
|
237
|
+
const adapter = new PrismaBetterSQLite3(db)
|
|
238
|
+
return new PrismaClient({ adapter })
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
})
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Removed `url` from `DatabaseConfig`
|
|
245
|
+
|
|
246
|
+
The `url` field has been removed from the `DatabaseConfig` type. Database connection URLs are now passed directly to adapters in `prismaClientConstructor`:
|
|
247
|
+
|
|
248
|
+
```typescript
|
|
249
|
+
// ā Before (Prisma 6)
|
|
250
|
+
db: {
|
|
251
|
+
provider: 'sqlite',
|
|
252
|
+
url: 'file:./dev.db', // url in config
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// ā
After (Prisma 7)
|
|
256
|
+
db: {
|
|
257
|
+
provider: 'sqlite',
|
|
258
|
+
prismaClientConstructor: (PrismaClient) => {
|
|
259
|
+
const adapter = new PrismaBetterSQLite3({ url: './dev.db' }) // url in adapter
|
|
260
|
+
return new PrismaClient({ adapter })
|
|
261
|
+
},
|
|
262
|
+
}
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Generated Schema Changes
|
|
266
|
+
- Generator provider changed from `prisma-client-js` to `prisma-client`
|
|
267
|
+
- Removed `url` field from datasource block
|
|
268
|
+
- Database URL now passed via adapter in `prismaClientConstructor`
|
|
269
|
+
|
|
270
|
+
### Required Dependencies
|
|
271
|
+
|
|
272
|
+
Install the appropriate adapter for your database:
|
|
273
|
+
- **SQLite**: `@prisma/adapter-better-sqlite3` + `better-sqlite3`
|
|
274
|
+
- **PostgreSQL**: `@prisma/adapter-pg` + `pg`
|
|
275
|
+
- **MySQL**: `@prisma/adapter-mysql` + `mysql2`
|
|
276
|
+
|
|
277
|
+
## Migration Steps
|
|
278
|
+
1. Install Prisma 7 and adapter:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
pnpm add @prisma/client@7 @prisma/adapter-better-sqlite3 better-sqlite3
|
|
282
|
+
pnpm add -D prisma@7
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
2. Update your `opensaas.config.ts` to include `prismaClientConstructor` (see example above)
|
|
286
|
+
3. Regenerate schema and client:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
pnpm generate
|
|
290
|
+
npx prisma generate
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
4. Push schema to database:
|
|
294
|
+
```bash
|
|
295
|
+
pnpm db:push
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
See the updated documentation in CLAUDE.md for more examples including PostgreSQL and custom adapters.
|
|
299
|
+
|
|
300
|
+
### Patch Changes
|
|
301
|
+
|
|
302
|
+
- [#107](https://github.com/OpenSaasAU/stack/pull/107) [`f4f3966`](https://github.com/OpenSaasAU/stack/commit/f4f3966faedba07d2cf412fab826d81e30c63a6c) Thanks [@borisno2](https://github.com/borisno2)! - Add strict typing for plugin runtime services
|
|
303
|
+
|
|
304
|
+
This change implements fully typed plugin runtime services, providing autocomplete and type safety for `context.plugins` throughout the codebase.
|
|
305
|
+
|
|
306
|
+
**Core Changes:**
|
|
307
|
+
- Extended `Plugin` type with optional `runtimeServiceTypes` metadata for type-safe code generation
|
|
308
|
+
- Converted `OpenSaasConfig` and `AccessContext` from `type` to `interface` to enable module augmentation
|
|
309
|
+
- Plugins can now declare their runtime service type information
|
|
310
|
+
|
|
311
|
+
**Auth Plugin:**
|
|
312
|
+
- Added `AuthRuntimeServices` interface defining runtime service types
|
|
313
|
+
- Exported runtime types from package
|
|
314
|
+
- Users now get full autocomplete for `context.plugins.auth.getUser()` and `context.plugins.auth.getCurrentUser()`
|
|
315
|
+
|
|
316
|
+
**RAG Plugin:**
|
|
317
|
+
- Added `RAGRuntimeServices` interface defining runtime service types
|
|
318
|
+
- Exported runtime types from package
|
|
319
|
+
- Users now get full autocomplete for `context.plugins.rag.generateEmbedding()` and `context.plugins.rag.generateEmbeddings()`
|
|
320
|
+
|
|
321
|
+
**CLI Generator:**
|
|
322
|
+
- Enhanced plugin types generator to import and use plugin runtime service types
|
|
323
|
+
- Generated `.opensaas/plugin-types.ts` now includes proper type imports
|
|
324
|
+
- `PluginServices` interface extends `Record<string, Record<string, any> | undefined>` for type compatibility
|
|
325
|
+
- Maintains backwards compatibility with plugins that don't provide type metadata
|
|
326
|
+
|
|
327
|
+
**UI Package:**
|
|
328
|
+
- Updated `AdminUI` props to accept contexts with typed plugin services
|
|
329
|
+
- Ensures compatibility between generated context types and UI components
|
|
330
|
+
|
|
331
|
+
**Benefits:**
|
|
332
|
+
- Full TypeScript autocomplete for all plugin runtime methods
|
|
333
|
+
- Compile-time type checking catches errors early
|
|
334
|
+
- Better IDE experience with hover documentation and jump-to-definition
|
|
335
|
+
- Backwards compatible - third-party plugins without type metadata continue to work
|
|
336
|
+
- Zero type errors in examples
|
|
337
|
+
|
|
338
|
+
**Example:**
|
|
339
|
+
|
|
340
|
+
```typescript
|
|
341
|
+
const context = await getContext()
|
|
342
|
+
|
|
343
|
+
// Fully typed with autocomplete
|
|
344
|
+
context.plugins.auth.getUser('123') // (userId: string) => Promise<unknown>
|
|
345
|
+
context.plugins.rag.generateEmbedding('text') // (text: string, providerName?: string) => Promise<number[]>
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
- Updated dependencies [[`fcf5cb8`](https://github.com/OpenSaasAU/stack/commit/fcf5cb8bbd55d802350b8d97e342dd7f6368163b), [`3851a3c`](https://github.com/OpenSaasAU/stack/commit/3851a3cf72e78dc6f01a73c6fff97deca6fad043), [`f4f3966`](https://github.com/OpenSaasAU/stack/commit/f4f3966faedba07d2cf412fab826d81e30c63a6c)]:
|
|
349
|
+
- @opensaas/stack-core@0.2.0
|
|
350
|
+
|
|
3
351
|
## 0.1.7
|
|
4
352
|
|
|
5
353
|
### Patch Changes
|
package/CLAUDE.md
CHANGED
|
@@ -87,11 +87,10 @@ Outputs:
|
|
|
87
87
|
```prisma
|
|
88
88
|
datasource db {
|
|
89
89
|
provider = "sqlite"
|
|
90
|
-
url = env("DATABASE_URL")
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
generator client {
|
|
94
|
-
provider = "prisma-client
|
|
93
|
+
provider = "prisma-client"
|
|
95
94
|
}
|
|
96
95
|
|
|
97
96
|
model Post {
|
|
@@ -102,6 +101,31 @@ model Post {
|
|
|
102
101
|
}
|
|
103
102
|
```
|
|
104
103
|
|
|
104
|
+
**Note:** Prisma 7 no longer includes `url` in the schema. The database URL is passed to PrismaClient via adapters in the `prismaClientConstructor` function.
|
|
105
|
+
|
|
106
|
+
### Prisma CLI Config (`prisma.config.ts`)
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
import 'dotenv/config'
|
|
110
|
+
import { defineConfig, env } from 'prisma/config'
|
|
111
|
+
|
|
112
|
+
export default defineConfig({
|
|
113
|
+
schema: 'prisma/schema.prisma',
|
|
114
|
+
datasource: {
|
|
115
|
+
url: env('DATABASE_URL'),
|
|
116
|
+
},
|
|
117
|
+
})
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Purpose:** Prisma 7 requires this file at the project root for CLI commands like `prisma db push` and `prisma migrate dev` to work. This is separate from the runtime configuration.
|
|
121
|
+
|
|
122
|
+
**Key points:**
|
|
123
|
+
|
|
124
|
+
- Generated automatically by `opensaas generate`
|
|
125
|
+
- Requires `dotenv` package to load `.env` files
|
|
126
|
+
- Reads `DATABASE_URL` from environment variables
|
|
127
|
+
- Only used by Prisma CLI commands, not by application runtime
|
|
128
|
+
|
|
105
129
|
### Types (`.opensaas/types.ts`)
|
|
106
130
|
|
|
107
131
|
```typescript
|
|
@@ -128,13 +152,16 @@ import { createContext } from '@opensaas/stack-core'
|
|
|
128
152
|
import { PrismaClient } from '@prisma/client'
|
|
129
153
|
import config from '../opensaas.config'
|
|
130
154
|
|
|
131
|
-
|
|
155
|
+
// Prisma 7 requires adapters - PrismaClient created via prismaClientConstructor
|
|
156
|
+
const prisma = config.db.prismaClientConstructor(PrismaClient)
|
|
132
157
|
|
|
133
158
|
export function getContext(session?: any) {
|
|
134
159
|
return createContext(config, prisma, session)
|
|
135
160
|
}
|
|
136
161
|
```
|
|
137
162
|
|
|
163
|
+
**Note:** The actual generated context is more sophisticated with async config resolution and singleton management, but this shows the core pattern.
|
|
164
|
+
|
|
138
165
|
## Integration Points
|
|
139
166
|
|
|
140
167
|
### With @opensaas/stack-core
|
|
@@ -155,9 +182,9 @@ export function getContext(session?: any) {
|
|
|
155
182
|
|
|
156
183
|
Workflow:
|
|
157
184
|
|
|
158
|
-
1. `opensaas generate` ā creates `prisma/schema.prisma`
|
|
185
|
+
1. `opensaas generate` ā creates `prisma/schema.prisma` and `prisma.config.ts`
|
|
159
186
|
2. `npx prisma generate` ā creates Prisma Client
|
|
160
|
-
3. `npx prisma db push` ā pushes schema to database
|
|
187
|
+
3. `npx prisma db push` ā pushes schema to database (uses `prisma.config.ts` for datasource URL)
|
|
161
188
|
|
|
162
189
|
## Common Patterns
|
|
163
190
|
|
|
@@ -195,30 +222,51 @@ pnpm next dev
|
|
|
195
222
|
- run: pnpm test
|
|
196
223
|
```
|
|
197
224
|
|
|
198
|
-
### Custom Prisma Client
|
|
225
|
+
### Custom Prisma Client (Required in Prisma 7)
|
|
199
226
|
|
|
200
|
-
|
|
227
|
+
**All configs must provide `prismaClientConstructor`** with a database adapter:
|
|
201
228
|
|
|
202
229
|
```typescript
|
|
230
|
+
// SQLite example
|
|
231
|
+
import { PrismaBetterSQLite3 } from '@prisma/adapter-better-sqlite3'
|
|
232
|
+
import Database from 'better-sqlite3'
|
|
233
|
+
|
|
234
|
+
config({
|
|
235
|
+
db: {
|
|
236
|
+
provider: 'sqlite',
|
|
237
|
+
url: process.env.DATABASE_URL || 'file:./dev.db',
|
|
238
|
+
prismaClientConstructor: (PrismaClient) => {
|
|
239
|
+
const db = new Database(process.env.DATABASE_URL || './dev.db')
|
|
240
|
+
const adapter = new PrismaBetterSQLite3(db)
|
|
241
|
+
return new PrismaClient({ adapter })
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
})
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
```typescript
|
|
248
|
+
// PostgreSQL example
|
|
249
|
+
import { PrismaPg } from '@prisma/adapter-pg'
|
|
250
|
+
import pg from 'pg'
|
|
251
|
+
|
|
203
252
|
config({
|
|
204
253
|
db: {
|
|
205
254
|
provider: 'postgresql',
|
|
206
255
|
url: process.env.DATABASE_URL,
|
|
207
256
|
prismaClientConstructor: (PrismaClient) => {
|
|
208
|
-
|
|
257
|
+
const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL })
|
|
258
|
+
const adapter = new PrismaPg(pool)
|
|
209
259
|
return new PrismaClient({ adapter })
|
|
210
260
|
},
|
|
211
261
|
},
|
|
212
262
|
})
|
|
213
263
|
```
|
|
214
264
|
|
|
215
|
-
Generated context uses
|
|
265
|
+
Generated context always uses the constructor:
|
|
216
266
|
|
|
217
267
|
```typescript
|
|
218
268
|
// .opensaas/context.ts
|
|
219
|
-
const prisma = config.db.prismaClientConstructor
|
|
220
|
-
? config.db.prismaClientConstructor(PrismaClient)
|
|
221
|
-
: new PrismaClient()
|
|
269
|
+
const prisma = config.db.prismaClientConstructor(PrismaClient)
|
|
222
270
|
```
|
|
223
271
|
|
|
224
272
|
## Type Patching
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAiBA,wBAAsB,eAAe,kBAoKpC"}
|
|
@@ -4,7 +4,7 @@ import { execSync } from 'child_process';
|
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import ora from 'ora';
|
|
6
6
|
import { createJiti } from 'jiti';
|
|
7
|
-
import { writePrismaSchema, writeTypes, writeContext,
|
|
7
|
+
import { writePrismaSchema, writePrismaConfig, writeTypes, writeLists, writeContext, writePluginTypes, writePrismaExtensions, } from '../generator/index.js';
|
|
8
8
|
export async function generateCommand() {
|
|
9
9
|
console.log(chalk.bold('\nš OpenSaas Generator\n'));
|
|
10
10
|
const cwd = process.cwd();
|
|
@@ -51,15 +51,27 @@ export async function generateCommand() {
|
|
|
51
51
|
const generatorSpinner = ora('Generating schema and types...').start();
|
|
52
52
|
try {
|
|
53
53
|
const prismaSchemaPath = path.join(cwd, 'prisma', 'schema.prisma');
|
|
54
|
+
const prismaConfigPath = path.join(cwd, 'prisma.config.ts');
|
|
54
55
|
const typesPath = path.join(cwd, '.opensaas', 'types.ts');
|
|
56
|
+
const listsPath = path.join(cwd, '.opensaas', 'lists.ts');
|
|
55
57
|
const contextPath = path.join(cwd, '.opensaas', 'context.ts');
|
|
58
|
+
const pluginTypesPath = path.join(cwd, '.opensaas', 'plugin-types.ts');
|
|
59
|
+
const prismaExtensionsPath = path.join(cwd, '.opensaas', 'prisma-extensions.ts');
|
|
56
60
|
writePrismaSchema(config, prismaSchemaPath);
|
|
61
|
+
writePrismaConfig(config, prismaConfigPath);
|
|
57
62
|
writeTypes(config, typesPath);
|
|
63
|
+
writeLists(config, listsPath);
|
|
58
64
|
writeContext(config, contextPath);
|
|
65
|
+
writePluginTypes(config, pluginTypesPath);
|
|
66
|
+
writePrismaExtensions(config, prismaExtensionsPath);
|
|
59
67
|
generatorSpinner.succeed(chalk.green('Schema generation complete'));
|
|
60
68
|
console.log(chalk.green('ā
Prisma schema generated'));
|
|
69
|
+
console.log(chalk.green('ā
Prisma config generated'));
|
|
61
70
|
console.log(chalk.green('ā
TypeScript types generated'));
|
|
71
|
+
console.log(chalk.green('ā
Lists namespace generated'));
|
|
62
72
|
console.log(chalk.green('ā
Context factory generated'));
|
|
73
|
+
console.log(chalk.green('ā
Plugin types generated'));
|
|
74
|
+
console.log(chalk.green('ā
Prisma extensions generated'));
|
|
63
75
|
// Execute afterGenerate hooks if plugins are present
|
|
64
76
|
if (config.plugins && config.plugins.length > 0) {
|
|
65
77
|
const afterGenSpinner = ora('Running plugin afterGenerate hooks...').start();
|
|
@@ -125,18 +137,6 @@ export async function generateCommand() {
|
|
|
125
137
|
console.error(chalk.red('\nā Error:'), message);
|
|
126
138
|
process.exit(1);
|
|
127
139
|
}
|
|
128
|
-
// Patch Prisma types with field transformations
|
|
129
|
-
const patchSpinner = ora('Patching Prisma types...').start();
|
|
130
|
-
try {
|
|
131
|
-
patchPrismaTypes(config, cwd);
|
|
132
|
-
patchSpinner.succeed(chalk.green('Type patching complete'));
|
|
133
|
-
}
|
|
134
|
-
catch (err) {
|
|
135
|
-
patchSpinner.fail(chalk.red('Failed to patch types'));
|
|
136
|
-
const message = err instanceof Error ? err.message : String(err);
|
|
137
|
-
console.error(chalk.red('\nā Error:'), message);
|
|
138
|
-
process.exit(1);
|
|
139
|
-
}
|
|
140
140
|
console.log(chalk.bold('\n⨠Generation complete!\n'));
|
|
141
141
|
console.log(chalk.gray('Next steps:'));
|
|
142
142
|
console.log(chalk.gray(' 1. Run: npx prisma db push'));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAA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