@mandujs/core 0.18.22 → 0.19.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 +0 -14
- package/package.json +4 -1
- package/src/brain/architecture/analyzer.ts +4 -4
- package/src/brain/doctor/analyzer.ts +18 -14
- package/src/bundler/build.test.ts +127 -0
- package/src/bundler/build.ts +291 -113
- package/src/bundler/css.ts +20 -5
- package/src/bundler/dev.ts +55 -2
- package/src/bundler/prerender.ts +195 -0
- package/src/change/snapshot.ts +4 -23
- package/src/change/types.ts +2 -3
- package/src/client/Form.tsx +105 -0
- package/src/client/__tests__/use-sse.test.ts +153 -0
- package/src/client/hooks.ts +105 -6
- package/src/client/index.ts +35 -6
- package/src/client/router.ts +670 -433
- package/src/client/rpc.ts +140 -0
- package/src/client/runtime.ts +24 -21
- package/src/client/use-fetch.ts +239 -0
- package/src/client/use-head.ts +197 -0
- package/src/client/use-sse.ts +378 -0
- package/src/components/Image.tsx +162 -0
- package/src/config/mandu.ts +5 -0
- package/src/config/validate.ts +34 -0
- package/src/content/index.ts +5 -1
- package/src/devtools/client/catchers/error-catcher.ts +17 -0
- package/src/devtools/client/catchers/network-proxy.ts +390 -367
- package/src/devtools/client/components/kitchen-root.tsx +479 -467
- package/src/devtools/client/components/panel/diff-viewer.tsx +219 -0
- package/src/devtools/client/components/panel/guard-panel.tsx +374 -244
- package/src/devtools/client/components/panel/index.ts +45 -32
- package/src/devtools/client/components/panel/panel-container.tsx +332 -312
- package/src/devtools/client/components/panel/preview-panel.tsx +188 -0
- package/src/devtools/client/state-manager.ts +535 -478
- package/src/devtools/design-tokens.ts +265 -264
- package/src/devtools/types.ts +345 -319
- package/src/filling/context.ts +65 -0
- package/src/filling/filling.ts +336 -14
- package/src/filling/index.ts +5 -1
- package/src/filling/session.ts +216 -0
- package/src/filling/ws.ts +78 -0
- package/src/generator/generate.ts +2 -2
- package/src/guard/auto-correct.ts +0 -29
- package/src/guard/check.ts +14 -31
- package/src/guard/presets/index.ts +296 -294
- package/src/guard/rules.ts +15 -19
- package/src/guard/validator.ts +834 -834
- package/src/index.ts +5 -1
- package/src/island/index.ts +373 -304
- package/src/kitchen/api/contract-api.ts +225 -0
- package/src/kitchen/api/diff-parser.ts +108 -0
- package/src/kitchen/api/file-api.ts +273 -0
- package/src/kitchen/api/guard-api.ts +83 -0
- package/src/kitchen/api/guard-decisions.ts +100 -0
- package/src/kitchen/api/routes-api.ts +50 -0
- package/src/kitchen/index.ts +21 -0
- package/src/kitchen/kitchen-handler.ts +256 -0
- package/src/kitchen/kitchen-ui.ts +1732 -0
- package/src/kitchen/stream/activity-sse.ts +145 -0
- package/src/kitchen/stream/file-tailer.ts +99 -0
- package/src/middleware/compress.ts +62 -0
- package/src/middleware/cors.ts +47 -0
- package/src/middleware/index.ts +10 -0
- package/src/middleware/jwt.ts +134 -0
- package/src/middleware/logger.ts +58 -0
- package/src/middleware/timeout.ts +55 -0
- package/src/paths.ts +0 -4
- package/src/plugins/hooks.ts +64 -0
- package/src/plugins/index.ts +3 -0
- package/src/plugins/types.ts +5 -0
- package/src/report/build.ts +0 -6
- package/src/resource/__tests__/backward-compat.test.ts +0 -1
- package/src/router/fs-patterns.ts +11 -1
- package/src/router/fs-routes.ts +78 -14
- package/src/router/fs-scanner.ts +2 -2
- package/src/router/fs-types.ts +2 -1
- package/src/runtime/adapter-bun.ts +62 -0
- package/src/runtime/adapter.ts +47 -0
- package/src/runtime/cache.ts +310 -0
- package/src/runtime/handler.ts +65 -0
- package/src/runtime/image-handler.ts +195 -0
- package/src/runtime/index.ts +12 -0
- package/src/runtime/middleware.ts +263 -0
- package/src/runtime/server.ts +686 -92
- package/src/runtime/ssr.ts +55 -29
- package/src/runtime/streaming-ssr.ts +106 -82
- package/src/spec/index.ts +0 -1
- package/src/spec/schema.ts +1 -0
- package/src/testing/index.ts +144 -0
- package/src/watcher/watcher.ts +27 -1
- package/src/spec/lock.ts +0 -56
|
@@ -1,294 +1,296 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Guard Presets
|
|
3
|
-
*
|
|
4
|
-
* 아키텍처 프리셋 모음
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { GuardPreset, PresetDefinition } from "../types";
|
|
8
|
-
import { fsdPreset, FSD_HIERARCHY } from "./fsd";
|
|
9
|
-
import { cleanPreset, CLEAN_HIERARCHY } from "./clean";
|
|
10
|
-
import { hexagonalPreset, HEXAGONAL_HIERARCHY } from "./hexagonal";
|
|
11
|
-
import { atomicPreset, ATOMIC_HIERARCHY } from "./atomic";
|
|
12
|
-
import { cqrsPreset, CQRS_HIERARCHY } from "./cqrs";
|
|
13
|
-
|
|
14
|
-
// Re-export types
|
|
15
|
-
export type { GuardPreset, PresetDefinition } from "../types";
|
|
16
|
-
|
|
17
|
-
// Re-export
|
|
18
|
-
export { fsdPreset, FSD_HIERARCHY } from "./fsd";
|
|
19
|
-
export { cleanPreset, CLEAN_HIERARCHY } from "./clean";
|
|
20
|
-
export { hexagonalPreset, HEXAGONAL_HIERARCHY } from "./hexagonal";
|
|
21
|
-
export { atomicPreset, ATOMIC_HIERARCHY } from "./atomic";
|
|
22
|
-
export { cqrsPreset, CQRS_HIERARCHY } from "./cqrs";
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Mandu 권장 프리셋 (FSD + Clean 조합)
|
|
26
|
-
*
|
|
27
|
-
* 풀스택 프로젝트에 최적화
|
|
28
|
-
*/
|
|
29
|
-
export const manduPreset: PresetDefinition = {
|
|
30
|
-
name: "mandu",
|
|
31
|
-
description: "Mandu 권장 아키텍처 - client/server 분리 + strict shared",
|
|
32
|
-
|
|
33
|
-
hierarchy: [
|
|
34
|
-
// Client (FSD)
|
|
35
|
-
"client/app",
|
|
36
|
-
"client/pages",
|
|
37
|
-
"client/widgets",
|
|
38
|
-
"client/features",
|
|
39
|
-
"client/entities",
|
|
40
|
-
"client/shared",
|
|
41
|
-
// Shared (strict)
|
|
42
|
-
"shared/contracts",
|
|
43
|
-
"shared/types",
|
|
44
|
-
"shared/utils/client",
|
|
45
|
-
"shared/utils/server",
|
|
46
|
-
"shared/schema",
|
|
47
|
-
"shared/env",
|
|
48
|
-
"shared/unsafe",
|
|
49
|
-
// Server (Clean)
|
|
50
|
-
"server/api",
|
|
51
|
-
"server/application",
|
|
52
|
-
"server/domain",
|
|
53
|
-
"server/infra",
|
|
54
|
-
"server/core",
|
|
55
|
-
],
|
|
56
|
-
|
|
57
|
-
layers: [
|
|
58
|
-
// Client layers
|
|
59
|
-
{
|
|
60
|
-
name: "client/app",
|
|
61
|
-
pattern: "src/client/app/**",
|
|
62
|
-
canImport: [
|
|
63
|
-
"client/pages",
|
|
64
|
-
"client/widgets",
|
|
65
|
-
"client/features",
|
|
66
|
-
"client/entities",
|
|
67
|
-
"client/shared",
|
|
68
|
-
"shared/contracts",
|
|
69
|
-
"shared/types",
|
|
70
|
-
"shared/utils/client",
|
|
71
|
-
],
|
|
72
|
-
description: "클라이언트 앱 진입점",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
name: "client/pages",
|
|
76
|
-
pattern: "src/client/pages/**",
|
|
77
|
-
canImport: [
|
|
78
|
-
"client/widgets",
|
|
79
|
-
"client/features",
|
|
80
|
-
"client/entities",
|
|
81
|
-
"client/shared",
|
|
82
|
-
"shared/contracts",
|
|
83
|
-
"shared/types",
|
|
84
|
-
"shared/utils/client",
|
|
85
|
-
],
|
|
86
|
-
description: "클라이언트 페이지",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
name: "client/widgets",
|
|
90
|
-
pattern: "src/client/widgets/**",
|
|
91
|
-
canImport: [
|
|
92
|
-
"client/features",
|
|
93
|
-
"client/entities",
|
|
94
|
-
"client/shared",
|
|
95
|
-
"shared/contracts",
|
|
96
|
-
"shared/types",
|
|
97
|
-
"shared/utils/client",
|
|
98
|
-
],
|
|
99
|
-
description: "클라이언트 위젯",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: "client/features",
|
|
103
|
-
pattern: "src/client/features/**",
|
|
104
|
-
canImport: [
|
|
105
|
-
"client/entities",
|
|
106
|
-
"client/shared",
|
|
107
|
-
"shared/contracts",
|
|
108
|
-
"shared/types",
|
|
109
|
-
"shared/utils/client",
|
|
110
|
-
],
|
|
111
|
-
description: "클라이언트 기능",
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
name: "client/entities",
|
|
115
|
-
pattern: "src/client/entities/**",
|
|
116
|
-
canImport: [
|
|
117
|
-
"client/shared",
|
|
118
|
-
"shared/contracts",
|
|
119
|
-
"shared/types",
|
|
120
|
-
"shared/utils/client",
|
|
121
|
-
],
|
|
122
|
-
description: "클라이언트 엔티티",
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
name: "client/shared",
|
|
126
|
-
pattern: "src/client/shared/**",
|
|
127
|
-
canImport: [
|
|
128
|
-
"shared/contracts",
|
|
129
|
-
"shared/types",
|
|
130
|
-
"shared/utils/client",
|
|
131
|
-
],
|
|
132
|
-
description: "클라이언트 전용 공유",
|
|
133
|
-
},
|
|
134
|
-
// Shared layers
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
"server/
|
|
185
|
-
"server/
|
|
186
|
-
"
|
|
187
|
-
"
|
|
188
|
-
"shared/
|
|
189
|
-
"shared/
|
|
190
|
-
"shared/
|
|
191
|
-
"shared/
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
"
|
|
202
|
-
"
|
|
203
|
-
"shared/
|
|
204
|
-
"shared/
|
|
205
|
-
"shared/
|
|
206
|
-
"shared/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
"shared/
|
|
217
|
-
"shared/
|
|
218
|
-
"shared/
|
|
219
|
-
"shared/
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
"server/
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"shared/
|
|
233
|
-
"shared/
|
|
234
|
-
"shared/
|
|
235
|
-
"shared/
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
"shared/
|
|
246
|
-
"shared/
|
|
247
|
-
"shared/
|
|
248
|
-
"shared/
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Guard Presets
|
|
3
|
+
*
|
|
4
|
+
* 아키텍처 프리셋 모음
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { GuardPreset, PresetDefinition } from "../types";
|
|
8
|
+
import { fsdPreset, FSD_HIERARCHY } from "./fsd";
|
|
9
|
+
import { cleanPreset, CLEAN_HIERARCHY } from "./clean";
|
|
10
|
+
import { hexagonalPreset, HEXAGONAL_HIERARCHY } from "./hexagonal";
|
|
11
|
+
import { atomicPreset, ATOMIC_HIERARCHY } from "./atomic";
|
|
12
|
+
import { cqrsPreset, CQRS_HIERARCHY } from "./cqrs";
|
|
13
|
+
|
|
14
|
+
// Re-export types
|
|
15
|
+
export type { GuardPreset, PresetDefinition } from "../types";
|
|
16
|
+
|
|
17
|
+
// Re-export
|
|
18
|
+
export { fsdPreset, FSD_HIERARCHY } from "./fsd";
|
|
19
|
+
export { cleanPreset, CLEAN_HIERARCHY } from "./clean";
|
|
20
|
+
export { hexagonalPreset, HEXAGONAL_HIERARCHY } from "./hexagonal";
|
|
21
|
+
export { atomicPreset, ATOMIC_HIERARCHY } from "./atomic";
|
|
22
|
+
export { cqrsPreset, CQRS_HIERARCHY } from "./cqrs";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Mandu 권장 프리셋 (FSD + Clean 조합)
|
|
26
|
+
*
|
|
27
|
+
* 풀스택 프로젝트에 최적화
|
|
28
|
+
*/
|
|
29
|
+
export const manduPreset: PresetDefinition = {
|
|
30
|
+
name: "mandu",
|
|
31
|
+
description: "Mandu 권장 아키텍처 - client/server 분리 + strict shared",
|
|
32
|
+
|
|
33
|
+
hierarchy: [
|
|
34
|
+
// Client (FSD)
|
|
35
|
+
"client/app",
|
|
36
|
+
"client/pages",
|
|
37
|
+
"client/widgets",
|
|
38
|
+
"client/features",
|
|
39
|
+
"client/entities",
|
|
40
|
+
"client/shared",
|
|
41
|
+
// Shared (strict)
|
|
42
|
+
"shared/contracts",
|
|
43
|
+
"shared/types",
|
|
44
|
+
"shared/utils/client",
|
|
45
|
+
"shared/utils/server",
|
|
46
|
+
"shared/schema",
|
|
47
|
+
"shared/env",
|
|
48
|
+
"shared/unsafe",
|
|
49
|
+
// Server (Clean)
|
|
50
|
+
"server/api",
|
|
51
|
+
"server/application",
|
|
52
|
+
"server/domain",
|
|
53
|
+
"server/infra",
|
|
54
|
+
"server/core",
|
|
55
|
+
],
|
|
56
|
+
|
|
57
|
+
layers: [
|
|
58
|
+
// Client layers
|
|
59
|
+
{
|
|
60
|
+
name: "client/app",
|
|
61
|
+
pattern: "src/client/app/**",
|
|
62
|
+
canImport: [
|
|
63
|
+
"client/pages",
|
|
64
|
+
"client/widgets",
|
|
65
|
+
"client/features",
|
|
66
|
+
"client/entities",
|
|
67
|
+
"client/shared",
|
|
68
|
+
"shared/contracts",
|
|
69
|
+
"shared/types",
|
|
70
|
+
"shared/utils/client",
|
|
71
|
+
],
|
|
72
|
+
description: "클라이언트 앱 진입점",
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "client/pages",
|
|
76
|
+
pattern: "src/client/pages/**",
|
|
77
|
+
canImport: [
|
|
78
|
+
"client/widgets",
|
|
79
|
+
"client/features",
|
|
80
|
+
"client/entities",
|
|
81
|
+
"client/shared",
|
|
82
|
+
"shared/contracts",
|
|
83
|
+
"shared/types",
|
|
84
|
+
"shared/utils/client",
|
|
85
|
+
],
|
|
86
|
+
description: "클라이언트 페이지",
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "client/widgets",
|
|
90
|
+
pattern: "src/client/widgets/**",
|
|
91
|
+
canImport: [
|
|
92
|
+
"client/features",
|
|
93
|
+
"client/entities",
|
|
94
|
+
"client/shared",
|
|
95
|
+
"shared/contracts",
|
|
96
|
+
"shared/types",
|
|
97
|
+
"shared/utils/client",
|
|
98
|
+
],
|
|
99
|
+
description: "클라이언트 위젯",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "client/features",
|
|
103
|
+
pattern: "src/client/features/**",
|
|
104
|
+
canImport: [
|
|
105
|
+
"client/entities",
|
|
106
|
+
"client/shared",
|
|
107
|
+
"shared/contracts",
|
|
108
|
+
"shared/types",
|
|
109
|
+
"shared/utils/client",
|
|
110
|
+
],
|
|
111
|
+
description: "클라이언트 기능",
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "client/entities",
|
|
115
|
+
pattern: "src/client/entities/**",
|
|
116
|
+
canImport: [
|
|
117
|
+
"client/shared",
|
|
118
|
+
"shared/contracts",
|
|
119
|
+
"shared/types",
|
|
120
|
+
"shared/utils/client",
|
|
121
|
+
],
|
|
122
|
+
description: "클라이언트 엔티티",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: "client/shared",
|
|
126
|
+
pattern: "src/client/shared/**",
|
|
127
|
+
canImport: [
|
|
128
|
+
"shared/contracts",
|
|
129
|
+
"shared/types",
|
|
130
|
+
"shared/utils/client",
|
|
131
|
+
],
|
|
132
|
+
description: "클라이언트 전용 공유",
|
|
133
|
+
},
|
|
134
|
+
// Shared layers
|
|
135
|
+
// Patterns use brace expansion to match both directory contents (e.g. src/shared/types/**)
|
|
136
|
+
// and direct files (e.g. src/shared/types.ts, src/shared/types.tsx)
|
|
137
|
+
{
|
|
138
|
+
name: "shared/contracts",
|
|
139
|
+
pattern: "src/shared/contracts{/**,.ts,.tsx}",
|
|
140
|
+
canImport: ["shared/types", "shared/utils/client"],
|
|
141
|
+
description: "공용 계약 (클라이언트 safe)",
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "shared/schema",
|
|
145
|
+
pattern: "src/shared/schema{/**,.ts,.tsx}",
|
|
146
|
+
canImport: ["shared/types", "shared/utils/server"],
|
|
147
|
+
description: "서버 전용 스키마 (JSON/OpenAPI)",
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: "shared/types",
|
|
151
|
+
pattern: "src/shared/types{/**,.ts,.tsx}",
|
|
152
|
+
canImport: [],
|
|
153
|
+
description: "공용 타입",
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "shared/utils/client",
|
|
157
|
+
pattern: "src/shared/utils/client{/**,.ts,.tsx}",
|
|
158
|
+
canImport: ["shared/types"],
|
|
159
|
+
description: "클라이언트 safe 유틸",
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: "shared/utils/server",
|
|
163
|
+
pattern: "src/shared/utils/server{/**,.ts,.tsx}",
|
|
164
|
+
canImport: ["shared/types", "shared/utils/client"],
|
|
165
|
+
description: "서버 전용 유틸",
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
name: "shared/env",
|
|
169
|
+
pattern: "src/shared/env{/**,.ts,.tsx}",
|
|
170
|
+
canImport: ["shared/types", "shared/utils/client", "shared/utils/server"],
|
|
171
|
+
description: "서버 전용 환경/설정",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: "shared/unsafe",
|
|
175
|
+
pattern: "src/shared/**",
|
|
176
|
+
canImport: [],
|
|
177
|
+
description: "금지된 shared 경로",
|
|
178
|
+
},
|
|
179
|
+
// Server layers
|
|
180
|
+
{
|
|
181
|
+
name: "server/api",
|
|
182
|
+
pattern: "src/server/api/**",
|
|
183
|
+
canImport: [
|
|
184
|
+
"server/application",
|
|
185
|
+
"server/domain",
|
|
186
|
+
"server/infra",
|
|
187
|
+
"server/core",
|
|
188
|
+
"shared/contracts",
|
|
189
|
+
"shared/schema",
|
|
190
|
+
"shared/types",
|
|
191
|
+
"shared/utils/client",
|
|
192
|
+
"shared/utils/server",
|
|
193
|
+
"shared/env",
|
|
194
|
+
],
|
|
195
|
+
description: "서버 API 라우트, 컨트롤러",
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "server/application",
|
|
199
|
+
pattern: "src/server/application/**",
|
|
200
|
+
canImport: [
|
|
201
|
+
"server/domain",
|
|
202
|
+
"server/core",
|
|
203
|
+
"shared/contracts",
|
|
204
|
+
"shared/schema",
|
|
205
|
+
"shared/types",
|
|
206
|
+
"shared/utils/client",
|
|
207
|
+
"shared/utils/server",
|
|
208
|
+
"shared/env",
|
|
209
|
+
],
|
|
210
|
+
description: "서버 유스케이스, 서비스",
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
name: "server/domain",
|
|
214
|
+
pattern: "src/server/domain/**",
|
|
215
|
+
canImport: [
|
|
216
|
+
"shared/contracts",
|
|
217
|
+
"shared/schema",
|
|
218
|
+
"shared/types",
|
|
219
|
+
"shared/utils/client",
|
|
220
|
+
"shared/utils/server",
|
|
221
|
+
"shared/env",
|
|
222
|
+
],
|
|
223
|
+
description: "서버 도메인 모델",
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
name: "server/infra",
|
|
227
|
+
pattern: "src/server/infra/**",
|
|
228
|
+
canImport: [
|
|
229
|
+
"server/application",
|
|
230
|
+
"server/domain",
|
|
231
|
+
"server/core",
|
|
232
|
+
"shared/contracts",
|
|
233
|
+
"shared/schema",
|
|
234
|
+
"shared/types",
|
|
235
|
+
"shared/utils/client",
|
|
236
|
+
"shared/utils/server",
|
|
237
|
+
"shared/env",
|
|
238
|
+
],
|
|
239
|
+
description: "서버 인프라 구현",
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "server/core",
|
|
243
|
+
pattern: "src/server/core/**",
|
|
244
|
+
canImport: [
|
|
245
|
+
"shared/contracts",
|
|
246
|
+
"shared/schema",
|
|
247
|
+
"shared/types",
|
|
248
|
+
"shared/utils/client",
|
|
249
|
+
"shared/utils/server",
|
|
250
|
+
"shared/env",
|
|
251
|
+
],
|
|
252
|
+
description: "서버 핵심 공통",
|
|
253
|
+
},
|
|
254
|
+
],
|
|
255
|
+
|
|
256
|
+
defaultSeverity: {
|
|
257
|
+
layerViolation: "error",
|
|
258
|
+
circularDependency: "warn",
|
|
259
|
+
crossSliceDependency: "warn",
|
|
260
|
+
deepNesting: "info",
|
|
261
|
+
fileType: "error",
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* 모든 프리셋 맵
|
|
267
|
+
*/
|
|
268
|
+
export const presets: Record<GuardPreset, PresetDefinition> = {
|
|
269
|
+
fsd: fsdPreset,
|
|
270
|
+
clean: cleanPreset,
|
|
271
|
+
hexagonal: hexagonalPreset,
|
|
272
|
+
atomic: atomicPreset,
|
|
273
|
+
cqrs: cqrsPreset,
|
|
274
|
+
mandu: manduPreset,
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* 프리셋 가져오기
|
|
279
|
+
*/
|
|
280
|
+
export function getPreset(name: GuardPreset): PresetDefinition {
|
|
281
|
+
const preset = presets[name];
|
|
282
|
+
if (!preset) {
|
|
283
|
+
throw new Error(`Unknown guard preset: ${name}`);
|
|
284
|
+
}
|
|
285
|
+
return preset;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* 프리셋 목록 가져오기
|
|
290
|
+
*/
|
|
291
|
+
export function listPresets(): Array<{ name: GuardPreset; description: string }> {
|
|
292
|
+
return Object.values(presets).map((p) => ({
|
|
293
|
+
name: p.name,
|
|
294
|
+
description: p.description,
|
|
295
|
+
}));
|
|
296
|
+
}
|
package/src/guard/rules.ts
CHANGED
|
@@ -15,12 +15,6 @@ export interface GuardRule {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export const GUARD_RULES: Record<string, GuardRule> = {
|
|
18
|
-
SPEC_HASH_MISMATCH: {
|
|
19
|
-
id: "SPEC_HASH_MISMATCH",
|
|
20
|
-
name: "Spec Hash Mismatch",
|
|
21
|
-
description: "spec.lock.json의 해시와 현재 spec이 일치하지 않습니다",
|
|
22
|
-
severity: "error",
|
|
23
|
-
},
|
|
24
18
|
GENERATED_MANUAL_EDIT: {
|
|
25
19
|
id: "GENERATED_MANUAL_EDIT",
|
|
26
20
|
name: "Generated File Manual Edit",
|
|
@@ -64,18 +58,18 @@ export const GUARD_RULES: Record<string, GuardRule> = {
|
|
|
64
58
|
description: "Slot 핸들러에 ctx.ok(), ctx.json() 등의 응답 패턴이 없습니다",
|
|
65
59
|
severity: "error",
|
|
66
60
|
},
|
|
67
|
-
SLOT_MISSING_FILLING_PATTERN: {
|
|
68
|
-
id: "SLOT_MISSING_FILLING_PATTERN",
|
|
69
|
-
name: "Slot Missing Filling Pattern",
|
|
70
|
-
description: "Slot 파일에 Mandu.filling() 패턴이 없습니다",
|
|
71
|
-
severity: "error",
|
|
72
|
-
},
|
|
73
|
-
SLOT_ZOD_DIRECT_IMPORT: {
|
|
74
|
-
id: "SLOT_ZOD_DIRECT_IMPORT",
|
|
75
|
-
name: "Zod Direct Import in Slot",
|
|
76
|
-
description: "Slot 파일에서 zod를 직접 import 했습니다",
|
|
77
|
-
severity: "error",
|
|
78
|
-
},
|
|
61
|
+
SLOT_MISSING_FILLING_PATTERN: {
|
|
62
|
+
id: "SLOT_MISSING_FILLING_PATTERN",
|
|
63
|
+
name: "Slot Missing Filling Pattern",
|
|
64
|
+
description: "Slot 파일에 Mandu.filling() 패턴이 없습니다",
|
|
65
|
+
severity: "error",
|
|
66
|
+
},
|
|
67
|
+
SLOT_ZOD_DIRECT_IMPORT: {
|
|
68
|
+
id: "SLOT_ZOD_DIRECT_IMPORT",
|
|
69
|
+
name: "Zod Direct Import in Slot",
|
|
70
|
+
description: "Slot 파일에서 zod를 직접 import 했습니다",
|
|
71
|
+
severity: "error",
|
|
72
|
+
},
|
|
79
73
|
// Contract-related rules
|
|
80
74
|
CONTRACT_MISSING: {
|
|
81
75
|
id: "CONTRACT_MISSING",
|
|
@@ -105,7 +99,9 @@ export const GUARD_RULES: Record<string, GuardRule> = {
|
|
|
105
99
|
ISLAND_FIRST_INTEGRITY: {
|
|
106
100
|
id: "ISLAND_FIRST_INTEGRITY",
|
|
107
101
|
name: "Island-First Integrity",
|
|
108
|
-
description:
|
|
102
|
+
description:
|
|
103
|
+
"A page route has a clientModule defined but the island file does not exist. " +
|
|
104
|
+
"Create a .island.tsx file in the same directory; do NOT import island() into page.tsx.",
|
|
109
105
|
severity: "error",
|
|
110
106
|
},
|
|
111
107
|
CLIENT_MODULE_NOT_FOUND: {
|