@opensaas/stack-cli 0.1.6 → 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.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +215 -0
- package/CLAUDE.md +60 -12
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +10 -1
- 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 +21 -3
- package/dist/generator/context.js.map +1 -1
- package/dist/generator/index.d.ts +3 -0
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +3 -0
- 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 +91 -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.d.ts.map +1 -1
- package/dist/generator/prisma.js +1 -2
- package/dist/generator/prisma.js.map +1 -1
- package/dist/generator/types.d.ts.map +1 -1
- package/dist/generator/types.js +53 -1
- 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 +9 -7
- package/src/commands/__snapshots__/generate.test.ts.snap +61 -21
- package/src/commands/dev.test.ts +0 -1
- package/src/commands/generate.test.ts +18 -8
- package/src/commands/generate.ts +12 -0
- package/src/commands/mcp.ts +135 -0
- package/src/generator/__snapshots__/context.test.ts.snap +8 -8
- package/src/generator/__snapshots__/prisma.test.ts.snap +8 -16
- package/src/generator/__snapshots__/types.test.ts.snap +605 -9
- package/src/generator/context.test.ts +13 -8
- package/src/generator/context.ts +21 -3
- package/src/generator/index.ts +3 -0
- package/src/generator/lists.test.ts +335 -0
- package/src/generator/lists.ts +102 -0
- package/src/generator/plugin-types.ts +147 -0
- package/src/generator/prisma-config.ts +46 -0
- package/src/generator/prisma.test.ts +0 -10
- package/src/generator/prisma.ts +1 -2
- package/src/generator/types.test.ts +0 -12
- package/src/generator/types.ts +56 -1
- 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
|
@@ -48,7 +48,8 @@ describe('Generate Command Integration', () => {
|
|
|
48
48
|
const config: OpenSaasConfig = {
|
|
49
49
|
db: {
|
|
50
50
|
provider: 'sqlite',
|
|
51
|
-
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
52
|
+
prismaClientConstructor: (() => null) as any,
|
|
52
53
|
},
|
|
53
54
|
lists: {
|
|
54
55
|
User: {
|
|
@@ -89,7 +90,8 @@ describe('Generate Command Integration', () => {
|
|
|
89
90
|
const config: OpenSaasConfig = {
|
|
90
91
|
db: {
|
|
91
92
|
provider: 'sqlite',
|
|
92
|
-
|
|
93
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
|
+
prismaClientConstructor: (() => null) as any,
|
|
93
95
|
},
|
|
94
96
|
lists: {},
|
|
95
97
|
}
|
|
@@ -106,7 +108,8 @@ describe('Generate Command Integration', () => {
|
|
|
106
108
|
const config1: OpenSaasConfig = {
|
|
107
109
|
db: {
|
|
108
110
|
provider: 'sqlite',
|
|
109
|
-
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
112
|
+
prismaClientConstructor: (() => null) as any,
|
|
110
113
|
},
|
|
111
114
|
lists: {
|
|
112
115
|
User: {
|
|
@@ -120,7 +123,8 @@ describe('Generate Command Integration', () => {
|
|
|
120
123
|
const config2: OpenSaasConfig = {
|
|
121
124
|
db: {
|
|
122
125
|
provider: 'sqlite',
|
|
123
|
-
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
127
|
+
prismaClientConstructor: (() => null) as any,
|
|
124
128
|
},
|
|
125
129
|
lists: {
|
|
126
130
|
Post: {
|
|
@@ -148,7 +152,8 @@ describe('Generate Command Integration', () => {
|
|
|
148
152
|
const config: OpenSaasConfig = {
|
|
149
153
|
db: {
|
|
150
154
|
provider: 'sqlite',
|
|
151
|
-
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
+
prismaClientConstructor: (() => null) as any,
|
|
152
157
|
},
|
|
153
158
|
opensaasPath: '.custom',
|
|
154
159
|
lists: {},
|
|
@@ -169,7 +174,8 @@ describe('Generate Command Integration', () => {
|
|
|
169
174
|
const config: OpenSaasConfig = {
|
|
170
175
|
db: {
|
|
171
176
|
provider: 'sqlite',
|
|
172
|
-
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
178
|
+
prismaClientConstructor: (() => null) as any,
|
|
173
179
|
},
|
|
174
180
|
lists: {
|
|
175
181
|
User: {
|
|
@@ -198,7 +204,8 @@ describe('Generate Command Integration', () => {
|
|
|
198
204
|
const config: OpenSaasConfig = {
|
|
199
205
|
db: {
|
|
200
206
|
provider: 'sqlite',
|
|
201
|
-
|
|
207
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
208
|
+
prismaClientConstructor: (() => null) as any,
|
|
202
209
|
},
|
|
203
210
|
lists: {},
|
|
204
211
|
}
|
|
@@ -227,6 +234,8 @@ describe('Generate Command Integration', () => {
|
|
|
227
234
|
db: {
|
|
228
235
|
provider,
|
|
229
236
|
url: provider === 'sqlite' ? 'file:./dev.db' : 'postgresql://localhost:5432/db',
|
|
237
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
238
|
+
prismaClientConstructor: (() => null) as any,
|
|
230
239
|
},
|
|
231
240
|
lists: {},
|
|
232
241
|
}
|
|
@@ -243,7 +252,8 @@ describe('Generate Command Integration', () => {
|
|
|
243
252
|
const config: OpenSaasConfig = {
|
|
244
253
|
db: {
|
|
245
254
|
provider: 'sqlite',
|
|
246
|
-
|
|
255
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
256
|
+
prismaClientConstructor: (() => null) as any,
|
|
247
257
|
},
|
|
248
258
|
lists: {
|
|
249
259
|
User: {
|
package/src/commands/generate.ts
CHANGED
|
@@ -6,8 +6,11 @@ import ora from 'ora'
|
|
|
6
6
|
import { createJiti } from 'jiti'
|
|
7
7
|
import {
|
|
8
8
|
writePrismaSchema,
|
|
9
|
+
writePrismaConfig,
|
|
9
10
|
writeTypes,
|
|
11
|
+
writeLists,
|
|
10
12
|
writeContext,
|
|
13
|
+
writePluginTypes,
|
|
11
14
|
patchPrismaTypes,
|
|
12
15
|
} from '../generator/index.js'
|
|
13
16
|
import { OpenSaasConfig } from '@opensaas/stack-core'
|
|
@@ -70,17 +73,26 @@ export async function generateCommand() {
|
|
|
70
73
|
const generatorSpinner = ora('Generating schema and types...').start()
|
|
71
74
|
try {
|
|
72
75
|
const prismaSchemaPath = path.join(cwd, 'prisma', 'schema.prisma')
|
|
76
|
+
const prismaConfigPath = path.join(cwd, 'prisma.config.ts')
|
|
73
77
|
const typesPath = path.join(cwd, '.opensaas', 'types.ts')
|
|
78
|
+
const listsPath = path.join(cwd, '.opensaas', 'lists.ts')
|
|
74
79
|
const contextPath = path.join(cwd, '.opensaas', 'context.ts')
|
|
80
|
+
const pluginTypesPath = path.join(cwd, '.opensaas', 'plugin-types.ts')
|
|
75
81
|
|
|
76
82
|
writePrismaSchema(config, prismaSchemaPath)
|
|
83
|
+
writePrismaConfig(config, prismaConfigPath)
|
|
77
84
|
writeTypes(config, typesPath)
|
|
85
|
+
writeLists(config, listsPath)
|
|
78
86
|
writeContext(config, contextPath)
|
|
87
|
+
writePluginTypes(config, pluginTypesPath)
|
|
79
88
|
|
|
80
89
|
generatorSpinner.succeed(chalk.green('Schema generation complete'))
|
|
81
90
|
console.log(chalk.green('✅ Prisma schema generated'))
|
|
91
|
+
console.log(chalk.green('✅ Prisma config generated'))
|
|
82
92
|
console.log(chalk.green('✅ TypeScript types generated'))
|
|
93
|
+
console.log(chalk.green('✅ Lists namespace generated'))
|
|
83
94
|
console.log(chalk.green('✅ Context factory generated'))
|
|
95
|
+
console.log(chalk.green('✅ Plugin types generated'))
|
|
84
96
|
|
|
85
97
|
// Execute afterGenerate hooks if plugins are present
|
|
86
98
|
if (config.plugins && config.plugins.length > 0) {
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP command group for AI-assisted development
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { Command } from 'commander'
|
|
6
|
+
import { spawn } from 'child_process'
|
|
7
|
+
import { fileURLToPath } from 'url'
|
|
8
|
+
import { dirname, join } from 'path'
|
|
9
|
+
|
|
10
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
11
|
+
const __dirname = dirname(__filename)
|
|
12
|
+
|
|
13
|
+
function getServerPath(): string {
|
|
14
|
+
// In development: cli/dist/mcp/server/index.js
|
|
15
|
+
// In production: same structure
|
|
16
|
+
return join(__dirname, '..', 'mcp', 'server', 'index.js')
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function installMCPServer(): Promise<void> {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
console.log('📦 Installing OpenSaaS Stack MCP server...\n')
|
|
22
|
+
|
|
23
|
+
const serverPath = getServerPath()
|
|
24
|
+
const claudeCommand = ['claude', 'mcp', 'add', 'opensaas-stack', '--', 'node', serverPath]
|
|
25
|
+
|
|
26
|
+
console.log(`Running: ${claudeCommand.join(' ')}\n`)
|
|
27
|
+
|
|
28
|
+
const child = spawn(claudeCommand[0], claudeCommand.slice(1), {
|
|
29
|
+
stdio: 'inherit',
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
child.on('close', (code) => {
|
|
33
|
+
if (code === 0) {
|
|
34
|
+
console.log('\n✅ OpenSaaS Stack MCP server installed successfully!')
|
|
35
|
+
console.log('\n📖 Available tools:')
|
|
36
|
+
console.log(' - opensaas_implement_feature')
|
|
37
|
+
console.log(' - opensaas_feature_docs')
|
|
38
|
+
console.log(' - opensaas_list_features')
|
|
39
|
+
console.log(' - opensaas_suggest_features')
|
|
40
|
+
console.log(' - opensaas_validate_feature')
|
|
41
|
+
console.log('\n🚀 Restart Claude Code to use the MCP tools.')
|
|
42
|
+
resolve()
|
|
43
|
+
} else {
|
|
44
|
+
console.error(
|
|
45
|
+
`\n❌ Installation failed with code ${code}. Please ensure Claude Code is installed.`,
|
|
46
|
+
)
|
|
47
|
+
reject(new Error(`Installation failed with code ${code}`))
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
child.on('error', (error) => {
|
|
52
|
+
console.error('\n❌ Error during installation:', error.message)
|
|
53
|
+
console.error('\nMake sure Claude Code is installed and the "claude" command is available.')
|
|
54
|
+
reject(error)
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function uninstallMCPServer(): Promise<void> {
|
|
60
|
+
return new Promise((resolve, reject) => {
|
|
61
|
+
console.log('🗑️ Uninstalling OpenSaaS Stack MCP server...\n')
|
|
62
|
+
|
|
63
|
+
const child = spawn('claude', ['mcp', 'remove', 'opensaas-stack'], {
|
|
64
|
+
stdio: 'inherit',
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
child.on('close', (code) => {
|
|
68
|
+
if (code === 0) {
|
|
69
|
+
console.log('\n✅ OpenSaaS Stack MCP server uninstalled successfully.')
|
|
70
|
+
resolve()
|
|
71
|
+
} else {
|
|
72
|
+
console.error(`\n❌ Uninstall failed with code ${code}`)
|
|
73
|
+
reject(new Error(`Uninstall failed with code ${code}`))
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
child.on('error', (error) => {
|
|
78
|
+
console.error('\n❌ Error during uninstall:', error.message)
|
|
79
|
+
reject(error)
|
|
80
|
+
})
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function startMCPServer(): void {
|
|
85
|
+
console.log('🚀 Starting OpenSaaS Stack MCP server...\n')
|
|
86
|
+
|
|
87
|
+
const serverPath = getServerPath()
|
|
88
|
+
|
|
89
|
+
const child = spawn('node', [serverPath], {
|
|
90
|
+
stdio: 'inherit',
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
child.on('error', (error) => {
|
|
94
|
+
console.error('❌ Error starting server:', error.message)
|
|
95
|
+
process.exit(1)
|
|
96
|
+
})
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function createMCPCommand(): Command {
|
|
100
|
+
const mcp = new Command('mcp')
|
|
101
|
+
mcp.description('MCP server for AI-assisted development with Claude Code')
|
|
102
|
+
|
|
103
|
+
mcp
|
|
104
|
+
.command('install')
|
|
105
|
+
.description('Install MCP server in Claude Code')
|
|
106
|
+
.action(async () => {
|
|
107
|
+
try {
|
|
108
|
+
await installMCPServer()
|
|
109
|
+
process.exit(0)
|
|
110
|
+
} catch {
|
|
111
|
+
process.exit(1)
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
mcp
|
|
116
|
+
.command('uninstall')
|
|
117
|
+
.description('Remove MCP server from Claude Code')
|
|
118
|
+
.action(async () => {
|
|
119
|
+
try {
|
|
120
|
+
await uninstallMCPServer()
|
|
121
|
+
process.exit(0)
|
|
122
|
+
} catch {
|
|
123
|
+
process.exit(1)
|
|
124
|
+
}
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
mcp
|
|
128
|
+
.command('start')
|
|
129
|
+
.description('Start MCP server directly (for debugging)')
|
|
130
|
+
.action(() => {
|
|
131
|
+
startMCPServer()
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
return mcp
|
|
135
|
+
}
|
|
@@ -12,7 +12,7 @@ exports[`Context Generator > generateContext > should export rawOpensaasContext
|
|
|
12
12
|
|
|
13
13
|
import { getContext as getOpensaasContext } from '@opensaas/stack-core'
|
|
14
14
|
import type { Session as OpensaasSession, OpenSaasConfig } from '@opensaas/stack-core'
|
|
15
|
-
import { PrismaClient } from './prisma-client'
|
|
15
|
+
import { PrismaClient } from './prisma-client/client'
|
|
16
16
|
import type { Context } from './types'
|
|
17
17
|
import configOrPromise from '../opensaas.config'
|
|
18
18
|
|
|
@@ -21,7 +21,7 @@ const configPromise = Promise.resolve(configOrPromise)
|
|
|
21
21
|
let resolvedConfig: OpenSaasConfig | null = null
|
|
22
22
|
|
|
23
23
|
// Internal Prisma singleton - managed automatically
|
|
24
|
-
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient |
|
|
24
|
+
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient | null }
|
|
25
25
|
let prisma: PrismaClient | null = null
|
|
26
26
|
|
|
27
27
|
async function getPrisma() {
|
|
@@ -29,7 +29,7 @@ async function getPrisma() {
|
|
|
29
29
|
if (!resolvedConfig) {
|
|
30
30
|
resolvedConfig = await configPromise
|
|
31
31
|
}
|
|
32
|
-
prisma = globalForPrisma.prisma ??
|
|
32
|
+
prisma = globalForPrisma.prisma ?? resolvedConfig.db.prismaClientConstructor!(PrismaClient)
|
|
33
33
|
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
|
|
34
34
|
}
|
|
35
35
|
return prisma
|
|
@@ -117,7 +117,7 @@ exports[`Context Generator > generateContext > should generate context factory w
|
|
|
117
117
|
|
|
118
118
|
import { getContext as getOpensaasContext } from '@opensaas/stack-core'
|
|
119
119
|
import type { Session as OpensaasSession, OpenSaasConfig } from '@opensaas/stack-core'
|
|
120
|
-
import { PrismaClient } from './prisma-client'
|
|
120
|
+
import { PrismaClient } from './prisma-client/client'
|
|
121
121
|
import type { Context } from './types'
|
|
122
122
|
import configOrPromise from '../opensaas.config'
|
|
123
123
|
|
|
@@ -126,7 +126,7 @@ const configPromise = Promise.resolve(configOrPromise)
|
|
|
126
126
|
let resolvedConfig: OpenSaasConfig | null = null
|
|
127
127
|
|
|
128
128
|
// Internal Prisma singleton - managed automatically
|
|
129
|
-
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient |
|
|
129
|
+
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient | null }
|
|
130
130
|
let prisma: PrismaClient | null = null
|
|
131
131
|
|
|
132
132
|
async function getPrisma() {
|
|
@@ -222,7 +222,7 @@ exports[`Context Generator > generateContext > should generate context factory w
|
|
|
222
222
|
|
|
223
223
|
import { getContext as getOpensaasContext } from '@opensaas/stack-core'
|
|
224
224
|
import type { Session as OpensaasSession, OpenSaasConfig } from '@opensaas/stack-core'
|
|
225
|
-
import { PrismaClient } from './prisma-client'
|
|
225
|
+
import { PrismaClient } from './prisma-client/client'
|
|
226
226
|
import type { Context } from './types'
|
|
227
227
|
import configOrPromise from '../opensaas.config'
|
|
228
228
|
|
|
@@ -231,7 +231,7 @@ const configPromise = Promise.resolve(configOrPromise)
|
|
|
231
231
|
let resolvedConfig: OpenSaasConfig | null = null
|
|
232
232
|
|
|
233
233
|
// Internal Prisma singleton - managed automatically
|
|
234
|
-
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient |
|
|
234
|
+
const globalForPrisma = globalThis as unknown as { prisma: PrismaClient | null }
|
|
235
235
|
let prisma: PrismaClient | null = null
|
|
236
236
|
|
|
237
237
|
async function getPrisma() {
|
|
@@ -239,7 +239,7 @@ async function getPrisma() {
|
|
|
239
239
|
if (!resolvedConfig) {
|
|
240
240
|
resolvedConfig = await configPromise
|
|
241
241
|
}
|
|
242
|
-
prisma = globalForPrisma.prisma ??
|
|
242
|
+
prisma = globalForPrisma.prisma ?? resolvedConfig.db.prismaClientConstructor!(PrismaClient)
|
|
243
243
|
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma
|
|
244
244
|
}
|
|
245
245
|
return prisma
|
|
@@ -2,26 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
exports[`Prisma Schema Generator > generatePrismaSchema > should generate basic schema with datasource and generator 1`] = `
|
|
4
4
|
"generator client {
|
|
5
|
-
provider = "prisma-client
|
|
5
|
+
provider = "prisma-client"
|
|
6
6
|
output = "../.opensaas/prisma-client"
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
datasource db {
|
|
10
10
|
provider = "sqlite"
|
|
11
|
-
url = env("DATABASE_URL")
|
|
12
11
|
}
|
|
13
12
|
"
|
|
14
13
|
`;
|
|
15
14
|
|
|
16
15
|
exports[`Prisma Schema Generator > generatePrismaSchema > should generate many-to-one relationship 1`] = `
|
|
17
16
|
"generator client {
|
|
18
|
-
provider = "prisma-client
|
|
17
|
+
provider = "prisma-client"
|
|
19
18
|
output = "../.opensaas/prisma-client"
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
datasource db {
|
|
23
22
|
provider = "sqlite"
|
|
24
|
-
url = env("DATABASE_URL")
|
|
25
23
|
}
|
|
26
24
|
|
|
27
25
|
model User {
|
|
@@ -44,13 +42,12 @@ model Post {
|
|
|
44
42
|
|
|
45
43
|
exports[`Prisma Schema Generator > generatePrismaSchema > should generate model with basic fields 1`] = `
|
|
46
44
|
"generator client {
|
|
47
|
-
provider = "prisma-client
|
|
45
|
+
provider = "prisma-client"
|
|
48
46
|
output = "../.opensaas/prisma-client"
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
datasource db {
|
|
52
50
|
provider = "sqlite"
|
|
53
|
-
url = env("DATABASE_URL")
|
|
54
51
|
}
|
|
55
52
|
|
|
56
53
|
model User {
|
|
@@ -66,13 +63,12 @@ model User {
|
|
|
66
63
|
|
|
67
64
|
exports[`Prisma Schema Generator > generatePrismaSchema > should generate model with checkbox field 1`] = `
|
|
68
65
|
"generator client {
|
|
69
|
-
provider = "prisma-client
|
|
66
|
+
provider = "prisma-client"
|
|
70
67
|
output = "../.opensaas/prisma-client"
|
|
71
68
|
}
|
|
72
69
|
|
|
73
70
|
datasource db {
|
|
74
71
|
provider = "sqlite"
|
|
75
|
-
url = env("DATABASE_URL")
|
|
76
72
|
}
|
|
77
73
|
|
|
78
74
|
model Post {
|
|
@@ -87,13 +83,12 @@ model Post {
|
|
|
87
83
|
|
|
88
84
|
exports[`Prisma Schema Generator > generatePrismaSchema > should generate model with timestamp field 1`] = `
|
|
89
85
|
"generator client {
|
|
90
|
-
provider = "prisma-client
|
|
86
|
+
provider = "prisma-client"
|
|
91
87
|
output = "../.opensaas/prisma-client"
|
|
92
88
|
}
|
|
93
89
|
|
|
94
90
|
datasource db {
|
|
95
91
|
provider = "sqlite"
|
|
96
|
-
url = env("DATABASE_URL")
|
|
97
92
|
}
|
|
98
93
|
|
|
99
94
|
model Post {
|
|
@@ -108,13 +103,12 @@ model Post {
|
|
|
108
103
|
|
|
109
104
|
exports[`Prisma Schema Generator > generatePrismaSchema > should generate multiple models 1`] = `
|
|
110
105
|
"generator client {
|
|
111
|
-
provider = "prisma-client
|
|
106
|
+
provider = "prisma-client"
|
|
112
107
|
output = "../.opensaas/prisma-client"
|
|
113
108
|
}
|
|
114
109
|
|
|
115
110
|
datasource db {
|
|
116
111
|
provider = "postgresql"
|
|
117
|
-
url = env("DATABASE_URL")
|
|
118
112
|
}
|
|
119
113
|
|
|
120
114
|
model User {
|
|
@@ -142,13 +136,12 @@ model Comment {
|
|
|
142
136
|
|
|
143
137
|
exports[`Prisma Schema Generator > generatePrismaSchema > should generate one-to-many relationship 1`] = `
|
|
144
138
|
"generator client {
|
|
145
|
-
provider = "prisma-client
|
|
139
|
+
provider = "prisma-client"
|
|
146
140
|
output = "../.opensaas/prisma-client"
|
|
147
141
|
}
|
|
148
142
|
|
|
149
143
|
datasource db {
|
|
150
144
|
provider = "sqlite"
|
|
151
|
-
url = env("DATABASE_URL")
|
|
152
145
|
}
|
|
153
146
|
|
|
154
147
|
model User {
|
|
@@ -170,13 +163,12 @@ model Post {
|
|
|
170
163
|
|
|
171
164
|
exports[`Prisma Schema Generator > generatePrismaSchema > should use custom opensaasPath for generator output 1`] = `
|
|
172
165
|
"generator client {
|
|
173
|
-
provider = "prisma-client
|
|
166
|
+
provider = "prisma-client"
|
|
174
167
|
output = "../.custom-path/prisma-client"
|
|
175
168
|
}
|
|
176
169
|
|
|
177
170
|
datasource db {
|
|
178
171
|
provider = "sqlite"
|
|
179
|
-
url = env("DATABASE_URL")
|
|
180
172
|
}
|
|
181
173
|
"
|
|
182
174
|
`;
|