@mandujs/cli 0.2.0 → 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.ko.md +172 -0
- package/README.md +172 -0
- package/package.json +1 -1
package/README.ko.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# @mandujs/cli
|
|
2
|
+
|
|
3
|
+
> **[English](./README.md)** | 한국어
|
|
4
|
+
|
|
5
|
+
Agent-Native Fullstack Framework CLI - 에이전트가 코딩해도 아키텍처가 무너지지 않는 개발 OS
|
|
6
|
+
|
|
7
|
+
## 설치
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Bun 필수
|
|
11
|
+
bun add -D @mandujs/cli
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 빠른 시작
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# 새 프로젝트 생성
|
|
18
|
+
bunx @mandujs/cli init my-app
|
|
19
|
+
cd my-app
|
|
20
|
+
|
|
21
|
+
# 개발 서버 시작
|
|
22
|
+
bun run dev
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 명령어
|
|
26
|
+
|
|
27
|
+
### `mandu init <project-name>`
|
|
28
|
+
|
|
29
|
+
새 Mandu 프로젝트를 생성합니다.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
bunx @mandujs/cli init my-app
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
생성되는 구조:
|
|
36
|
+
```
|
|
37
|
+
my-app/
|
|
38
|
+
├── apps/
|
|
39
|
+
│ ├── server/main.ts # 서버 진입점
|
|
40
|
+
│ └── web/entry.tsx # 클라이언트 진입점
|
|
41
|
+
├── spec/
|
|
42
|
+
│ └── routes.manifest.json # SSOT - 라우트 정의
|
|
43
|
+
├── tests/ # 테스트 템플릿
|
|
44
|
+
├── package.json
|
|
45
|
+
└── tsconfig.json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### `mandu dev`
|
|
49
|
+
|
|
50
|
+
개발 서버를 시작합니다 (HMR 지원).
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bun run dev
|
|
54
|
+
# 또는
|
|
55
|
+
bunx mandu dev
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `mandu spec`
|
|
59
|
+
|
|
60
|
+
spec 파일을 검증하고 lock 파일을 갱신합니다.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
bun run spec
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### `mandu generate`
|
|
67
|
+
|
|
68
|
+
spec 기반으로 코드를 생성합니다.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
bun run generate
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `mandu guard`
|
|
75
|
+
|
|
76
|
+
아키텍처 규칙을 검사하고 위반 사항을 자동 수정합니다.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
bun run guard
|
|
80
|
+
|
|
81
|
+
# 자동 수정 비활성화
|
|
82
|
+
bunx mandu guard --no-auto-correct
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
자동 수정 가능한 규칙:
|
|
86
|
+
- `SPEC_HASH_MISMATCH` → lock 파일 갱신
|
|
87
|
+
- `GENERATED_MANUAL_EDIT` → 코드 재생성
|
|
88
|
+
- `SLOT_NOT_FOUND` → slot 파일 생성
|
|
89
|
+
|
|
90
|
+
## Spec 파일 작성
|
|
91
|
+
|
|
92
|
+
`spec/routes.manifest.json`이 모든 라우트의 단일 진실 공급원(SSOT)입니다.
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"version": "1.0.0",
|
|
97
|
+
"routes": [
|
|
98
|
+
{
|
|
99
|
+
"id": "getUsers",
|
|
100
|
+
"pattern": "/api/users",
|
|
101
|
+
"kind": "api",
|
|
102
|
+
"module": "apps/server/api/users.ts"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "homePage",
|
|
106
|
+
"pattern": "/",
|
|
107
|
+
"kind": "page",
|
|
108
|
+
"module": "apps/server/pages/home.ts",
|
|
109
|
+
"componentModule": "apps/web/pages/Home.tsx"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Slot 시스템 (v0.2.0+)
|
|
116
|
+
|
|
117
|
+
비즈니스 로직을 분리하려면 `slotModule`을 추가합니다:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"id": "getUsers",
|
|
122
|
+
"pattern": "/api/users",
|
|
123
|
+
"kind": "api",
|
|
124
|
+
"module": "apps/server/api/users.generated.ts",
|
|
125
|
+
"slotModule": "apps/server/api/users.slot.ts"
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- `*.generated.ts` - 프레임워크가 관리 (수정 금지)
|
|
130
|
+
- `*.slot.ts` - 개발자가 작성하는 비즈니스 로직
|
|
131
|
+
|
|
132
|
+
## 개발 워크플로우
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# 1. spec 수정
|
|
136
|
+
# 2. spec 검증 및 lock 갱신
|
|
137
|
+
bun run spec
|
|
138
|
+
|
|
139
|
+
# 3. 코드 생성
|
|
140
|
+
bun run generate
|
|
141
|
+
|
|
142
|
+
# 4. 아키텍처 검사
|
|
143
|
+
bun run guard
|
|
144
|
+
|
|
145
|
+
# 5. 테스트
|
|
146
|
+
bun test
|
|
147
|
+
|
|
148
|
+
# 6. 개발 서버
|
|
149
|
+
bun run dev
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## 테스트
|
|
153
|
+
|
|
154
|
+
Bun 테스트 프레임워크를 기본 지원합니다.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
bun test # 테스트 실행
|
|
158
|
+
bun test --watch # 감시 모드
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 요구 사항
|
|
162
|
+
|
|
163
|
+
- Bun >= 1.0.0
|
|
164
|
+
- React >= 18.0.0
|
|
165
|
+
|
|
166
|
+
## 관련 패키지
|
|
167
|
+
|
|
168
|
+
- [@mandujs/core](https://www.npmjs.com/package/@mandujs/core) - 핵심 런타임
|
|
169
|
+
|
|
170
|
+
## 라이선스
|
|
171
|
+
|
|
172
|
+
MIT
|
package/README.md
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# @mandujs/cli
|
|
2
|
+
|
|
3
|
+
> English | **[한국어](./README.ko.md)**
|
|
4
|
+
|
|
5
|
+
Agent-Native Fullstack Framework CLI - A development OS where architecture stays intact even when AI agents write your code
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Bun required
|
|
11
|
+
bun add -D @mandujs/cli
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Quick Start
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Create a new project
|
|
18
|
+
bunx @mandujs/cli init my-app
|
|
19
|
+
cd my-app
|
|
20
|
+
|
|
21
|
+
# Start development server
|
|
22
|
+
bun run dev
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Commands
|
|
26
|
+
|
|
27
|
+
### `mandu init <project-name>`
|
|
28
|
+
|
|
29
|
+
Creates a new Mandu project.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
bunx @mandujs/cli init my-app
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Generated structure:
|
|
36
|
+
```
|
|
37
|
+
my-app/
|
|
38
|
+
├── apps/
|
|
39
|
+
│ ├── server/main.ts # Server entry point
|
|
40
|
+
│ └── web/entry.tsx # Client entry point
|
|
41
|
+
├── spec/
|
|
42
|
+
│ └── routes.manifest.json # SSOT - Route definitions
|
|
43
|
+
├── tests/ # Test templates
|
|
44
|
+
├── package.json
|
|
45
|
+
└── tsconfig.json
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### `mandu dev`
|
|
49
|
+
|
|
50
|
+
Starts the development server (with HMR support).
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
bun run dev
|
|
54
|
+
# or
|
|
55
|
+
bunx mandu dev
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `mandu spec`
|
|
59
|
+
|
|
60
|
+
Validates the spec file and updates the lock file.
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
bun run spec
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### `mandu generate`
|
|
67
|
+
|
|
68
|
+
Generates code based on the spec.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
bun run generate
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `mandu guard`
|
|
75
|
+
|
|
76
|
+
Checks architecture rules and auto-corrects violations.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
bun run guard
|
|
80
|
+
|
|
81
|
+
# Disable auto-correction
|
|
82
|
+
bunx mandu guard --no-auto-correct
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Auto-correctable rules:
|
|
86
|
+
- `SPEC_HASH_MISMATCH` → Updates lock file
|
|
87
|
+
- `GENERATED_MANUAL_EDIT` → Regenerates code
|
|
88
|
+
- `SLOT_NOT_FOUND` → Creates slot file
|
|
89
|
+
|
|
90
|
+
## Writing Spec Files
|
|
91
|
+
|
|
92
|
+
`spec/routes.manifest.json` is the Single Source of Truth (SSOT) for all routes.
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"version": "1.0.0",
|
|
97
|
+
"routes": [
|
|
98
|
+
{
|
|
99
|
+
"id": "getUsers",
|
|
100
|
+
"pattern": "/api/users",
|
|
101
|
+
"kind": "api",
|
|
102
|
+
"module": "apps/server/api/users.ts"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "homePage",
|
|
106
|
+
"pattern": "/",
|
|
107
|
+
"kind": "page",
|
|
108
|
+
"module": "apps/server/pages/home.ts",
|
|
109
|
+
"componentModule": "apps/web/pages/Home.tsx"
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Slot System (v0.2.0+)
|
|
116
|
+
|
|
117
|
+
Add `slotModule` to separate business logic:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"id": "getUsers",
|
|
122
|
+
"pattern": "/api/users",
|
|
123
|
+
"kind": "api",
|
|
124
|
+
"module": "apps/server/api/users.generated.ts",
|
|
125
|
+
"slotModule": "apps/server/api/users.slot.ts"
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- `*.generated.ts` - Managed by framework (do not modify)
|
|
130
|
+
- `*.slot.ts` - Business logic written by developers
|
|
131
|
+
|
|
132
|
+
## Development Workflow
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# 1. Edit spec
|
|
136
|
+
# 2. Validate spec and update lock
|
|
137
|
+
bun run spec
|
|
138
|
+
|
|
139
|
+
# 3. Generate code
|
|
140
|
+
bun run generate
|
|
141
|
+
|
|
142
|
+
# 4. Check architecture
|
|
143
|
+
bun run guard
|
|
144
|
+
|
|
145
|
+
# 5. Run tests
|
|
146
|
+
bun test
|
|
147
|
+
|
|
148
|
+
# 6. Start dev server
|
|
149
|
+
bun run dev
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## Testing
|
|
153
|
+
|
|
154
|
+
Built-in support for Bun test framework.
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
bun test # Run tests
|
|
158
|
+
bun test --watch # Watch mode
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Requirements
|
|
162
|
+
|
|
163
|
+
- Bun >= 1.0.0
|
|
164
|
+
- React >= 18.0.0
|
|
165
|
+
|
|
166
|
+
## Related Packages
|
|
167
|
+
|
|
168
|
+
- [@mandujs/core](https://www.npmjs.com/package/@mandujs/core) - Core runtime
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
MIT
|