claudeship 0.2.23 → 0.2.25
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/apps/server/dist/chat/chat.module.js +8 -1
- package/apps/server/dist/chat/chat.module.js.map +1 -1
- package/apps/server/dist/chat/chat.service.d.ts +5 -1
- package/apps/server/dist/chat/chat.service.js +35 -4
- package/apps/server/dist/chat/chat.service.js.map +1 -1
- package/apps/server/dist/chat/framework-detector.service.d.ts +17 -0
- package/apps/server/dist/chat/framework-detector.service.js +193 -0
- package/apps/server/dist/chat/framework-detector.service.js.map +1 -0
- package/apps/server/dist/chat/prompts/backend/django.d.ts +1 -0
- package/apps/server/dist/chat/prompts/backend/django.js +207 -0
- package/apps/server/dist/chat/prompts/backend/django.js.map +1 -0
- package/apps/server/dist/chat/prompts/backend/express.d.ts +1 -0
- package/apps/server/dist/chat/prompts/backend/express.js +260 -0
- package/apps/server/dist/chat/prompts/backend/express.js.map +1 -0
- package/apps/server/dist/chat/prompts/backend/fastapi.d.ts +1 -0
- package/apps/server/dist/chat/prompts/backend/fastapi.js +246 -0
- package/apps/server/dist/chat/prompts/backend/fastapi.js.map +1 -0
- package/apps/server/dist/chat/prompts/backend/index.d.ts +4 -0
- package/apps/server/dist/chat/prompts/backend/index.js +12 -0
- package/apps/server/dist/chat/prompts/backend/index.js.map +1 -0
- package/apps/server/dist/chat/prompts/backend/nestjs.d.ts +1 -0
- package/apps/server/dist/chat/prompts/backend/nestjs.js +270 -0
- package/apps/server/dist/chat/prompts/backend/nestjs.js.map +1 -0
- package/apps/server/dist/chat/prompts/frontend/expo.d.ts +1 -0
- package/apps/server/dist/chat/prompts/frontend/expo.js +208 -0
- package/apps/server/dist/chat/prompts/frontend/expo.js.map +1 -0
- package/apps/server/dist/chat/prompts/frontend/flutter.d.ts +1 -0
- package/apps/server/dist/chat/prompts/frontend/flutter.js +271 -0
- package/apps/server/dist/chat/prompts/frontend/flutter.js.map +1 -0
- package/apps/server/dist/chat/prompts/frontend/index.d.ts +4 -0
- package/apps/server/dist/chat/prompts/frontend/index.js +12 -0
- package/apps/server/dist/chat/prompts/frontend/index.js.map +1 -0
- package/apps/server/dist/chat/prompts/frontend/nextjs.d.ts +1 -0
- package/apps/server/dist/chat/prompts/frontend/nextjs.js +195 -0
- package/apps/server/dist/chat/prompts/frontend/nextjs.js.map +1 -0
- package/apps/server/dist/chat/prompts/frontend/react-native.d.ts +1 -0
- package/apps/server/dist/chat/prompts/frontend/react-native.js +224 -0
- package/apps/server/dist/chat/prompts/frontend/react-native.js.map +1 -0
- package/apps/server/dist/chat/prompts/frontend/react-vite.d.ts +1 -0
- package/apps/server/dist/chat/prompts/frontend/react-vite.js +187 -0
- package/apps/server/dist/chat/prompts/frontend/react-vite.js.map +1 -0
- package/apps/server/dist/chat/prompts/frontend/svelte.d.ts +1 -0
- package/apps/server/dist/chat/prompts/frontend/svelte.js +255 -0
- package/apps/server/dist/chat/prompts/frontend/svelte.js.map +1 -0
- package/apps/server/dist/chat/prompts/frontend/vue.d.ts +1 -0
- package/apps/server/dist/chat/prompts/frontend/vue.js +267 -0
- package/apps/server/dist/chat/prompts/frontend/vue.js.map +1 -0
- package/apps/server/dist/chat/prompts/index.d.ts +4 -0
- package/apps/server/dist/chat/prompts/index.js +20 -1
- package/apps/server/dist/chat/prompts/index.js.map +1 -1
- package/apps/server/dist/chat/prompts/prompt-builder.service.d.ts +15 -0
- package/apps/server/dist/chat/prompts/prompt-builder.service.js +177 -0
- package/apps/server/dist/chat/prompts/prompt-builder.service.js.map +1 -0
- package/apps/server/dist/chat/prompts/sections/core.d.ts +9 -0
- package/apps/server/dist/chat/prompts/sections/core.js +149 -0
- package/apps/server/dist/chat/prompts/sections/core.js.map +1 -0
- package/apps/server/dist/project/project.controller.d.ts +6 -0
- package/apps/server/dist/project/project.service.d.ts +6 -0
- package/apps/server/dist/tsconfig.tsbuildinfo +1 -1
- package/apps/server/package.json +1 -1
- package/apps/server/prisma/dev.db +0 -0
- package/apps/server/prisma/migrations/20260127071040_add_frontend_framework/migration.sql +24 -0
- package/apps/server/prisma/migrations/20260127071520_add_app_type_and_mobile/migration.sql +25 -0
- package/apps/server/prisma/schema.prisma +33 -5
- package/apps/web/.next/BUILD_ID +1 -1
- package/apps/web/.next/app-build-manifest.json +10 -8
- package/apps/web/.next/app-path-routes-manifest.json +2 -2
- package/apps/web/.next/build-manifest.json +2 -2
- package/apps/web/.next/cache/.previewinfo +1 -1
- package/apps/web/.next/cache/.rscinfo +1 -1
- package/apps/web/.next/cache/.tsbuildinfo +1 -1
- package/apps/web/.next/cache/config.json +3 -3
- package/apps/web/.next/cache/eslint/.cache_j3uhuz +1 -1
- package/apps/web/.next/cache/webpack/client-production/0.pack +0 -0
- package/apps/web/.next/cache/webpack/client-production/index.pack +0 -0
- package/apps/web/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/apps/web/.next/cache/webpack/server-production/0.pack +0 -0
- package/apps/web/.next/cache/webpack/server-production/index.pack +0 -0
- package/apps/web/.next/prerender-manifest.json +3 -3
- package/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/_not-found.html +1 -1
- package/apps/web/.next/server/app/_not-found.rsc +2 -2
- package/apps/web/.next/server/app/index.html +1 -1
- package/apps/web/.next/server/app/index.rsc +3 -3
- package/apps/web/.next/server/app/page.js +2 -2
- package/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/project/[id]/page.js +2 -2
- package/apps/web/.next/server/app/project/[id]/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/settings/page.js +1 -1
- package/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/apps/web/.next/server/app/settings.html +1 -1
- package/apps/web/.next/server/app/settings.rsc +2 -2
- package/apps/web/.next/server/app-paths-manifest.json +2 -2
- package/apps/web/.next/server/pages/404.html +1 -1
- package/apps/web/.next/server/pages/500.html +1 -1
- package/apps/web/.next/server/server-reference-manifest.json +1 -1
- package/apps/web/.next/static/chunks/18-22b1cf4231121555.js +1 -0
- package/apps/web/.next/static/chunks/700-75e1212e819e279c.js +1 -0
- package/apps/web/.next/static/chunks/app/page-6ea560755549086e.js +1 -0
- package/apps/web/.next/static/chunks/app/project/[id]/page-3e4777b355c4aec9.js +1 -0
- package/apps/web/.next/static/css/45ddb08a7b4470d5.css +3 -0
- package/apps/web/.next/trace +18 -18
- package/apps/web/package.json +1 -1
- package/apps/web/src/app/page.tsx +2 -5
- package/apps/web/src/components/project/CreateProjectModal.tsx +175 -80
- package/apps/web/src/components/project/ProjectCard.tsx +122 -31
- package/apps/web/src/stores/useProjectStore.ts +2 -1
- package/package.json +1 -1
- package/packages/shared/src/index.ts +1 -0
- package/packages/shared/src/types/project.ts +18 -3
- package/packages/shared/src/types/tech-stack.ts +74 -0
- package/apps/web/.next/static/chunks/700-a927807facd2c50d.js +0 -1
- package/apps/web/.next/static/chunks/app/page-93b78578e7896d90.js +0 -1
- package/apps/web/.next/static/chunks/app/project/[id]/page-e9304c25ba897608.js +0 -1
- package/apps/web/.next/static/css/70f2a13cf3d254d8.css +0 -3
- /package/apps/web/.next/static/{c-H9phuqk4ohtFNK0geg2 → IMWKpuHss3gLOeJ7K93sg}/_buildManifest.js +0 -0
- /package/apps/web/.next/static/{c-H9phuqk4ohtFNK0geg2 → IMWKpuHss3gLOeJ7K93sg}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NESTJS_PROMPT = void 0;
|
|
4
|
+
exports.NESTJS_PROMPT = `## Backend: NestJS + TypeScript + Prisma
|
|
5
|
+
|
|
6
|
+
You are building a NestJS backend with TypeScript and Prisma ORM.
|
|
7
|
+
|
|
8
|
+
### Technology Stack (Backend)
|
|
9
|
+
|
|
10
|
+
| Category | Technology | Notes |
|
|
11
|
+
|----------|------------|-------|
|
|
12
|
+
| Runtime | Node.js 20+ | LTS version |
|
|
13
|
+
| Framework | NestJS 10+ | Enterprise-grade |
|
|
14
|
+
| Language | TypeScript | Strict mode |
|
|
15
|
+
| ORM | Prisma | Type-safe database access |
|
|
16
|
+
| Database | SQLite (dev) / PostgreSQL (prod) | |
|
|
17
|
+
| Validation | class-validator | DTO validation |
|
|
18
|
+
|
|
19
|
+
### Project Structure
|
|
20
|
+
|
|
21
|
+
\`\`\`
|
|
22
|
+
backend/
|
|
23
|
+
├── src/
|
|
24
|
+
│ ├── main.ts # Entry point
|
|
25
|
+
│ ├── app.module.ts # Root module
|
|
26
|
+
│ ├── prisma/
|
|
27
|
+
│ │ ├── prisma.module.ts
|
|
28
|
+
│ │ └── prisma.service.ts
|
|
29
|
+
│ └── users/
|
|
30
|
+
│ ├── users.module.ts
|
|
31
|
+
│ ├── users.controller.ts
|
|
32
|
+
│ ├── users.service.ts
|
|
33
|
+
│ └── dto/
|
|
34
|
+
│ ├── create-user.dto.ts
|
|
35
|
+
│ └── update-user.dto.ts
|
|
36
|
+
├── prisma/
|
|
37
|
+
│ └── schema.prisma
|
|
38
|
+
├── package.json
|
|
39
|
+
└── tsconfig.json
|
|
40
|
+
\`\`\`
|
|
41
|
+
|
|
42
|
+
### Backend Setup
|
|
43
|
+
|
|
44
|
+
\`\`\`bash
|
|
45
|
+
cd backend
|
|
46
|
+
npm init -y
|
|
47
|
+
npm install @nestjs/core @nestjs/common @nestjs/platform-express reflect-metadata rxjs
|
|
48
|
+
npm install class-validator class-transformer
|
|
49
|
+
npm install prisma @prisma/client
|
|
50
|
+
npm install -D typescript @types/node @types/express ts-node
|
|
51
|
+
npx prisma init --datasource-provider sqlite
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
### Main Entry Point
|
|
55
|
+
|
|
56
|
+
\`\`\`typescript
|
|
57
|
+
// backend/src/main.ts
|
|
58
|
+
import { NestFactory } from '@nestjs/core';
|
|
59
|
+
import { ValidationPipe } from '@nestjs/common';
|
|
60
|
+
import { AppModule } from './app.module';
|
|
61
|
+
|
|
62
|
+
async function bootstrap() {
|
|
63
|
+
const app = await NestFactory.create(AppModule);
|
|
64
|
+
|
|
65
|
+
app.enableCors({
|
|
66
|
+
origin: 'http://localhost:3000',
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
app.setGlobalPrefix('api');
|
|
70
|
+
app.useGlobalPipes(new ValidationPipe({ transform: true }));
|
|
71
|
+
|
|
72
|
+
await app.listen(3001);
|
|
73
|
+
console.log('Server running on http://localhost:3001');
|
|
74
|
+
}
|
|
75
|
+
bootstrap();
|
|
76
|
+
\`\`\`
|
|
77
|
+
|
|
78
|
+
### App Module
|
|
79
|
+
|
|
80
|
+
\`\`\`typescript
|
|
81
|
+
// backend/src/app.module.ts
|
|
82
|
+
import { Module } from '@nestjs/common';
|
|
83
|
+
import { PrismaModule } from './prisma/prisma.module';
|
|
84
|
+
import { UsersModule } from './users/users.module';
|
|
85
|
+
|
|
86
|
+
@Module({
|
|
87
|
+
imports: [PrismaModule, UsersModule],
|
|
88
|
+
})
|
|
89
|
+
export class AppModule {}
|
|
90
|
+
\`\`\`
|
|
91
|
+
|
|
92
|
+
### Prisma Service
|
|
93
|
+
|
|
94
|
+
\`\`\`typescript
|
|
95
|
+
// backend/src/prisma/prisma.service.ts
|
|
96
|
+
import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common';
|
|
97
|
+
import { PrismaClient } from '@prisma/client';
|
|
98
|
+
|
|
99
|
+
@Injectable()
|
|
100
|
+
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
|
|
101
|
+
async onModuleInit() {
|
|
102
|
+
await this.$connect();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async onModuleDestroy() {
|
|
106
|
+
await this.$disconnect();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
\`\`\`
|
|
110
|
+
|
|
111
|
+
\`\`\`typescript
|
|
112
|
+
// backend/src/prisma/prisma.module.ts
|
|
113
|
+
import { Module, Global } from '@nestjs/common';
|
|
114
|
+
import { PrismaService } from './prisma.service';
|
|
115
|
+
|
|
116
|
+
@Global()
|
|
117
|
+
@Module({
|
|
118
|
+
providers: [PrismaService],
|
|
119
|
+
exports: [PrismaService],
|
|
120
|
+
})
|
|
121
|
+
export class PrismaModule {}
|
|
122
|
+
\`\`\`
|
|
123
|
+
|
|
124
|
+
### DTOs with Validation
|
|
125
|
+
|
|
126
|
+
\`\`\`typescript
|
|
127
|
+
// backend/src/users/dto/create-user.dto.ts
|
|
128
|
+
import { IsString, IsEmail, MinLength } from 'class-validator';
|
|
129
|
+
|
|
130
|
+
export class CreateUserDto {
|
|
131
|
+
@IsString()
|
|
132
|
+
@MinLength(1)
|
|
133
|
+
name: string;
|
|
134
|
+
|
|
135
|
+
@IsEmail()
|
|
136
|
+
email: string;
|
|
137
|
+
}
|
|
138
|
+
\`\`\`
|
|
139
|
+
|
|
140
|
+
\`\`\`typescript
|
|
141
|
+
// backend/src/users/dto/update-user.dto.ts
|
|
142
|
+
import { PartialType } from '@nestjs/common';
|
|
143
|
+
import { CreateUserDto } from './create-user.dto';
|
|
144
|
+
|
|
145
|
+
export class UpdateUserDto extends PartialType(CreateUserDto) {}
|
|
146
|
+
\`\`\`
|
|
147
|
+
|
|
148
|
+
### Service
|
|
149
|
+
|
|
150
|
+
\`\`\`typescript
|
|
151
|
+
// backend/src/users/users.service.ts
|
|
152
|
+
import { Injectable, NotFoundException } from '@nestjs/common';
|
|
153
|
+
import { PrismaService } from '../prisma/prisma.service';
|
|
154
|
+
import { CreateUserDto } from './dto/create-user.dto';
|
|
155
|
+
import { UpdateUserDto } from './dto/update-user.dto';
|
|
156
|
+
|
|
157
|
+
@Injectable()
|
|
158
|
+
export class UsersService {
|
|
159
|
+
constructor(private prisma: PrismaService) {}
|
|
160
|
+
|
|
161
|
+
async findAll() {
|
|
162
|
+
return this.prisma.user.findMany();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async findOne(id: number) {
|
|
166
|
+
const user = await this.prisma.user.findUnique({ where: { id } });
|
|
167
|
+
if (!user) {
|
|
168
|
+
throw new NotFoundException(\`User #\${id} not found\`);
|
|
169
|
+
}
|
|
170
|
+
return user;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async create(createUserDto: CreateUserDto) {
|
|
174
|
+
return this.prisma.user.create({ data: createUserDto });
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async update(id: number, updateUserDto: UpdateUserDto) {
|
|
178
|
+
await this.findOne(id); // Check existence
|
|
179
|
+
return this.prisma.user.update({
|
|
180
|
+
where: { id },
|
|
181
|
+
data: updateUserDto,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async remove(id: number) {
|
|
186
|
+
await this.findOne(id); // Check existence
|
|
187
|
+
return this.prisma.user.delete({ where: { id } });
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
\`\`\`
|
|
191
|
+
|
|
192
|
+
### Controller
|
|
193
|
+
|
|
194
|
+
\`\`\`typescript
|
|
195
|
+
// backend/src/users/users.controller.ts
|
|
196
|
+
import {
|
|
197
|
+
Controller,
|
|
198
|
+
Get,
|
|
199
|
+
Post,
|
|
200
|
+
Put,
|
|
201
|
+
Delete,
|
|
202
|
+
Body,
|
|
203
|
+
Param,
|
|
204
|
+
ParseIntPipe,
|
|
205
|
+
HttpCode,
|
|
206
|
+
HttpStatus,
|
|
207
|
+
} from '@nestjs/common';
|
|
208
|
+
import { UsersService } from './users.service';
|
|
209
|
+
import { CreateUserDto } from './dto/create-user.dto';
|
|
210
|
+
import { UpdateUserDto } from './dto/update-user.dto';
|
|
211
|
+
|
|
212
|
+
@Controller('users')
|
|
213
|
+
export class UsersController {
|
|
214
|
+
constructor(private readonly usersService: UsersService) {}
|
|
215
|
+
|
|
216
|
+
@Get()
|
|
217
|
+
findAll() {
|
|
218
|
+
return this.usersService.findAll();
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@Get(':id')
|
|
222
|
+
findOne(@Param('id', ParseIntPipe) id: number) {
|
|
223
|
+
return this.usersService.findOne(id);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
@Post()
|
|
227
|
+
@HttpCode(HttpStatus.CREATED)
|
|
228
|
+
create(@Body() createUserDto: CreateUserDto) {
|
|
229
|
+
return this.usersService.create(createUserDto);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
@Put(':id')
|
|
233
|
+
update(
|
|
234
|
+
@Param('id', ParseIntPipe) id: number,
|
|
235
|
+
@Body() updateUserDto: UpdateUserDto,
|
|
236
|
+
) {
|
|
237
|
+
return this.usersService.update(id, updateUserDto);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@Delete(':id')
|
|
241
|
+
@HttpCode(HttpStatus.NO_CONTENT)
|
|
242
|
+
remove(@Param('id', ParseIntPipe) id: number) {
|
|
243
|
+
return this.usersService.remove(id);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
\`\`\`
|
|
247
|
+
|
|
248
|
+
### Module
|
|
249
|
+
|
|
250
|
+
\`\`\`typescript
|
|
251
|
+
// backend/src/users/users.module.ts
|
|
252
|
+
import { Module } from '@nestjs/common';
|
|
253
|
+
import { UsersController } from './users.controller';
|
|
254
|
+
import { UsersService } from './users.service';
|
|
255
|
+
|
|
256
|
+
@Module({
|
|
257
|
+
controllers: [UsersController],
|
|
258
|
+
providers: [UsersService],
|
|
259
|
+
})
|
|
260
|
+
export class UsersModule {}
|
|
261
|
+
\`\`\`
|
|
262
|
+
|
|
263
|
+
### API Design Guidelines
|
|
264
|
+
|
|
265
|
+
- **Decorators for everything**: @Controller, @Get, @Post, etc.
|
|
266
|
+
- **DTOs for validation**: Use class-validator decorators
|
|
267
|
+
- **Dependency Injection**: Inject services via constructor
|
|
268
|
+
- **Exception filters**: Use built-in exceptions (NotFoundException, etc.)
|
|
269
|
+
- **Pipes for transformation**: ParseIntPipe, ValidationPipe`;
|
|
270
|
+
//# sourceMappingURL=nestjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nestjs.js","sourceRoot":"","sources":["../../../../src/chat/prompts/backend/nestjs.ts"],"names":[],"mappings":";;;AAMa,QAAA,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6DAyQgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const EXPO_PROMPT = "## Expo (React Native) Development Guide\n\n### Project Structure\n\n```\nfrontend/\n\u251C\u2500\u2500 app/ # Expo Router pages (file-based routing)\n\u2502 \u251C\u2500\u2500 _layout.tsx # Root layout\n\u2502 \u251C\u2500\u2500 index.tsx # Home screen\n\u2502 \u251C\u2500\u2500 (tabs)/ # Tab navigation group\n\u2502 \u2502 \u251C\u2500\u2500 _layout.tsx # Tab layout\n\u2502 \u2502 \u251C\u2500\u2500 home.tsx\n\u2502 \u2502 \u2514\u2500\u2500 profile.tsx\n\u2502 \u2514\u2500\u2500 [id].tsx # Dynamic route\n\u251C\u2500\u2500 components/ # Reusable components\n\u2502 \u251C\u2500\u2500 ui/ # Basic UI components\n\u2502 \u2514\u2500\u2500 features/ # Feature-specific components\n\u251C\u2500\u2500 constants/ # App constants (colors, etc.)\n\u251C\u2500\u2500 hooks/ # Custom hooks\n\u251C\u2500\u2500 lib/ # Utilities\n\u251C\u2500\u2500 assets/ # Images, fonts\n\u251C\u2500\u2500 app.json # Expo config\n\u251C\u2500\u2500 package.json\n\u2514\u2500\u2500 tsconfig.json\n```\n\n### Essential Dependencies\n\n```json\n{\n \"dependencies\": {\n \"expo\": \"~52.0.0\",\n \"expo-router\": \"~4.0.0\",\n \"expo-status-bar\": \"~2.0.0\",\n \"react\": \"18.3.1\",\n \"react-native\": \"0.76.0\",\n \"react-native-safe-area-context\": \"4.12.0\",\n \"react-native-screens\": \"~4.0.0\",\n \"react-native-reanimated\": \"~3.16.0\",\n \"react-native-gesture-handler\": \"~2.20.0\",\n \"@expo/vector-icons\": \"^14.0.0\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.25.0\",\n \"@types/react\": \"~18.3.0\",\n \"typescript\": \"~5.3.0\"\n }\n}\n```\n\n### Navigation with Expo Router\n\n**Root Layout (_layout.tsx)**:\n```tsx\nimport { Stack } from \"expo-router\";\nimport { StatusBar } from \"expo-status-bar\";\n\nexport default function RootLayout() {\n return (\n <>\n <StatusBar style=\"auto\" />\n <Stack>\n <Stack.Screen name=\"index\" options={{ headerShown: false }} />\n <Stack.Screen name=\"(tabs)\" options={{ headerShown: false }} />\n </Stack>\n </>\n );\n}\n```\n\n**Tab Layout**:\n```tsx\nimport { Tabs } from \"expo-router\";\nimport { Ionicons } from \"@expo/vector-icons\";\n\nexport default function TabLayout() {\n return (\n <Tabs screenOptions={{ tabBarActiveTintColor: \"#007AFF\" }}>\n <Tabs.Screen\n name=\"home\"\n options={{\n title: \"Home\",\n tabBarIcon: ({ color, size }) => (\n <Ionicons name=\"home\" size={size} color={color} />\n ),\n }}\n />\n </Tabs>\n );\n}\n```\n\n### Styling Approach\n\nUse StyleSheet for performance:\n```tsx\nimport { StyleSheet, View, Text } from \"react-native\";\n\nexport function Card({ title, children }) {\n return (\n <View style={styles.card}>\n <Text style={styles.title}>{title}</Text>\n {children}\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n card: {\n backgroundColor: \"#fff\",\n borderRadius: 12,\n padding: 16,\n shadowColor: \"#000\",\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.1,\n shadowRadius: 4,\n elevation: 3,\n },\n title: {\n fontSize: 18,\n fontWeight: \"600\",\n marginBottom: 8,\n },\n});\n```\n\n### API Communication\n\n```tsx\n// lib/api.ts\nconst API_URL = process.env.EXPO_PUBLIC_API_URL || \"http://localhost:3001\";\n\nexport async function fetcher<T>(endpoint: string, options?: RequestInit): Promise<T> {\n const response = await fetch(`${API_URL}${endpoint}`, {\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.headers,\n },\n ...options,\n });\n\n if (!response.ok) {\n throw new Error(`API Error: ${response.status}`);\n }\n\n return response.json();\n}\n```\n\n### State Management\n\nUse React Context or Zustand:\n```tsx\n// stores/useAuthStore.ts\nimport { create } from \"zustand\";\n\ninterface AuthState {\n user: User | null;\n setUser: (user: User | null) => void;\n}\n\nexport const useAuthStore = create<AuthState>((set) => ({\n user: null,\n setUser: (user) => set({ user }),\n}));\n```\n\n### Critical Rules\n\n1. **Always use SafeAreaView** for screen components\n2. **Test on both iOS and Android** - use platform-specific code when needed\n3. **Handle keyboard** with KeyboardAvoidingView for forms\n4. **Use FlatList** for long lists (not ScrollView with map)\n5. **Optimize images** with expo-image or cached images\n6. **Handle loading states** - mobile users expect feedback\n\n### Platform-Specific Code\n\n```tsx\nimport { Platform, StyleSheet } from \"react-native\";\n\nconst styles = StyleSheet.create({\n container: {\n paddingTop: Platform.OS === \"ios\" ? 20 : 0,\n ...Platform.select({\n ios: { shadowColor: \"#000\" },\n android: { elevation: 4 },\n }),\n },\n});\n```\n\n### Package Scripts\n\n```json\n{\n \"scripts\": {\n \"dev\": \"expo start\",\n \"android\": \"expo start --android\",\n \"ios\": \"expo start --ios\",\n \"web\": \"expo start --web\"\n }\n}\n```";
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EXPO_PROMPT = void 0;
|
|
4
|
+
exports.EXPO_PROMPT = `## Expo (React Native) Development Guide
|
|
5
|
+
|
|
6
|
+
### Project Structure
|
|
7
|
+
|
|
8
|
+
\`\`\`
|
|
9
|
+
frontend/
|
|
10
|
+
├── app/ # Expo Router pages (file-based routing)
|
|
11
|
+
│ ├── _layout.tsx # Root layout
|
|
12
|
+
│ ├── index.tsx # Home screen
|
|
13
|
+
│ ├── (tabs)/ # Tab navigation group
|
|
14
|
+
│ │ ├── _layout.tsx # Tab layout
|
|
15
|
+
│ │ ├── home.tsx
|
|
16
|
+
│ │ └── profile.tsx
|
|
17
|
+
│ └── [id].tsx # Dynamic route
|
|
18
|
+
├── components/ # Reusable components
|
|
19
|
+
│ ├── ui/ # Basic UI components
|
|
20
|
+
│ └── features/ # Feature-specific components
|
|
21
|
+
├── constants/ # App constants (colors, etc.)
|
|
22
|
+
├── hooks/ # Custom hooks
|
|
23
|
+
├── lib/ # Utilities
|
|
24
|
+
├── assets/ # Images, fonts
|
|
25
|
+
├── app.json # Expo config
|
|
26
|
+
├── package.json
|
|
27
|
+
└── tsconfig.json
|
|
28
|
+
\`\`\`
|
|
29
|
+
|
|
30
|
+
### Essential Dependencies
|
|
31
|
+
|
|
32
|
+
\`\`\`json
|
|
33
|
+
{
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"expo": "~52.0.0",
|
|
36
|
+
"expo-router": "~4.0.0",
|
|
37
|
+
"expo-status-bar": "~2.0.0",
|
|
38
|
+
"react": "18.3.1",
|
|
39
|
+
"react-native": "0.76.0",
|
|
40
|
+
"react-native-safe-area-context": "4.12.0",
|
|
41
|
+
"react-native-screens": "~4.0.0",
|
|
42
|
+
"react-native-reanimated": "~3.16.0",
|
|
43
|
+
"react-native-gesture-handler": "~2.20.0",
|
|
44
|
+
"@expo/vector-icons": "^14.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@babel/core": "^7.25.0",
|
|
48
|
+
"@types/react": "~18.3.0",
|
|
49
|
+
"typescript": "~5.3.0"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
\`\`\`
|
|
53
|
+
|
|
54
|
+
### Navigation with Expo Router
|
|
55
|
+
|
|
56
|
+
**Root Layout (_layout.tsx)**:
|
|
57
|
+
\`\`\`tsx
|
|
58
|
+
import { Stack } from "expo-router";
|
|
59
|
+
import { StatusBar } from "expo-status-bar";
|
|
60
|
+
|
|
61
|
+
export default function RootLayout() {
|
|
62
|
+
return (
|
|
63
|
+
<>
|
|
64
|
+
<StatusBar style="auto" />
|
|
65
|
+
<Stack>
|
|
66
|
+
<Stack.Screen name="index" options={{ headerShown: false }} />
|
|
67
|
+
<Stack.Screen name="(tabs)" options={{ headerShown: false }} />
|
|
68
|
+
</Stack>
|
|
69
|
+
</>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
\`\`\`
|
|
73
|
+
|
|
74
|
+
**Tab Layout**:
|
|
75
|
+
\`\`\`tsx
|
|
76
|
+
import { Tabs } from "expo-router";
|
|
77
|
+
import { Ionicons } from "@expo/vector-icons";
|
|
78
|
+
|
|
79
|
+
export default function TabLayout() {
|
|
80
|
+
return (
|
|
81
|
+
<Tabs screenOptions={{ tabBarActiveTintColor: "#007AFF" }}>
|
|
82
|
+
<Tabs.Screen
|
|
83
|
+
name="home"
|
|
84
|
+
options={{
|
|
85
|
+
title: "Home",
|
|
86
|
+
tabBarIcon: ({ color, size }) => (
|
|
87
|
+
<Ionicons name="home" size={size} color={color} />
|
|
88
|
+
),
|
|
89
|
+
}}
|
|
90
|
+
/>
|
|
91
|
+
</Tabs>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
\`\`\`
|
|
95
|
+
|
|
96
|
+
### Styling Approach
|
|
97
|
+
|
|
98
|
+
Use StyleSheet for performance:
|
|
99
|
+
\`\`\`tsx
|
|
100
|
+
import { StyleSheet, View, Text } from "react-native";
|
|
101
|
+
|
|
102
|
+
export function Card({ title, children }) {
|
|
103
|
+
return (
|
|
104
|
+
<View style={styles.card}>
|
|
105
|
+
<Text style={styles.title}>{title}</Text>
|
|
106
|
+
{children}
|
|
107
|
+
</View>
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const styles = StyleSheet.create({
|
|
112
|
+
card: {
|
|
113
|
+
backgroundColor: "#fff",
|
|
114
|
+
borderRadius: 12,
|
|
115
|
+
padding: 16,
|
|
116
|
+
shadowColor: "#000",
|
|
117
|
+
shadowOffset: { width: 0, height: 2 },
|
|
118
|
+
shadowOpacity: 0.1,
|
|
119
|
+
shadowRadius: 4,
|
|
120
|
+
elevation: 3,
|
|
121
|
+
},
|
|
122
|
+
title: {
|
|
123
|
+
fontSize: 18,
|
|
124
|
+
fontWeight: "600",
|
|
125
|
+
marginBottom: 8,
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
\`\`\`
|
|
129
|
+
|
|
130
|
+
### API Communication
|
|
131
|
+
|
|
132
|
+
\`\`\`tsx
|
|
133
|
+
// lib/api.ts
|
|
134
|
+
const API_URL = process.env.EXPO_PUBLIC_API_URL || "http://localhost:3001";
|
|
135
|
+
|
|
136
|
+
export async function fetcher<T>(endpoint: string, options?: RequestInit): Promise<T> {
|
|
137
|
+
const response = await fetch(\`\${API_URL}\${endpoint}\`, {
|
|
138
|
+
headers: {
|
|
139
|
+
"Content-Type": "application/json",
|
|
140
|
+
...options?.headers,
|
|
141
|
+
},
|
|
142
|
+
...options,
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
if (!response.ok) {
|
|
146
|
+
throw new Error(\`API Error: \${response.status}\`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return response.json();
|
|
150
|
+
}
|
|
151
|
+
\`\`\`
|
|
152
|
+
|
|
153
|
+
### State Management
|
|
154
|
+
|
|
155
|
+
Use React Context or Zustand:
|
|
156
|
+
\`\`\`tsx
|
|
157
|
+
// stores/useAuthStore.ts
|
|
158
|
+
import { create } from "zustand";
|
|
159
|
+
|
|
160
|
+
interface AuthState {
|
|
161
|
+
user: User | null;
|
|
162
|
+
setUser: (user: User | null) => void;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export const useAuthStore = create<AuthState>((set) => ({
|
|
166
|
+
user: null,
|
|
167
|
+
setUser: (user) => set({ user }),
|
|
168
|
+
}));
|
|
169
|
+
\`\`\`
|
|
170
|
+
|
|
171
|
+
### Critical Rules
|
|
172
|
+
|
|
173
|
+
1. **Always use SafeAreaView** for screen components
|
|
174
|
+
2. **Test on both iOS and Android** - use platform-specific code when needed
|
|
175
|
+
3. **Handle keyboard** with KeyboardAvoidingView for forms
|
|
176
|
+
4. **Use FlatList** for long lists (not ScrollView with map)
|
|
177
|
+
5. **Optimize images** with expo-image or cached images
|
|
178
|
+
6. **Handle loading states** - mobile users expect feedback
|
|
179
|
+
|
|
180
|
+
### Platform-Specific Code
|
|
181
|
+
|
|
182
|
+
\`\`\`tsx
|
|
183
|
+
import { Platform, StyleSheet } from "react-native";
|
|
184
|
+
|
|
185
|
+
const styles = StyleSheet.create({
|
|
186
|
+
container: {
|
|
187
|
+
paddingTop: Platform.OS === "ios" ? 20 : 0,
|
|
188
|
+
...Platform.select({
|
|
189
|
+
ios: { shadowColor: "#000" },
|
|
190
|
+
android: { elevation: 4 },
|
|
191
|
+
}),
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
\`\`\`
|
|
195
|
+
|
|
196
|
+
### Package Scripts
|
|
197
|
+
|
|
198
|
+
\`\`\`json
|
|
199
|
+
{
|
|
200
|
+
"scripts": {
|
|
201
|
+
"dev": "expo start",
|
|
202
|
+
"android": "expo start --android",
|
|
203
|
+
"ios": "expo start --ios",
|
|
204
|
+
"web": "expo start --web"
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
\`\`\``;
|
|
208
|
+
//# sourceMappingURL=expo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expo.js","sourceRoot":"","sources":["../../../../src/chat/prompts/frontend/expo.ts"],"names":[],"mappings":";;;AAIa,QAAA,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2MpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const FLUTTER_PROMPT = "## Flutter Development Guide\n\n### Project Structure\n\n```\nfrontend/\n\u251C\u2500\u2500 lib/\n\u2502 \u251C\u2500\u2500 main.dart # Entry point\n\u2502 \u251C\u2500\u2500 app.dart # App widget with routing\n\u2502 \u251C\u2500\u2500 screens/ # Screen widgets\n\u2502 \u2502 \u251C\u2500\u2500 home_screen.dart\n\u2502 \u2502 \u2514\u2500\u2500 profile_screen.dart\n\u2502 \u251C\u2500\u2500 widgets/ # Reusable widgets\n\u2502 \u2502 \u251C\u2500\u2500 common/ # Generic widgets\n\u2502 \u2502 \u2514\u2500\u2500 features/ # Feature-specific widgets\n\u2502 \u251C\u2500\u2500 models/ # Data models\n\u2502 \u251C\u2500\u2500 services/ # API, storage services\n\u2502 \u251C\u2500\u2500 providers/ # State management\n\u2502 \u251C\u2500\u2500 utils/ # Utilities\n\u2502 \u2514\u2500\u2500 constants/ # App constants\n\u251C\u2500\u2500 assets/ # Images, fonts\n\u251C\u2500\u2500 android/ # Android config\n\u251C\u2500\u2500 ios/ # iOS config\n\u251C\u2500\u2500 pubspec.yaml # Dependencies\n\u2514\u2500\u2500 analysis_options.yaml # Lint rules\n```\n\n### Essential Dependencies (pubspec.yaml)\n\n```yaml\ndependencies:\n flutter:\n sdk: flutter\n go_router: ^14.0.0 # Navigation\n provider: ^6.1.0 # State management\n dio: ^5.4.0 # HTTP client\n flutter_riverpod: ^2.5.0 # Alternative state management\n freezed_annotation: ^2.4.0 # Immutable models\n json_annotation: ^4.8.0 # JSON serialization\n\ndev_dependencies:\n flutter_test:\n sdk: flutter\n flutter_lints: ^4.0.0\n build_runner: ^2.4.0\n freezed: ^2.4.0\n json_serializable: ^6.7.0\n```\n\n### App Entry Point\n\n```dart\n// lib/main.dart\nimport 'package:flutter/material.dart';\nimport 'package:provider/provider.dart';\nimport 'app.dart';\nimport 'providers/auth_provider.dart';\n\nvoid main() {\n runApp(\n MultiProvider(\n providers: [\n ChangeNotifierProvider(create: (_) => AuthProvider()),\n ],\n child: const MyApp(),\n ),\n );\n}\n```\n\n### Navigation with go_router\n\n```dart\n// lib/app.dart\nimport 'package:flutter/material.dart';\nimport 'package:go_router/go_router.dart';\n\nfinal _router = GoRouter(\n initialLocation: '/',\n routes: [\n GoRoute(\n path: '/',\n builder: (context, state) => const HomeScreen(),\n ),\n GoRoute(\n path: '/profile/:id',\n builder: (context, state) {\n final id = state.pathParameters['id']!;\n return ProfileScreen(userId: id);\n },\n ),\n ],\n);\n\nclass MyApp extends StatelessWidget {\n const MyApp({super.key});\n\n @override\n Widget build(BuildContext context) {\n return MaterialApp.router(\n title: 'My App',\n theme: ThemeData(\n colorScheme: ColorScheme.fromSeed(seedColor: Colors.blue),\n useMaterial3: true,\n ),\n routerConfig: _router,\n );\n }\n}\n```\n\n### Screen Widget Pattern\n\n```dart\n// lib/screens/home_screen.dart\nimport 'package:flutter/material.dart';\nimport 'package:go_router/go_router.dart';\n\nclass HomeScreen extends StatefulWidget {\n const HomeScreen({super.key});\n\n @override\n State<HomeScreen> createState() => _HomeScreenState();\n}\n\nclass _HomeScreenState extends State<HomeScreen> {\n List<Item> _items = [];\n bool _isLoading = true;\n\n @override\n void initState() {\n super.initState();\n _loadItems();\n }\n\n Future<void> _loadItems() async {\n try {\n final items = await ApiService.getItems();\n setState(() {\n _items = items;\n _isLoading = false;\n });\n } catch (e) {\n setState(() => _isLoading = false);\n // Handle error\n }\n }\n\n @override\n Widget build(BuildContext context) {\n return Scaffold(\n appBar: AppBar(title: const Text('Home')),\n body: _isLoading\n ? const Center(child: CircularProgressIndicator())\n : ListView.builder(\n itemCount: _items.length,\n itemBuilder: (context, index) {\n final item = _items[index];\n return ListTile(\n title: Text(item.name),\n onTap: () => context.go('/details/${item.id}'),\n );\n },\n ),\n );\n }\n}\n```\n\n### Data Models with Freezed\n\n```dart\n// lib/models/user.dart\nimport 'package:freezed_annotation/freezed_annotation.dart';\n\npart 'user.freezed.dart';\npart 'user.g.dart';\n\n@freezed\nclass User with _$User {\n const factory User({\n required String id,\n required String name,\n required String email,\n }) = _User;\n\n factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);\n}\n```\n\n### API Service with Dio\n\n```dart\n// lib/services/api_service.dart\nimport 'package:dio/dio.dart';\n\nclass ApiService {\n static final _dio = Dio(BaseOptions(\n baseUrl: const String.fromEnvironment('API_URL', defaultValue: 'http://localhost:3001'),\n connectTimeout: const Duration(seconds: 10),\n receiveTimeout: const Duration(seconds: 10),\n ));\n\n static Future<List<Item>> getItems() async {\n final response = await _dio.get('/items');\n return (response.data as List)\n .map((json) => Item.fromJson(json))\n .toList();\n }\n\n static Future<Item> createItem(CreateItemInput input) async {\n final response = await _dio.post('/items', data: input.toJson());\n return Item.fromJson(response.data);\n }\n}\n```\n\n### State Management with Provider\n\n```dart\n// lib/providers/auth_provider.dart\nimport 'package:flutter/material.dart';\nimport '../models/user.dart';\n\nclass AuthProvider extends ChangeNotifier {\n User? _user;\n\n User? get user => _user;\n bool get isLoggedIn => _user != null;\n\n void setUser(User user) {\n _user = user;\n notifyListeners();\n }\n\n void logout() {\n _user = null;\n notifyListeners();\n }\n}\n```\n\n### Critical Rules\n\n1. **Use const constructors** for performance optimization\n2. **Separate business logic** from UI (use services/providers)\n3. **Use StatelessWidget** when no local state is needed\n4. **Run build_runner** after changing Freezed models: `dart run build_runner build`\n5. **Test on both iOS and Android** - platform-specific issues are common\n6. **Handle async errors** with try-catch and show user feedback\n\n### Package Scripts\n\nAdd these to your workflow:\n```bash\n# Run app\nflutter run\n\n# Build runner for code generation\ndart run build_runner build --delete-conflicting-outputs\n\n# Analyze code\nflutter analyze\n\n# Run tests\nflutter test\n```";
|