@mandujs/mcp 0.13.0 → 0.16.0
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.md +6 -7
- package/package.json +3 -2
- package/src/adapters/index.ts +20 -20
- package/src/adapters/monitor-adapter.ts +100 -100
- package/src/adapters/tool-adapter.ts +88 -88
- package/src/executor/error-handler.ts +250 -250
- package/src/executor/index.ts +22 -22
- package/src/executor/tool-executor.ts +148 -148
- package/src/hooks/config-watcher.ts +174 -174
- package/src/hooks/index.ts +23 -23
- package/src/hooks/mcp-hooks.ts +227 -227
- package/src/logging/index.ts +15 -15
- package/src/logging/mcp-transport.ts +134 -134
- package/src/registry/index.ts +13 -13
- package/src/registry/mcp-tool-registry.ts +298 -298
- package/src/resources/skills/guides.ts +1136 -1136
- package/src/resources/skills/index.ts +12 -12
- package/src/resources/skills/loader.ts +218 -218
- package/src/resources/skills/mandu-composition/SKILL.md +91 -91
- package/src/resources/skills/mandu-composition/metadata.json +13 -13
- package/src/resources/skills/mandu-composition/rules/_sections.md +26 -26
- package/src/resources/skills/mandu-composition/rules/_template.md +77 -77
- package/src/resources/skills/mandu-composition/rules/comp-arch-avoid-boolean-props.md +146 -146
- package/src/resources/skills/mandu-composition/rules/comp-arch-compound-components.md +164 -164
- package/src/resources/skills/mandu-composition/rules/comp-island-event.md +161 -161
- package/src/resources/skills/mandu-composition/rules/comp-island-slot-split.md +167 -167
- package/src/resources/skills/mandu-composition/rules/comp-pattern-children.md +149 -149
- package/src/resources/skills/mandu-composition/rules/comp-state-context-interface.md +148 -148
- package/src/resources/skills/mandu-composition/rules/comp-state-lift-state.md +150 -150
- package/src/resources/skills/mandu-deployment/SKILL.md +92 -92
- package/src/resources/skills/mandu-deployment/_sections.md +41 -41
- package/src/resources/skills/mandu-deployment/_template.md +38 -38
- package/src/resources/skills/mandu-deployment/metadata.json +13 -13
- package/src/resources/skills/mandu-deployment/rules/deploy-build-bun.md +109 -109
- package/src/resources/skills/mandu-deployment/rules/deploy-build-output.md +115 -115
- package/src/resources/skills/mandu-deployment/rules/deploy-cicd-github.md +219 -219
- package/src/resources/skills/mandu-deployment/rules/deploy-docker-bun.md +150 -150
- package/src/resources/skills/mandu-deployment/rules/deploy-docker-compose.md +223 -223
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-fly.md +152 -152
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-render.md +179 -179
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-supabase.md +323 -323
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-vercel.md +140 -140
- package/src/resources/skills/mandu-fs-routes/SKILL.md +82 -82
- package/src/resources/skills/mandu-fs-routes/metadata.json +12 -12
- package/src/resources/skills/mandu-fs-routes/rules/_sections.md +36 -36
- package/src/resources/skills/mandu-fs-routes/rules/_template.md +69 -69
- package/src/resources/skills/mandu-fs-routes/rules/routes-api-methods.md +65 -65
- package/src/resources/skills/mandu-fs-routes/rules/routes-dynamic-param.md +93 -93
- package/src/resources/skills/mandu-fs-routes/rules/routes-naming-page.md +55 -55
- package/src/resources/skills/mandu-guard/SKILL.md +129 -129
- package/src/resources/skills/mandu-guard/metadata.json +12 -12
- package/src/resources/skills/mandu-guard/rules/_sections.md +36 -36
- package/src/resources/skills/mandu-guard/rules/_template.md +82 -82
- package/src/resources/skills/mandu-guard/rules/guard-config-rules.md +100 -100
- package/src/resources/skills/mandu-guard/rules/guard-layer-direction.md +76 -76
- package/src/resources/skills/mandu-guard/rules/guard-preset-mandu.md +81 -81
- package/src/resources/skills/mandu-guard/rules/guard-validate-import.md +80 -80
- package/src/resources/skills/mandu-hydration/SKILL.md +91 -91
- package/src/resources/skills/mandu-hydration/metadata.json +12 -12
- package/src/resources/skills/mandu-hydration/rules/_sections.md +31 -31
- package/src/resources/skills/mandu-hydration/rules/_template.md +72 -72
- package/src/resources/skills/mandu-hydration/rules/hydration-data-event.md +109 -109
- package/src/resources/skills/mandu-hydration/rules/hydration-directive-use-client.md +55 -55
- package/src/resources/skills/mandu-hydration/rules/hydration-island-setup.md +113 -113
- package/src/resources/skills/mandu-hydration/rules/hydration-priority-visible.md +68 -68
- package/src/resources/skills/mandu-performance/SKILL.md +85 -85
- package/src/resources/skills/mandu-performance/metadata.json +14 -14
- package/src/resources/skills/mandu-performance/rules/_sections.md +31 -31
- package/src/resources/skills/mandu-performance/rules/_template.md +64 -64
- package/src/resources/skills/mandu-performance/rules/perf-async-defer-await.md +103 -103
- package/src/resources/skills/mandu-performance/rules/perf-async-parallel.md +95 -95
- package/src/resources/skills/mandu-performance/rules/perf-bun-file.md +124 -124
- package/src/resources/skills/mandu-performance/rules/perf-bun-serve.md +125 -125
- package/src/resources/skills/mandu-performance/rules/perf-bundle-imports.md +80 -80
- package/src/resources/skills/mandu-performance/rules/perf-bundle-island-lazy.md +145 -145
- package/src/resources/skills/mandu-performance/rules/perf-cache-react.md +98 -98
- package/src/resources/skills/mandu-performance/rules/perf-render-transitions.md +154 -154
- package/src/resources/skills/mandu-security/SKILL.md +87 -87
- package/src/resources/skills/mandu-security/metadata.json +13 -13
- package/src/resources/skills/mandu-security/rules/_sections.md +31 -31
- package/src/resources/skills/mandu-security/rules/_template.md +74 -74
- package/src/resources/skills/mandu-security/rules/sec-auth-guard.md +127 -127
- package/src/resources/skills/mandu-security/rules/sec-env-management.md +133 -133
- package/src/resources/skills/mandu-security/rules/sec-input-validate.md +148 -148
- package/src/resources/skills/mandu-security/rules/sec-protect-csrf.md +146 -146
- package/src/resources/skills/mandu-security/rules/sec-protect-headers.md +138 -138
- package/src/resources/skills/mandu-slot/SKILL.md +85 -85
- package/src/resources/skills/mandu-slot/metadata.json +12 -12
- package/src/resources/skills/mandu-slot/rules/_sections.md +36 -36
- package/src/resources/skills/mandu-slot/rules/_template.md +63 -63
- package/src/resources/skills/mandu-slot/rules/slot-basic-structure.md +38 -38
- package/src/resources/skills/mandu-slot/rules/slot-ctx-response.md +56 -56
- package/src/resources/skills/mandu-slot/rules/slot-guard-auth.md +59 -59
- package/src/resources/skills/mandu-slot/rules/slot-http-methods.md +64 -64
- package/src/resources/skills/mandu-styling/SKILL.md +154 -154
- package/src/resources/skills/mandu-styling/_sections.md +43 -43
- package/src/resources/skills/mandu-styling/_template.md +32 -32
- package/src/resources/skills/mandu-styling/metadata.json +15 -15
- package/src/resources/skills/mandu-styling/rules/style-component-compound.md +235 -235
- package/src/resources/skills/mandu-styling/rules/style-component-slots.md +255 -255
- package/src/resources/skills/mandu-styling/rules/style-component-tokens.md +205 -205
- package/src/resources/skills/mandu-styling/rules/style-island-animations.md +272 -272
- package/src/resources/skills/mandu-styling/rules/style-island-scoping.md +167 -167
- package/src/resources/skills/mandu-styling/rules/style-island-variants.md +221 -221
- package/src/resources/skills/mandu-styling/rules/style-perf-critical.md +209 -209
- package/src/resources/skills/mandu-styling/rules/style-perf-purge.md +192 -192
- package/src/resources/skills/mandu-styling/rules/style-setup-modules.md +162 -162
- package/src/resources/skills/mandu-styling/rules/style-setup-panda.md +164 -164
- package/src/resources/skills/mandu-styling/rules/style-setup-tailwind.md +170 -170
- package/src/resources/skills/mandu-styling/rules/style-tailwind-v4-gotchas.md +179 -179
- package/src/resources/skills/mandu-styling/rules/style-theme-darkmode.md +229 -229
- package/src/resources/skills/mandu-testing/SKILL.md +99 -99
- package/src/resources/skills/mandu-testing/metadata.json +13 -13
- package/src/resources/skills/mandu-testing/rules/_sections.md +26 -26
- package/src/resources/skills/mandu-testing/rules/_template.md +65 -65
- package/src/resources/skills/mandu-testing/rules/test-component-island.md +195 -195
- package/src/resources/skills/mandu-testing/rules/test-e2e-playwright.md +196 -196
- package/src/resources/skills/mandu-testing/rules/test-mock-fetch.md +219 -219
- package/src/resources/skills/mandu-testing/rules/test-slot-unit.md +192 -192
- package/src/resources/skills/mandu-ui/SKILL.md +117 -117
- package/src/resources/skills/mandu-ui/_sections.md +23 -23
- package/src/resources/skills/mandu-ui/_template.md +32 -32
- package/src/resources/skills/mandu-ui/metadata.json +13 -13
- package/src/resources/skills/mandu-ui/rules/ui-accessibility-aria.md +232 -232
- package/src/resources/skills/mandu-ui/rules/ui-accessibility-focus.md +238 -238
- package/src/resources/skills/mandu-ui/rules/ui-composition-patterns.md +259 -259
- package/src/resources/skills/mandu-ui/rules/ui-island-integration.md +258 -258
- package/src/resources/skills/mandu-ui/rules/ui-radix-patterns.md +213 -213
- package/src/resources/skills/mandu-ui/rules/ui-shadcn-setup.md +209 -209
- package/src/resources/skills/recipes.ts +932 -932
- package/src/tools/ate.ts +129 -0
- package/src/tools/index.ts +4 -1
- package/src/tools/project.ts +334 -334
- package/src/tools/runtime.ts +497 -497
- package/src/tools/seo.ts +417 -417
- package/src/utils/withWarnings.ts +83 -83
|
@@ -1,150 +1,150 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Docker with Bun
|
|
3
|
-
impact: HIGH
|
|
4
|
-
impactDescription: Ensures consistent deployment environment
|
|
5
|
-
tags: deployment, docker, bun, container
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Docker with Bun
|
|
9
|
-
|
|
10
|
-
**Impact: HIGH (Ensures consistent deployment environment)**
|
|
11
|
-
|
|
12
|
-
Docker를 사용하여 Bun 기반 Mandu 앱을 컨테이너화하세요.
|
|
13
|
-
|
|
14
|
-
**Dockerfile (Production):**
|
|
15
|
-
|
|
16
|
-
```dockerfile
|
|
17
|
-
# Build stage
|
|
18
|
-
FROM oven/bun:1.0 as builder
|
|
19
|
-
|
|
20
|
-
WORKDIR /app
|
|
21
|
-
|
|
22
|
-
# 의존성 설치 (캐시 활용)
|
|
23
|
-
COPY package.json bun.lockb ./
|
|
24
|
-
RUN bun install --frozen-lockfile
|
|
25
|
-
|
|
26
|
-
# 소스 복사 및 빌드
|
|
27
|
-
COPY . .
|
|
28
|
-
RUN bun run build
|
|
29
|
-
|
|
30
|
-
# 프로덕션 의존성만 설치
|
|
31
|
-
RUN bun install --frozen-lockfile --production
|
|
32
|
-
|
|
33
|
-
# Production stage
|
|
34
|
-
FROM oven/bun:1.0-slim
|
|
35
|
-
|
|
36
|
-
WORKDIR /app
|
|
37
|
-
|
|
38
|
-
# 빌드 결과물만 복사
|
|
39
|
-
COPY --from=builder /app/dist ./dist
|
|
40
|
-
COPY --from=builder /app/node_modules ./node_modules
|
|
41
|
-
COPY --from=builder /app/package.json ./
|
|
42
|
-
|
|
43
|
-
# 보안: non-root 사용자
|
|
44
|
-
USER bun
|
|
45
|
-
|
|
46
|
-
EXPOSE 3000
|
|
47
|
-
|
|
48
|
-
# 헬스체크
|
|
49
|
-
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
50
|
-
CMD curl -f http://localhost:3000/health || exit 1
|
|
51
|
-
|
|
52
|
-
CMD ["bun", "run", "start"]
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## .dockerignore
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
node_modules
|
|
59
|
-
dist
|
|
60
|
-
.git
|
|
61
|
-
.gitignore
|
|
62
|
-
*.md
|
|
63
|
-
*.log
|
|
64
|
-
.env*
|
|
65
|
-
!.env.example
|
|
66
|
-
tests
|
|
67
|
-
coverage
|
|
68
|
-
.github
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## 멀티스테이지 빌드 최적화
|
|
72
|
-
|
|
73
|
-
```dockerfile
|
|
74
|
-
# Alpine 기반 (더 작은 이미지)
|
|
75
|
-
FROM oven/bun:1.0-alpine as builder
|
|
76
|
-
# ... 빌드 과정
|
|
77
|
-
|
|
78
|
-
FROM oven/bun:1.0-alpine
|
|
79
|
-
# ... 프로덕션 설정
|
|
80
|
-
|
|
81
|
-
# distroless 기반 (최소 공격면)
|
|
82
|
-
FROM gcr.io/distroless/cc
|
|
83
|
-
COPY --from=builder /app/dist /app/dist
|
|
84
|
-
COPY --from=builder /usr/local/bin/bun /usr/local/bin/bun
|
|
85
|
-
CMD ["/usr/local/bin/bun", "run", "/app/dist/server.js"]
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## 빌드 및 실행
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
# 이미지 빌드
|
|
92
|
-
docker build -t mandu-app:latest .
|
|
93
|
-
|
|
94
|
-
# 빌드 캐시 활용
|
|
95
|
-
docker build --cache-from mandu-app:latest -t mandu-app:latest .
|
|
96
|
-
|
|
97
|
-
# 컨테이너 실행
|
|
98
|
-
docker run -d \
|
|
99
|
-
--name mandu \
|
|
100
|
-
-p 3000:3000 \
|
|
101
|
-
-e DATABASE_URL="postgresql://..." \
|
|
102
|
-
-e SESSION_SECRET="..." \
|
|
103
|
-
mandu-app:latest
|
|
104
|
-
|
|
105
|
-
# 로그 확인
|
|
106
|
-
docker logs -f mandu
|
|
107
|
-
|
|
108
|
-
# 컨테이너 접속
|
|
109
|
-
docker exec -it mandu sh
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
## 개발용 Dockerfile
|
|
113
|
-
|
|
114
|
-
```dockerfile
|
|
115
|
-
# Dockerfile.dev
|
|
116
|
-
FROM oven/bun:1.0
|
|
117
|
-
|
|
118
|
-
WORKDIR /app
|
|
119
|
-
|
|
120
|
-
# Hot reload를 위한 볼륨 마운트용
|
|
121
|
-
COPY package.json bun.lockb ./
|
|
122
|
-
RUN bun install
|
|
123
|
-
|
|
124
|
-
EXPOSE 3000
|
|
125
|
-
|
|
126
|
-
CMD ["bun", "run", "dev"]
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# 개발 모드 실행
|
|
131
|
-
docker build -f Dockerfile.dev -t mandu-dev .
|
|
132
|
-
docker run -v $(pwd):/app -p 3000:3000 mandu-dev
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## 이미지 크기 최적화
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# 이미지 크기 확인
|
|
139
|
-
docker images mandu-app
|
|
140
|
-
|
|
141
|
-
# 레이어 분석
|
|
142
|
-
docker history mandu-app:latest
|
|
143
|
-
|
|
144
|
-
# 최적화 목표
|
|
145
|
-
# - oven/bun:1.0-slim: ~150MB base
|
|
146
|
-
# - 프로덕션 deps만: 추가 50-100MB
|
|
147
|
-
# - 총 목표: < 300MB
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
Reference: [Bun Docker Images](https://hub.docker.com/r/oven/bun)
|
|
1
|
+
---
|
|
2
|
+
title: Docker with Bun
|
|
3
|
+
impact: HIGH
|
|
4
|
+
impactDescription: Ensures consistent deployment environment
|
|
5
|
+
tags: deployment, docker, bun, container
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Docker with Bun
|
|
9
|
+
|
|
10
|
+
**Impact: HIGH (Ensures consistent deployment environment)**
|
|
11
|
+
|
|
12
|
+
Docker를 사용하여 Bun 기반 Mandu 앱을 컨테이너화하세요.
|
|
13
|
+
|
|
14
|
+
**Dockerfile (Production):**
|
|
15
|
+
|
|
16
|
+
```dockerfile
|
|
17
|
+
# Build stage
|
|
18
|
+
FROM oven/bun:1.0 as builder
|
|
19
|
+
|
|
20
|
+
WORKDIR /app
|
|
21
|
+
|
|
22
|
+
# 의존성 설치 (캐시 활용)
|
|
23
|
+
COPY package.json bun.lockb ./
|
|
24
|
+
RUN bun install --frozen-lockfile
|
|
25
|
+
|
|
26
|
+
# 소스 복사 및 빌드
|
|
27
|
+
COPY . .
|
|
28
|
+
RUN bun run build
|
|
29
|
+
|
|
30
|
+
# 프로덕션 의존성만 설치
|
|
31
|
+
RUN bun install --frozen-lockfile --production
|
|
32
|
+
|
|
33
|
+
# Production stage
|
|
34
|
+
FROM oven/bun:1.0-slim
|
|
35
|
+
|
|
36
|
+
WORKDIR /app
|
|
37
|
+
|
|
38
|
+
# 빌드 결과물만 복사
|
|
39
|
+
COPY --from=builder /app/dist ./dist
|
|
40
|
+
COPY --from=builder /app/node_modules ./node_modules
|
|
41
|
+
COPY --from=builder /app/package.json ./
|
|
42
|
+
|
|
43
|
+
# 보안: non-root 사용자
|
|
44
|
+
USER bun
|
|
45
|
+
|
|
46
|
+
EXPOSE 3000
|
|
47
|
+
|
|
48
|
+
# 헬스체크
|
|
49
|
+
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
50
|
+
CMD curl -f http://localhost:3000/health || exit 1
|
|
51
|
+
|
|
52
|
+
CMD ["bun", "run", "start"]
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## .dockerignore
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
node_modules
|
|
59
|
+
dist
|
|
60
|
+
.git
|
|
61
|
+
.gitignore
|
|
62
|
+
*.md
|
|
63
|
+
*.log
|
|
64
|
+
.env*
|
|
65
|
+
!.env.example
|
|
66
|
+
tests
|
|
67
|
+
coverage
|
|
68
|
+
.github
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 멀티스테이지 빌드 최적화
|
|
72
|
+
|
|
73
|
+
```dockerfile
|
|
74
|
+
# Alpine 기반 (더 작은 이미지)
|
|
75
|
+
FROM oven/bun:1.0-alpine as builder
|
|
76
|
+
# ... 빌드 과정
|
|
77
|
+
|
|
78
|
+
FROM oven/bun:1.0-alpine
|
|
79
|
+
# ... 프로덕션 설정
|
|
80
|
+
|
|
81
|
+
# distroless 기반 (최소 공격면)
|
|
82
|
+
FROM gcr.io/distroless/cc
|
|
83
|
+
COPY --from=builder /app/dist /app/dist
|
|
84
|
+
COPY --from=builder /usr/local/bin/bun /usr/local/bin/bun
|
|
85
|
+
CMD ["/usr/local/bin/bun", "run", "/app/dist/server.js"]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 빌드 및 실행
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# 이미지 빌드
|
|
92
|
+
docker build -t mandu-app:latest .
|
|
93
|
+
|
|
94
|
+
# 빌드 캐시 활용
|
|
95
|
+
docker build --cache-from mandu-app:latest -t mandu-app:latest .
|
|
96
|
+
|
|
97
|
+
# 컨테이너 실행
|
|
98
|
+
docker run -d \
|
|
99
|
+
--name mandu \
|
|
100
|
+
-p 3000:3000 \
|
|
101
|
+
-e DATABASE_URL="postgresql://..." \
|
|
102
|
+
-e SESSION_SECRET="..." \
|
|
103
|
+
mandu-app:latest
|
|
104
|
+
|
|
105
|
+
# 로그 확인
|
|
106
|
+
docker logs -f mandu
|
|
107
|
+
|
|
108
|
+
# 컨테이너 접속
|
|
109
|
+
docker exec -it mandu sh
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## 개발용 Dockerfile
|
|
113
|
+
|
|
114
|
+
```dockerfile
|
|
115
|
+
# Dockerfile.dev
|
|
116
|
+
FROM oven/bun:1.0
|
|
117
|
+
|
|
118
|
+
WORKDIR /app
|
|
119
|
+
|
|
120
|
+
# Hot reload를 위한 볼륨 마운트용
|
|
121
|
+
COPY package.json bun.lockb ./
|
|
122
|
+
RUN bun install
|
|
123
|
+
|
|
124
|
+
EXPOSE 3000
|
|
125
|
+
|
|
126
|
+
CMD ["bun", "run", "dev"]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# 개발 모드 실행
|
|
131
|
+
docker build -f Dockerfile.dev -t mandu-dev .
|
|
132
|
+
docker run -v $(pwd):/app -p 3000:3000 mandu-dev
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## 이미지 크기 최적화
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
# 이미지 크기 확인
|
|
139
|
+
docker images mandu-app
|
|
140
|
+
|
|
141
|
+
# 레이어 분석
|
|
142
|
+
docker history mandu-app:latest
|
|
143
|
+
|
|
144
|
+
# 최적화 목표
|
|
145
|
+
# - oven/bun:1.0-slim: ~150MB base
|
|
146
|
+
# - 프로덕션 deps만: 추가 50-100MB
|
|
147
|
+
# - 총 목표: < 300MB
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Reference: [Bun Docker Images](https://hub.docker.com/r/oven/bun)
|