@mandujs/cli 0.2.1 → 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 +46 -44
- 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
CHANGED
|
@@ -1,61 +1,63 @@
|
|
|
1
1
|
# @mandujs/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> English | **[한국어](./README.ko.md)**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Agent-Native Fullstack Framework CLI - A development OS where architecture stays intact even when AI agents write your code
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
8
|
-
# Bun
|
|
10
|
+
# Bun required
|
|
9
11
|
bun add -D @mandujs/cli
|
|
10
12
|
```
|
|
11
13
|
|
|
12
|
-
##
|
|
14
|
+
## Quick Start
|
|
13
15
|
|
|
14
16
|
```bash
|
|
15
|
-
#
|
|
17
|
+
# Create a new project
|
|
16
18
|
bunx @mandujs/cli init my-app
|
|
17
19
|
cd my-app
|
|
18
20
|
|
|
19
|
-
#
|
|
21
|
+
# Start development server
|
|
20
22
|
bun run dev
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
##
|
|
25
|
+
## Commands
|
|
24
26
|
|
|
25
27
|
### `mandu init <project-name>`
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
Creates a new Mandu project.
|
|
28
30
|
|
|
29
31
|
```bash
|
|
30
32
|
bunx @mandujs/cli init my-app
|
|
31
33
|
```
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
Generated structure:
|
|
34
36
|
```
|
|
35
37
|
my-app/
|
|
36
38
|
├── apps/
|
|
37
|
-
│ ├── server/main.ts #
|
|
38
|
-
│ └── web/entry.tsx #
|
|
39
|
+
│ ├── server/main.ts # Server entry point
|
|
40
|
+
│ └── web/entry.tsx # Client entry point
|
|
39
41
|
├── spec/
|
|
40
|
-
│ └── routes.manifest.json # SSOT -
|
|
41
|
-
├── tests/ #
|
|
42
|
+
│ └── routes.manifest.json # SSOT - Route definitions
|
|
43
|
+
├── tests/ # Test templates
|
|
42
44
|
├── package.json
|
|
43
45
|
└── tsconfig.json
|
|
44
46
|
```
|
|
45
47
|
|
|
46
48
|
### `mandu dev`
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
Starts the development server (with HMR support).
|
|
49
51
|
|
|
50
52
|
```bash
|
|
51
53
|
bun run dev
|
|
52
|
-
#
|
|
54
|
+
# or
|
|
53
55
|
bunx mandu dev
|
|
54
56
|
```
|
|
55
57
|
|
|
56
58
|
### `mandu spec`
|
|
57
59
|
|
|
58
|
-
spec
|
|
60
|
+
Validates the spec file and updates the lock file.
|
|
59
61
|
|
|
60
62
|
```bash
|
|
61
63
|
bun run spec
|
|
@@ -63,7 +65,7 @@ bun run spec
|
|
|
63
65
|
|
|
64
66
|
### `mandu generate`
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
Generates code based on the spec.
|
|
67
69
|
|
|
68
70
|
```bash
|
|
69
71
|
bun run generate
|
|
@@ -71,23 +73,23 @@ bun run generate
|
|
|
71
73
|
|
|
72
74
|
### `mandu guard`
|
|
73
75
|
|
|
74
|
-
|
|
76
|
+
Checks architecture rules and auto-corrects violations.
|
|
75
77
|
|
|
76
78
|
```bash
|
|
77
79
|
bun run guard
|
|
78
80
|
|
|
79
|
-
#
|
|
81
|
+
# Disable auto-correction
|
|
80
82
|
bunx mandu guard --no-auto-correct
|
|
81
83
|
```
|
|
82
84
|
|
|
83
|
-
|
|
84
|
-
- `SPEC_HASH_MISMATCH` → lock
|
|
85
|
-
- `GENERATED_MANUAL_EDIT` →
|
|
86
|
-
- `SLOT_NOT_FOUND` → slot
|
|
85
|
+
Auto-correctable rules:
|
|
86
|
+
- `SPEC_HASH_MISMATCH` → Updates lock file
|
|
87
|
+
- `GENERATED_MANUAL_EDIT` → Regenerates code
|
|
88
|
+
- `SLOT_NOT_FOUND` → Creates slot file
|
|
87
89
|
|
|
88
|
-
## Spec
|
|
90
|
+
## Writing Spec Files
|
|
89
91
|
|
|
90
|
-
`spec/routes.manifest.json
|
|
92
|
+
`spec/routes.manifest.json` is the Single Source of Truth (SSOT) for all routes.
|
|
91
93
|
|
|
92
94
|
```json
|
|
93
95
|
{
|
|
@@ -110,9 +112,9 @@ bunx mandu guard --no-auto-correct
|
|
|
110
112
|
}
|
|
111
113
|
```
|
|
112
114
|
|
|
113
|
-
### Slot
|
|
115
|
+
### Slot System (v0.2.0+)
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
Add `slotModule` to separate business logic:
|
|
116
118
|
|
|
117
119
|
```json
|
|
118
120
|
{
|
|
@@ -124,47 +126,47 @@ bunx mandu guard --no-auto-correct
|
|
|
124
126
|
}
|
|
125
127
|
```
|
|
126
128
|
|
|
127
|
-
- `*.generated.ts` -
|
|
128
|
-
- `*.slot.ts` -
|
|
129
|
+
- `*.generated.ts` - Managed by framework (do not modify)
|
|
130
|
+
- `*.slot.ts` - Business logic written by developers
|
|
129
131
|
|
|
130
|
-
##
|
|
132
|
+
## Development Workflow
|
|
131
133
|
|
|
132
134
|
```bash
|
|
133
|
-
# 1. spec
|
|
134
|
-
# 2. spec
|
|
135
|
+
# 1. Edit spec
|
|
136
|
+
# 2. Validate spec and update lock
|
|
135
137
|
bun run spec
|
|
136
138
|
|
|
137
|
-
# 3.
|
|
139
|
+
# 3. Generate code
|
|
138
140
|
bun run generate
|
|
139
141
|
|
|
140
|
-
# 4.
|
|
142
|
+
# 4. Check architecture
|
|
141
143
|
bun run guard
|
|
142
144
|
|
|
143
|
-
# 5.
|
|
145
|
+
# 5. Run tests
|
|
144
146
|
bun test
|
|
145
147
|
|
|
146
|
-
# 6.
|
|
148
|
+
# 6. Start dev server
|
|
147
149
|
bun run dev
|
|
148
150
|
```
|
|
149
151
|
|
|
150
|
-
##
|
|
152
|
+
## Testing
|
|
151
153
|
|
|
152
|
-
|
|
154
|
+
Built-in support for Bun test framework.
|
|
153
155
|
|
|
154
156
|
```bash
|
|
155
|
-
bun test #
|
|
156
|
-
bun test --watch #
|
|
157
|
+
bun test # Run tests
|
|
158
|
+
bun test --watch # Watch mode
|
|
157
159
|
```
|
|
158
160
|
|
|
159
|
-
##
|
|
161
|
+
## Requirements
|
|
160
162
|
|
|
161
163
|
- Bun >= 1.0.0
|
|
162
164
|
- React >= 18.0.0
|
|
163
165
|
|
|
164
|
-
##
|
|
166
|
+
## Related Packages
|
|
165
167
|
|
|
166
|
-
- [@mandujs/core](https://www.npmjs.com/package/@mandujs/core) -
|
|
168
|
+
- [@mandujs/core](https://www.npmjs.com/package/@mandujs/core) - Core runtime
|
|
167
169
|
|
|
168
|
-
##
|
|
170
|
+
## License
|
|
169
171
|
|
|
170
172
|
MIT
|