create-einja-app 0.1.2 → 0.2.2
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 +80 -1
- package/dist/cli.js +875 -23
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/default/.env.development +25 -0
- package/templates/default/.env.local +24 -0
- package/templates/default/.env.production +25 -0
- package/templates/default/.env.staging +25 -0
- package/templates/default/.github/dependabot.yml +63 -0
- package/templates/default/.github/workflows/ci.yml +52 -0
- package/templates/default/.github/workflows/claude.yml +38 -0
- package/templates/default/.husky/_/applypatch-msg +2 -0
- package/templates/default/.husky/_/commit-msg +2 -0
- package/templates/default/.husky/_/gitignore +1 -0
- package/templates/default/.husky/_/h +22 -0
- package/templates/default/.husky/_/husky.sh +9 -0
- package/templates/default/.husky/_/post-applypatch +2 -0
- package/templates/default/.husky/_/post-checkout +2 -0
- package/templates/default/.husky/_/post-commit +2 -0
- package/templates/default/.husky/_/post-merge +2 -0
- package/templates/default/.husky/_/post-rewrite +2 -0
- package/templates/default/.husky/_/pre-applypatch +2 -0
- package/templates/default/.husky/_/pre-auto-gc +2 -0
- package/templates/default/.husky/_/pre-commit +2 -0
- package/templates/default/.husky/_/pre-merge-commit +2 -0
- package/templates/default/.husky/_/pre-push +2 -0
- package/templates/default/.husky/_/pre-rebase +2 -0
- package/templates/default/.husky/_/prepare-commit-msg +2 -0
- package/templates/default/.serena/gitignore +1 -0
- package/templates/default/.serena/project.yml +84 -0
- package/templates/default/CLAUDE.md +27 -0
- package/templates/default/README.md +150 -45
- package/templates/default/apps/web/server/presentation/routes/userRoutes.ts +2 -5
- package/templates/default/apps/web/src/app/(authenticated)/data/_components/UserTable.tsx +110 -113
- package/templates/default/apps/web/src/app/(authenticated)/data/_components/UserTableContainer.tsx +5 -17
- package/templates/default/apps/web/src/app/(authenticated)/data/page.tsx +9 -7
- package/templates/default/apps/web/src/app/api/rpc/[[...route]]/route.ts +1 -1
- package/templates/default/apps/web/src/hooks/api/prefetch-users.ts +63 -0
- package/templates/default/apps/web/src/hooks/{use-users.ts → api/use-users.ts} +11 -46
- package/templates/default/apps/web/src/lib/api/parse-response.ts +114 -0
- package/templates/default/apps/web/src/shared/schemas/user.ts +36 -0
- package/templates/default/gitignore +86 -0
- package/templates/default/package.json +1 -1
- package/templates/default/worktree.config.json +14 -0
- package/templates/default/.templateignore +0 -60
- package/templates/default/middleware.ts +0 -32
- package/templates/default/apps/web/src/lib/{api-client.ts → api/client.ts} +1 -1
package/README.md
CHANGED
|
@@ -98,6 +98,78 @@ cd existing-project
|
|
|
98
98
|
npx create-einja-app --setup
|
|
99
99
|
```
|
|
100
100
|
|
|
101
|
+
### `create-einja-app add [options]`
|
|
102
|
+
|
|
103
|
+
既存のモノレポにEinja標準構成を追加します。
|
|
104
|
+
|
|
105
|
+
**オプション:**
|
|
106
|
+
|
|
107
|
+
| オプション | 説明 | デフォルト |
|
|
108
|
+
|----------|------|----------|
|
|
109
|
+
| `-y, --yes` | 対話プロンプトをスキップ(全コンポーネント選択) | false |
|
|
110
|
+
| `--all` | `-y`と同義 | false |
|
|
111
|
+
| `--dry-run` | 変更をプレビュー(実際のファイル操作なし) | false |
|
|
112
|
+
|
|
113
|
+
**対話式フロー:**
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
$ npx create-einja-app add
|
|
117
|
+
|
|
118
|
+
? 追加するコンポーネントを選択:
|
|
119
|
+
[x] packages/ - 共通パッケージ
|
|
120
|
+
[x] apps/ - アプリテンプレート
|
|
121
|
+
[x] 直下設定ファイル
|
|
122
|
+
|
|
123
|
+
? 追加するパッケージを選択:
|
|
124
|
+
[x] front-core [x] server-core
|
|
125
|
+
[x] config [x] ui
|
|
126
|
+
|
|
127
|
+
? 追加するアプリを選択:
|
|
128
|
+
[x] web
|
|
129
|
+
|
|
130
|
+
✓ 追加完了!
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**競合処理:**
|
|
134
|
+
|
|
135
|
+
ファイルの競合は以下のマーカーベースで処理されます:
|
|
136
|
+
- `@einja:managed` - テンプレートで上書き
|
|
137
|
+
- `@einja:seed` - ローカル優先(初回のみコピー)
|
|
138
|
+
- マーカーなし - 既存ファイル優先
|
|
139
|
+
|
|
140
|
+
**JSONマージ設定 (.einja-sync.json):**
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"jsonPaths": {
|
|
145
|
+
"managed": {
|
|
146
|
+
"package.json": ["scripts.dev", "scripts.build"]
|
|
147
|
+
},
|
|
148
|
+
"seed": {
|
|
149
|
+
"package.json": ["scripts.custom"]
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**除外されるファイル:**
|
|
156
|
+
- `.claude/`, `docs/einja/`, `CLAUDE.md`, `.mcp.json` → @einja/cli管轄
|
|
157
|
+
- `.gitignore`に含まれるファイル
|
|
158
|
+
- 自動生成ファイル(node_modules/, styled-system/等)
|
|
159
|
+
|
|
160
|
+
**例:**
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# 対話式で追加
|
|
164
|
+
npx create-einja-app add
|
|
165
|
+
|
|
166
|
+
# 全コンポーネントを追加(プロンプトスキップ)
|
|
167
|
+
npx create-einja-app add --all
|
|
168
|
+
|
|
169
|
+
# プレビューのみ
|
|
170
|
+
npx create-einja-app add --dry-run
|
|
171
|
+
```
|
|
172
|
+
|
|
101
173
|
---
|
|
102
174
|
|
|
103
175
|
## プロジェクト構成
|
|
@@ -136,6 +208,9 @@ my-project/
|
|
|
136
208
|
# プロジェクトディレクトリに移動
|
|
137
209
|
cd my-project
|
|
138
210
|
|
|
211
|
+
# 環境変数を設定(重要!)
|
|
212
|
+
pnpm env:update
|
|
213
|
+
|
|
139
214
|
# PostgreSQLを起動
|
|
140
215
|
docker-compose up -d postgres
|
|
141
216
|
|
|
@@ -143,7 +218,11 @@ docker-compose up -d postgres
|
|
|
143
218
|
pnpm dev
|
|
144
219
|
```
|
|
145
220
|
|
|
146
|
-
|
|
221
|
+
> ⚠️ **重要**: テンプレートにはサンプルの環境変数ファイルが含まれています。
|
|
222
|
+
> `pnpm env:update` を実行して、自分のプロジェクト用に環境変数を再設定してください。
|
|
223
|
+
|
|
224
|
+
開発サーバーが起動したら、ターミナルに表示されるURLにアクセスしてください。
|
|
225
|
+
(ポート番号はワークツリーのブランチ名から自動計算されます)
|
|
147
226
|
|
|
148
227
|
---
|
|
149
228
|
|