create-einja-app 0.2.8 → 0.2.10
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 +12 -7
- package/dist/cli.js +879 -14
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
- package/templates/default/.envrc +29 -3
- package/templates/default/AGENTS.md +52 -0
- package/templates/default/CLAUDE.md +2 -2
- package/templates/default/scripts/template-update.ts +3 -3
package/package.json
CHANGED
package/templates/default/.envrc
CHANGED
|
@@ -1,4 +1,30 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @einja:managed:start
|
|
2
2
|
dotenv_if_exists .env
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
# メインワークツリーの.env.personalを共有
|
|
5
|
+
get_main_worktree() {
|
|
6
|
+
local current_worktree=""
|
|
7
|
+
while IFS= read -r line; do
|
|
8
|
+
if [[ "$line" == "worktree "* ]]; then
|
|
9
|
+
current_worktree="${line#worktree }"
|
|
10
|
+
elif [[ "$line" == "bare" ]]; then
|
|
11
|
+
current_worktree=""
|
|
12
|
+
elif [[ -z "$line" && -n "$current_worktree" ]]; then
|
|
13
|
+
echo "$current_worktree"
|
|
14
|
+
return
|
|
15
|
+
fi
|
|
16
|
+
done < <(git worktree list --porcelain 2>/dev/null)
|
|
17
|
+
if [[ -n "$current_worktree" ]]; then
|
|
18
|
+
echo "$current_worktree"
|
|
19
|
+
fi
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
MAIN_WORKTREE=$(get_main_worktree)
|
|
23
|
+
if [ -n "$MAIN_WORKTREE" ] && [ -f "$MAIN_WORKTREE/.env.personal" ]; then
|
|
24
|
+
dotenv_if_exists "$MAIN_WORKTREE/.env.personal"
|
|
25
|
+
fi
|
|
26
|
+
# @einja:managed:end
|
|
27
|
+
|
|
28
|
+
# @einja:seed:start id="project-env"
|
|
29
|
+
# プロジェクト固有の環境設定を追加
|
|
30
|
+
# @einja:seed:end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Repository Guidelines
|
|
2
|
+
|
|
3
|
+
## Project Structure & Module Organization
|
|
4
|
+
- `apps/web/` hosts the main Next.js 15 admin app (App Router in `apps/web/src/app/`).
|
|
5
|
+
- Shared packages live under `packages/`:
|
|
6
|
+
- `packages/ui/` for shared UI components (shadcn/ui).
|
|
7
|
+
- `packages/front-core/` for shared frontend auth/hooks/utils.
|
|
8
|
+
- `packages/server-core/` for Prisma schema and backend utilities.
|
|
9
|
+
- `packages/config/` for shared Biome/TS/Panda configs.
|
|
10
|
+
- Database schema lives in `packages/server-core/prisma/`.
|
|
11
|
+
- Scripts live in `scripts/`, logs in `log/`, docs in `docs/`.
|
|
12
|
+
- Worktree dev auto-assigns ports per branch; check `.env.local` for `PORT`.
|
|
13
|
+
|
|
14
|
+
## Build, Test, and Development Commands
|
|
15
|
+
- `pnpm dev:setup`: initial setup (.env creation, DB start/init).
|
|
16
|
+
- `pnpm dev:bg`: run dev servers in the background (logs at `log/dev.log`).
|
|
17
|
+
- `pnpm dev:status` / `pnpm dev:logs` / `pnpm dev:stop`: manage background dev servers.
|
|
18
|
+
- `pnpm build` / `pnpm start`: production build and run.
|
|
19
|
+
- `pnpm lint` / `pnpm format` / `pnpm typecheck`: Biome + TypeScript checks.
|
|
20
|
+
- `pnpm test` / `pnpm test:watch` / `pnpm test:coverage`: Vitest runs.
|
|
21
|
+
- `pnpm db:generate` / `pnpm db:push` / `pnpm db:migrate`: Prisma client and migrations.
|
|
22
|
+
|
|
23
|
+
## Coding Style & Naming Conventions
|
|
24
|
+
- TypeScript strict mode; keep types explicit at module boundaries.
|
|
25
|
+
- Biome formatting: 2-space indentation and double quotes.
|
|
26
|
+
- Panda CSS generates styles into `apps/web/src/styled-system/` (do not hand-edit).
|
|
27
|
+
- Import patterns: app-local uses `@/...`, shared uses `@repo/...`.
|
|
28
|
+
|
|
29
|
+
## Testing Guidelines
|
|
30
|
+
- Unit/integration tests use Vitest + React Testing Library.
|
|
31
|
+
- E2E coverage uses Playwright (Chromium).
|
|
32
|
+
- Prefer colocated tests near source; use `*.test.ts` / `*.test.tsx` naming.
|
|
33
|
+
- Run the minimal scope first (`pnpm --filter @repo/web test`) before full suite.
|
|
34
|
+
- Test expectations and scope are defined in `docs/einja/steering/development/testing-strategy.md` (read before adding new suites).
|
|
35
|
+
|
|
36
|
+
## Commit & Pull Request Guidelines
|
|
37
|
+
- Commit history follows Conventional Commits: `feat:`, `fix:`, `chore(scope):`.
|
|
38
|
+
- Use clear scopes when relevant (e.g., `feat(cli): ...`).
|
|
39
|
+
- PRs should include: summary, test evidence, and screenshots for UI changes.
|
|
40
|
+
- Link related issues and call out any migrations or env changes.
|
|
41
|
+
- Commit rules live in `docs/einja/steering/commit-rules.md` (keep prefixes and scopes consistent).
|
|
42
|
+
- Review expectations are in `docs/einja/steering/development/review-guidelines.md` (use the checklist before requesting review).
|
|
43
|
+
|
|
44
|
+
## Architecture & Workflow References
|
|
45
|
+
- Branch naming and lifecycle rules: `docs/einja/steering/branch-strategy.md`.
|
|
46
|
+
- Day-to-day dev flow and checkpoints: `docs/einja/steering/development-workflow.md`.
|
|
47
|
+
- System overview and major boundaries: `docs/einja/steering/architecture.md`.
|
|
48
|
+
- Environment variable policy and storage: `docs/einja/steering/infrastructure/environment-variables.md`.
|
|
49
|
+
|
|
50
|
+
## Security & Configuration Tips
|
|
51
|
+
- Manage env files via `pnpm env:update`; encrypted secrets require `.env.keys`.
|
|
52
|
+
- Local DB runs via `docker-compose up -d postgres` (port `25432`).
|
|
@@ -410,7 +410,7 @@ export const { handlers, signIn, signOut, auth } = NextAuth(authOptions);
|
|
|
410
410
|
- @docs/einja/memory/decisions.md - 過去の意思決定記録(セッション跨ぎで継承)
|
|
411
411
|
- @docs/einja/memory/patterns.md - 再利用可能なパターン(セッション跨ぎで継承)
|
|
412
412
|
|
|
413
|
-
<!-- @einja:
|
|
413
|
+
<!-- @einja:excluded:start -->
|
|
414
414
|
## このリポジトリ限定の設定
|
|
415
415
|
|
|
416
416
|
このセクションはテンプレート生成時に除外され、CLIで他リポジトリにコピーされません。
|
|
@@ -439,4 +439,4 @@ export const { handlers, signIn, signOut, auth } = NextAuth(authOptions);
|
|
|
439
439
|
| `CLAUDE.md` | `scaffolds/CLAUDE.md.template` | **変換生成** |
|
|
440
440
|
|
|
441
441
|
**コピー先のファイルは直接編集禁止**(ビルド時に上書きされる)
|
|
442
|
-
<!-- @einja:
|
|
442
|
+
<!-- @einja:excluded:end -->
|
|
@@ -168,11 +168,11 @@ function transformImports(content: string): string {
|
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
/**
|
|
171
|
-
* @einja:
|
|
171
|
+
* @einja:excluded マーカーを除去し、除外後の空行・水平線をクリーンアップ
|
|
172
172
|
*/
|
|
173
173
|
function removeExcludeMarkers(content: string): string {
|
|
174
174
|
const excludePattern =
|
|
175
|
-
/<!-- @einja:
|
|
175
|
+
/<!-- @einja:excluded:start -->[\s\S]*?<!-- @einja:excluded:end -->/g;
|
|
176
176
|
let result = content.replace(excludePattern, "");
|
|
177
177
|
|
|
178
178
|
// 連続する水平線を1つに
|
|
@@ -190,7 +190,7 @@ function removeExcludeMarkers(content: string): string {
|
|
|
190
190
|
function transformFileContent(filePath: string, content: string): string {
|
|
191
191
|
const fileName = filePath.split("/").pop() || "";
|
|
192
192
|
|
|
193
|
-
// ルートREADME.mdの変換(@einja:
|
|
193
|
+
// ルートREADME.mdの変換(@einja:excluded マーカー除去)
|
|
194
194
|
if (filePath === "README.md") {
|
|
195
195
|
return removeExcludeMarkers(content);
|
|
196
196
|
}
|