create-einja-app 0.1.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/README.md +307 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1041 -0
- package/dist/cli.js.map +1 -0
- package/package.json +62 -0
- package/templates/turborepo-pandacss/.biomeignore +15 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/biome-format.sh +49 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/design-doc-check.sh +61 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/detect-secrets.sh +62 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/large-file-warning.sh +42 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/playwright-resize.sh +36 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/typecheck.sh +37 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/unset-volta-recursion.sh +32 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/validate-git-commit.sh +239 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/warn-index-ts.sh +34 -0
- package/templates/turborepo-pandacss/.claude/hooks/einja/warn-relative-import.sh +48 -0
- package/templates/turborepo-pandacss/.claude/settings.json +174 -0
- package/templates/turborepo-pandacss/.claude/skills/create-einja-app-release/SKILL.md +186 -0
- package/templates/turborepo-pandacss/.claude/skills/dev-cli-release/SKILL.md +173 -0
- package/templates/turborepo-pandacss/.cursor/commands/spec-create.md +227 -0
- package/templates/turborepo-pandacss/.cursor/commands/start-dev.md +98 -0
- package/templates/turborepo-pandacss/.cursor/commands/task-exec.md +287 -0
- package/templates/turborepo-pandacss/.cursor/commands/task-vibe-kanban-loop.md +532 -0
- package/templates/turborepo-pandacss/.cursor/commands/update-docs-by-task-specs.md +448 -0
- package/templates/turborepo-pandacss/.cursor/mcp.json +45 -0
- package/templates/turborepo-pandacss/.cursor/rules/api-rules.mdc +171 -0
- package/templates/turborepo-pandacss/.cursor/rules/api-test-rules.mdc +181 -0
- package/templates/turborepo-pandacss/.cursor/rules/base-code.mdc +70 -0
- package/templates/turborepo-pandacss/.cursor/rules/base-commit-rules.mdc +174 -0
- package/templates/turborepo-pandacss/.cursor/rules/base-design.mdc +12 -0
- package/templates/turborepo-pandacss/.cursor/rules/base-rules.mdc +231 -0
- package/templates/turborepo-pandacss/.cursor/rules/error-handling-rules.mdc +188 -0
- package/templates/turborepo-pandacss/.cursor/rules/refactor-rules.mdc +93 -0
- package/templates/turborepo-pandacss/.dockerignore +126 -0
- package/templates/turborepo-pandacss/.einja-sync.json +35 -0
- package/templates/turborepo-pandacss/.env.ci +25 -0
- package/templates/turborepo-pandacss/.env.example +35 -0
- package/templates/turborepo-pandacss/.env.personal.example +27 -0
- package/templates/turborepo-pandacss/.envrc +4 -0
- package/templates/turborepo-pandacss/.gitattributes +5 -0
- package/templates/turborepo-pandacss/.husky/pre-commit +1 -0
- package/templates/turborepo-pandacss/.lintstagedrc.js +24 -0
- package/templates/turborepo-pandacss/.mcp.json +45 -0
- package/templates/turborepo-pandacss/.node-version +1 -0
- package/templates/turborepo-pandacss/.templateignore +60 -0
- package/templates/turborepo-pandacss/.vscode/extensions.json +3 -0
- package/templates/turborepo-pandacss/CLAUDE.md +415 -0
- package/templates/turborepo-pandacss/README.md +322 -0
- package/templates/turborepo-pandacss/apps/web/middleware.ts +28 -0
- package/templates/turborepo-pandacss/apps/web/next.config.ts +10 -0
- package/templates/turborepo-pandacss/apps/web/package.json +80 -0
- package/templates/turborepo-pandacss/apps/web/panda.config.ts +114 -0
- package/templates/turborepo-pandacss/apps/web/postcss.config.cjs +6 -0
- package/templates/turborepo-pandacss/apps/web/public/file.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/public/globe.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/public/next.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/public/vercel.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/public/window.svg +1 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/dashboard/page.tsx +79 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/data/_components/UserTable.tsx +203 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/data/page.tsx +57 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/layout-client.tsx +31 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/layout.tsx +17 -0
- package/templates/turborepo-pandacss/apps/web/src/app/(authenticated)/profile/page.tsx +59 -0
- package/templates/turborepo-pandacss/apps/web/src/app/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/turborepo-pandacss/apps/web/src/app/api/auth/signup/route.ts +70 -0
- package/templates/turborepo-pandacss/apps/web/src/app/error.tsx +106 -0
- package/templates/turborepo-pandacss/apps/web/src/app/favicon.ico +0 -0
- package/templates/turborepo-pandacss/apps/web/src/app/global-error.tsx +110 -0
- package/templates/turborepo-pandacss/apps/web/src/app/globals.css +121 -0
- package/templates/turborepo-pandacss/apps/web/src/app/layout.tsx +28 -0
- package/templates/turborepo-pandacss/apps/web/src/app/not-found.tsx +54 -0
- package/templates/turborepo-pandacss/apps/web/src/app/page.module.css +165 -0
- package/templates/turborepo-pandacss/apps/web/src/app/page.test.tsx +52 -0
- package/templates/turborepo-pandacss/apps/web/src/app/page.tsx +284 -0
- package/templates/turborepo-pandacss/apps/web/src/app/signin/page.tsx +296 -0
- package/templates/turborepo-pandacss/apps/web/src/app/signup/page.tsx +395 -0
- package/templates/turborepo-pandacss/apps/web/src/application/use-cases/UserUseCases.test.ts +229 -0
- package/templates/turborepo-pandacss/apps/web/src/application/use-cases/UserUseCases.ts +115 -0
- package/templates/turborepo-pandacss/apps/web/src/components/auth/login-button.tsx +35 -0
- package/templates/turborepo-pandacss/apps/web/src/components/auth/logout-button.tsx +24 -0
- package/templates/turborepo-pandacss/apps/web/src/components/auth/user-avatar.test.tsx +68 -0
- package/templates/turborepo-pandacss/apps/web/src/components/auth/user-avatar.tsx +43 -0
- package/templates/turborepo-pandacss/apps/web/src/components/dashboard/dashboard-stats.tsx +128 -0
- package/templates/turborepo-pandacss/apps/web/src/components/providers/query-provider.tsx +30 -0
- package/templates/turborepo-pandacss/apps/web/src/components/providers/session-provider.tsx +12 -0
- package/templates/turborepo-pandacss/apps/web/src/components/shared/Sidebar.tsx +175 -0
- package/templates/turborepo-pandacss/apps/web/src/components/shared/header.tsx +166 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/accordion.tsx +64 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/alert-dialog.tsx +135 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/alert.tsx +60 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/aspect-ratio.tsx +9 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/avatar.tsx +41 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/badge.tsx +39 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/breadcrumb.tsx +101 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/button.tsx +56 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/card.tsx +75 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/checkbox.tsx +29 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/data-table.tsx +189 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/dialog-hook.tsx +210 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/dialog.tsx +129 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/drawer.tsx +124 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/dropdown-menu.tsx +228 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/form.tsx +152 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/hover-card.tsx +38 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/input.tsx +21 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/label.tsx +21 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/pagination.tsx +105 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/popover.tsx +42 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/progress.tsx +28 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/select.tsx +170 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/separator.tsx +28 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/skeleton.tsx +13 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/sonner.tsx +25 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/table.tsx +92 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/tabs.tsx +54 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/textarea.tsx +18 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/tooltip.tsx +57 -0
- package/templates/turborepo-pandacss/apps/web/src/components/ui/typography.tsx +158 -0
- package/templates/turborepo-pandacss/apps/web/src/lib/auth/guard.ts +36 -0
- package/templates/turborepo-pandacss/apps/web/src/lib/auth/index.ts +22 -0
- package/templates/turborepo-pandacss/apps/web/src/lib/prisma.ts +3 -0
- package/templates/turborepo-pandacss/apps/web/src/lib/utils.ts +6 -0
- package/templates/turborepo-pandacss/apps/web/test/globals.d.ts +1 -0
- package/templates/turborepo-pandacss/apps/web/test/matchers.d.ts +1 -0
- package/templates/turborepo-pandacss/apps/web/test/setup.ts +22 -0
- package/templates/turborepo-pandacss/apps/web/tsconfig.json +37 -0
- package/templates/turborepo-pandacss/apps/web/vitest.config.ts +20 -0
- package/templates/turborepo-pandacss/apps/web/vitest.d.ts +2 -0
- package/templates/turborepo-pandacss/biome.json +60 -0
- package/templates/turborepo-pandacss/components.json +21 -0
- package/templates/turborepo-pandacss/docker-compose.yml +27 -0
- package/templates/turborepo-pandacss/middleware.ts +32 -0
- package/templates/turborepo-pandacss/next.config.ts +10 -0
- package/templates/turborepo-pandacss/package-lock.json +9346 -0
- package/templates/turborepo-pandacss/package.json +64 -0
- package/templates/turborepo-pandacss/packages/config/package.json +41 -0
- package/templates/turborepo-pandacss/packages/config/panda.config.ts +114 -0
- package/templates/turborepo-pandacss/packages/config/src/index.ts +24 -0
- package/templates/turborepo-pandacss/packages/config/src/worktree-config-loader.ts +129 -0
- package/templates/turborepo-pandacss/packages/config/src/worktree-config.ts +75 -0
- package/templates/turborepo-pandacss/packages/config/tsconfig.build.json +19 -0
- package/templates/turborepo-pandacss/packages/config/tsconfig.json +24 -0
- package/templates/turborepo-pandacss/packages/config/typescript/base.json +19 -0
- package/templates/turborepo-pandacss/packages/front-core/package.json +24 -0
- package/templates/turborepo-pandacss/packages/front-core/src/auth/config.ts +84 -0
- package/templates/turborepo-pandacss/packages/front-core/src/auth/index.ts +5 -0
- package/templates/turborepo-pandacss/packages/front-core/src/auth/types/next-auth.d.ts +20 -0
- package/templates/turborepo-pandacss/packages/front-core/src/auth/utils.ts +29 -0
- package/templates/turborepo-pandacss/packages/front-core/src/context/index.ts +2 -0
- package/templates/turborepo-pandacss/packages/front-core/src/hooks/index.ts +2 -0
- package/templates/turborepo-pandacss/packages/front-core/src/index.ts +4 -0
- package/templates/turborepo-pandacss/packages/front-core/src/utils/index.ts +2 -0
- package/templates/turborepo-pandacss/packages/front-core/tsconfig.json +14 -0
- package/templates/turborepo-pandacss/packages/server-core/package.json +32 -0
- package/templates/turborepo-pandacss/packages/server-core/prisma/schema.prisma +102 -0
- package/templates/turborepo-pandacss/packages/server-core/prisma/seed.ts +67 -0
- package/templates/turborepo-pandacss/packages/server-core/prisma.config.ts +8 -0
- package/templates/turborepo-pandacss/packages/server-core/src/__generated__/fabbrica/index.d.ts +270 -0
- package/templates/turborepo-pandacss/packages/server-core/src/__generated__/fabbrica/index.js +484 -0
- package/templates/turborepo-pandacss/packages/server-core/src/core/result.test.ts +78 -0
- package/templates/turborepo-pandacss/packages/server-core/src/core/result.ts +53 -0
- package/templates/turborepo-pandacss/packages/server-core/src/domain/.gitkeep +0 -0
- package/templates/turborepo-pandacss/packages/server-core/src/domain/entities/User.test.ts +232 -0
- package/templates/turborepo-pandacss/packages/server-core/src/domain/entities/User.ts +105 -0
- package/templates/turborepo-pandacss/packages/server-core/src/domain/repository-interfaces/IUserRepository.ts +101 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/client.ts +15 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/mappers/UserMapper.test.ts +278 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/mappers/UserMapper.ts +103 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/repositories/UserRepository.test.ts +317 -0
- package/templates/turborepo-pandacss/packages/server-core/src/infrastructure/database/repositories/UserRepository.ts +169 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/factories/index.ts +22 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/factories/user.factory.ts +123 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/fixtures/users.ts +92 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/helpers/date.ts +49 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/helpers/password.ts +50 -0
- package/templates/turborepo-pandacss/packages/server-core/src/testing/index.ts +26 -0
- package/templates/turborepo-pandacss/packages/server-core/tsconfig.json +14 -0
- package/templates/turborepo-pandacss/packages/server-core/vitest.config.ts +15 -0
- package/templates/turborepo-pandacss/packages/ui/package.json +37 -0
- package/templates/turborepo-pandacss/packages/ui/src/accordion.tsx +66 -0
- package/templates/turborepo-pandacss/packages/ui/src/alert-dialog.tsx +157 -0
- package/templates/turborepo-pandacss/packages/ui/src/alert.tsx +66 -0
- package/templates/turborepo-pandacss/packages/ui/src/aspect-ratio.tsx +11 -0
- package/templates/turborepo-pandacss/packages/ui/src/avatar.tsx +53 -0
- package/templates/turborepo-pandacss/packages/ui/src/badge.tsx +46 -0
- package/templates/turborepo-pandacss/packages/ui/src/breadcrumb.tsx +108 -0
- package/templates/turborepo-pandacss/packages/ui/src/button.tsx +59 -0
- package/templates/turborepo-pandacss/packages/ui/src/card.tsx +92 -0
- package/templates/turborepo-pandacss/packages/ui/src/checkbox.tsx +32 -0
- package/templates/turborepo-pandacss/packages/ui/src/data-table.tsx +216 -0
- package/templates/turborepo-pandacss/packages/ui/src/dialog-hook.tsx +226 -0
- package/templates/turborepo-pandacss/packages/ui/src/dialog.tsx +143 -0
- package/templates/turborepo-pandacss/packages/ui/src/drawer.tsx +135 -0
- package/templates/turborepo-pandacss/packages/ui/src/dropdown-menu.tsx +257 -0
- package/templates/turborepo-pandacss/packages/ui/src/form.tsx +168 -0
- package/templates/turborepo-pandacss/packages/ui/src/hover-card.tsx +44 -0
- package/templates/turborepo-pandacss/packages/ui/src/input.tsx +21 -0
- package/templates/turborepo-pandacss/packages/ui/src/label.tsx +24 -0
- package/templates/turborepo-pandacss/packages/ui/src/lib/utils.ts +6 -0
- package/templates/turborepo-pandacss/packages/ui/src/pagination.tsx +126 -0
- package/templates/turborepo-pandacss/packages/ui/src/popover.tsx +48 -0
- package/templates/turborepo-pandacss/packages/ui/src/progress.tsx +31 -0
- package/templates/turborepo-pandacss/packages/ui/src/select.tsx +185 -0
- package/templates/turborepo-pandacss/packages/ui/src/separator.tsx +28 -0
- package/templates/turborepo-pandacss/packages/ui/src/skeleton.tsx +13 -0
- package/templates/turborepo-pandacss/packages/ui/src/sonner.tsx +25 -0
- package/templates/turborepo-pandacss/packages/ui/src/table.tsx +116 -0
- package/templates/turborepo-pandacss/packages/ui/src/tabs.tsx +66 -0
- package/templates/turborepo-pandacss/packages/ui/src/textarea.tsx +18 -0
- package/templates/turborepo-pandacss/packages/ui/src/tooltip.tsx +61 -0
- package/templates/turborepo-pandacss/packages/ui/src/typography.tsx +187 -0
- package/templates/turborepo-pandacss/packages/ui/tsconfig.json +20 -0
- package/templates/turborepo-pandacss/panda.config.ts +114 -0
- package/templates/turborepo-pandacss/pnpm-lock.yaml +9032 -0
- package/templates/turborepo-pandacss/pnpm-workspace.yaml +11 -0
- package/templates/turborepo-pandacss/postcss.config.cjs +6 -0
- package/templates/turborepo-pandacss/prisma/schema.prisma +82 -0
- package/templates/turborepo-pandacss/public/file.svg +1 -0
- package/templates/turborepo-pandacss/public/globe.svg +1 -0
- package/templates/turborepo-pandacss/public/next.svg +1 -0
- package/templates/turborepo-pandacss/public/vercel.svg +1 -0
- package/templates/turborepo-pandacss/public/window.svg +1 -0
- package/templates/turborepo-pandacss/scripts/cli-template-update.ts +387 -0
- package/templates/turborepo-pandacss/scripts/env-show.ts +129 -0
- package/templates/turborepo-pandacss/scripts/env.ts +555 -0
- package/templates/turborepo-pandacss/scripts/init.sh +92 -0
- package/templates/turborepo-pandacss/scripts/setup-dev.ts +640 -0
- package/templates/turborepo-pandacss/scripts/template-update.ts +277 -0
- package/templates/turborepo-pandacss/scripts/worktree/dev.ts +872 -0
- package/templates/turborepo-pandacss/test/globals.d.ts +1 -0
- package/templates/turborepo-pandacss/test/setup.ts +22 -0
- package/templates/turborepo-pandacss/tsconfig.json +46 -0
- package/templates/turborepo-pandacss/turbo.json +57 -0
- package/templates/turborepo-pandacss/vitest.config.ts +20 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: hono エラーハンドリング
|
|
3
|
+
globs: src/server,src/server/*
|
|
4
|
+
alwaysApply: false
|
|
5
|
+
---
|
|
6
|
+
# エラーハンドリングのプロジェクトルール
|
|
7
|
+
## 概要
|
|
8
|
+
|
|
9
|
+
本プロジェクトでは、エラーハンドリングに「Result モナド」パターンを採用しています。このドキュメントでは、各層でのエラーハンドリングの責務と実装方法について説明します。
|
|
10
|
+
|
|
11
|
+
## Result モナドとは
|
|
12
|
+
|
|
13
|
+
Result モナドは、処理の結果を「成功」または「失敗」として表現するデータ型です。TypeScript では以下のように定義されています:
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
// 成功時の結果
|
|
17
|
+
type Success<T> = {
|
|
18
|
+
isSuccess: true;
|
|
19
|
+
value: T;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
// 失敗時の結果
|
|
23
|
+
type Failure<E> = {
|
|
24
|
+
isSuccess: false;
|
|
25
|
+
error: E;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Result型(成功または失敗)
|
|
29
|
+
type Result<T, E> = Success<T> | Failure<E>;
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 各層の責務
|
|
33
|
+
|
|
34
|
+
### 1. リポジトリ層(データアクセス層)
|
|
35
|
+
|
|
36
|
+
リポジトリ層は、データベースアクセスに関するエラーを捕捉し、適切な `Result` オブジェクトに変換する責務を持ちます。
|
|
37
|
+
|
|
38
|
+
**実装ルール**:
|
|
39
|
+
|
|
40
|
+
- リポジトリのメソッドは `Promise<Result<T, ApplicationError>>` を返すこと
|
|
41
|
+
- データベース操作は try-catch ブロックで囲み、例外を捕捉すること
|
|
42
|
+
- データが存在しない場合は `NOT_FOUND` エラーを返すこと
|
|
43
|
+
- バリデーションエラーは `VALIDATION_ERROR` として返すこと
|
|
44
|
+
- データベース固有のエラーは適切なアプリケーションエラーに変換すること
|
|
45
|
+
|
|
46
|
+
**実装例**:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
async find(userId: string): Promise<Result<prettifiedTafProfile, ApplicationError>> {
|
|
50
|
+
if (!userId) {
|
|
51
|
+
return Result.failure(new ApplicationError(ERROR_CODES.VALIDATION_ERROR, 'userIdが指定されていません。'));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
try {
|
|
55
|
+
const tafProfile = await prismaClient.tafProfile.findUnique({
|
|
56
|
+
where: { userId },
|
|
57
|
+
include: { TafEventRecord: true },
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (!tafProfile) {
|
|
61
|
+
return Result.failure(new ApplicationError(ERROR_CODES.NOT_FOUND, 'TAFプロフィールが見つかりませんでした。'));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return Result.success(convertToPrettifiedTafProfile(tafProfile));
|
|
65
|
+
} catch (error) {
|
|
66
|
+
return Result.failure(new ApplicationError(ERROR_CODES.SYSTEM_ERROR, 'TAFプロフィールの取得に失敗しました。'));
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### 2. ユースケース層(ビジネスロジック層)
|
|
72
|
+
|
|
73
|
+
ユースケース層は、ビジネスロジックに関するバリデーションを行い、リポジトリから返された `Result` を適切に処理する責務を持ちます。
|
|
74
|
+
|
|
75
|
+
**実装ルール**:
|
|
76
|
+
|
|
77
|
+
- ユースケースのメソッドは `Promise<Result<T, ApplicationError>>` を返すこと
|
|
78
|
+
- ビジネスルールに関するバリデーションを行い、エラーの場合は `Result.failure` を返すこと
|
|
79
|
+
- リポジトリから返された `Result` は、必要に応じて `flatMap` や `map` を使って変換すること
|
|
80
|
+
- 複数のリポジトリ操作を連鎖させる場合は、`flatMap` を使用すること
|
|
81
|
+
|
|
82
|
+
**実装例**:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
export const getUserTafProfileByIdService = async (
|
|
86
|
+
userId: string
|
|
87
|
+
): Promise<Result<prettifiedTafProfile, ApplicationError>> => {
|
|
88
|
+
if (!userId) {
|
|
89
|
+
return Result.failure(
|
|
90
|
+
new ApplicationError(ERROR_CODES.VALIDATION_ERROR, 'ユーザーIDが指定されていません。')
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return await tafProfileRepository.find(userId);
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const postUserTafProfileService = async (
|
|
98
|
+
userId: string,
|
|
99
|
+
data: z.infer<typeof tafProfileMutationInputSchema>
|
|
100
|
+
): Promise<Result<{ status: 'success' }, ApplicationError>> => {
|
|
101
|
+
if (!userId) {
|
|
102
|
+
return Result.failure(
|
|
103
|
+
new ApplicationError(ERROR_CODES.VALIDATION_ERROR, 'ユーザーIDが指定されていません。')
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const result = await tafProfileRepository.create(userId, data);
|
|
108
|
+
|
|
109
|
+
return Result.flatMap(result, _ => {
|
|
110
|
+
return Result.success({ status: 'success' });
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 3. プレゼンテーション層(API 層)
|
|
116
|
+
|
|
117
|
+
プレゼンテーション層は、ユースケースから返された `Result` を適切な HTTP レスポンスに変換する責務を持ちます。
|
|
118
|
+
|
|
119
|
+
**実装ルール**:
|
|
120
|
+
|
|
121
|
+
- API 入力パラメータのバリデーションを行うこと(zValidator などを使用)
|
|
122
|
+
- その際にバリデーションエラーが起きた場合の返却値は、zValidatorの標準挙動に準拠して返却し、明示的なハンドリングは実装しないこと
|
|
123
|
+
- ユースケースから返された `Result` を、`isSuccess` フラグに基づいて適切な HTTP レスポンスに変換すること
|
|
124
|
+
- 成功時は `createSuccessResponse` を使用してレスポンスを生成すること
|
|
125
|
+
- 失敗時は `createErrorResponse` を使用してエラーレスポンスを生成すること
|
|
126
|
+
- レスポンスは `c.json` を使用して返すこと。日付型から文字列への変換はもその関数の内部処理に任せて、明示的な実装での変換は行わないこと
|
|
127
|
+
|
|
128
|
+
**実装例**:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
.get('/:userId', zValidator('param', userIdSchema), async c => {
|
|
132
|
+
const { userId } = c.req.valid('param');
|
|
133
|
+
const result = await getUserTafProfileByIdService(userId);
|
|
134
|
+
|
|
135
|
+
if (result.isSuccess) {
|
|
136
|
+
const response = createSuccessResponse(result.value);
|
|
137
|
+
return c.json(response.data, response.status);
|
|
138
|
+
} else {
|
|
139
|
+
const errorResponse = createErrorResponse(result.error);
|
|
140
|
+
return c.json(errorResponse.error, errorResponse.status);
|
|
141
|
+
}
|
|
142
|
+
})
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## エラーコードとステータスコードのマッピング
|
|
146
|
+
|
|
147
|
+
エラーコードと HTTP ステータスコードのマッピングは、`errorHandler.ts` で定義されています:
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
export const ERROR_STATUS_MAP: Record<ApplicationErrorType, StatusCode> = {
|
|
151
|
+
VALIDATION_ERROR: 400,
|
|
152
|
+
NOT_FOUND: 404,
|
|
153
|
+
ALREADY_EXISTS: 409,
|
|
154
|
+
UNAUTHORIZED: 401,
|
|
155
|
+
SYSTEM_ERROR: 500,
|
|
156
|
+
} as const;
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## モナド操作の活用
|
|
160
|
+
|
|
161
|
+
Result モナドは、以下の操作を提供しています:
|
|
162
|
+
|
|
163
|
+
- `Result.success(value)`: 成功結果を生成
|
|
164
|
+
- `Result.failure(error)`: 失敗結果を生成
|
|
165
|
+
- `Result.map(result, fn)`: 成功時の値を変換
|
|
166
|
+
- `Result.flatMap(result, fn)`: 成功時の値を別の Result に変換
|
|
167
|
+
|
|
168
|
+
特に `flatMap` は、複数の操作を連鎖させる際に有用です。例えば:
|
|
169
|
+
|
|
170
|
+
```typescript
|
|
171
|
+
// ユーザーを取得し、そのプロフィールを更新する
|
|
172
|
+
const result = await userRepository.findById(userId);
|
|
173
|
+
return Result.flatMap(result, user => {
|
|
174
|
+
return profileRepository.update(user.id, profileData);
|
|
175
|
+
});
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## vitestのテストデータについて
|
|
179
|
+
|
|
180
|
+
[mockUser.ts](mdc:picker-app/src/server/test/mocks/mockUser.ts)に基本的にmockデータを作成する関数を作成し、テストファイル側では関数を呼び出すだけにする
|
|
181
|
+
|
|
182
|
+
## まとめ
|
|
183
|
+
|
|
184
|
+
- infrastracture層: データアクセスエラーを Result モナドに変換
|
|
185
|
+
- UseCase層: ビジネスロジックのバリデーションと Result モナドの処理
|
|
186
|
+
- Presentation層: Result モナドを HTTP レスポンスに変換
|
|
187
|
+
|
|
188
|
+
このパターンを一貫して適用することで、型安全なエラーハンドリングと明確なコードの意図を実現します。
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
---
|
|
2
|
+
description:
|
|
3
|
+
globs:
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
# リファクタリング方針
|
|
7
|
+
## DRY原則(Don't Repeat Yourself)
|
|
8
|
+
|
|
9
|
+
### 基本方針
|
|
10
|
+
- 同じコードを2回以上書かない
|
|
11
|
+
- 似たような処理は抽象化して再利用可能にする
|
|
12
|
+
- 共通のロジックは適切な場所に集約する
|
|
13
|
+
|
|
14
|
+
### 具体的な実践
|
|
15
|
+
- 重複するコードは関数やコンポーネントとして抽出
|
|
16
|
+
- 共通のロジックはユーティリティ関数として実装
|
|
17
|
+
- 定数は定数ファイルに集約
|
|
18
|
+
- 似たような処理は抽象化して再利用可能に
|
|
19
|
+
- 共通のバリデーションロジックは共通関数化
|
|
20
|
+
- 共通のエラーハンドリングは統一する
|
|
21
|
+
|
|
22
|
+
## コードスメル(改善すべきコードの特徴)
|
|
23
|
+
|
|
24
|
+
### 関数・メソッド関連
|
|
25
|
+
- 長すぎる関数(20行以上)は分割
|
|
26
|
+
- 引数が多すぎる関数(4つ以上)はオブジェクト化を検討
|
|
27
|
+
- 戻り値の型が複雑な場合は型定義を明確に
|
|
28
|
+
- 副作用のある関数は最小限に
|
|
29
|
+
|
|
30
|
+
### 制御構造
|
|
31
|
+
- 深すぎるネスト(3段階以上)は避ける
|
|
32
|
+
- 複雑な条件分岐は早期リターンで簡略化
|
|
33
|
+
- マジックナンバーは定数化
|
|
34
|
+
- フラグ変数は列挙型(enum)で管理
|
|
35
|
+
|
|
36
|
+
### コードの品質
|
|
37
|
+
- コメントアウトされたコードは削除
|
|
38
|
+
- 未使用の変数やインポートは削除
|
|
39
|
+
- デッドコードは削除
|
|
40
|
+
- 一時変数は適切なスコープで使用
|
|
41
|
+
|
|
42
|
+
## SOLID原則
|
|
43
|
+
|
|
44
|
+
### 単一責任の原則(Single Responsibility Principle)
|
|
45
|
+
- 1つのクラス/関数は1つの責務のみを持つ
|
|
46
|
+
- 複数の責務を持つ場合は分割を検討
|
|
47
|
+
- 責務の境界を明確に定義
|
|
48
|
+
- 関連する機能は適切にグループ化
|
|
49
|
+
|
|
50
|
+
### 開放閉鎖の原則(Open-Closed Principle)
|
|
51
|
+
- 既存のコードを修正せずに拡張できる設計
|
|
52
|
+
- 抽象化とインターフェースを活用
|
|
53
|
+
- 新しい機能追加は既存コードの修正を最小限に
|
|
54
|
+
- 拡張ポイントを明確に定義
|
|
55
|
+
|
|
56
|
+
### リスコフの置換原則(Liskov Substitution Principle)
|
|
57
|
+
- サブクラスは親クラスの動作を壊さない
|
|
58
|
+
- 継承関係は慎重に設計
|
|
59
|
+
- サブクラスは親クラスの契約を守る
|
|
60
|
+
- 継承よりも委譲を優先
|
|
61
|
+
|
|
62
|
+
### インターフェース分離の原則(Interface Segregation Principle)
|
|
63
|
+
- クライアントが必要としないメソッドを強制しない
|
|
64
|
+
- インターフェースは小さく分割
|
|
65
|
+
- クライアント固有のインターフェースを提供
|
|
66
|
+
- 汎用的なインターフェースは避ける
|
|
67
|
+
|
|
68
|
+
### 依存性逆転の原則(Dependency Inversion Principle)
|
|
69
|
+
- 高レベルのモジュールは低レベルのモジュールに依存しない
|
|
70
|
+
- 抽象化に依存する設計
|
|
71
|
+
- 依存関係はインターフェースを通じて定義
|
|
72
|
+
- 具象クラスへの直接依存を避ける
|
|
73
|
+
|
|
74
|
+
## リファクタリングの進め方
|
|
75
|
+
|
|
76
|
+
### 事前準備
|
|
77
|
+
- テストカバレッジを確認
|
|
78
|
+
- リファクタリング範囲を明確に定義
|
|
79
|
+
- 影響範囲を分析
|
|
80
|
+
- 段階的なアプローチを計画
|
|
81
|
+
|
|
82
|
+
### 実施手順
|
|
83
|
+
1. テストを書く(既存のテストがなければ)
|
|
84
|
+
2. 小さな変更から始める
|
|
85
|
+
3. 変更ごとにテストを実行
|
|
86
|
+
4. コミット単位を適切に分割
|
|
87
|
+
5. コードレビューを受ける
|
|
88
|
+
|
|
89
|
+
### 注意事項
|
|
90
|
+
- 機能追加とリファクタリングは分離
|
|
91
|
+
- 大きな変更は段階的に実施
|
|
92
|
+
- パフォーマンスへの影響を考慮
|
|
93
|
+
- ドキュメントの更新を忘れない
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
npm-debug.log*
|
|
4
|
+
yarn-debug.log*
|
|
5
|
+
yarn-error.log*
|
|
6
|
+
|
|
7
|
+
# Next.js
|
|
8
|
+
.next/
|
|
9
|
+
.next
|
|
10
|
+
out/
|
|
11
|
+
|
|
12
|
+
# Environment variables
|
|
13
|
+
.env
|
|
14
|
+
.env.local
|
|
15
|
+
.env.development.local
|
|
16
|
+
.env.test.local
|
|
17
|
+
.env.production.local
|
|
18
|
+
|
|
19
|
+
# Database
|
|
20
|
+
*.db
|
|
21
|
+
*.sqlite
|
|
22
|
+
*.sqlite3
|
|
23
|
+
|
|
24
|
+
# Logs
|
|
25
|
+
logs
|
|
26
|
+
*.log
|
|
27
|
+
|
|
28
|
+
# Runtime data
|
|
29
|
+
pids
|
|
30
|
+
*.pid
|
|
31
|
+
*.seed
|
|
32
|
+
*.pid.lock
|
|
33
|
+
|
|
34
|
+
# Coverage directory used by tools like istanbul
|
|
35
|
+
coverage/
|
|
36
|
+
|
|
37
|
+
# nyc test coverage
|
|
38
|
+
.nyc_output
|
|
39
|
+
|
|
40
|
+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
|
|
41
|
+
.grunt
|
|
42
|
+
|
|
43
|
+
# Bower dependency directory (https://bower.io/)
|
|
44
|
+
bower_components
|
|
45
|
+
|
|
46
|
+
# node-waf configuration
|
|
47
|
+
.lock-wscript
|
|
48
|
+
|
|
49
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
50
|
+
build/Release
|
|
51
|
+
|
|
52
|
+
# Dependency directories
|
|
53
|
+
jspm_packages/
|
|
54
|
+
|
|
55
|
+
# TypeScript cache
|
|
56
|
+
*.tsbuildinfo
|
|
57
|
+
|
|
58
|
+
# Optional npm cache directory
|
|
59
|
+
.npm
|
|
60
|
+
|
|
61
|
+
# Optional eslint cache
|
|
62
|
+
.eslintcache
|
|
63
|
+
|
|
64
|
+
# Microbundle cache
|
|
65
|
+
.rpt2_cache/
|
|
66
|
+
.rts2_cache_cjs/
|
|
67
|
+
.rts2_cache_es/
|
|
68
|
+
.rts2_cache_umd/
|
|
69
|
+
|
|
70
|
+
# Optional REPL history
|
|
71
|
+
.node_repl_history
|
|
72
|
+
|
|
73
|
+
# Output of 'npm pack'
|
|
74
|
+
*.tgz
|
|
75
|
+
|
|
76
|
+
# Yarn Integrity file
|
|
77
|
+
.yarn-integrity
|
|
78
|
+
|
|
79
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
80
|
+
.cache
|
|
81
|
+
.parcel-cache
|
|
82
|
+
|
|
83
|
+
# Next.js build output
|
|
84
|
+
.next
|
|
85
|
+
|
|
86
|
+
# Nuxt.js build / generate output
|
|
87
|
+
.nuxt
|
|
88
|
+
dist
|
|
89
|
+
|
|
90
|
+
# Gatsby files
|
|
91
|
+
.cache/
|
|
92
|
+
public
|
|
93
|
+
|
|
94
|
+
# Storybook build outputs
|
|
95
|
+
.out
|
|
96
|
+
.storybook-out
|
|
97
|
+
|
|
98
|
+
# Temporary folders
|
|
99
|
+
tmp/
|
|
100
|
+
temp/
|
|
101
|
+
|
|
102
|
+
# Editor directories and files
|
|
103
|
+
.vscode/
|
|
104
|
+
.idea/
|
|
105
|
+
*.swp
|
|
106
|
+
*.swo
|
|
107
|
+
*~
|
|
108
|
+
|
|
109
|
+
# OS generated files
|
|
110
|
+
.DS_Store
|
|
111
|
+
.DS_Store?
|
|
112
|
+
._*
|
|
113
|
+
.Spotlight-V100
|
|
114
|
+
.Trashes
|
|
115
|
+
ehthumbs.db
|
|
116
|
+
Thumbs.db
|
|
117
|
+
|
|
118
|
+
# Git
|
|
119
|
+
.git
|
|
120
|
+
.gitignore
|
|
121
|
+
README.md
|
|
122
|
+
|
|
123
|
+
# Docker
|
|
124
|
+
Dockerfile*
|
|
125
|
+
docker-compose*
|
|
126
|
+
.dockerignore
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"lastSync": "2026-01-04T16:21:21.138Z",
|
|
4
|
+
"templateVersion": "0.1.0",
|
|
5
|
+
"files": {
|
|
6
|
+
".claude/commands/einja/update-docs-by-task-specs.md": {
|
|
7
|
+
"hash": "6c09bb6748134849e8de535d6cdb382bfe0aeb0a3fb19730e1c7708ceaa283bc",
|
|
8
|
+
"syncedAt": "2026-01-04T16:21:21.151Z"
|
|
9
|
+
},
|
|
10
|
+
".claude/commands/einja/start-dev.md": {
|
|
11
|
+
"hash": "944d0009a156ca81a965aa7c2e5555420ea7a9562248ab14e981a6aebe82807c",
|
|
12
|
+
"syncedAt": "2026-01-04T16:21:21.151Z"
|
|
13
|
+
},
|
|
14
|
+
".claude/commands/einja/frontend-implement.md": {
|
|
15
|
+
"hash": "900a2fa79b0cd53f3475965e81287085aecdecd8a2e9761a638ff368345aaaee",
|
|
16
|
+
"syncedAt": "2026-01-04T16:21:21.152Z"
|
|
17
|
+
},
|
|
18
|
+
".claude/agents/einja/task/task-modification-analyzer.md": {
|
|
19
|
+
"hash": "b0df7e02599d46078ef6712552e0035f1bf577fc48324f6356ec454b6b0eafed",
|
|
20
|
+
"syncedAt": "2026-01-04T16:21:21.152Z"
|
|
21
|
+
},
|
|
22
|
+
".claude/agents/einja/frontend/frontend-coder.md": {
|
|
23
|
+
"hash": "1d6db52607fa6ca10f36ba354f98da2155a0214bb417014ef3440ddf1496d2f3",
|
|
24
|
+
"syncedAt": "2026-01-04T16:21:21.152Z"
|
|
25
|
+
},
|
|
26
|
+
".claude/agents/einja/frontend/frontend-architect.md": {
|
|
27
|
+
"hash": "1fbc2937cd3d330cc1b852427a2fd6fb4c1070acc3d6de8596acdbac94d73da1",
|
|
28
|
+
"syncedAt": "2026-01-04T16:21:21.153Z"
|
|
29
|
+
},
|
|
30
|
+
".claude/agents/einja/frontend/design-engineer.md": {
|
|
31
|
+
"hash": "dcad5e62ac13087ffa2ec870f14bea41e6c4cde333aca5f6878c51a631055c65",
|
|
32
|
+
"syncedAt": "2026-01-04T16:21:21.153Z"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#/-------------------[DOTENV_PUBLIC_KEY]--------------------/
|
|
2
|
+
#/ public-key encryption for .env files /
|
|
3
|
+
#/ [how it works](https://dotenvx.com/encryption) /
|
|
4
|
+
#/----------------------------------------------------------/
|
|
5
|
+
DOTENV_PUBLIC_KEY_CI="02c888edf6b766c5a9781ab2966c142b5f401e9a9d534aab37d6c0fa5c12a04dfa"
|
|
6
|
+
|
|
7
|
+
# .env.ci
|
|
8
|
+
# ============================================
|
|
9
|
+
# CI/CD Environment
|
|
10
|
+
# ============================================
|
|
11
|
+
# GitHub Actions等のCI/CD環境用
|
|
12
|
+
# dotenvxで暗号化されます
|
|
13
|
+
#
|
|
14
|
+
# 編集方法: pnpm env:update → 「環境設定を変更」→「CI環境」
|
|
15
|
+
# ============================================
|
|
16
|
+
|
|
17
|
+
# NextAuth設定
|
|
18
|
+
NEXTAUTH_SECRET=encrypted:BDqRRvYcNnJ5rYo4c8Zhu/lThghcW8b6+7u4+MeaJNlkDWHlWeXwVkMf4NJ61mXSCWckIfyg6CrGsgbt78qJ18mEvf2yBmQr1TZxi+byzT34thNOoks8NCE7YudmVaLv7UCZyncLltOl3ida24BxVKv0TA==
|
|
19
|
+
NEXTAUTH_URL=encrypted:BIsPWaPuZKcIShhWg/mkQ4hAIb5XfJxHq8434VrnPEpqnJMeV9PDvUFd/Ra1sg99z6/dpK49jPCLBjK/Uz0t9AKXUMWNd3f2LgoAViktW/0z8WDRhv7vmSt3TA8vwCWBo09NNweIQovudjbR96xJREShBBIKYA==
|
|
20
|
+
|
|
21
|
+
# データベース設定(CI用SQLite/PostgreSQL)
|
|
22
|
+
DATABASE_URL="encrypted:BBCXNkJ8IKIWFGCSg/QG1xwAI0NdhSAiOL96KreYtcRPeySngZecHQpHm8LUF3/MvjnyjJMcSBzfiPtDbiaUl4dXxOE8l4z0t+96IfgzOIsXxqy/eQW0qZ3YcZq4L3ioz4+D/jfLPX0BdQ9dh5KLB1KgoT0lydCo4v1jAmQ6Fs/RNQmp42XyKp6o4lNoxQN+BAnmBfASxVzirjLgJ7/JzsFaXRQx6Mo="
|
|
23
|
+
|
|
24
|
+
# アプリケーション設定
|
|
25
|
+
NODE_ENV=encrypted:BGqfAinM4i1q4jyFHGgDieBnatHXGHLbMsC16tSgMdHLCrnPSsdCS3xddycesRH/jQYR2+pbyAstYbhhL87dDiTXcr66/5QHSVkCSZYzf3Ud/abIT82GqXuvgiLDvlum9YhFNEw=
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# ============================================
|
|
2
|
+
# 環境変数の参考テンプレート
|
|
3
|
+
# ============================================
|
|
4
|
+
# ⚠️ このファイルは直接編集しません
|
|
5
|
+
#
|
|
6
|
+
# 【重要】pnpm dev は毎回 .env を再生成します
|
|
7
|
+
# → 秘密情報は .env.local または .env.personal に書いてください
|
|
8
|
+
#
|
|
9
|
+
# 【ファイル構成】
|
|
10
|
+
# .env.local(暗号化・Git共有)→ チーム共有の秘密情報
|
|
11
|
+
# ↓ pnpm dev:setup で復号
|
|
12
|
+
# .env(作業用・毎回再生成)← このテンプレートがベース
|
|
13
|
+
# +
|
|
14
|
+
# .env.personal(個人トークン)→ 個人の秘密情報
|
|
15
|
+
#
|
|
16
|
+
# 詳細: docs/einja/steering/infrastructure/environment-variables.md
|
|
17
|
+
# ============================================
|
|
18
|
+
|
|
19
|
+
# NextAuth設定
|
|
20
|
+
AUTH_SECRET=your-nextauth-secret-key-here
|
|
21
|
+
NEXTAUTH_URL=http://localhost:3000
|
|
22
|
+
|
|
23
|
+
# OAuth設定(必要に応じて有効化)
|
|
24
|
+
# AUTH_GOOGLE_ID=your-google-client-id
|
|
25
|
+
# AUTH_GOOGLE_SECRET=your-google-client-secret
|
|
26
|
+
# AUTH_GITHUB_ID=your-github-client-id
|
|
27
|
+
# AUTH_GITHUB_SECRET=your-github-client-secret
|
|
28
|
+
|
|
29
|
+
# データベース設定
|
|
30
|
+
# pnpm dev 実行時に自動設定されます
|
|
31
|
+
DATABASE_URL="postgresql://postgres:postgres@localhost:25432/main?schema=public"
|
|
32
|
+
|
|
33
|
+
# アプリケーションポート(複数アプリ対応)
|
|
34
|
+
# pnpm dev 実行時にブランチ名から自動計算されます
|
|
35
|
+
PORT_WEB=3000
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# ============================================
|
|
2
|
+
# 個人用環境変数テンプレート
|
|
3
|
+
# ============================================
|
|
4
|
+
# 【使い方】
|
|
5
|
+
# 1. cp .env.personal.example .env.personal
|
|
6
|
+
# 2. 各トークンを設定
|
|
7
|
+
#
|
|
8
|
+
# 【このファイルについて】
|
|
9
|
+
# - 個人固有のトークン(他人と共有しない)
|
|
10
|
+
# - Git管理外
|
|
11
|
+
# - direnvのロード順: .env → .env.personal(後勝ち)
|
|
12
|
+
# → チームの設定を個人設定で上書き可能
|
|
13
|
+
#
|
|
14
|
+
# 詳細: docs/einja/steering/infrastructure/environment-variables.md
|
|
15
|
+
# ============================================
|
|
16
|
+
|
|
17
|
+
# GitHub MCP接続用(Claude Code開発時に必要)
|
|
18
|
+
# 取得方法: https://github.com/settings/tokens/new
|
|
19
|
+
# 必要なスコープ: repo, read:org
|
|
20
|
+
GITHUB_TOKEN=
|
|
21
|
+
|
|
22
|
+
# Claude Code 実験的機能フラグ
|
|
23
|
+
ENABLE_TOOL_SEARCH=true
|
|
24
|
+
|
|
25
|
+
# その他の個人用トークン(必要に応じて)
|
|
26
|
+
# OPENAI_API_KEY=
|
|
27
|
+
# ANTHROPIC_API_KEY=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npx lint-staged
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
// Biomeによるリントとフォーマット(CLAUDE.md、.claude/、docs/specs/を除外)
|
|
3
|
+
"**/*.{js,jsx,ts,tsx,json}": (filenames) => {
|
|
4
|
+
const filteredFiles = filenames.filter(
|
|
5
|
+
(filename) =>
|
|
6
|
+
!filename.includes("CLAUDE.md") &&
|
|
7
|
+
!filename.includes(".claude/") &&
|
|
8
|
+
!filename.includes("docs/specs/"),
|
|
9
|
+
);
|
|
10
|
+
if (filteredFiles.length === 0) return [];
|
|
11
|
+
// ステージングされたファイルだけをBiomeに直接渡す(高速)
|
|
12
|
+
return [`npx biome check --write ${filteredFiles.join(" ")}`];
|
|
13
|
+
},
|
|
14
|
+
"**/*.md": (filenames) => {
|
|
15
|
+
const filteredFiles = filenames.filter(
|
|
16
|
+
(filename) =>
|
|
17
|
+
!filename.includes("CLAUDE.md") &&
|
|
18
|
+
!filename.includes(".claude/") &&
|
|
19
|
+
!filename.includes("docs/specs/"),
|
|
20
|
+
);
|
|
21
|
+
if (filteredFiles.length === 0) return [];
|
|
22
|
+
return [`npx biome check --write ${filteredFiles.join(" ")}`];
|
|
23
|
+
},
|
|
24
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"vibe_kanban": {
|
|
4
|
+
"command": "npx",
|
|
5
|
+
"args": ["-y", "vibe-kanban@latest", "--mcp"]
|
|
6
|
+
},
|
|
7
|
+
"codex": {
|
|
8
|
+
"type": "stdio",
|
|
9
|
+
"command": "codex",
|
|
10
|
+
"args": ["mcp-server"]
|
|
11
|
+
},
|
|
12
|
+
"context7": {
|
|
13
|
+
"command": "npx",
|
|
14
|
+
"args": ["-y", "@upstash/context7-mcp"]
|
|
15
|
+
},
|
|
16
|
+
"playwright": {
|
|
17
|
+
"type": "stdio",
|
|
18
|
+
"command": "npx",
|
|
19
|
+
"args": ["-y", "@playwright/mcp", "--isolated"]
|
|
20
|
+
},
|
|
21
|
+
"serena": {
|
|
22
|
+
"command": "uvx",
|
|
23
|
+
"args": [
|
|
24
|
+
"--from",
|
|
25
|
+
"git+https://github.com/oraios/serena",
|
|
26
|
+
"serena-mcp-server",
|
|
27
|
+
"--context",
|
|
28
|
+
"ide-assistant",
|
|
29
|
+
".",
|
|
30
|
+
"--enable-web-dashboard=false"
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
"github": {
|
|
34
|
+
"type": "http",
|
|
35
|
+
"url": "https://api.githubcopilot.com/mcp/",
|
|
36
|
+
"headers": {
|
|
37
|
+
"Authorization": "Bearer ${GITHUB_TOKEN}"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"asana": {
|
|
41
|
+
"command": "npx",
|
|
42
|
+
"args": ["mcp-remote", "https://mcp.asana.com/sse"]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
22.16.0
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# create-einja-app テンプレート除外設定
|
|
2
|
+
# このファイルはテンプレート更新時に除外するファイル・ディレクトリを定義します
|
|
3
|
+
|
|
4
|
+
# CLI関連パッケージ
|
|
5
|
+
packages/cli/
|
|
6
|
+
packages/create-einja-app/
|
|
7
|
+
|
|
8
|
+
# 依存関係・ビルド成果物
|
|
9
|
+
node_modules/
|
|
10
|
+
.next/
|
|
11
|
+
out/
|
|
12
|
+
dist/
|
|
13
|
+
build/
|
|
14
|
+
styled-system/
|
|
15
|
+
|
|
16
|
+
# Git関連
|
|
17
|
+
.git/
|
|
18
|
+
.github/
|
|
19
|
+
|
|
20
|
+
# ログファイル
|
|
21
|
+
*.log
|
|
22
|
+
logs/
|
|
23
|
+
|
|
24
|
+
# 環境変数ファイル
|
|
25
|
+
.env
|
|
26
|
+
.env.local
|
|
27
|
+
.env.*.local
|
|
28
|
+
.env.production
|
|
29
|
+
.env.staging
|
|
30
|
+
.env.development
|
|
31
|
+
|
|
32
|
+
# IDE設定
|
|
33
|
+
.idea/
|
|
34
|
+
.vscode/settings.json
|
|
35
|
+
|
|
36
|
+
# OS固有ファイル
|
|
37
|
+
.DS_Store
|
|
38
|
+
Thumbs.db
|
|
39
|
+
|
|
40
|
+
# テストカバレッジ
|
|
41
|
+
coverage/
|
|
42
|
+
|
|
43
|
+
# Prisma migrations(テンプレートには含めない)
|
|
44
|
+
packages/database/prisma/migrations/
|
|
45
|
+
|
|
46
|
+
# Worktree設定(プロジェクト固有)
|
|
47
|
+
worktree.config.json
|
|
48
|
+
|
|
49
|
+
# タスク実行関連スクリプト(Einja固有)
|
|
50
|
+
scripts/task-vibe-kanban-loop/
|
|
51
|
+
|
|
52
|
+
# Einja固有のClaude設定
|
|
53
|
+
.claude/agents/einja/
|
|
54
|
+
.claude/commands/einja/
|
|
55
|
+
.claude/skills/einja-*/
|
|
56
|
+
|
|
57
|
+
# 仕様書・タスク記録(Einja固有のプロジェクト管理ファイル)
|
|
58
|
+
docs/specs/
|
|
59
|
+
modifications/
|
|
60
|
+
qa-tests/
|