@mandujs/cli 0.15.1 → 0.15.3
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.ko.md +33 -33
- package/README.md +354 -354
- package/package.json +2 -2
- package/src/commands/check.ts +71 -7
- package/src/commands/contract.ts +173 -173
- package/src/commands/dev.ts +9 -42
- package/src/commands/guard-arch.ts +303 -303
- package/src/commands/init.ts +50 -5
- package/src/commands/monitor.ts +300 -300
- package/src/commands/openapi.ts +107 -107
- package/src/commands/registry.ts +1 -0
- package/src/commands/start.ts +9 -42
- package/src/errors/codes.ts +35 -35
- package/src/errors/index.ts +2 -2
- package/src/errors/messages.ts +143 -143
- package/src/hooks/index.ts +17 -17
- package/src/hooks/preaction.ts +256 -256
- package/src/main.ts +9 -7
- package/src/terminal/banner.ts +166 -166
- package/src/terminal/help.ts +306 -306
- package/src/terminal/index.ts +71 -71
- package/src/terminal/output.ts +295 -295
- package/src/terminal/palette.ts +30 -30
- package/src/terminal/progress.ts +327 -327
- package/src/terminal/stream-writer.ts +214 -214
- package/src/terminal/table.ts +354 -354
- package/src/terminal/theme.ts +142 -142
- package/src/util/bun.ts +6 -6
- package/src/util/fs.ts +23 -23
- package/src/util/handlers.ts +49 -5
- package/src/util/lockfile.ts +66 -0
- package/src/util/output.ts +22 -22
- package/src/util/port.ts +71 -71
- package/templates/default/AGENTS.md +96 -96
- package/templates/default/app/api/health/route.ts +13 -13
- package/templates/default/app/globals.css +49 -49
- package/templates/default/app/layout.tsx +27 -27
- package/templates/default/app/page.tsx +38 -38
- package/templates/default/src/client/shared/lib/utils.ts +16 -16
- package/templates/default/src/client/shared/ui/button.tsx +57 -57
- package/templates/default/src/client/shared/ui/card.tsx +1 -1
- package/templates/default/src/client/shared/ui/index.ts +21 -21
- package/templates/default/src/client/shared/ui/input.tsx +5 -1
- package/templates/default/tests/example.test.ts +58 -58
- package/templates/default/tests/helpers.ts +52 -52
- package/templates/default/tests/setup.ts +9 -9
- package/templates/default/tsconfig.json +23 -23
- package/templates/realtime-chat/AGENTS.md +96 -0
- package/templates/realtime-chat/app/api/chat/messages/route.ts +63 -0
- package/templates/realtime-chat/app/api/chat/stream/route.ts +85 -0
- package/templates/realtime-chat/app/api/health/route.ts +13 -0
- package/templates/realtime-chat/app/globals.css +49 -0
- package/templates/realtime-chat/app/layout.tsx +27 -0
- package/templates/realtime-chat/app/page.tsx +16 -0
- package/templates/realtime-chat/package.json +34 -0
- package/templates/realtime-chat/src/client/app/index.ts +1 -0
- package/templates/realtime-chat/src/client/entities/index.ts +1 -0
- package/templates/realtime-chat/src/client/features/chat/chat-api.ts +209 -0
- package/templates/realtime-chat/src/client/features/chat/realtime-chat-starter.client.tsx +89 -0
- package/templates/realtime-chat/src/client/features/chat/use-realtime-chat.ts +65 -0
- package/templates/realtime-chat/src/client/features/index.ts +1 -0
- package/templates/realtime-chat/src/client/pages/index.ts +1 -0
- package/templates/realtime-chat/src/client/shared/index.ts +1 -0
- package/templates/realtime-chat/src/client/shared/lib/utils.ts +16 -0
- package/templates/realtime-chat/src/client/shared/ui/button.tsx +57 -0
- package/templates/realtime-chat/src/client/shared/ui/card.tsx +78 -0
- package/templates/realtime-chat/src/client/shared/ui/index.ts +21 -0
- package/templates/realtime-chat/src/client/shared/ui/input.tsx +28 -0
- package/templates/realtime-chat/src/client/widgets/index.ts +1 -0
- package/templates/realtime-chat/src/server/api/index.ts +1 -0
- package/templates/realtime-chat/src/server/application/ai-adapter.ts +24 -0
- package/templates/realtime-chat/src/server/application/chat-store.ts +158 -0
- package/templates/realtime-chat/src/server/application/index.ts +1 -0
- package/templates/realtime-chat/src/server/core/index.ts +1 -0
- package/templates/realtime-chat/src/server/domain/index.ts +1 -0
- package/templates/realtime-chat/src/server/infra/index.ts +1 -0
- package/templates/realtime-chat/src/shared/contracts/chat.ts +29 -0
- package/templates/realtime-chat/src/shared/contracts/index.ts +1 -0
- package/templates/realtime-chat/src/shared/env/index.ts +1 -0
- package/templates/realtime-chat/src/shared/schema/index.ts +1 -0
- package/templates/realtime-chat/src/shared/types/index.ts +1 -0
- package/templates/realtime-chat/src/shared/utils/client/index.ts +1 -0
- package/templates/realtime-chat/src/shared/utils/server/index.ts +1 -0
- package/templates/realtime-chat/tests/chat-api.sse.test.ts +188 -0
- package/templates/realtime-chat/tests/chat-starter.test.ts +200 -0
- package/templates/realtime-chat/tests/chat-store.concurrency.test.ts +39 -0
- package/templates/realtime-chat/tests/example.test.ts +58 -0
- package/templates/realtime-chat/tests/helpers.ts +52 -0
- package/templates/realtime-chat/tests/setup.ts +9 -0
- package/templates/realtime-chat/tsconfig.json +23 -0
package/README.ko.md
CHANGED
|
@@ -72,7 +72,11 @@ my-app/
|
|
|
72
72
|
│ ├── server/main.ts # 서버 진입점
|
|
73
73
|
│ └── web/entry.tsx # 클라이언트 진입점
|
|
74
74
|
├── spec/
|
|
75
|
-
│
|
|
75
|
+
│ ├── slots/ # 비즈니스 로직 파일
|
|
76
|
+
│ └── contracts/ # 타입 안전 계약
|
|
77
|
+
├── .mandu/ # 생성된 산출물 (자동 관리)
|
|
78
|
+
│ ├── routes.manifest.json # 라우트 매니페스트 (자동 생성)
|
|
79
|
+
│ └── spec.lock.json # 해시 검증
|
|
76
80
|
├── package.json
|
|
77
81
|
└── tsconfig.json
|
|
78
82
|
```
|
|
@@ -87,12 +91,12 @@ bun run dev
|
|
|
87
91
|
bunx mandu dev
|
|
88
92
|
```
|
|
89
93
|
|
|
90
|
-
### `mandu
|
|
94
|
+
### `mandu routes generate`
|
|
91
95
|
|
|
92
|
-
|
|
96
|
+
FS Routes(app/)를 스캔하여 매니페스트를 생성합니다.
|
|
93
97
|
|
|
94
98
|
```bash
|
|
95
|
-
bun run
|
|
99
|
+
bun run generate
|
|
96
100
|
```
|
|
97
101
|
|
|
98
102
|
### `mandu generate`
|
|
@@ -149,30 +153,28 @@ bunx mandu contract build
|
|
|
149
153
|
bunx mandu contract diff
|
|
150
154
|
```
|
|
151
155
|
|
|
152
|
-
##
|
|
156
|
+
## FS Routes (라우트 정의)
|
|
153
157
|
|
|
154
|
-
`
|
|
158
|
+
`app/` 디렉토리가 모든 라우트의 단일 진실 공급원(SSOT)입니다. 파일을 생성하면 라우트가 자동으로 정의됩니다.
|
|
155
159
|
|
|
156
|
-
```json
|
|
157
|
-
{
|
|
158
|
-
"version": "1.0.0",
|
|
159
|
-
"routes": [
|
|
160
|
-
{
|
|
161
|
-
"id": "getUsers",
|
|
162
|
-
"pattern": "/api/users",
|
|
163
|
-
"kind": "api",
|
|
164
|
-
"module": "apps/server/api/users.ts"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
"id": "homePage",
|
|
168
|
-
"pattern": "/",
|
|
169
|
-
"kind": "page",
|
|
170
|
-
"module": "apps/server/pages/home.ts",
|
|
171
|
-
"componentModule": "apps/web/pages/Home.tsx"
|
|
172
|
-
}
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
160
|
```
|
|
161
|
+
app/
|
|
162
|
+
├── page.tsx # / (홈 페이지)
|
|
163
|
+
├── about/
|
|
164
|
+
│ └── page.tsx # /about
|
|
165
|
+
├── api/
|
|
166
|
+
│ └── users/
|
|
167
|
+
│ └── route.ts # /api/users
|
|
168
|
+
└── blog/
|
|
169
|
+
└── [slug]/
|
|
170
|
+
└── page.tsx # /blog/:slug (동적 라우트)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
`bun run generate` 실행 시 `app/` 디렉토리를 스캔하여 `.mandu/routes.manifest.json`을 자동 생성합니다.
|
|
174
|
+
직접 매니페스트를 편집할 필요가 없습니다.
|
|
175
|
+
|
|
176
|
+
- `spec/slots/` - 개발자가 작성하는 비즈니스 로직
|
|
177
|
+
- `spec/contracts/` - 타입 안전 계약 정의
|
|
176
178
|
|
|
177
179
|
### Slot 시스템 (v0.2.0+)
|
|
178
180
|
|
|
@@ -194,20 +196,18 @@ bunx mandu contract diff
|
|
|
194
196
|
## 개발 워크플로우
|
|
195
197
|
|
|
196
198
|
```bash
|
|
197
|
-
# 1.
|
|
198
|
-
# 2. spec 검증 및 lock 갱신
|
|
199
|
-
bun run spec
|
|
199
|
+
# 1. app/ 디렉토리에 라우트 파일 생성/수정
|
|
200
200
|
|
|
201
|
-
#
|
|
201
|
+
# 2. 코드 생성 (매니페스트 자동 갱신)
|
|
202
202
|
bun run generate
|
|
203
203
|
|
|
204
|
-
#
|
|
204
|
+
# 3. 아키텍처 검사
|
|
205
205
|
bun run guard
|
|
206
206
|
|
|
207
|
-
#
|
|
207
|
+
# 4. 테스트
|
|
208
208
|
bun test
|
|
209
209
|
|
|
210
|
-
#
|
|
210
|
+
# 5. 개발 서버
|
|
211
211
|
bun run dev
|
|
212
212
|
```
|
|
213
213
|
|
|
@@ -231,4 +231,4 @@ bun test --watch # 감시 모드
|
|
|
231
231
|
|
|
232
232
|
## 라이선스
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
MPL-2.0
|