create-einja-app 0.2.14 → 0.2.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-einja-app",
3
- "version": "0.2.14",
3
+ "version": "0.2.17",
4
4
  "description": "CLI tool to create new projects with Einja Management Template",
5
5
  "type": "module",
6
6
  "bin": {
@@ -18,10 +18,10 @@ if [[ "$file_path" =~ \.(ts|tsx|js|jsx|json)$ ]]; then
18
18
  cd "$CLAUDE_PROJECT_DIR" 2>/dev/null || exit 0
19
19
 
20
20
  # biome check(format + lint)を実行、自動修正可能なものは修正
21
- npx biome check --write "$file_path" 2>/dev/null || true
21
+ pnpm exec biome check --write "$file_path" 2>/dev/null || true
22
22
 
23
23
  # 修正後に残っているlintエラーをチェック(any型など自動修正できないもの)
24
- lint_errors=$(npx biome lint "$file_path" 2>&1 | grep -E "lint/|noExplicitAny|error" | head -20)
24
+ lint_errors=$(pnpm exec biome lint "$file_path" 2>&1 | grep -E "lint/|noExplicitAny|error" | head -20)
25
25
 
26
26
  if [ -n "$lint_errors" ]; then
27
27
  echo "" >&2
@@ -26,7 +26,7 @@ NODE_ENV=encrypted:BMz9t7QSXJ+dMA5otX1d9bLq/2JR4/j4QwAsCmfiPXtUfwANtPlyigFGcq9fC
26
26
 
27
27
  VERCEL_TOKEN=
28
28
  VERCEL_ORG_ID=
29
- VERCEL_WEB_PROJECT_ID_WEB=
29
+ VERCEL_PROJECT_ID_WEB=
30
30
 
31
31
  TURBO_TOKEN=encrypted:BCX+8GLR1/VqhVW3JzqOXHP8JD6PjQhkodGY3W3gDzz64H/kI2HRQyBviTa7x5gsjXF7FqggzxZ/zkC//ixrFlvLQa1beC/5odd8rBEvs+ZGHWEeLG8c5XxudVsTsHIWjA==
32
32
  TURBO_TEAM=encrypted:BMSAczdJn8VnXxSvrIqn38ubQ334pbFtFyeKkmK2995mvj7B17YE5oCYmKIUxQdzkbD7NWLhOrjTkAqAXODpxVxi9JGjy8T2d7a8F6lurz7AY84jVY3tlcuYKWyw2RIrOA==
@@ -2,9 +2,9 @@
2
2
  #/ public-key encryption for .env files /
3
3
  #/ [how it works](https://dotenvx.com/encryption) /
4
4
  #/----------------------------------------------------------/
5
- DOTENV_PUBLIC_KEY_DEVELOPMENT="02e723fedf2667d7fd82b661d6c9c541d945bb5a3b0c9dcd792bb13316bc9eea33"
5
+ DOTENV_PUBLIC_KEY_DEVELOP="02e723fedf2667d7fd82b661d6c9c541d945bb5a3b0c9dcd792bb13316bc9eea33"
6
6
 
7
- # .env.development
7
+ # .env.develop
8
8
  # ============================================
9
9
  # Development Environment
10
10
  # ============================================
@@ -23,3 +23,9 @@ DATABASE_URL="encrypted:BFLDc6fRsdz0mfkrXWFk3p2ECSzyaTHea4IC3gSJ90uTaAPwc02JYnI5
23
23
 
24
24
  # アプリケーション設定
25
25
  NODE_ENV=encrypted:BBJfTcYKXYjk8LsfO1qSdICzPMxhTHSg9aDFb+udaIFwAQxuIGMOrARuG2gPMv0+e8338j0NAdXdqbd2XWfD0XwYHWD3csBn7IT5aDdSZDduX23NHb6ONFSzsgUv3P9PKEBTRV4EXI4Dk0Y=
26
+
27
+ # Neon Database設定(PR Preview用)
28
+ # ⚠️ 重要: 以下の値を設定後、必ず `pnpm env:encrypt` で暗号化してください
29
+ # 設定方法: pnpm env:update → 「環境設定を変更」→「プレビュー環境」
30
+ NEON_API_KEY="your-neon-api-key"
31
+ NEON_PROJECT_ID="your-neon-project-id"
@@ -27,12 +27,9 @@ jobs:
27
27
  - name: Install dependencies
28
28
  run: pnpm install --frozen-lockfile
29
29
 
30
- - name: Generate Prisma Client
31
- run: pnpm db:generate
32
-
33
- - name: Generate Panda CSS
30
+ - name: Generate artifacts
34
31
  run: |
35
- pnpm --filter @einja/web panda
32
+ pnpm generate
36
33
  # Panda CSS生成確認
37
34
  if [ ! -d "apps/web/styled-system" ]; then
38
35
  echo "Error: styled-system directory was not created"
@@ -52,7 +49,7 @@ jobs:
52
49
 
53
50
  deploy-web:
54
51
  needs: test
55
- if: github.event_name == 'push'
52
+ if: github.event_name == 'push' && github.ref == 'refs/heads/main'
56
53
  runs-on: ubuntu-latest
57
54
  env:
58
55
  DOTENV_PRIVATE_KEY_CI: ${{ secrets.DOTENV_PRIVATE_KEY_CI }}
@@ -77,48 +74,23 @@ jobs:
77
74
  - name: Install Vercel CLI
78
75
  run: pnpm add -g vercel@latest
79
76
 
80
- - name: Resolve deploy environment
81
- id: deploy_env
82
- run: |
83
- BRANCH="${GITHUB_REF_NAME}"
84
- if [ "$BRANCH" = "main" ]; then
85
- echo "vercel_env=production" >> "$GITHUB_OUTPUT"
86
- echo "dotenv_file=../../.env.production" >> "$GITHUB_OUTPUT"
87
- echo "vercel_args=--prod" >> "$GITHUB_OUTPUT"
88
- elif [ "$BRANCH" = "staging" ]; then
89
- echo "vercel_env=preview" >> "$GITHUB_OUTPUT"
90
- echo "dotenv_file=../../.env.staging" >> "$GITHUB_OUTPUT"
91
- echo "vercel_args=" >> "$GITHUB_OUTPUT"
92
- elif [ "$BRANCH" = "develop" ]; then
93
- echo "vercel_env=preview" >> "$GITHUB_OUTPUT"
94
- echo "dotenv_file=../../.env.development" >> "$GITHUB_OUTPUT"
95
- echo "vercel_args=" >> "$GITHUB_OUTPUT"
96
- else
97
- echo "vercel_env=preview" >> "$GITHUB_OUTPUT"
98
- echo "dotenv_file=../../.env.preview" >> "$GITHUB_OUTPUT"
99
- echo "vercel_args=" >> "$GITHUB_OUTPUT"
100
- fi
101
-
102
77
  - name: Pull Vercel Environment Information
103
78
  run: |
104
79
  npx dotenvx run -f ../../.env.ci -- \
105
- vercel pull --yes --environment=${{ steps.deploy_env.outputs.vercel_env }}
80
+ vercel pull --yes --environment=production
106
81
  working-directory: apps/web
107
82
 
108
83
  - name: Build Project Artifacts
109
84
  run: |
110
- npx dotenvx run -f ../../.env.ci -f ${{ steps.deploy_env.outputs.dotenv_file }} -- \
111
- vercel build ${{ steps.deploy_env.outputs.vercel_args }}
85
+ npx dotenvx run -f ../../.env.ci -f ../../.env.production -- \
86
+ vercel build --prod
112
87
  working-directory: apps/web
113
88
  env:
114
89
  DOTENV_PRIVATE_KEY_CI: ${{ secrets.DOTENV_PRIVATE_KEY_CI }}
115
- DOTENV_PRIVATE_KEY_DEVELOPMENT: ${{ secrets.DOTENV_PRIVATE_KEY_DEVELOPMENT }}
116
- DOTENV_PRIVATE_KEY_STAGING: ${{ secrets.DOTENV_PRIVATE_KEY_STAGING }}
117
- DOTENV_PRIVATE_KEY_PREVIEW: ${{ secrets.DOTENV_PRIVATE_KEY_PREVIEW }}
118
90
  DOTENV_PRIVATE_KEY_PRODUCTION: ${{ secrets.DOTENV_PRIVATE_KEY_PRODUCTION }}
119
91
 
120
92
  - name: Deploy to Vercel
121
93
  run: |
122
94
  npx dotenvx run -f ../../.env.ci -- \
123
- vercel deploy --prebuilt ${{ steps.deploy_env.outputs.vercel_args }}
95
+ vercel deploy --prebuilt --prod
124
96
  working-directory: apps/web
@@ -0,0 +1,90 @@
1
+ name: Cleanup Old Neon Branches
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 0 * * *' # 毎日 0:00 UTC
6
+ workflow_dispatch: # 手動実行可能
7
+
8
+ permissions:
9
+ contents: read
10
+ pull-requests: read
11
+
12
+ jobs:
13
+ cleanup:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Setup pnpm
19
+ uses: pnpm/action-setup@v4
20
+ with:
21
+ version: 10.14.0
22
+
23
+ - name: Setup Node.js
24
+ uses: actions/setup-node@v4
25
+ with:
26
+ node-version: '22.16.0'
27
+ cache: 'pnpm'
28
+
29
+ - name: Install dependencies
30
+ run: pnpm install --frozen-lockfile
31
+
32
+ - name: Export Neon environment variables
33
+ run: |
34
+ npx dotenvx run -f .env.preview -- bash -c 'echo "NEON_API_KEY=$NEON_API_KEY" >> $GITHUB_ENV'
35
+ npx dotenvx run -f .env.preview -- bash -c 'echo "NEON_PROJECT_ID=$NEON_PROJECT_ID" >> $GITHUB_ENV'
36
+ env:
37
+ DOTENV_PRIVATE_KEY_PREVIEW: ${{ secrets.DOTENV_PRIVATE_KEY_PREVIEW }}
38
+
39
+ - name: Cleanup orphaned preview branches
40
+ run: |
41
+ # NOTE: Neon APIはページングされる可能性あり。ブランチ数が多い場合は要対応
42
+ echo "Fetching branches from Neon..."
43
+ BRANCHES=$(curl -s "https://console.neon.tech/api/v2/projects/${{ env.NEON_PROJECT_ID }}/branches" \
44
+ -H "Authorization: Bearer ${{ env.NEON_API_KEY }}" \
45
+ -H "Accept: application/json")
46
+
47
+ # preview/pr-{番号}形式のブランチを抽出
48
+ echo "$BRANCHES" | jq -r '.branches[] | select(.name | startswith("preview/pr-")) | "\(.id) \(.name)"' | \
49
+ while read -r BRANCH_ID BRANCH_NAME; do
50
+ if [ -n "$BRANCH_ID" ]; then
51
+ # ブランチ名からPR番号を抽出
52
+ PR_NUMBER=$(echo "$BRANCH_NAME" | sed 's/preview\/pr-//')
53
+
54
+ # GitHub APIでPR状態を確認(HTTPステータスも取得)
55
+ HTTP_RESPONSE=$(curl -s -w "\n%{http_code}" \
56
+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
57
+ -H "Accept: application/vnd.github+json" \
58
+ "https://api.github.com/repos/${{ github.repository }}/pulls/$PR_NUMBER")
59
+ HTTP_STATUS=$(echo "$HTTP_RESPONSE" | tail -n1)
60
+ HTTP_BODY=$(echo "$HTTP_RESPONSE" | sed '$d')
61
+
62
+ echo "Branch: $BRANCH_NAME, PR #$PR_NUMBER, HTTP status: $HTTP_STATUS"
63
+
64
+ # HTTPステータスに応じた処理
65
+ if [ "$HTTP_STATUS" = "200" ]; then
66
+ PR_STATE=$(echo "$HTTP_BODY" | jq -r '.state')
67
+ if [ "$PR_STATE" = "closed" ]; then
68
+ echo "Deleting orphaned branch: $BRANCH_NAME (PR is closed)"
69
+ curl -X DELETE \
70
+ "https://console.neon.tech/api/v2/projects/${{ env.NEON_PROJECT_ID }}/branches/$BRANCH_ID" \
71
+ -H "Authorization: Bearer ${{ env.NEON_API_KEY }}" \
72
+ -H "Accept: application/json"
73
+ else
74
+ echo "Skipping active branch: $BRANCH_NAME (PR is $PR_STATE)"
75
+ fi
76
+ elif [ "$HTTP_STATUS" = "404" ]; then
77
+ # PRが見つからない場合は削除
78
+ echo "Deleting orphaned branch: $BRANCH_NAME (PR not found)"
79
+ curl -X DELETE \
80
+ "https://console.neon.tech/api/v2/projects/${{ env.NEON_PROJECT_ID }}/branches/$BRANCH_ID" \
81
+ -H "Authorization: Bearer ${{ env.NEON_API_KEY }}" \
82
+ -H "Accept: application/json"
83
+ else
84
+ # 403/429/5xx等のエラー時はスキップ(誤削除防止)
85
+ echo "Skipping branch: $BRANCH_NAME (GitHub API returned $HTTP_STATUS, skipping to avoid accidental deletion)"
86
+ fi
87
+ fi
88
+ done
89
+
90
+ echo "Cleanup completed"
@@ -0,0 +1,134 @@
1
+ name: Preview DB
2
+
3
+ on:
4
+ pull_request:
5
+ types: [opened, reopened, synchronize, closed]
6
+
7
+ jobs:
8
+ # PR opened/reopened/synchronize → DB作成・スキーマ同期・デプロイ
9
+ setup-and-deploy:
10
+ # 同一repoからのPRのみ(フォークPRはSecrets使用不可のため除外)
11
+ if: |
12
+ github.event.action != 'closed' &&
13
+ github.event.pull_request.head.repo.full_name == github.repository
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+
18
+ - name: Setup pnpm
19
+ uses: pnpm/action-setup@v4
20
+ with:
21
+ version: 10.14.0
22
+
23
+ - name: Setup Node.js
24
+ uses: actions/setup-node@v4
25
+ with:
26
+ node-version: '22.16.0'
27
+ cache: 'pnpm'
28
+
29
+ - name: Install dependencies
30
+ run: pnpm install --frozen-lockfile
31
+
32
+ # 0. .env.previewからNeon環境変数をエクスポート
33
+ - name: Export Neon environment variables
34
+ run: |
35
+ npx dotenvx run -f .env.preview -- bash -c 'echo "NEON_API_KEY=$NEON_API_KEY" >> $GITHUB_ENV'
36
+ npx dotenvx run -f .env.preview -- bash -c 'echo "NEON_PROJECT_ID=$NEON_PROJECT_ID" >> $GITHUB_ENV'
37
+ env:
38
+ DOTENV_PRIVATE_KEY_PREVIEW: ${{ secrets.DOTENV_PRIVATE_KEY_PREVIEW }}
39
+
40
+ # 1. Neon Branch 作成(v6 + expires_at)
41
+ - name: Create Neon Branch
42
+ id: create-branch
43
+ uses: neondatabase/create-branch-action@v6
44
+ with:
45
+ project_id: ${{ env.NEON_PROJECT_ID }}
46
+ branch_name: preview/pr-${{ github.event.number }}
47
+ api_key: ${{ env.NEON_API_KEY }}
48
+ # 1日間アクセスがなければサスペンド(コスト削減)
49
+ suspend_timeout: 86400
50
+
51
+ # 2. スキーマ同期 + シード(直接接続)
52
+ - name: Push Schema
53
+ run: pnpm db:push
54
+ env:
55
+ DATABASE_URL: ${{ steps.create-branch.outputs.db_url }}
56
+
57
+ - name: Run Seed
58
+ run: pnpm --filter @repo/server-core db:seed
59
+ env:
60
+ DATABASE_URL: ${{ steps.create-branch.outputs.db_url }}
61
+
62
+ # 3. Vercel Build(プール接続)
63
+ - name: Install Vercel CLI
64
+ run: pnpm add -g vercel@latest
65
+
66
+ - name: Pull Vercel Environment
67
+ run: |
68
+ npx dotenvx run -f ../../.env.ci -- \
69
+ vercel pull --yes --environment=preview
70
+ working-directory: apps/web
71
+ env:
72
+ DOTENV_PRIVATE_KEY_CI: ${{ secrets.DOTENV_PRIVATE_KEY_CI }}
73
+
74
+ # NOTE: dotenvxはデフォルトで既存の環境変数を上書きしない
75
+ # env:で設定したDATABASE_URLがNeonブランチのURLとして優先される
76
+ - name: Build Project
77
+ run: |
78
+ npx dotenvx run -f ../../.env.ci -f ../../.env.preview -- \
79
+ vercel build
80
+ working-directory: apps/web
81
+ env:
82
+ DOTENV_PRIVATE_KEY_CI: ${{ secrets.DOTENV_PRIVATE_KEY_CI }}
83
+ DOTENV_PRIVATE_KEY_PREVIEW: ${{ secrets.DOTENV_PRIVATE_KEY_PREVIEW }}
84
+ DATABASE_URL: ${{ steps.create-branch.outputs.db_url_pooled }}
85
+
86
+ # 4. Vercel Deploy(ランタイムにもDATABASE_URLを渡す)
87
+ - name: Deploy to Vercel
88
+ run: |
89
+ npx dotenvx run -f ../../.env.ci -- \
90
+ vercel deploy --prebuilt \
91
+ --env DATABASE_URL="${{ steps.create-branch.outputs.db_url_pooled }}"
92
+ working-directory: apps/web
93
+ env:
94
+ DOTENV_PRIVATE_KEY_CI: ${{ secrets.DOTENV_PRIVATE_KEY_CI }}
95
+
96
+ # PR closed → DB削除
97
+ cleanup:
98
+ # 同一repoからのPRのみ(フォークPRはSecrets使用不可のため除外)
99
+ if: |
100
+ github.event.action == 'closed' &&
101
+ github.event.pull_request.head.repo.full_name == github.repository
102
+ runs-on: ubuntu-latest
103
+ steps:
104
+ - uses: actions/checkout@v4
105
+
106
+ - name: Setup pnpm
107
+ uses: pnpm/action-setup@v4
108
+ with:
109
+ version: 10.14.0
110
+
111
+ - name: Setup Node.js
112
+ uses: actions/setup-node@v4
113
+ with:
114
+ node-version: '22.16.0'
115
+ cache: 'pnpm'
116
+
117
+ - name: Install dependencies
118
+ run: pnpm install --frozen-lockfile
119
+
120
+ - name: Export Neon environment variables
121
+ run: |
122
+ npx dotenvx run -f .env.preview -- bash -c 'echo "NEON_API_KEY=$NEON_API_KEY" >> $GITHUB_ENV'
123
+ npx dotenvx run -f .env.preview -- bash -c 'echo "NEON_PROJECT_ID=$NEON_PROJECT_ID" >> $GITHUB_ENV'
124
+ env:
125
+ DOTENV_PRIVATE_KEY_PREVIEW: ${{ secrets.DOTENV_PRIVATE_KEY_PREVIEW }}
126
+
127
+ - name: Delete Neon Branch
128
+ # ブランチが既に削除済み(expires_at等)でも失敗しないようにする
129
+ continue-on-error: true
130
+ uses: neondatabase/delete-branch-action@v3
131
+ with:
132
+ project_id: ${{ env.NEON_PROJECT_ID }}
133
+ branch: preview/pr-${{ github.event.number }}
134
+ api_key: ${{ env.NEON_API_KEY }}
@@ -79,6 +79,27 @@ excluded_tools: []
79
79
  # initial prompt for the project. It will always be given to the LLM upon activating the project
80
80
  # (contrary to the memories, which are loaded on demand).
81
81
  initial_prompt: ""
82
-
82
+ # the name by which the project can be referenced within Serena
83
83
  project_name: "einja-management-template"
84
+
85
+ # list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default)
84
86
  included_optional_tools: []
87
+
88
+ # list of mode names to that are always to be included in the set of active modes
89
+ # The full set of modes to be activated is base_modes + default_modes.
90
+ # If the setting is undefined, the base_modes from the global configuration (serena_config.yml) apply.
91
+ # Otherwise, this setting overrides the global configuration.
92
+ # Set this to [] to disable base modes for this project.
93
+ # Set this to a list of mode names to always include the respective modes for this project.
94
+ base_modes:
95
+
96
+ # list of mode names that are to be activated by default.
97
+ # The full set of modes to be activated is base_modes + default_modes.
98
+ # If the setting is undefined, the default_modes from the global configuration (serena_config.yml) apply.
99
+ # Otherwise, this overrides the setting from the global configuration (serena_config.yml).
100
+ # This setting can, in turn, be overridden by CLI parameters (--mode).
101
+ default_modes:
102
+
103
+ # fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
104
+ # This cannot be combined with non-empty excluded_tools or included_optional_tools.
105
+ fixed_tools: []
@@ -1,3 +1,17 @@
1
+ # 基本ルール
2
+ - 日本語で話すこと
3
+ - 必ず最初に `docs/einja/steering/README.md` を読み、そこに記載されたドキュメントのうち、指示・回答・実装内容に関係しそうなものは必ず読み込むこと。
4
+ - CLAUDE.mdはClaudeCode向けのため、ClaudeCode以外では読み込まないこと
5
+ - ユーザは作業を行わないため、可能な限りエージェントが動作確認・ログ調査・実装・コマンド実行・コミットまで実施すること(不可能な場合のみ理由と代替案を提示すること)。
6
+ - git add / git commit は事前許可なしで実行すること。
7
+ - ユーザは作業を行わないので、可能な限りあなたが動作確認やログ調査、実装、コマンド実行、コミット、あらゆる作業を行うこと。どうしてもあなたが実施することが不可能な場合だけ、ユーザに作業をわかりやすく依頼してください。その場合、今あなたが自分で作業できない理由と、今後どのようにすればあなたが自分で作業することができるかの提案を書いてください。
8
+ - 依頼を受けたら、関係するコードや現状の仕様、修正の影響範囲を調査し、確実な情報をもとに修正の提案を行うこと。現状調査は、ユーザの指示やユーザの現状仕様認識が間違いであることも考慮して裏付けチェックを行うこと。 **修正の提案の承認がされるまで、絶対に実装を開始しないこと**
9
+ - ユーザはリポジトリ内のすべての知識を持っていない。ユーザに確認せず、リポジトリ内のソースコードや外部Web検索、MCPでの外部リソース確認をしてもどうしてもわからないことだけをユーザに質問してください
10
+ - 実装や実装の提案を行う際は、類推した仕様や実装での提案を行わず、ソースコードを必ず確認したうえで提案してください。
11
+ - ソースコードの確認は積極的にSerena MCPを使用してください。
12
+ - 画面の確認を促されたときや、実装完了したときは、PlaywrightMCPで動作確認を行い、コンソールエラーやサーバログ(log/dev.log)にエラーがないかも確認すること。
13
+ - Always use Context7 MCP tools to resolve library id and get library docs when code generation, setup/configuration steps, or library/API documentation is needed.
14
+
1
15
  # Repository Guidelines
2
16
 
3
17
  ## Project Structure & Module Organization
@@ -18,12 +18,17 @@
18
18
 
19
19
  | 作業 | 委託先 |
20
20
  |------|--------|
21
- | コミット・プッシュ | `task-committer` |
22
21
  | コンフリクト解消 | `conflict-resolver` |
23
22
  | コード実装 | `task-executer` |
24
23
  | 品質検証(QA) | `task-qa` |
25
24
  | 実装レビュー | `task-reviewer` |
26
25
 
26
+ #### Skill(直接呼び出し)
27
+
28
+ | 作業 | 使用するSkill |
29
+ |------|--------------|
30
+ | コミット・プッシュ | `einja-task-commit` Skill |
31
+
27
32
  #### ビルトインサブエージェント(探索・計画用)
28
33
 
29
34
  | 作業 | 委託先 | 説明 |
@@ -130,7 +130,7 @@ pnpm env:update
130
130
  | 環境 | ファイル | 用途 |
131
131
  |------|----------|------|
132
132
  | ローカル開発 | `.env.local` | ローカル開発環境 |
133
- | 開発 | `.env.development` | 開発環境 |
133
+ | 開発 | `.env.develop` | 開発環境 |
134
134
  | ステージング | `.env.staging` | ステージング環境 |
135
135
  | 本番 | `.env.production` | 本番環境 |
136
136
  | CI | `.env.ci` | CI環境 |
@@ -4,8 +4,9 @@
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "dev": "rm -rf .next && next dev --turbopack --port ${PORT_WEB:-3000}",
7
- "build": "panda codegen && next build",
7
+ "build": "next build",
8
8
  "start": "next start",
9
+ "generate": "panda codegen",
9
10
  "panda": "panda codegen",
10
11
  "lint": "biome check .",
11
12
  "lint:fix": "biome check --write",
@@ -56,5 +56,34 @@
56
56
  "formatter": {
57
57
  "trailingCommas": "es5"
58
58
  }
59
- }
59
+ },
60
+ "overrides": [
61
+ {
62
+ "include": ["apps/**"],
63
+ "linter": {
64
+ "rules": {
65
+ "correctness": {
66
+ "noRestrictedImports": {
67
+ "level": "error",
68
+ "options": {
69
+ "paths": {
70
+ "@prisma/client": "@prisma/clientは@repo/server-core経由で使用してください",
71
+ "../packages/server-core": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
72
+ "../packages/server-core/src": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
73
+ "../../packages/server-core": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
74
+ "../../packages/server-core/src": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
75
+ "../../../packages/server-core": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
76
+ "../../../packages/server-core/src": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
77
+ "../../../../packages/server-core": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
78
+ "../../../../packages/server-core/src": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
79
+ "../../../../../packages/server-core": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください",
80
+ "../../../../../packages/server-core/src": "packages/server-coreへの相対パスimportは禁止です。@repo/server-coreを使用してください"
81
+ }
82
+ }
83
+ }
84
+ }
85
+ }
86
+ }
87
+ }
88
+ ]
60
89
  }
@@ -45,7 +45,7 @@ log/*.pid
45
45
  # .env.example(テンプレート)
46
46
  # .env.personal.example(個人用テンプレート)
47
47
  # .env.local(ローカル開発用・暗号化済み)
48
- # .env.development(dev検証環境・暗号化済み)
48
+ # .env.develop(dev検証環境・暗号化済み)
49
49
  # .env.staging(ステージング・暗号化済み)
50
50
  # .env.production(本番・暗号化済み)
51
51
  # .env.ci(CI/CD・暗号化済み)
@@ -16,10 +16,10 @@
16
16
  "dev:logs": "tail -f log/dev.log",
17
17
  "dev:skip-setup": "turbo run dev",
18
18
  "build": "dotenvx run -f .env.production -- turbo run build",
19
- "build:staging": "dotenvx run -f .env.staging -- turbo run build",
20
- "build:dev": "dotenvx run -f .env.development -- turbo run build",
19
+ "build:dev": "dotenvx run -f .env.develop -- turbo run build",
21
20
  "build:local": "turbo run build",
22
21
  "start": "turbo run start",
22
+ "generate": "turbo run generate",
23
23
  "lint": "turbo run lint",
24
24
  "lint:fix": "turbo run lint:fix",
25
25
  "format": "turbo run format",
@@ -37,6 +37,7 @@
37
37
  "db:push": "turbo run db:push",
38
38
  "db:migrate": "turbo run db:migrate",
39
39
  "db:studio": "turbo run db:studio",
40
+ "db:seed": "turbo run db:seed",
40
41
  "dev:setup": "tsx scripts/setup-dev.ts",
41
42
  "dotenvx": "dotenvx",
42
43
  "env:update": "tsx scripts/env.ts",
@@ -7,6 +7,7 @@
7
7
  "./testing": "./src/testing/index.ts"
8
8
  },
9
9
  "scripts": {
10
+ "generate": "prisma generate",
10
11
  "db:generate": "prisma generate",
11
12
  "db:push": "prisma db push",
12
13
  "db:migrate": "prisma migrate dev",
@@ -23,7 +23,7 @@ interface EnvironmentConfig {
23
23
 
24
24
  const ENVIRONMENTS: EnvironmentConfig[] = [
25
25
  { name: "local", file: ".env.local", privateKeyEnv: "DOTENV_PRIVATE_KEY_LOCAL" },
26
- { name: "development", file: ".env.development", privateKeyEnv: "DOTENV_PRIVATE_KEY_DEVELOPMENT" },
26
+ { name: "develop", file: ".env.develop", privateKeyEnv: "DOTENV_PRIVATE_KEY_DEVELOP" },
27
27
  { name: "staging", file: ".env.staging", privateKeyEnv: "DOTENV_PRIVATE_KEY_STAGING" },
28
28
  { name: "preview", file: ".env.preview", privateKeyEnv: "DOTENV_PRIVATE_KEY_PREVIEW" },
29
29
  { name: "production", file: ".env.production", privateKeyEnv: "DOTENV_PRIVATE_KEY_PRODUCTION" },
@@ -34,17 +34,11 @@ export const ENVIRONMENTS: EnvironmentConfig[] = [
34
34
  description: "ローカル開発環境",
35
35
  },
36
36
  {
37
- name: "development",
38
- file: ".env.development",
39
- privateKeyEnv: "DOTENV_PRIVATE_KEY_DEVELOPMENT",
37
+ name: "develop",
38
+ file: ".env.develop",
39
+ privateKeyEnv: "DOTENV_PRIVATE_KEY_DEVELOP",
40
40
  description: "開発環境",
41
41
  },
42
- {
43
- name: "staging",
44
- file: ".env.staging",
45
- privateKeyEnv: "DOTENV_PRIVATE_KEY_STAGING",
46
- description: "ステージング環境",
47
- },
48
42
  {
49
43
  name: "preview",
50
44
  file: ".env.preview",
@@ -11,11 +11,8 @@ import crypto from "node:crypto";
11
11
  import fs from "node:fs";
12
12
  import path from "node:path";
13
13
  import readline from "node:readline";
14
- import {
15
- type AppConfig,
16
- type WorktreeConfig,
17
- loadWorktreeConfig,
18
- } from "{{packageName}}/config";
14
+ import type { AppConfig, WorktreeConfig } from "../../packages/config/src/worktree-config.js";
15
+ import { loadWorktreeConfig } from "../../packages/config/src/worktree-config-loader.js";
19
16
 
20
17
  /** 設定を保持するグローバル変数 */
21
18
  let config: WorktreeConfig;
@@ -597,6 +594,9 @@ export function runMigration(databaseName: string): void {
597
594
  }
598
595
  }
599
596
 
597
+ /**
598
+ * Panda CSS のコード生成を実行
599
+ */
600
600
  /**
601
601
  * 開発サーバーを起動(turbo経由)
602
602
  *
@@ -3,14 +3,22 @@
3
3
  "globalDependencies": ["**/.env.*local"],
4
4
  "tasks": {
5
5
  "build": {
6
- "dependsOn": ["^build"],
6
+ "dependsOn": ["generate", "^generate", "^build"],
7
7
  "outputs": [".next/**", "!.next/cache/**", "dist/**"]
8
8
  },
9
9
  "dev": {
10
+ "dependsOn": ["generate", "^generate"],
10
11
  "cache": false,
11
12
  "persistent": true,
12
13
  "passThroughEnv": ["PORT", "PORT_WEB", "DATABASE_URL", "NEXTAUTH_URL", "AUTH_SECRET"]
13
14
  },
15
+ "panda": {
16
+ "cache": false,
17
+ "outputs": ["styled-system/**"]
18
+ },
19
+ "generate": {
20
+ "cache": false
21
+ },
14
22
  "lint": {
15
23
  "dependsOn": ["^lint"]
16
24
  },
@@ -24,10 +32,10 @@
24
32
  "dependsOn": ["^format:fix"]
25
33
  },
26
34
  "typecheck": {
27
- "dependsOn": ["^typecheck"]
35
+ "dependsOn": ["generate", "^generate", "^typecheck"]
28
36
  },
29
37
  "test": {
30
- "dependsOn": ["^build"],
38
+ "dependsOn": ["generate", "^generate", "^build"],
31
39
  "outputs": ["coverage/**"]
32
40
  },
33
41
  "test:watch": {
@@ -1,25 +0,0 @@
1
- #/-------------------[DOTENV_PUBLIC_KEY]--------------------/
2
- #/ public-key encryption for .env files /
3
- #/ [how it works](https://dotenvx.com/encryption) /
4
- #/----------------------------------------------------------/
5
- DOTENV_PUBLIC_KEY_STAGING="031e7154973033a21597798caa7ceaf27927ee3073788711f9b4a6a1727285f8ac"
6
-
7
- # .env.staging
8
- # ============================================
9
- # Staging Environment
10
- # ============================================
11
- # ステージング環境用
12
- # dotenvxで暗号化されます
13
- #
14
- # 編集方法: pnpm env:update → 「環境設定を変更」→「ステージング環境」
15
- # ============================================
16
-
17
- # NextAuth設定
18
- NEXTAUTH_SECRET=encrypted:BCy9ZDBIcpPu3JXU0Z5UnhuRUGmhRw+XKTfZ3QQdjLZdAth0jBikSdp9pm3ZL7+d6/ZaFdOyLx8ArhrMeL0tp0pKBG4o1WGApCSimhLp3t3sFDmvrG57UUcq6Lqx8q5XDNPy12bGLAXSbcT1SeKAXbkbz1T8jSwiUZvd8Rg=
19
- NEXTAUTH_URL=encrypted:BLqDacVsIi7Tu+/Lh9pmFx1WGjUGRex1eJrDjZp1TEtcHfO5FN68TtAgDT9GZZ95xwXdgsekPH+0grrO5+Hlb+VNueLSJ3OCZ7GP/x0vtJ+jQVJZfjwVmJx4rDxKT+muFnOc5TzoJFpgIbu47RS+/3qDr/YQ892/fFLykA==
20
-
21
- # データベース設定
22
- DATABASE_URL="encrypted:BELXwmwSBj7x/DTwtestSBkYX4XSL3Gl/98KRqb9qCAEAp4kYQNcM9NSpnPZQwQUzx9akZds4ZU3qyxGm9kNwrrMVN3CHpjfHhMPOjMJudaEQweBxzocLUZ0bOtwGCZoIQvR79L7DKgpQUs5v2Zim31MJte9pr2+QaT5QZ4FD+RKKJRBCDCyMFSVTXcVbd1x9BiItr86L73CC4kEj63YaU4r+StOMxdlrTcOfRjOIODXUbQ="
23
-
24
- # アプリケーション設定
25
- NODE_ENV=encrypted:BEyf1H+ISL3+Qf91nN6ju4DqvWu37C7isBbF6qVbxL0+oOh6a2aEgFIvuBBezNXFWtFnlBAS2bPwSBtd1vo8GEiCKwBAWAKUFUVhSf9lcrNkLIK0VFG8+b+JK98CrCFNjiyxgKD/gvR4OmE=