@kood/claude-code 0.3.4 → 0.3.6

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/dist/index.js CHANGED
@@ -409,7 +409,7 @@ var init = async (options) => {
409
409
 
410
410
  // src/index.ts
411
411
  var program = new Command();
412
- program.name("claude-code").description("Claude Code documentation installer for projects").version("0.3.4");
412
+ program.name("claude-code").description("Claude Code documentation installer for projects").version("0.3.6");
413
413
  program.option(
414
414
  "-t, --template <names>",
415
415
  "template names (comma-separated: tanstack-start,hono)"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kood/claude-code",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "Claude Code documentation installer for projects",
5
5
  "type": "module",
6
6
  "bin": "./dist/index.js",
@@ -15,6 +15,8 @@
15
15
 
16
16
  | 분류 | 금지 |
17
17
  |------|------|
18
+ | **라우트** | Flat 파일 라우트 (`routes/users.tsx`) |
19
+ | **Route Export** | `export const IndexRoute`, `const Route` (export 안함) |
18
20
  | **API** | `/api` 라우터 생성 (Server Functions 사용) |
19
21
  | **레이어** | Service Layer 건너뛰기, Routes에서 직접 DB 접근 |
20
22
  | **검증** | Handler 내부 수동 검증, 인증 로직 분산 |
@@ -28,6 +30,8 @@
28
30
 
29
31
  | 분류 | 필수 |
30
32
  |------|------|
33
+ | **라우트 구조** | 페이지마다 폴더 생성 (`routes/users/index.tsx`) |
34
+ | **Route Export** | `export const Route = createFileRoute(...)` 필수 |
31
35
  | **계층 구조** | Routes → Server Functions → Services → Database |
32
36
  | **Route Group** | 목록 → `(main)/`, 생성/편집 → 외부 |
33
37
  | **페이지 분리** | 100줄+ → `-components`, 200줄+ → `-sections` |
@@ -80,12 +84,60 @@
80
84
 
81
85
  ---
82
86
 
87
+ <route_export_rule>
88
+
89
+ ## Route Export 규칙
90
+
91
+ > ⚠️ **`export const Route` 필수**
92
+ >
93
+ > TanStack Router는 모든 라우트 파일에서 **정확히 `Route`라는 이름**으로 내보내야 합니다.
94
+ >
95
+ > `tsr generate` 및 `tsr watch` 명령어가 자동으로 경로를 생성하고 업데이트합니다.
96
+
97
+ | ❌ 금지 | ✅ 필수 |
98
+ |--------|--------|
99
+ | `const Route = createFileRoute(...)` | `export const Route = createFileRoute(...)` |
100
+ | `export const IndexRoute = ...` | `export const Route = ...` |
101
+ | `export default createFileRoute(...)` | `export const Route = createFileRoute(...)` |
102
+
103
+ ```typescript
104
+ // ❌ 금지: export 없음
105
+ const Route = createFileRoute('/users')({
106
+ component: UsersPage,
107
+ })
108
+
109
+ // ❌ 금지: 다른 이름
110
+ export const UsersRoute = createFileRoute('/users')({
111
+ component: UsersPage,
112
+ })
113
+
114
+ // ✅ 필수: 정확히 'Route' 이름으로 export
115
+ export const Route = createFileRoute('/users')({
116
+ component: UsersPage,
117
+ })
118
+ ```
119
+
120
+ </route_export_rule>
121
+
122
+ ---
123
+
83
124
  <layers>
84
125
 
85
126
  ## Layer Architecture
86
127
 
87
128
  ### 1. Routes Layer
88
129
 
130
+ > ⚠️ **페이지마다 폴더 생성 필수**
131
+ >
132
+ > 모든 페이지는 **반드시 폴더 구조**로 만들어야 합니다. Flat 파일 방식(`routes/users.tsx`)은 금지됩니다.
133
+ >
134
+ > **이유:** -components/, -functions/, -hooks/ 등 페이지 전용 리소스를 체계적으로 관리하기 위함입니다.
135
+ >
136
+ > | ❌ 금지 | ✅ 필수 |
137
+ > |--------|--------|
138
+ > | `routes/users.tsx` | `routes/users/index.tsx` |
139
+ > | `routes/posts.tsx` | `routes/posts/(main)/index.tsx` |
140
+
89
141
  ```
90
142
  routes/<route-name>/
91
143
  ├── (main)/ # route group (목록 페이지)
@@ -107,27 +159,58 @@ routes/<route-name>/
107
159
  | **-components/** | 100-200줄 | 페이지 전용 컴포넌트 분리 |
108
160
  | **-sections/** | 200줄+ | 논리적 섹션 분리 |
109
161
  | **-tabs/** | 탭 UI | 탭 콘텐츠 분리 |
110
- | **_layout/** | Pathless | 공통 레이아웃 (URL 미영향) |
162
+ | **route.tsx** | 레이아웃 | 하위 경로 공통 레이아웃 |
111
163
 
112
164
  #### Layout Routes 패턴
113
165
 
166
+ > ⚠️ **route.tsx로 레이아웃 구성**
167
+ >
168
+ > `route.tsx`는 하위 경로의 공통 레이아웃 역할을 합니다.
169
+ > `index.tsx`는 Route Group `()`으로 묶어야 합니다.
170
+ >
171
+ > **필수:** `route.tsx`는 반드시 `component`를 export해야 합니다.
172
+ >
173
+ > | ❌ 금지 | ✅ 필수 |
174
+ > |--------|--------|
175
+ > | `export const Route = createFileRoute(...)({})` | `export const Route = createFileRoute(...)({ component: ... })` |
176
+
114
177
  ```
115
178
  routes/
116
- ├── (auth)/_layout/ # Pathless Layout
117
- │ ├── route.tsx # <Outlet />
118
- │ ├── login.tsx # /login
119
- │ └── register.tsx # /register
179
+ ├── (auth)/
180
+ │ ├── route.tsx # 레이아웃 (<Outlet />)
181
+ │ ├── (main)/
182
+ └── index.tsx # /auth (목록/메인)
183
+ │ ├── login/
184
+ │ │ └── index.tsx # /auth/login
185
+ │ └── register/
186
+ │ └── index.tsx # /auth/register
120
187
  ```
121
188
 
122
189
  ```typescript
123
- // routes/(auth)/_layout/route.tsx
124
- export const Route = createFileRoute('/(auth)/_layout')({
190
+ // ❌ 금지: component 없음
191
+ export const Route = createFileRoute('/(auth)')({
192
+ beforeLoad: async () => ({ user: await getUser() }),
193
+ })
194
+
195
+ // ✅ 필수: component 반드시 포함
196
+ // routes/(auth)/route.tsx - 레이아웃
197
+ export const Route = createFileRoute('/(auth)')({
125
198
  component: () => (
126
199
  <div className="auth-container">
127
200
  <Outlet />
128
201
  </div>
129
202
  ),
130
203
  })
204
+
205
+ // routes/(auth)/(main)/index.tsx - 메인 페이지
206
+ export const Route = createFileRoute('/(auth)/')({
207
+ component: AuthMainPage,
208
+ })
209
+
210
+ // routes/(auth)/login/index.tsx
211
+ export const Route = createFileRoute('/(auth)/login')({
212
+ component: LoginPage,
213
+ })
131
214
  ```
132
215
 
133
216
  ### 2. Services Layer