@idealyst/cli 1.0.41 → 1.0.43

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 (78) hide show
  1. package/dist/generators/api.js +1 -2
  2. package/dist/generators/api.js.map +1 -1
  3. package/dist/generators/database.js +1 -2
  4. package/dist/generators/database.js.map +1 -1
  5. package/dist/generators/fullstack.js +371 -0
  6. package/dist/generators/fullstack.js.map +1 -0
  7. package/dist/generators/index.js +5 -0
  8. package/dist/generators/index.js.map +1 -1
  9. package/dist/generators/native.js +2 -1
  10. package/dist/generators/native.js.map +1 -1
  11. package/dist/generators/shared.js +1 -2
  12. package/dist/generators/shared.js.map +1 -1
  13. package/dist/generators/utils.js +71 -7
  14. package/dist/generators/utils.js.map +1 -1
  15. package/dist/generators/web.js +1 -2
  16. package/dist/generators/web.js.map +1 -1
  17. package/dist/generators/workspace.js +56 -2
  18. package/dist/generators/workspace.js.map +1 -1
  19. package/dist/index.js +50 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/templates/database/.env.example +1 -8
  22. package/dist/templates/database/README.md +29 -74
  23. package/dist/templates/database/package.json +20 -34
  24. package/dist/templates/database/prisma/seed.ts +11 -11
  25. package/dist/templates/database/schema.prisma +97 -0
  26. package/dist/templates/database/src/index.ts +12 -8
  27. package/dist/templates/database/tsconfig.json +9 -23
  28. package/dist/templates/native/src/App-with-trpc-and-shared.tsx +266 -0
  29. package/dist/templates/shared/package.json +28 -3
  30. package/dist/templates/shared/src/components/index.ts +392 -0
  31. package/dist/templates/shared/src/index.ts +59 -1
  32. package/dist/templates/shared/src/types/index.ts +148 -0
  33. package/dist/templates/shared/src/utils/index.ts +278 -0
  34. package/dist/templates/web/package.json +2 -2
  35. package/dist/templates/web/src/App-with-trpc-and-shared.tsx +304 -0
  36. package/dist/templates/workspace/.devcontainer/Dockerfile +1 -1
  37. package/dist/templates/workspace/.devcontainer/devcontainer.json +7 -2
  38. package/dist/templates/workspace/.devcontainer/docker-compose.yml +14 -0
  39. package/dist/templates/workspace/.devcontainer/figma-mcp.sh +32 -0
  40. package/dist/templates/workspace/.devcontainer/setup.sh +3 -0
  41. package/dist/templates/workspace/setup.sh +22 -197
  42. package/dist/templates/workspace/tsconfig.json +32 -0
  43. package/dist/types/generators/fullstack.d.ts +2 -0
  44. package/dist/types/generators/index.d.ts +1 -0
  45. package/dist/types/generators/utils.d.ts +4 -1
  46. package/dist/types/types.d.ts +3 -1
  47. package/package.json +1 -1
  48. package/templates/database/.env.example +1 -0
  49. package/templates/database/README.md +48 -0
  50. package/templates/database/package.json +21 -2
  51. package/templates/database/prisma/seed.ts +28 -0
  52. package/templates/database/schema.prisma +85 -9
  53. package/templates/database/src/index.ts +7 -7
  54. package/templates/database/src/validators.ts +10 -0
  55. package/templates/native/src/App-with-trpc-and-shared.tsx +266 -0
  56. package/templates/shared/package.json +28 -3
  57. package/templates/shared/src/components/index.ts +392 -0
  58. package/templates/shared/src/index.ts +59 -1
  59. package/templates/shared/src/types/index.ts +148 -0
  60. package/templates/shared/src/utils/index.ts +278 -0
  61. package/templates/web/package.json +1 -1
  62. package/templates/web/src/App-with-trpc-and-shared.tsx +304 -0
  63. package/templates/workspace/.devcontainer/devcontainer.json +7 -2
  64. package/templates/workspace/.devcontainer/docker-compose.yml +14 -0
  65. package/templates/workspace/.devcontainer/figma-mcp.sh +32 -0
  66. package/templates/workspace/.devcontainer/setup.sh +3 -0
  67. package/templates/workspace/setup.sh +30 -0
  68. package/templates/workspace/tsconfig.json +32 -0
  69. package/dist/templates/database/__tests__/database.test.ts +0 -14
  70. package/dist/templates/database/jest.config.js +0 -19
  71. package/dist/templates/database/jest.setup.js +0 -11
  72. package/dist/templates/database/prisma/schema.prisma +0 -21
  73. package/dist/templates/database/src/client.ts +0 -18
  74. package/dist/templates/database/src/schemas.ts +0 -26
  75. package/dist/templates/workspace/scripts/docker/db-backup.sh +0 -230
  76. package/dist/templates/workspace/scripts/docker/deploy.sh +0 -212
  77. package/dist/templates/workspace/scripts/test-runner.js +0 -120
  78. /package/{templates/database/src/validatgors.ts → dist/templates/database/src/validators.ts} +0 -0
@@ -0,0 +1,304 @@
1
+ import React, { useState } from 'react';
2
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
3
+ import { httpBatchLink } from '@trpc/client';
4
+ import { BrowserRouter, Routes, Route, Link } from 'react-router-dom';
5
+ import { trpc } from './utils/trpc';
6
+ import { Screen, Text, View, Button, ScrollView } from '@idealyst/components';
7
+
8
+ // Import shared components and utilities
9
+ import {
10
+ UserCard,
11
+ PostCard,
12
+ LoadingSpinner,
13
+ ErrorMessage,
14
+ FeatureCard,
15
+ DEMO_USERS,
16
+ DEMO_POSTS,
17
+ formatRelativeTime,
18
+ type User,
19
+ type Post,
20
+ type PostWithAuthor
21
+ } from '{{workspaceScope}}/shared';
22
+
23
+ // Create tRPC client
24
+ const queryClient = new QueryClient();
25
+
26
+ const trpcClient = trpc.createClient({
27
+ links: [
28
+ httpBatchLink({
29
+ url: 'http://localhost:3001/trpc', // Updated to match API port
30
+ // Optional: Add headers for authentication
31
+ // headers() {
32
+ // return {
33
+ // authorization: getAuthToken(),
34
+ // };
35
+ // },
36
+ }),
37
+ ],
38
+ });
39
+
40
+ // Navigation Component
41
+ function Navigation() {
42
+ return (
43
+ <View style={{
44
+ flexDirection: 'row',
45
+ padding: 16,
46
+ backgroundColor: '#f8f9fa',
47
+ borderBottomWidth: 1,
48
+ borderBottomColor: '#e9ecef'
49
+ }}>
50
+ <Text variant="h2" style={{ marginRight: 24 }}>{{projectName}}</Text>
51
+ <View style={{ flexDirection: 'row', gap: 16 }}>
52
+ <Link to="/" style={{ textDecoration: 'none' }}>
53
+ <Text style={{ color: '#007bff' }}>Home</Text>
54
+ </Link>
55
+ <Link to="/users" style={{ textDecoration: 'none' }}>
56
+ <Text style={{ color: '#007bff' }}>Users</Text>
57
+ </Link>
58
+ <Link to="/posts" style={{ textDecoration: 'none' }}>
59
+ <Text style={{ color: '#007bff' }}>Posts</Text>
60
+ </Link>
61
+ </View>
62
+ </View>
63
+ );
64
+ }
65
+
66
+ // Home Page Component
67
+ function HomePage() {
68
+ // Example tRPC usage
69
+ const { data: helloData, isLoading: helloLoading, error: helloError } = trpc.hello.useQuery({ name: 'Web User' });
70
+ const { data: usersData, isLoading: usersLoading } = trpc.users.getAll.useQuery();
71
+ const { data: postsData, isLoading: postsLoading } = trpc.posts.getAll.useQuery();
72
+
73
+ return (
74
+ <ScrollView style={{ flex: 1 }}>
75
+ <View style={{ padding: 20 }}>
76
+ {/* Welcome Section */}
77
+ <View style={{ marginBottom: 32, textAlign: 'center' }}>
78
+ <Text variant="h1" style={{ marginBottom: 16 }}>
79
+ Welcome to {{projectName}}! 🚀
80
+ </Text>
81
+ <Text variant="body" style={{ marginBottom: 16, fontSize: 18 }}>
82
+ A full-stack application built with the Idealyst Framework
83
+ </Text>
84
+
85
+ {/* tRPC Connection Test */}
86
+ <View style={{
87
+ padding: 16,
88
+ backgroundColor: '#e3f2fd',
89
+ borderRadius: 8,
90
+ marginBottom: 24
91
+ }}>
92
+ <Text variant="h3" style={{ marginBottom: 8 }}>🔗 API Connection:</Text>
93
+ {helloLoading && <Text>Testing connection...</Text>}
94
+ {helloError && <Text style={{ color: 'red' }}>Error: {helloError.message}</Text>}
95
+ {helloData && <Text style={{ color: 'green' }}>✅ {helloData.greeting}</Text>}
96
+ </View>
97
+ </View>
98
+
99
+ {/* Features Overview */}
100
+ <View style={{ marginBottom: 32 }}>
101
+ <Text variant="h2" style={{ marginBottom: 16 }}>🏗️ Architecture Overview</Text>
102
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 16 }}>
103
+ <FeatureCard
104
+ icon="🗄️"
105
+ title="Database Layer"
106
+ description="Prisma ORM with SQLite, user management, posts, and comments"
107
+ />
108
+ <FeatureCard
109
+ icon="🚀"
110
+ title="API Server"
111
+ description="tRPC API with type-safe endpoints and real-time capabilities"
112
+ />
113
+ <FeatureCard
114
+ icon="🌐"
115
+ title="Web Application"
116
+ description="React web app with Idealyst components and responsive design"
117
+ />
118
+ <FeatureCard
119
+ icon="📱"
120
+ title="Mobile App"
121
+ description="React Native app with shared components and unified styling"
122
+ />
123
+ <FeatureCard
124
+ icon="📦"
125
+ title="Shared Library"
126
+ description="Cross-platform components, utilities, and type definitions"
127
+ />
128
+ <FeatureCard
129
+ icon="🔗"
130
+ title="Full Integration"
131
+ description="End-to-end type safety and unified development workflow"
132
+ />
133
+ </View>
134
+ </View>
135
+
136
+ {/* Live Data Preview */}
137
+ <View style={{ marginBottom: 32 }}>
138
+ <Text variant="h2" style={{ marginBottom: 16 }}>📊 Live Data Preview</Text>
139
+
140
+ {/* Users Section */}
141
+ <View style={{ marginBottom: 24 }}>
142
+ <Text variant="h3" style={{ marginBottom: 12 }}>👥 Users ({usersLoading ? '...' : usersData?.length || DEMO_USERS.length})</Text>
143
+ {usersLoading ? (
144
+ <LoadingSpinner message="Loading users..." />
145
+ ) : (
146
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 12 }}>
147
+ {(usersData || DEMO_USERS.slice(0, 3)).map((user: User) => (
148
+ <View key={user.id} style={{ width: '300px' }}>
149
+ <UserCard
150
+ user={user}
151
+ showBio={false}
152
+ onPress={() => console.log('View profile:', user.name)}
153
+ />
154
+ </View>
155
+ ))}
156
+ </View>
157
+ )}
158
+ </View>
159
+
160
+ {/* Posts Section */}
161
+ <View style={{ marginBottom: 24 }}>
162
+ <Text variant="h3" style={{ marginBottom: 12 }}>📝 Recent Posts ({postsLoading ? '...' : postsData?.length || DEMO_POSTS.length})</Text>
163
+ {postsLoading ? (
164
+ <LoadingSpinner message="Loading posts..." />
165
+ ) : (
166
+ <View>
167
+ {(postsData || DEMO_POSTS.slice(0, 2)).map((post: Post) => {
168
+ const author = DEMO_USERS.find(u => u.id === post.authorId);
169
+ return (
170
+ <PostCard
171
+ key={post.id}
172
+ post={post}
173
+ author={author}
174
+ onPress={() => console.log('Read post:', post.title)}
175
+ onLike={() => console.log('Like post:', post.title)}
176
+ />
177
+ );
178
+ })}
179
+ </View>
180
+ )}
181
+ </View>
182
+ </View>
183
+
184
+ {/* Quick Start Section */}
185
+ <View style={{
186
+ padding: 20,
187
+ backgroundColor: '#f8f9fa',
188
+ borderRadius: 8,
189
+ marginBottom: 24
190
+ }}>
191
+ <Text variant="h2" style={{ marginBottom: 16 }}>🚀 Quick Start</Text>
192
+ <Text variant="body" style={{ marginBottom: 12 }}>
193
+ Your full-stack workspace is ready! Here's what you can do:
194
+ </Text>
195
+ <View style={{ marginLeft: 16 }}>
196
+ <Text style={{ marginBottom: 4 }}>• 🗄️ Add your models in <code>packages/database/schema.prisma</code></Text>
197
+ <Text style={{ marginBottom: 4 }}>• 🚀 Create API endpoints in <code>packages/api/src/routers/</code></Text>
198
+ <Text style={{ marginBottom: 4 }}>• 📦 Build shared components in <code>packages/shared/src/</code></Text>
199
+ <Text style={{ marginBottom: 4 }}>• 🌐 Customize this web app in <code>packages/web/src/</code></Text>
200
+ <Text style={{ marginBottom: 4 }}>• 📱 Update the mobile app in <code>packages/mobile/src/</code></Text>
201
+ </View>
202
+ </View>
203
+
204
+ {/* Development Commands */}
205
+ <View style={{
206
+ padding: 20,
207
+ backgroundColor: '#e8f5e8',
208
+ borderRadius: 8,
209
+ marginBottom: 24
210
+ }}>
211
+ <Text variant="h3" style={{ marginBottom: 12 }}>💻 Development Commands</Text>
212
+ <View style={{ fontFamily: 'monospace', fontSize: 14 }}>
213
+ <Text style={{ marginBottom: 4 }}>yarn dev # Start all servers</Text>
214
+ <Text style={{ marginBottom: 4 }}>yarn web:dev # Start web app only</Text>
215
+ <Text style={{ marginBottom: 4 }}>yarn mobile:start # Start mobile bundler</Text>
216
+ <Text style={{ marginBottom: 4 }}>yarn api:dev # Start API server only</Text>
217
+ <Text style={{ marginBottom: 4 }}>yarn db:push # Update database schema</Text>
218
+ <Text style={{ marginBottom: 4 }}>yarn db:studio # Open database admin</Text>
219
+ </View>
220
+ </View>
221
+ </View>
222
+ </ScrollView>
223
+ );
224
+ }
225
+
226
+ // Users Page Component
227
+ function UsersPage() {
228
+ const { data: users, isLoading, error } = trpc.users.getAll.useQuery();
229
+
230
+ if (isLoading) return <LoadingSpinner message="Loading users..." />;
231
+ if (error) return <ErrorMessage message={error.message} />;
232
+
233
+ const allUsers = users || DEMO_USERS;
234
+
235
+ return (
236
+ <ScrollView style={{ flex: 1, padding: 20 }}>
237
+ <Text variant="h1" style={{ marginBottom: 20 }}>👥 Users ({allUsers.length})</Text>
238
+ <View style={{ flexDirection: 'row', flexWrap: 'wrap', gap: 16 }}>
239
+ {allUsers.map((user: User) => (
240
+ <View key={user.id} style={{ width: '400px' }}>
241
+ <UserCard
242
+ user={user}
243
+ showBio={true}
244
+ onPress={() => console.log('View profile:', user.name)}
245
+ />
246
+ </View>
247
+ ))}
248
+ </View>
249
+ </ScrollView>
250
+ );
251
+ }
252
+
253
+ // Posts Page Component
254
+ function PostsPage() {
255
+ const { data: posts, isLoading, error } = trpc.posts.getAll.useQuery();
256
+
257
+ if (isLoading) return <LoadingSpinner message="Loading posts..." />;
258
+ if (error) return <ErrorMessage message={error.message} />;
259
+
260
+ const allPosts = posts || DEMO_POSTS;
261
+
262
+ return (
263
+ <ScrollView style={{ flex: 1, padding: 20 }}>
264
+ <Text variant="h1" style={{ marginBottom: 20 }}>📝 Posts ({allPosts.length})</Text>
265
+ <View>
266
+ {allPosts.map((post: Post) => {
267
+ const author = DEMO_USERS.find(u => u.id === post.authorId);
268
+ return (
269
+ <PostCard
270
+ key={post.id}
271
+ post={post}
272
+ author={author}
273
+ showFullContent={false}
274
+ onPress={() => console.log('Read post:', post.title)}
275
+ onLike={() => console.log('Like post:', post.title)}
276
+ />
277
+ );
278
+ })}
279
+ </View>
280
+ </ScrollView>
281
+ );
282
+ }
283
+
284
+ // Main App Component
285
+ function App() {
286
+ return (
287
+ <trpc.Provider client={trpcClient} queryClient={queryClient}>
288
+ <QueryClientProvider client={queryClient}>
289
+ <BrowserRouter>
290
+ <Screen>
291
+ <Navigation />
292
+ <Routes>
293
+ <Route path="/" element={<HomePage />} />
294
+ <Route path="/users" element={<UsersPage />} />
295
+ <Route path="/posts" element={<PostsPage />} />
296
+ </Routes>
297
+ </Screen>
298
+ </BrowserRouter>
299
+ </QueryClientProvider>
300
+ </trpc.Provider>
301
+ );
302
+ }
303
+
304
+ export default App;
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "Idealyst Development",
2
+ "name": "{{projectName}} Development",
3
3
  "dockerComposeFile": "docker-compose.yml",
4
4
  "service": "app",
5
5
  "workspaceFolder": "/workspace",
@@ -12,7 +12,8 @@
12
12
  8080, // Additional dev server
13
13
  19006, // Expo dev tools
14
14
  5432, // PostgreSQL
15
- 6379 // Redis
15
+ 6379, // Redis
16
+ 3333 // Figma MCP server
16
17
  ],
17
18
 
18
19
  // Port attributes
@@ -44,6 +45,10 @@
44
45
  "6379": {
45
46
  "label": "Redis Cache",
46
47
  "onAutoForward": "silent"
48
+ },
49
+ "3333": {
50
+ "label": "Figma MCP Server",
51
+ "onAutoForward": "openBrowser"
47
52
  }
48
53
  },
49
54
 
@@ -42,6 +42,20 @@ services:
42
42
  - redis
43
43
  command: sleep infinity
44
44
 
45
+ # Figma MCP Server
46
+ figma-mcp:
47
+ image: node:18-alpine
48
+ working_dir: /app
49
+ environment:
50
+ - FIGMA_ACCESS_TOKEN=${FIGMA_ACCESS_TOKEN:-}
51
+ ports:
52
+ - "3333:3333"
53
+ volumes:
54
+ - ./figma-mcp.sh:/app/figma-mcp.sh:ro
55
+ - figma_mcp_data:/app/node_modules
56
+ command: ["sh", "/app/figma-mcp.sh"]
57
+
45
58
  volumes:
46
59
  postgres_data:
47
60
  redis_data:
61
+ figma_mcp_data:
@@ -0,0 +1,32 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "Starting Figma MCP Server..."
5
+
6
+ # Check if FIGMA_ACCESS_TOKEN is provided
7
+ if [ -z "$FIGMA_ACCESS_TOKEN" ]; then
8
+ echo "❌ No FIGMA_ACCESS_TOKEN provided"
9
+ echo "💡 Add your token to .devcontainer/.env to enable Figma integration"
10
+ echo " Example: echo 'FIGMA_ACCESS_TOKEN=fig_your_token_here' > .devcontainer/.env"
11
+ echo ""
12
+ echo "🔄 Keeping container alive (waiting for token)..."
13
+ sleep infinity
14
+ exit 0
15
+ fi
16
+
17
+ echo "✅ Figma token found, installing figma-developer-mcp..."
18
+
19
+ # Install figma-developer-mcp if not already installed
20
+ if ! command -v figma-developer-mcp &> /dev/null; then
21
+ npm install -g figma-developer-mcp
22
+ echo "📦 figma-developer-mcp installed successfully"
23
+ else
24
+ echo "📦 figma-developer-mcp already installed"
25
+ fi
26
+
27
+ echo "🚀 Starting Figma MCP server on port 3333..."
28
+ echo "🎨 Figma designs will be available to AI tools like Claude"
29
+
30
+ # Start the MCP server with the correct environment variable
31
+ export FIGMA_API_KEY="$FIGMA_ACCESS_TOKEN"
32
+ exec npx figma-developer-mcp --port 3333
@@ -60,5 +60,8 @@ if [ -d "packages" ]; then
60
60
  done
61
61
  fi
62
62
 
63
+ echo "Add Figma MCP to Claude Code"
64
+ claude mcp add -t sse figma-mcp http://figma-mcp:3333/sse
65
+
63
66
  echo "✅ Development environment is ready!"
64
67
  echo "🎉 You can now start developing your Idealyst application!"
@@ -0,0 +1,30 @@
1
+ #!/bin/bash
2
+
3
+ # Idealyst Framework Workspace Setup Script
4
+ # This script sets up the development environment for your workspace
5
+
6
+ echo "🏗️ Setting up Idealyst Framework workspace..."
7
+
8
+ # Install dependencies
9
+ echo "📦 Installing dependencies..."
10
+ yarn install
11
+
12
+ # Build all packages
13
+ echo "🔨 Building packages..."
14
+ yarn build:packages
15
+
16
+ # Set up git hooks (if using husky)
17
+ if [ -f "package.json" ] && grep -q "husky" package.json; then
18
+ echo "🪝 Setting up git hooks..."
19
+ yarn prepare
20
+ fi
21
+
22
+ echo "✅ Workspace setup complete!"
23
+ echo ""
24
+ echo "🚀 Quick start:"
25
+ echo " • Run 'yarn dev' to start development mode"
26
+ echo " • Run 'yarn build' to build all packages"
27
+ echo " • Run 'yarn test' to run tests"
28
+ echo " • Use 'idealyst create <type> <name>' to add new projects"
29
+ echo ""
30
+ echo "📚 Check README.md and DOCKER.md for more information."
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["ES2020"],
5
+ "module": "commonjs",
6
+ "moduleResolution": "node",
7
+ "esModuleInterop": true,
8
+ "allowSyntheticDefaultImports": true,
9
+ "strict": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "declaration": true,
13
+ "declarationMap": true,
14
+ "sourceMap": true,
15
+ "outDir": "./dist",
16
+ "rootDir": "./src"
17
+ },
18
+ "include": [
19
+ "packages/*/src/**/*"
20
+ ],
21
+ "exclude": [
22
+ "node_modules",
23
+ "dist",
24
+ "**/*.test.ts",
25
+ "**/*.spec.ts"
26
+ ],
27
+ "references": [
28
+ {
29
+ "path": "./packages/*"
30
+ }
31
+ ]
32
+ }
@@ -1,14 +0,0 @@
1
- import { describe, it, expect } from '@jest/globals';
2
- import { db } from '../src';
3
-
4
- describe('Database', () => {
5
- it('should export database client', () => {
6
- expect(db).toBeDefined();
7
- });
8
-
9
- it('should connect to database', async () => {
10
- // This is a basic connection test
11
- // Add your own model-specific tests here
12
- expect(db.$connect).toBeDefined();
13
- });
14
- });
@@ -1,19 +0,0 @@
1
- module.exports = {
2
- preset: 'ts-jest',
3
- testEnvironment: 'node',
4
- collectCoverageFrom: [
5
- 'src/**/*.{ts,tsx}',
6
- '!src/**/*.d.ts',
7
- ],
8
- testMatch: [
9
- '**/__tests__/**/*.test.{ts,tsx}',
10
- ],
11
- setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
12
- moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
13
- transform: {
14
- '^.+\\.(ts|tsx)$': 'ts-jest',
15
- },
16
- moduleNameMapping: {
17
- '^@/(.*)$': '<rootDir>/src/$1',
18
- },
19
- };
@@ -1,11 +0,0 @@
1
- // Global test setup
2
- import { beforeEach, afterEach } from '@jest/globals';
3
-
4
- // Mock environment variables for testing
5
- process.env.NODE_ENV = 'test';
6
- process.env.DATABASE_URL = 'file:./test.db';
7
-
8
- // Clean up after each test
9
- afterEach(async () => {
10
- // Add any cleanup logic here
11
- });
@@ -1,21 +0,0 @@
1
- // This is your Prisma schema file,
2
- // learn more about it in the docs: https://pris.ly/d/prisma-schema
3
-
4
- generator client {
5
- provider = "prisma-client-js"
6
- }
7
-
8
- datasource db {
9
- provider = "sqlite"
10
- url = env("DATABASE_URL")
11
- }
12
-
13
- // Add your models here
14
- // Example:
15
- // model User {
16
- // id String @id @default(cuid())
17
- // email String @unique
18
- // name String?
19
- // createdAt DateTime @default(now())
20
- // updatedAt DateTime @updatedAt
21
- // }
@@ -1,18 +0,0 @@
1
- import { PrismaClient } from '@prisma/client';
2
-
3
- declare global {
4
- // Prevent multiple instances of Prisma Client in development
5
- var __globalPrisma: PrismaClient | undefined;
6
- }
7
-
8
- const prisma =
9
- globalThis.__globalPrisma ??
10
- new PrismaClient({
11
- log: ['query', 'error', 'warn'],
12
- });
13
-
14
- if (process.env.NODE_ENV !== 'production') {
15
- globalThis.__globalPrisma = prisma;
16
- }
17
-
18
- export default prisma;
@@ -1,26 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- // Add your Zod schemas here to match your Prisma models
4
- // Example:
5
- // export const UserSchema = z.object({
6
- // id: z.string().cuid(),
7
- // email: z.string().email(),
8
- // name: z.string().optional(),
9
- // createdAt: z.date(),
10
- // updatedAt: z.date(),
11
- // });
12
-
13
- // export const CreateUserSchema = UserSchema.omit({
14
- // id: true,
15
- // createdAt: true,
16
- // updatedAt: true,
17
- // });
18
-
19
- // export const UpdateUserSchema = CreateUserSchema.partial();
20
-
21
- // Export all your schemas
22
- export const schemas = {
23
- // user: UserSchema,
24
- // createUser: CreateUserSchema,
25
- // updateUser: UpdateUserSchema,
26
- } as const;