@idealyst/cli 1.1.9 → 1.2.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.
- package/dist/commands/add.js +233 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/index.js +13 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/info.js +193 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init.js +155 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/constants.js +119 -0
- package/dist/constants.js.map +1 -0
- package/dist/generators/core/index.js +23 -0
- package/dist/generators/core/index.js.map +1 -0
- package/dist/generators/core/mobile.js +286 -0
- package/dist/generators/core/mobile.js.map +1 -0
- package/dist/generators/core/shared.js +207 -0
- package/dist/generators/core/shared.js.map +1 -0
- package/dist/generators/core/web.js +377 -0
- package/dist/generators/core/web.js.map +1 -0
- package/dist/generators/extensions/api.js +223 -0
- package/dist/generators/extensions/api.js.map +1 -0
- package/dist/generators/extensions/devcontainer.js +510 -0
- package/dist/generators/extensions/devcontainer.js.map +1 -0
- package/dist/generators/extensions/graphql.js +202 -0
- package/dist/generators/extensions/graphql.js.map +1 -0
- package/dist/generators/extensions/index.js +17 -0
- package/dist/generators/extensions/index.js.map +1 -0
- package/dist/generators/extensions/prisma.js +249 -0
- package/dist/generators/extensions/prisma.js.map +1 -0
- package/dist/generators/extensions/trpc.js +258 -0
- package/dist/generators/extensions/trpc.js.map +1 -0
- package/dist/generators/index.js +106 -4
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/reactNative.js +177 -0
- package/dist/generators/reactNative.js.map +1 -0
- package/dist/generators/workspace.js +272 -0
- package/dist/generators/workspace.js.map +1 -0
- package/dist/identifiers/android.js +75 -0
- package/dist/identifiers/android.js.map +1 -0
- package/dist/identifiers/index.js +35 -0
- package/dist/identifiers/index.js.map +1 -0
- package/dist/identifiers/ios.js +65 -0
- package/dist/identifiers/ios.js.map +1 -0
- package/dist/index.js +41 -319
- package/dist/index.js.map +1 -1
- package/dist/templates/copier.js +135 -0
- package/dist/templates/copier.js.map +1 -0
- package/dist/templates/index.js +23 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/merger.js +113 -0
- package/dist/templates/merger.js.map +1 -0
- package/dist/templates/processor.js +142 -0
- package/dist/templates/processor.js.map +1 -0
- package/dist/types/commands/add.d.ts +14 -0
- package/dist/types/commands/index.d.ts +6 -0
- package/dist/types/commands/info.d.ts +10 -0
- package/dist/types/commands/init.d.ts +19 -0
- package/dist/types/constants.d.ts +76 -0
- package/dist/types/generators/core/index.d.ts +6 -0
- package/dist/types/generators/core/mobile.d.ts +13 -0
- package/dist/types/generators/core/shared.d.ts +8 -0
- package/dist/types/generators/core/web.d.ts +8 -0
- package/dist/types/generators/extensions/api.d.ts +8 -0
- package/dist/types/generators/extensions/devcontainer.d.ts +15 -0
- package/dist/types/generators/extensions/graphql.d.ts +8 -0
- package/dist/types/generators/extensions/index.d.ts +8 -0
- package/dist/types/generators/extensions/prisma.d.ts +8 -0
- package/dist/types/generators/extensions/trpc.d.ts +9 -0
- package/dist/types/generators/index.d.ts +11 -3
- package/dist/types/generators/reactNative.d.ts +19 -0
- package/dist/types/generators/workspace.d.ts +8 -0
- package/dist/types/identifiers/android.d.ts +26 -0
- package/dist/types/identifiers/index.d.ts +26 -0
- package/dist/types/identifiers/ios.d.ts +21 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/templates/copier.d.ts +24 -0
- package/dist/types/templates/index.d.ts +6 -0
- package/dist/types/templates/merger.d.ts +43 -0
- package/dist/types/templates/processor.d.ts +39 -0
- package/dist/types/types.d.ts +153 -5
- package/dist/types/utils/filesystem.d.ts +56 -0
- package/dist/types/utils/index.d.ts +7 -0
- package/dist/types/utils/logger.d.ts +58 -0
- package/dist/types/utils/shell.d.ts +35 -0
- package/dist/types/utils/validation.d.ts +32 -0
- package/dist/types/wizard/index.d.ts +20 -0
- package/dist/types/wizard/steps/apiExtension.d.ts +5 -0
- package/dist/types/wizard/steps/appDisplayName.d.ts +5 -0
- package/dist/types/wizard/steps/devcontainerExtension.d.ts +5 -0
- package/dist/types/wizard/steps/graphqlExtension.d.ts +5 -0
- package/dist/types/wizard/steps/index.d.ts +12 -0
- package/dist/types/wizard/steps/orgDomain.d.ts +5 -0
- package/dist/types/wizard/steps/prismaExtension.d.ts +5 -0
- package/dist/types/wizard/steps/projectName.d.ts +5 -0
- package/dist/types/wizard/steps/summary.d.ts +5 -0
- package/dist/types/wizard/steps/trpcExtension.d.ts +5 -0
- package/dist/types/wizard/validators.d.ts +17 -0
- package/dist/types.js +41 -0
- package/dist/types.js.map +1 -1
- package/dist/utils/filesystem.js +173 -0
- package/dist/utils/filesystem.js.map +1 -0
- package/dist/utils/index.js +24 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.js +95 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/shell.js +113 -0
- package/dist/utils/shell.js.map +1 -0
- package/dist/utils/validation.js +196 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/wizard/index.js +177 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/wizard/steps/apiExtension.js +33 -0
- package/dist/wizard/steps/apiExtension.js.map +1 -0
- package/dist/wizard/steps/appDisplayName.js +53 -0
- package/dist/wizard/steps/appDisplayName.js.map +1 -0
- package/dist/wizard/steps/devcontainerExtension.js +78 -0
- package/dist/wizard/steps/devcontainerExtension.js.map +1 -0
- package/dist/wizard/steps/graphqlExtension.js +37 -0
- package/dist/wizard/steps/graphqlExtension.js.map +1 -0
- package/dist/wizard/steps/index.js +25 -0
- package/dist/wizard/steps/index.js.map +1 -0
- package/dist/wizard/steps/orgDomain.js +40 -0
- package/dist/wizard/steps/orgDomain.js.map +1 -0
- package/dist/wizard/steps/prismaExtension.js +33 -0
- package/dist/wizard/steps/prismaExtension.js.map +1 -0
- package/dist/wizard/steps/projectName.js +40 -0
- package/dist/wizard/steps/projectName.js.map +1 -0
- package/dist/wizard/steps/summary.js +107 -0
- package/dist/wizard/steps/summary.js.map +1 -0
- package/dist/wizard/steps/trpcExtension.js +37 -0
- package/dist/wizard/steps/trpcExtension.js.map +1 -0
- package/dist/wizard/validators.js +35 -0
- package/dist/wizard/validators.js.map +1 -0
- package/package.json +6 -19
- package/README.md +0 -110
- package/dist/generators/init.js +0 -268
- package/dist/generators/init.js.map +0 -1
- package/dist/generators/utils.js +0 -682
- package/dist/generators/utils.js.map +0 -1
- package/dist/scripts/configure-react-native-monorepo.js +0 -144
- package/dist/scripts/configure-react-native-monorepo.js.map +0 -1
- package/dist/template/.devcontainer/Dockerfile +0 -26
- package/dist/template/.devcontainer/devcontainer.json +0 -113
- package/dist/template/.devcontainer/docker-compose.yml +0 -59
- package/dist/template/.devcontainer/figma-mcp.sh +0 -32
- package/dist/template/.devcontainer/gitignore.template +0 -2
- package/dist/template/.devcontainer/setup.sh +0 -45
- package/dist/template/DOCKER.md +0 -0
- package/dist/template/Dockerfile +0 -111
- package/dist/template/README.md +0 -233
- package/dist/template/docker/nginx/prod.conf +0 -238
- package/dist/template/docker/nginx.conf +0 -131
- package/dist/template/docker/postgres/init.sql +0 -41
- package/dist/template/docker/prometheus/prometheus.yml +0 -52
- package/dist/template/docker-compose.prod.yml +0 -146
- package/dist/template/docker-compose.yml +0 -143
- package/dist/template/dockerignore.template +0 -151
- package/dist/template/env.example.template +0 -36
- package/dist/template/gitignore.template +0 -56
- package/dist/template/jest.config.js +0 -20
- package/dist/template/mcp.json.template +0 -8
- package/dist/template/package.json +0 -45
- package/dist/template/packages/api/README.md +0 -510
- package/dist/template/packages/api/__tests__/api.test.ts +0 -26
- package/dist/template/packages/api/env.example.template +0 -6
- package/dist/template/packages/api/gitignore.template +0 -35
- package/dist/template/packages/api/jest.config.js +0 -23
- package/dist/template/packages/api/jest.setup.js +0 -9
- package/dist/template/packages/api/package.json +0 -66
- package/dist/template/packages/api/src/context.ts +0 -52
- package/dist/template/packages/api/src/controllers/TestController.ts +0 -0
- package/dist/template/packages/api/src/graphql/builder.ts +0 -75
- package/dist/template/packages/api/src/graphql/generated.ts +0 -64
- package/dist/template/packages/api/src/graphql/index.ts +0 -75
- package/dist/template/packages/api/src/graphql/types/index.ts +0 -44
- package/dist/template/packages/api/src/graphql/types/test.ts +0 -245
- package/dist/template/packages/api/src/index.ts +0 -26
- package/dist/template/packages/api/src/lib/database.ts +0 -23
- package/dist/template/packages/api/src/router/index.ts +0 -163
- package/dist/template/packages/api/src/routers/test.ts +0 -161
- package/dist/template/packages/api/src/server.ts +0 -68
- package/dist/template/packages/api/src/trpc.ts +0 -28
- package/dist/template/packages/api/tsconfig.json +0 -44
- package/dist/template/packages/database/README.md +0 -162
- package/dist/template/packages/database/gitignore.template +0 -41
- package/dist/template/packages/database/package.json +0 -49
- package/dist/template/packages/database/prisma/seed.ts +0 -64
- package/dist/template/packages/database/schema.prisma +0 -107
- package/dist/template/packages/database/src/index.ts +0 -15
- package/dist/template/packages/database/src/validators.ts +0 -10
- package/dist/template/packages/database/tsconfig.json +0 -18
- package/dist/template/packages/mobile/README.md +0 -86
- package/dist/template/packages/mobile/__tests__/App.test.tsx +0 -156
- package/dist/template/packages/mobile/__tests__/components.test.tsx +0 -300
- package/dist/template/packages/mobile/app.json +0 -5
- package/dist/template/packages/mobile/babel.config.js +0 -10
- package/dist/template/packages/mobile/gitignore.template +0 -73
- package/dist/template/packages/mobile/index.js +0 -6
- package/dist/template/packages/mobile/jest.config.js +0 -21
- package/dist/template/packages/mobile/jest.setup.js +0 -12
- package/dist/template/packages/mobile/metro.config.js +0 -36
- package/dist/template/packages/mobile/package.json +0 -60
- package/dist/template/packages/mobile/src/App.tsx +0 -8
- package/dist/template/packages/mobile/src/utils/trpc.ts +0 -7
- package/dist/template/packages/mobile/tsconfig.json +0 -28
- package/dist/template/packages/shared/README.md +0 -135
- package/dist/template/packages/shared/__tests__/shared.test.ts +0 -51
- package/dist/template/packages/shared/gitignore.template +0 -35
- package/dist/template/packages/shared/jest.config.js +0 -22
- package/dist/template/packages/shared/package.json +0 -68
- package/dist/template/packages/shared/src/components/App.tsx +0 -57
- package/dist/template/packages/shared/src/components/HelloWorld.tsx +0 -531
- package/dist/template/packages/shared/src/components/index.ts +0 -1
- package/dist/template/packages/shared/src/graphql/client.ts +0 -34
- package/dist/template/packages/shared/src/index.ts +0 -22
- package/dist/template/packages/shared/src/navigation/AppRouter.tsx +0 -565
- package/dist/template/packages/shared/src/trpc/client.ts +0 -44
- package/dist/template/packages/shared/tsconfig.json +0 -22
- package/dist/template/packages/web/README.md +0 -131
- package/dist/template/packages/web/__tests__/App.test.tsx +0 -342
- package/dist/template/packages/web/__tests__/components.test.tsx +0 -564
- package/dist/template/packages/web/gitignore.template +0 -35
- package/dist/template/packages/web/index.html +0 -13
- package/dist/template/packages/web/jest.config.js +0 -27
- package/dist/template/packages/web/jest.setup.js +0 -24
- package/dist/template/packages/web/package.json +0 -69
- package/dist/template/packages/web/src/App.tsx +0 -14
- package/dist/template/packages/web/src/components/TestDemo.tsx +0 -164
- package/dist/template/packages/web/src/main.tsx +0 -25
- package/dist/template/packages/web/src/utils/trpc.ts +0 -7
- package/dist/template/packages/web/tsconfig.json +0 -26
- package/dist/template/packages/web/vite.config.ts +0 -98
- package/dist/template/setup.sh +0 -30
- package/dist/template/tsconfig.json +0 -22
- package/dist/template/yarnrc.yml.template +0 -4
- package/dist/types/generators/init.d.ts +0 -5
- package/dist/types/generators/utils.d.ts +0 -45
- package/dist/types/scripts/configure-react-native-monorepo.d.ts +0 -23
- package/template/.devcontainer/Dockerfile +0 -26
- package/template/.devcontainer/devcontainer.json +0 -113
- package/template/.devcontainer/docker-compose.yml +0 -59
- package/template/.devcontainer/figma-mcp.sh +0 -32
- package/template/.devcontainer/setup.sh +0 -45
- package/template/.dockerignore +0 -151
- package/template/.env.example +0 -36
- package/template/.env.production +0 -56
- package/template/DOCKER.md +0 -0
- package/template/Dockerfile +0 -111
- package/template/README.md +0 -233
- package/template/docker/nginx/prod.conf +0 -238
- package/template/docker/nginx.conf +0 -131
- package/template/docker/postgres/init.sql +0 -41
- package/template/docker/prometheus/prometheus.yml +0 -52
- package/template/docker-compose.prod.yml +0 -146
- package/template/docker-compose.yml +0 -143
- package/template/jest.config.js +0 -20
- package/template/package.json +0 -45
- package/template/packages/api/.env.example +0 -6
- package/template/packages/api/README.md +0 -510
- package/template/packages/api/__tests__/api.test.ts +0 -26
- package/template/packages/api/jest.config.js +0 -23
- package/template/packages/api/jest.setup.js +0 -9
- package/template/packages/api/package.json +0 -66
- package/template/packages/api/src/context.ts +0 -52
- package/template/packages/api/src/controllers/TestController.ts +0 -0
- package/template/packages/api/src/graphql/builder.ts +0 -75
- package/template/packages/api/src/graphql/generated.ts +0 -64
- package/template/packages/api/src/graphql/index.ts +0 -75
- package/template/packages/api/src/graphql/types/index.ts +0 -44
- package/template/packages/api/src/graphql/types/test.ts +0 -245
- package/template/packages/api/src/index.ts +0 -26
- package/template/packages/api/src/lib/database.ts +0 -23
- package/template/packages/api/src/router/index.ts +0 -163
- package/template/packages/api/src/routers/test.ts +0 -161
- package/template/packages/api/src/server.ts +0 -68
- package/template/packages/api/src/trpc.ts +0 -28
- package/template/packages/api/tsconfig.json +0 -44
- package/template/packages/database/README.md +0 -162
- package/template/packages/database/package.json +0 -49
- package/template/packages/database/prisma/seed.ts +0 -64
- package/template/packages/database/schema.prisma +0 -107
- package/template/packages/database/src/index.ts +0 -15
- package/template/packages/database/src/validators.ts +0 -10
- package/template/packages/database/tsconfig.json +0 -18
- package/template/packages/mobile/README.md +0 -86
- package/template/packages/mobile/__tests__/App.test.tsx +0 -156
- package/template/packages/mobile/__tests__/components.test.tsx +0 -300
- package/template/packages/mobile/app.json +0 -5
- package/template/packages/mobile/babel.config.js +0 -26
- package/template/packages/mobile/index.js +0 -8
- package/template/packages/mobile/jest.config.js +0 -21
- package/template/packages/mobile/jest.setup.js +0 -12
- package/template/packages/mobile/metro.config.js +0 -36
- package/template/packages/mobile/package.json +0 -60
- package/template/packages/mobile/src/App.tsx +0 -8
- package/template/packages/mobile/src/utils/trpc.ts +0 -7
- package/template/packages/mobile/tsconfig.json +0 -28
- package/template/packages/shared/README.md +0 -135
- package/template/packages/shared/__tests__/shared.test.ts +0 -51
- package/template/packages/shared/jest.config.js +0 -22
- package/template/packages/shared/package.json +0 -68
- package/template/packages/shared/src/components/App.tsx +0 -57
- package/template/packages/shared/src/components/HelloWorld.tsx +0 -531
- package/template/packages/shared/src/components/index.ts +0 -1
- package/template/packages/shared/src/graphql/client.ts +0 -34
- package/template/packages/shared/src/index.ts +0 -25
- package/template/packages/shared/src/navigation/AppRouter.tsx +0 -565
- package/template/packages/shared/src/trpc/client.ts +0 -44
- package/template/packages/shared/src/unistyles.ts +0 -50
- package/template/packages/shared/tsconfig.json +0 -22
- package/template/packages/web/README.md +0 -131
- package/template/packages/web/__tests__/App.test.tsx +0 -342
- package/template/packages/web/__tests__/components.test.tsx +0 -564
- package/template/packages/web/index.html +0 -13
- package/template/packages/web/jest.config.js +0 -27
- package/template/packages/web/jest.setup.js +0 -24
- package/template/packages/web/package.json +0 -69
- package/template/packages/web/src/App.tsx +0 -14
- package/template/packages/web/src/components/TestDemo.tsx +0 -164
- package/template/packages/web/src/main.tsx +0 -27
- package/template/packages/web/src/utils/trpc.ts +0 -7
- package/template/packages/web/tsconfig.json +0 -26
- package/template/packages/web/vite.config.ts +0 -114
- package/template/setup.sh +0 -30
- package/template/tsconfig.json +0 -22
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { router, publicProcedure } from '../trpc.js';
|
|
3
|
-
import { testRouter } from '../routers/test.js';
|
|
4
|
-
|
|
5
|
-
export const appRouter = router({
|
|
6
|
-
// Simple hello world procedure
|
|
7
|
-
hello: publicProcedure
|
|
8
|
-
.input(z.object({ name: z.string().optional() }))
|
|
9
|
-
.query(({ input }) => {
|
|
10
|
-
return {
|
|
11
|
-
greeting: `Hello ${input.name || 'World'}!`,
|
|
12
|
-
timestamp: new Date().toISOString(),
|
|
13
|
-
};
|
|
14
|
-
}),
|
|
15
|
-
|
|
16
|
-
// Health check procedure
|
|
17
|
-
health: publicProcedure.query(() => {
|
|
18
|
-
return {
|
|
19
|
-
status: 'OK',
|
|
20
|
-
timestamp: new Date().toISOString(),
|
|
21
|
-
version: '1.0.0',
|
|
22
|
-
};
|
|
23
|
-
}),
|
|
24
|
-
|
|
25
|
-
// Test CRUD endpoints - generated automatically from Prisma model
|
|
26
|
-
test: testRouter,
|
|
27
|
-
|
|
28
|
-
// Add your model routers here
|
|
29
|
-
// Example:
|
|
30
|
-
// users: userRouter,
|
|
31
|
-
// posts: postRouter,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
// Export type definition of API
|
|
35
|
-
export type AppRouter = typeof appRouter;
|
|
36
|
-
|
|
37
|
-
/*
|
|
38
|
-
SIMPLIFIED CRUD API SYSTEM:
|
|
39
|
-
|
|
40
|
-
This API template uses a simplified approach with automatic CRUD generation for Prisma models.
|
|
41
|
-
|
|
42
|
-
## Quick Start:
|
|
43
|
-
|
|
44
|
-
1. **Define your Prisma model** in packages/database/schema.prisma
|
|
45
|
-
2. **Create Zod schemas** for validation
|
|
46
|
-
3. **Generate CRUD router** using createCrudRouter()
|
|
47
|
-
4. **Add to main router**
|
|
48
|
-
|
|
49
|
-
## Example - Adding a User model:
|
|
50
|
-
|
|
51
|
-
### 1. Define Prisma model:
|
|
52
|
-
```prisma
|
|
53
|
-
model User {
|
|
54
|
-
id String @id @default(cuid())
|
|
55
|
-
email String @unique
|
|
56
|
-
name String
|
|
57
|
-
createdAt DateTime @default(now())
|
|
58
|
-
updatedAt DateTime @updatedAt
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### 2. Create router file (src/routers/user.ts):
|
|
63
|
-
```typescript
|
|
64
|
-
import { z } from 'zod';
|
|
65
|
-
import { createCrudRouter } from '../lib/crud.js';
|
|
66
|
-
|
|
67
|
-
const createUserSchema = z.object({
|
|
68
|
-
email: z.string().email(),
|
|
69
|
-
name: z.string().min(1),
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
const updateUserSchema = z.object({
|
|
73
|
-
email: z.string().email().optional(),
|
|
74
|
-
name: z.string().min(1).optional(),
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
export const userRouter = createCrudRouter(
|
|
78
|
-
'user',
|
|
79
|
-
createUserSchema,
|
|
80
|
-
updateUserSchema
|
|
81
|
-
);
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### 3. Add to main router:
|
|
85
|
-
```typescript
|
|
86
|
-
import { userRouter } from '../routers/user.js';
|
|
87
|
-
|
|
88
|
-
export const appRouter = router({
|
|
89
|
-
// ... other routes
|
|
90
|
-
users: userRouter,
|
|
91
|
-
});
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### 4. Use in frontend:
|
|
95
|
-
```typescript
|
|
96
|
-
// Get all users
|
|
97
|
-
const { data: users } = trpc.users.getAll.useQuery();
|
|
98
|
-
|
|
99
|
-
// Create user
|
|
100
|
-
const createUser = trpc.users.create.useMutation();
|
|
101
|
-
await createUser.mutateAsync({
|
|
102
|
-
email: 'user@example.com',
|
|
103
|
-
name: 'John Doe'
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
// Update user
|
|
107
|
-
const updateUser = trpc.users.update.useMutation();
|
|
108
|
-
await updateUser.mutateAsync({
|
|
109
|
-
id: 'user-id',
|
|
110
|
-
data: { name: 'Jane Doe' }
|
|
111
|
-
});
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
## Available CRUD Operations:
|
|
115
|
-
|
|
116
|
-
Each generated router includes:
|
|
117
|
-
- `getAll({ skip?, take?, orderBy? })` - List with pagination
|
|
118
|
-
- `getById({ id })` - Get single record
|
|
119
|
-
- `create(data)` - Create new record
|
|
120
|
-
- `update({ id, data })` - Update existing record
|
|
121
|
-
- `delete({ id })` - Delete record
|
|
122
|
-
- `count({ where? })` - Count records
|
|
123
|
-
|
|
124
|
-
## Advanced Usage:
|
|
125
|
-
|
|
126
|
-
### Custom procedures:
|
|
127
|
-
You can extend generated routers with custom procedures:
|
|
128
|
-
|
|
129
|
-
```typescript
|
|
130
|
-
import { z } from 'zod';
|
|
131
|
-
import { router, publicProcedure } from '../trpc.js';
|
|
132
|
-
import { createCrudRouter } from '../lib/crud.js';
|
|
133
|
-
import { prisma } from '../lib/database.js';
|
|
134
|
-
|
|
135
|
-
const baseCrudRouter = createCrudRouter('user', createUserSchema);
|
|
136
|
-
|
|
137
|
-
export const userRouter = router({
|
|
138
|
-
...baseCrudRouter,
|
|
139
|
-
|
|
140
|
-
// Add custom procedures
|
|
141
|
-
getByEmail: publicProcedure
|
|
142
|
-
.input(z.object({ email: z.string().email() }))
|
|
143
|
-
.query(async ({ input }) => {
|
|
144
|
-
return await prisma.user.findUnique({
|
|
145
|
-
where: { email: input.email }
|
|
146
|
-
});
|
|
147
|
-
}),
|
|
148
|
-
});
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Authentication & Authorization:
|
|
152
|
-
Use middleware for protected procedures:
|
|
153
|
-
|
|
154
|
-
```typescript
|
|
155
|
-
import { protectedProcedure } from '../trpc.js';
|
|
156
|
-
|
|
157
|
-
// Replace publicProcedure with protectedProcedure in createCrudRouter
|
|
158
|
-
// or create a custom version for authenticated routes
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
This simplified system removes the controller layer complexity while providing
|
|
162
|
-
type-safe, validated CRUD operations for all your Prisma models.
|
|
163
|
-
*/
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { prisma } from '../lib/database.js';
|
|
3
|
-
import { publicProcedure, router } from '../trpc.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Test Router - tRPC CRUD operations for the Test model
|
|
7
|
-
*
|
|
8
|
-
* This router provides standard CRUD operations via tRPC.
|
|
9
|
-
* For the GraphQL equivalent, see src/graphql/types/test.ts
|
|
10
|
-
*
|
|
11
|
-
* Endpoints:
|
|
12
|
-
* - test.getById({ id }) - Get test by ID
|
|
13
|
-
* - test.getAll({ skip, take }) - Get all tests with pagination
|
|
14
|
-
* - test.count({ status }) - Get count of tests
|
|
15
|
-
* - test.create({ name, message }) - Create new test
|
|
16
|
-
* - test.update({ id, data }) - Update existing test
|
|
17
|
-
* - test.delete({ id }) - Delete test
|
|
18
|
-
*/
|
|
19
|
-
export const testRouter = router({
|
|
20
|
-
// Get a single test by ID
|
|
21
|
-
getById: publicProcedure
|
|
22
|
-
.input(z.object({ id: z.string() }))
|
|
23
|
-
.query(async ({ input }) => {
|
|
24
|
-
const test = await prisma.test.findUnique({
|
|
25
|
-
where: { id: input.id },
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
if (!test) {
|
|
29
|
-
throw new Error('Test not found');
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return test;
|
|
33
|
-
}),
|
|
34
|
-
|
|
35
|
-
// Get all tests with pagination
|
|
36
|
-
getAll: publicProcedure
|
|
37
|
-
.input(z.object({
|
|
38
|
-
skip: z.number().min(0).optional(),
|
|
39
|
-
take: z.number().min(1).max(100).optional(),
|
|
40
|
-
orderBy: z.enum(['createdAt', 'updatedAt', 'name']).optional(),
|
|
41
|
-
orderDir: z.enum(['asc', 'desc']).optional(),
|
|
42
|
-
}))
|
|
43
|
-
.query(async ({ input }) => {
|
|
44
|
-
const take = input.take ?? 10;
|
|
45
|
-
const orderField = input.orderBy ?? 'createdAt';
|
|
46
|
-
const orderDir = input.orderDir ?? 'desc';
|
|
47
|
-
|
|
48
|
-
return prisma.test.findMany({
|
|
49
|
-
...(input.skip != null ? { skip: input.skip } : {}),
|
|
50
|
-
take,
|
|
51
|
-
orderBy: { [orderField]: orderDir },
|
|
52
|
-
});
|
|
53
|
-
}),
|
|
54
|
-
|
|
55
|
-
// Get count of tests
|
|
56
|
-
count: publicProcedure
|
|
57
|
-
.input(z.object({
|
|
58
|
-
status: z.string().optional(),
|
|
59
|
-
}))
|
|
60
|
-
.query(async ({ input }) => {
|
|
61
|
-
return prisma.test.count({
|
|
62
|
-
...(input.status != null ? { where: { status: input.status } } : {}),
|
|
63
|
-
});
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
// Create a new test
|
|
67
|
-
create: publicProcedure
|
|
68
|
-
.input(z.object({
|
|
69
|
-
name: z.string().min(1, 'Name is required'),
|
|
70
|
-
message: z.string().min(1, 'Message is required'),
|
|
71
|
-
status: z.string().optional().default('active'),
|
|
72
|
-
}))
|
|
73
|
-
.mutation(async ({ input }) => {
|
|
74
|
-
return prisma.test.create({
|
|
75
|
-
data: {
|
|
76
|
-
name: input.name,
|
|
77
|
-
message: input.message,
|
|
78
|
-
status: input.status,
|
|
79
|
-
},
|
|
80
|
-
});
|
|
81
|
-
}),
|
|
82
|
-
|
|
83
|
-
// Update an existing test
|
|
84
|
-
update: publicProcedure
|
|
85
|
-
.input(z.object({
|
|
86
|
-
id: z.string(),
|
|
87
|
-
data: z.object({
|
|
88
|
-
name: z.string().min(1).optional(),
|
|
89
|
-
message: z.string().min(1).optional(),
|
|
90
|
-
status: z.string().optional(),
|
|
91
|
-
}),
|
|
92
|
-
}))
|
|
93
|
-
.mutation(async ({ input }) => {
|
|
94
|
-
const existing = await prisma.test.findUnique({
|
|
95
|
-
where: { id: input.id },
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
if (!existing) {
|
|
99
|
-
throw new Error('Test not found');
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// Build update data only with defined values
|
|
103
|
-
const updateData: { name?: string; message?: string; status?: string } = {};
|
|
104
|
-
if (input.data.name != null) updateData.name = input.data.name;
|
|
105
|
-
if (input.data.message != null) updateData.message = input.data.message;
|
|
106
|
-
if (input.data.status != null) updateData.status = input.data.status;
|
|
107
|
-
|
|
108
|
-
return prisma.test.update({
|
|
109
|
-
where: { id: input.id },
|
|
110
|
-
data: updateData,
|
|
111
|
-
});
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
// Delete a test
|
|
115
|
-
delete: publicProcedure
|
|
116
|
-
.input(z.object({ id: z.string() }))
|
|
117
|
-
.mutation(async ({ input }) => {
|
|
118
|
-
const existing = await prisma.test.findUnique({
|
|
119
|
-
where: { id: input.id },
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
if (!existing) {
|
|
123
|
-
throw new Error('Test not found');
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
return prisma.test.delete({
|
|
127
|
-
where: { id: input.id },
|
|
128
|
-
});
|
|
129
|
-
}),
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Example usage in frontend:
|
|
134
|
-
*
|
|
135
|
-
* ```typescript
|
|
136
|
-
* // Get all tests
|
|
137
|
-
* const { data: tests } = trpc.test.getAll.useQuery({ take: 10 });
|
|
138
|
-
*
|
|
139
|
-
* // Get test by ID
|
|
140
|
-
* const { data: test } = trpc.test.getById.useQuery({ id: 'test-id' });
|
|
141
|
-
*
|
|
142
|
-
* // Create a new test
|
|
143
|
-
* const createTest = trpc.test.create.useMutation();
|
|
144
|
-
* await createTest.mutateAsync({
|
|
145
|
-
* name: 'My Test',
|
|
146
|
-
* message: 'This is a test message',
|
|
147
|
-
* status: 'active'
|
|
148
|
-
* });
|
|
149
|
-
*
|
|
150
|
-
* // Update a test
|
|
151
|
-
* const updateTest = trpc.test.update.useMutation();
|
|
152
|
-
* await updateTest.mutateAsync({
|
|
153
|
-
* id: 'test-id',
|
|
154
|
-
* data: { name: 'Updated Test' }
|
|
155
|
-
* });
|
|
156
|
-
*
|
|
157
|
-
* // Delete a test
|
|
158
|
-
* const deleteTest = trpc.test.delete.useMutation();
|
|
159
|
-
* await deleteTest.mutateAsync({ id: 'test-id' });
|
|
160
|
-
* ```
|
|
161
|
-
*/
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import express from 'express';
|
|
2
|
-
import cors from 'cors';
|
|
3
|
-
import { createExpressMiddleware } from '@trpc/server/adapters/express';
|
|
4
|
-
import { appRouter } from './router/index.js';
|
|
5
|
-
import { createContext } from './context.js';
|
|
6
|
-
import { yoga } from './graphql/index.js';
|
|
7
|
-
import dotenv from 'dotenv';
|
|
8
|
-
|
|
9
|
-
// Load environment variables
|
|
10
|
-
dotenv.config();
|
|
11
|
-
|
|
12
|
-
const app = express();
|
|
13
|
-
const PORT = process.env.PORT || 3000;
|
|
14
|
-
|
|
15
|
-
// CORS configuration
|
|
16
|
-
app.use(cors({
|
|
17
|
-
origin: process.env.CORS_ORIGIN || 'http://localhost:5173',
|
|
18
|
-
credentials: true,
|
|
19
|
-
}));
|
|
20
|
-
|
|
21
|
-
// Parse JSON bodies (needed for some GraphQL clients)
|
|
22
|
-
app.use(express.json());
|
|
23
|
-
|
|
24
|
-
// Health check endpoint
|
|
25
|
-
app.get('/health', (_req, res) => {
|
|
26
|
-
res.json({ status: 'OK', timestamp: new Date().toISOString() });
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
// tRPC middleware - for internal TypeScript clients
|
|
30
|
-
app.use(
|
|
31
|
-
'/trpc',
|
|
32
|
-
createExpressMiddleware({
|
|
33
|
-
router: appRouter,
|
|
34
|
-
createContext,
|
|
35
|
-
})
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
// GraphQL middleware - for public API, mobile clients, etc.
|
|
39
|
-
// GraphQL Yoga handles the /graphql endpoint
|
|
40
|
-
// Using all() to handle both GET (GraphiQL) and POST (queries)
|
|
41
|
-
app.all('/graphql', yoga as unknown as express.RequestHandler);
|
|
42
|
-
|
|
43
|
-
// Default route
|
|
44
|
-
app.get('/', (_req, res) => {
|
|
45
|
-
res.json({
|
|
46
|
-
message: 'Welcome to {{projectName}} API',
|
|
47
|
-
endpoints: {
|
|
48
|
-
health: '/health',
|
|
49
|
-
trpc: '/trpc',
|
|
50
|
-
graphql: '/graphql',
|
|
51
|
-
graphiql: process.env.NODE_ENV !== 'production' ? '/graphql' : undefined,
|
|
52
|
-
},
|
|
53
|
-
documentation: {
|
|
54
|
-
trpc: 'Use tRPC for internal TypeScript clients with full type safety',
|
|
55
|
-
graphql: 'Use GraphQL for public APIs, mobile apps, and third-party integrations',
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
app.listen(PORT, () => {
|
|
61
|
-
console.log(`🚀 Server running on http://localhost:${PORT}`);
|
|
62
|
-
console.log(`📡 tRPC API available at http://localhost:${PORT}/trpc`);
|
|
63
|
-
console.log(`📊 GraphQL API available at http://localhost:${PORT}/graphql`);
|
|
64
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
65
|
-
console.log(`🎮 GraphiQL Playground at http://localhost:${PORT}/graphql`);
|
|
66
|
-
}
|
|
67
|
-
console.log(`🏥 Health check at http://localhost:${PORT}/health`);
|
|
68
|
-
});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { initTRPC } from '@trpc/server';
|
|
2
|
-
import { type Context } from './context.js';
|
|
3
|
-
import { ZodError } from 'zod';
|
|
4
|
-
|
|
5
|
-
const t = initTRPC.context<Context>().create({
|
|
6
|
-
errorFormatter({ shape, error }) {
|
|
7
|
-
return {
|
|
8
|
-
...shape,
|
|
9
|
-
data: {
|
|
10
|
-
...shape.data,
|
|
11
|
-
zodError:
|
|
12
|
-
error.cause instanceof ZodError ? error.cause.flatten() : null,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
// Export reusable router and procedure helpers
|
|
19
|
-
export const router = t.router;
|
|
20
|
-
export const publicProcedure = t.procedure;
|
|
21
|
-
|
|
22
|
-
// You can create additional procedures with middleware here
|
|
23
|
-
// For example, a protected procedure that requires authentication:
|
|
24
|
-
// export const protectedProcedure = t.procedure.use(async ({ ctx, next }) => {
|
|
25
|
-
// // Add your authentication logic here
|
|
26
|
-
// // Example: check for valid session/token
|
|
27
|
-
// return next({ ctx: { ...ctx, user: { id: 'user-id' } } });
|
|
28
|
-
// });
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"allowSyntheticDefaultImports": true,
|
|
7
|
-
"esModuleInterop": true,
|
|
8
|
-
"allowJs": true,
|
|
9
|
-
"checkJs": false,
|
|
10
|
-
"jsx": "preserve",
|
|
11
|
-
"declaration": true,
|
|
12
|
-
"declarationMap": true,
|
|
13
|
-
"sourceMap": true,
|
|
14
|
-
"outDir": "./dist",
|
|
15
|
-
"rootDir": "./src",
|
|
16
|
-
"removeComments": false,
|
|
17
|
-
"strict": true,
|
|
18
|
-
"noImplicitAny": true,
|
|
19
|
-
"strictNullChecks": true,
|
|
20
|
-
"strictFunctionTypes": true,
|
|
21
|
-
"noImplicitThis": true,
|
|
22
|
-
"useUnknownInCatchVariables": true,
|
|
23
|
-
"noImplicitReturns": true,
|
|
24
|
-
"noFallthroughCasesInSwitch": true,
|
|
25
|
-
"noUncheckedIndexedAccess": true,
|
|
26
|
-
"exactOptionalPropertyTypes": true,
|
|
27
|
-
"noPropertyAccessFromIndexSignature": false,
|
|
28
|
-
"resolveJsonModule": true,
|
|
29
|
-
"isolatedModules": true,
|
|
30
|
-
"forceConsistentCasingInFileNames": true,
|
|
31
|
-
"skipLibCheck": true
|
|
32
|
-
},
|
|
33
|
-
"include": [
|
|
34
|
-
"src/**/*"
|
|
35
|
-
],
|
|
36
|
-
"exclude": [
|
|
37
|
-
"node_modules",
|
|
38
|
-
"dist",
|
|
39
|
-
"**/*.test.ts"
|
|
40
|
-
],
|
|
41
|
-
"ts-node": {
|
|
42
|
-
"esm": true
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
# Database Package
|
|
2
|
-
|
|
3
|
-
This package provides database access and validation schemas for the workspace using Prisma ORM.
|
|
4
|
-
|
|
5
|
-
## Setup
|
|
6
|
-
|
|
7
|
-
1. Install dependencies:
|
|
8
|
-
```bash
|
|
9
|
-
yarn install
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
2. Set up your environment:
|
|
13
|
-
```bash
|
|
14
|
-
cp .env.example .env
|
|
15
|
-
# Edit .env with your database URL
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
3. Generate the Prisma client:
|
|
19
|
-
```bash
|
|
20
|
-
yarn db:generate
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
4. Push the schema to your database:
|
|
24
|
-
```bash
|
|
25
|
-
yarn db:push
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
5. Seed the database with test data:
|
|
29
|
-
```bash
|
|
30
|
-
yarn db:seed
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Database Schema
|
|
34
|
-
|
|
35
|
-
### Test Model
|
|
36
|
-
|
|
37
|
-
The Test model is included for quick testing and API demonstration:
|
|
38
|
-
|
|
39
|
-
```prisma
|
|
40
|
-
model Test {
|
|
41
|
-
id String @id @default(cuid())
|
|
42
|
-
name String
|
|
43
|
-
message String
|
|
44
|
-
status String @default("active")
|
|
45
|
-
createdAt DateTime @default(now())
|
|
46
|
-
updatedAt DateTime @updatedAt
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
#### Fields:
|
|
51
|
-
- `id`: Unique identifier (CUID)
|
|
52
|
-
- `name`: Test name/title
|
|
53
|
-
- `message`: Test message content
|
|
54
|
-
- `status`: Test status (defaults to "active")
|
|
55
|
-
- `createdAt`: Record creation timestamp
|
|
56
|
-
- `updatedAt`: Record last update timestamp
|
|
57
|
-
|
|
58
|
-
### Sample Models
|
|
59
|
-
|
|
60
|
-
The schema also includes comprehensive example models for reference:
|
|
61
|
-
|
|
62
|
-
#### User Model
|
|
63
|
-
- Complete user management with authentication fields
|
|
64
|
-
- Email validation and profile information
|
|
65
|
-
- Timestamps for tracking
|
|
66
|
-
|
|
67
|
-
#### Post Model
|
|
68
|
-
- Blog post or content management
|
|
69
|
-
- User relationship for authorship
|
|
70
|
-
- Publishing status and timestamps
|
|
71
|
-
|
|
72
|
-
#### Comment Model
|
|
73
|
-
- Comment system for posts
|
|
74
|
-
- User and post relationships
|
|
75
|
-
- Moderation support
|
|
76
|
-
|
|
77
|
-
## Usage
|
|
78
|
-
|
|
79
|
-
### In API Code
|
|
80
|
-
|
|
81
|
-
```typescript
|
|
82
|
-
import { db } from '@{{workspaceScope}}/database';
|
|
83
|
-
|
|
84
|
-
// Create a test record
|
|
85
|
-
const test = await db.test.create({
|
|
86
|
-
data: {
|
|
87
|
-
name: 'My Test',
|
|
88
|
-
message: 'This is a test message',
|
|
89
|
-
status: 'active'
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
// Get all tests
|
|
94
|
-
const tests = await db.test.findMany();
|
|
95
|
-
|
|
96
|
-
// Update a test
|
|
97
|
-
const updatedTest = await db.test.update({
|
|
98
|
-
where: { id: 'test-id' },
|
|
99
|
-
data: { status: 'completed' }
|
|
100
|
-
});
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### Prisma Commands
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
# Generate client
|
|
107
|
-
yarn prisma:generate
|
|
108
|
-
|
|
109
|
-
# Run migrations
|
|
110
|
-
yarn prisma:migrate
|
|
111
|
-
|
|
112
|
-
# Reset database
|
|
113
|
-
yarn prisma:reset
|
|
114
|
-
|
|
115
|
-
# Seed database
|
|
116
|
-
yarn prisma:seed
|
|
117
|
-
|
|
118
|
-
# Open Prisma Studio
|
|
119
|
-
yarn prisma:studio
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
## Quick Test
|
|
123
|
-
|
|
124
|
-
The database includes a simple `Test` model for immediate testing:
|
|
125
|
-
|
|
126
|
-
```typescript
|
|
127
|
-
import { prisma } from '@{{workspaceScope}}/{{name}}';
|
|
128
|
-
|
|
129
|
-
// Get all test entries
|
|
130
|
-
const tests = await prisma.test.findMany();
|
|
131
|
-
|
|
132
|
-
// Create a new test entry
|
|
133
|
-
const newTest = await prisma.test.create({
|
|
134
|
-
data: {
|
|
135
|
-
name: 'My Test',
|
|
136
|
-
message: 'Testing the database connection',
|
|
137
|
-
status: 'active',
|
|
138
|
-
},
|
|
139
|
-
});
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## Usage
|
|
143
|
-
|
|
144
|
-
```typescript
|
|
145
|
-
import { prisma, User, TestValidator } from '@{{workspaceScope}}/{{name}}';
|
|
146
|
-
|
|
147
|
-
// Use the database client
|
|
148
|
-
const users = await prisma.user.findMany();
|
|
149
|
-
|
|
150
|
-
// Use validators
|
|
151
|
-
const validatedData = TestValidator.parse(userData);
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Scripts
|
|
155
|
-
|
|
156
|
-
- `yarn db:generate` - Generate Prisma client
|
|
157
|
-
- `yarn db:push` - Push schema to database
|
|
158
|
-
- `yarn db:migrate` - Create and run migrations
|
|
159
|
-
- `yarn db:studio` - Open Prisma Studio
|
|
160
|
-
- `yarn db:reset` - Reset the database
|
|
161
|
-
- `yarn build` - Build the package
|
|
162
|
-
- `yarn dev` - Build in watch mode
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@{{workspaceScope}}/database",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"description": "Database layer with Prisma",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./dist/index.d.ts",
|
|
10
|
-
"import": "./dist/index.js",
|
|
11
|
-
"require": "./dist/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./client": {
|
|
14
|
-
"types": "./generated/client/index.d.ts",
|
|
15
|
-
"import": "./generated/client/index.js",
|
|
16
|
-
"require": "./generated/client/index.js"
|
|
17
|
-
},
|
|
18
|
-
"./schemas": {
|
|
19
|
-
"types": "./dist/validators.d.ts",
|
|
20
|
-
"import": "./dist/validators.js",
|
|
21
|
-
"require": "./dist/validators.js"
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"scripts": {
|
|
25
|
-
"build": "tsc",
|
|
26
|
-
"dev": "tsc --watch",
|
|
27
|
-
"db:generate": "prisma generate",
|
|
28
|
-
"db:push": "prisma db push",
|
|
29
|
-
"db:migrate": "prisma migrate dev",
|
|
30
|
-
"db:studio": "prisma studio",
|
|
31
|
-
"db:seed": "tsx prisma/seed.ts",
|
|
32
|
-
"db:reset": "prisma migrate reset"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@prisma/client": "^5.19.1",
|
|
36
|
-
"zod": "^3.22.4"
|
|
37
|
-
},
|
|
38
|
-
"devDependencies": {
|
|
39
|
-
"@types/node": "^20.10.0",
|
|
40
|
-
"prisma": "^5.19.1",
|
|
41
|
-
"tsx": "^4.7.0",
|
|
42
|
-
"typescript": "^5.3.3"
|
|
43
|
-
},
|
|
44
|
-
"files": [
|
|
45
|
-
"dist/**/*",
|
|
46
|
-
"prisma/**/*",
|
|
47
|
-
"generated/**/*"
|
|
48
|
-
]
|
|
49
|
-
}
|