@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,162 +1,162 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: CSS Modules Setup
|
|
3
|
-
impact: CRITICAL
|
|
4
|
-
impactDescription: Zero-dependency styling with native Bun support
|
|
5
|
-
tags: styling, css-modules, setup, native
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## CSS Modules Setup
|
|
9
|
-
|
|
10
|
-
**Impact: CRITICAL (Zero-dependency styling with native Bun support)**
|
|
11
|
-
|
|
12
|
-
외부 의존성 없이 스코프된 CSS가 필요할 때 CSS Modules를 사용하세요.
|
|
13
|
-
|
|
14
|
-
**Bun 설정:**
|
|
15
|
-
|
|
16
|
-
Bun은 CSS Modules를 네이티브로 지원합니다. 별도 설정 불필요.
|
|
17
|
-
|
|
18
|
-
```typescript
|
|
19
|
-
// bunfig.toml (선택적 최적화)
|
|
20
|
-
[build]
|
|
21
|
-
target = "browser"
|
|
22
|
-
minify = true
|
|
23
|
-
|
|
24
|
-
[build.loader]
|
|
25
|
-
".module.css" = "css"
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## 사용 예시
|
|
29
|
-
|
|
30
|
-
```css
|
|
31
|
-
/* app/button/button.module.css */
|
|
32
|
-
.button {
|
|
33
|
-
display: inline-flex;
|
|
34
|
-
align-items: center;
|
|
35
|
-
justify-content: center;
|
|
36
|
-
border-radius: 0.5rem;
|
|
37
|
-
font-weight: 500;
|
|
38
|
-
transition: all 0.2s;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.default {
|
|
42
|
-
background-color: var(--mandu-primary);
|
|
43
|
-
color: white;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.default:hover {
|
|
47
|
-
background-color: var(--mandu-primary-dark);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.outline {
|
|
51
|
-
border: 1px solid var(--mandu-primary);
|
|
52
|
-
color: var(--mandu-primary);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.outline:hover {
|
|
56
|
-
background-color: var(--mandu-primary-light);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.sm { height: 2rem; padding: 0 0.75rem; font-size: 0.875rem; }
|
|
60
|
-
.md { height: 2.5rem; padding: 0 1rem; }
|
|
61
|
-
.lg { height: 3rem; padding: 0 1.5rem; font-size: 1.125rem; }
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
```tsx
|
|
65
|
-
// app/button/client.tsx
|
|
66
|
-
"use client";
|
|
67
|
-
|
|
68
|
-
import styles from "./button.module.css";
|
|
69
|
-
|
|
70
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
71
|
-
variant?: "default" | "outline";
|
|
72
|
-
size?: "sm" | "md" | "lg";
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function ButtonIsland({
|
|
76
|
-
variant = "default",
|
|
77
|
-
size = "md",
|
|
78
|
-
className,
|
|
79
|
-
...props
|
|
80
|
-
}: ButtonProps) {
|
|
81
|
-
const classes = [
|
|
82
|
-
styles.button,
|
|
83
|
-
styles[variant],
|
|
84
|
-
styles[size],
|
|
85
|
-
className,
|
|
86
|
-
].filter(Boolean).join(" ");
|
|
87
|
-
|
|
88
|
-
return <button className={classes} {...props} />;
|
|
89
|
-
}
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## CSS Variables 활용
|
|
93
|
-
|
|
94
|
-
```css
|
|
95
|
-
/* app/globals.css */
|
|
96
|
-
:root {
|
|
97
|
-
--mandu-primary: #3b82f6;
|
|
98
|
-
--mandu-primary-dark: #2563eb;
|
|
99
|
-
--mandu-primary-light: rgba(59, 130, 246, 0.1);
|
|
100
|
-
--mandu-secondary: #64748b;
|
|
101
|
-
--mandu-radius: 0.5rem;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
.dark {
|
|
105
|
-
--mandu-primary: #60a5fa;
|
|
106
|
-
--mandu-primary-dark: #3b82f6;
|
|
107
|
-
--mandu-background: #0f172a;
|
|
108
|
-
--mandu-foreground: #f8fafc;
|
|
109
|
-
}
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
## clsx 조합
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
bun add clsx
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
```tsx
|
|
119
|
-
import clsx from "clsx";
|
|
120
|
-
import styles from "./card.module.css";
|
|
121
|
-
|
|
122
|
-
export function CardIsland({ highlighted }: { highlighted?: boolean }) {
|
|
123
|
-
return (
|
|
124
|
-
<div
|
|
125
|
-
className={clsx(styles.card, {
|
|
126
|
-
[styles.highlighted]: highlighted,
|
|
127
|
-
})}
|
|
128
|
-
>
|
|
129
|
-
Content
|
|
130
|
-
</div>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## TypeScript 타입 정의
|
|
136
|
-
|
|
137
|
-
```typescript
|
|
138
|
-
// types/css.d.ts
|
|
139
|
-
declare module "*.module.css" {
|
|
140
|
-
const classes: { [key: string]: string };
|
|
141
|
-
export default classes;
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## 장단점
|
|
146
|
-
|
|
147
|
-
**장점:**
|
|
148
|
-
- 의존성 없음 (Bun 네이티브)
|
|
149
|
-
- 스코프 자동 격리
|
|
150
|
-
- 작은 번들 크기
|
|
151
|
-
|
|
152
|
-
**단점:**
|
|
153
|
-
- 유틸리티 클래스 없음
|
|
154
|
-
- 반복 코드 발생 가능
|
|
155
|
-
- Tailwind 생태계 미호환
|
|
156
|
-
|
|
157
|
-
**추천 사용 케이스:**
|
|
158
|
-
- 최소 의존성 프로젝트
|
|
159
|
-
- 레거시 CSS 마이그레이션
|
|
160
|
-
- 특정 컴포넌트 격리
|
|
161
|
-
|
|
162
|
-
Reference: [Bun CSS Support](https://bun.sh/docs/bundler/loaders#css)
|
|
1
|
+
---
|
|
2
|
+
title: CSS Modules Setup
|
|
3
|
+
impact: CRITICAL
|
|
4
|
+
impactDescription: Zero-dependency styling with native Bun support
|
|
5
|
+
tags: styling, css-modules, setup, native
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## CSS Modules Setup
|
|
9
|
+
|
|
10
|
+
**Impact: CRITICAL (Zero-dependency styling with native Bun support)**
|
|
11
|
+
|
|
12
|
+
외부 의존성 없이 스코프된 CSS가 필요할 때 CSS Modules를 사용하세요.
|
|
13
|
+
|
|
14
|
+
**Bun 설정:**
|
|
15
|
+
|
|
16
|
+
Bun은 CSS Modules를 네이티브로 지원합니다. 별도 설정 불필요.
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
// bunfig.toml (선택적 최적화)
|
|
20
|
+
[build]
|
|
21
|
+
target = "browser"
|
|
22
|
+
minify = true
|
|
23
|
+
|
|
24
|
+
[build.loader]
|
|
25
|
+
".module.css" = "css"
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## 사용 예시
|
|
29
|
+
|
|
30
|
+
```css
|
|
31
|
+
/* app/button/button.module.css */
|
|
32
|
+
.button {
|
|
33
|
+
display: inline-flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: center;
|
|
36
|
+
border-radius: 0.5rem;
|
|
37
|
+
font-weight: 500;
|
|
38
|
+
transition: all 0.2s;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.default {
|
|
42
|
+
background-color: var(--mandu-primary);
|
|
43
|
+
color: white;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.default:hover {
|
|
47
|
+
background-color: var(--mandu-primary-dark);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.outline {
|
|
51
|
+
border: 1px solid var(--mandu-primary);
|
|
52
|
+
color: var(--mandu-primary);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.outline:hover {
|
|
56
|
+
background-color: var(--mandu-primary-light);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.sm { height: 2rem; padding: 0 0.75rem; font-size: 0.875rem; }
|
|
60
|
+
.md { height: 2.5rem; padding: 0 1rem; }
|
|
61
|
+
.lg { height: 3rem; padding: 0 1.5rem; font-size: 1.125rem; }
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```tsx
|
|
65
|
+
// app/button/client.tsx
|
|
66
|
+
"use client";
|
|
67
|
+
|
|
68
|
+
import styles from "./button.module.css";
|
|
69
|
+
|
|
70
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
71
|
+
variant?: "default" | "outline";
|
|
72
|
+
size?: "sm" | "md" | "lg";
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function ButtonIsland({
|
|
76
|
+
variant = "default",
|
|
77
|
+
size = "md",
|
|
78
|
+
className,
|
|
79
|
+
...props
|
|
80
|
+
}: ButtonProps) {
|
|
81
|
+
const classes = [
|
|
82
|
+
styles.button,
|
|
83
|
+
styles[variant],
|
|
84
|
+
styles[size],
|
|
85
|
+
className,
|
|
86
|
+
].filter(Boolean).join(" ");
|
|
87
|
+
|
|
88
|
+
return <button className={classes} {...props} />;
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## CSS Variables 활용
|
|
93
|
+
|
|
94
|
+
```css
|
|
95
|
+
/* app/globals.css */
|
|
96
|
+
:root {
|
|
97
|
+
--mandu-primary: #3b82f6;
|
|
98
|
+
--mandu-primary-dark: #2563eb;
|
|
99
|
+
--mandu-primary-light: rgba(59, 130, 246, 0.1);
|
|
100
|
+
--mandu-secondary: #64748b;
|
|
101
|
+
--mandu-radius: 0.5rem;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.dark {
|
|
105
|
+
--mandu-primary: #60a5fa;
|
|
106
|
+
--mandu-primary-dark: #3b82f6;
|
|
107
|
+
--mandu-background: #0f172a;
|
|
108
|
+
--mandu-foreground: #f8fafc;
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## clsx 조합
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
bun add clsx
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```tsx
|
|
119
|
+
import clsx from "clsx";
|
|
120
|
+
import styles from "./card.module.css";
|
|
121
|
+
|
|
122
|
+
export function CardIsland({ highlighted }: { highlighted?: boolean }) {
|
|
123
|
+
return (
|
|
124
|
+
<div
|
|
125
|
+
className={clsx(styles.card, {
|
|
126
|
+
[styles.highlighted]: highlighted,
|
|
127
|
+
})}
|
|
128
|
+
>
|
|
129
|
+
Content
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## TypeScript 타입 정의
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
// types/css.d.ts
|
|
139
|
+
declare module "*.module.css" {
|
|
140
|
+
const classes: { [key: string]: string };
|
|
141
|
+
export default classes;
|
|
142
|
+
}
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## 장단점
|
|
146
|
+
|
|
147
|
+
**장점:**
|
|
148
|
+
- 의존성 없음 (Bun 네이티브)
|
|
149
|
+
- 스코프 자동 격리
|
|
150
|
+
- 작은 번들 크기
|
|
151
|
+
|
|
152
|
+
**단점:**
|
|
153
|
+
- 유틸리티 클래스 없음
|
|
154
|
+
- 반복 코드 발생 가능
|
|
155
|
+
- Tailwind 생태계 미호환
|
|
156
|
+
|
|
157
|
+
**추천 사용 케이스:**
|
|
158
|
+
- 최소 의존성 프로젝트
|
|
159
|
+
- 레거시 CSS 마이그레이션
|
|
160
|
+
- 특정 컴포넌트 격리
|
|
161
|
+
|
|
162
|
+
Reference: [Bun CSS Support](https://bun.sh/docs/bundler/loaders#css)
|
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Panda CSS Setup
|
|
3
|
-
impact: CRITICAL
|
|
4
|
-
impactDescription: Type-safe alternative CSS framework
|
|
5
|
-
tags: styling, panda, setup, type-safe
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Panda CSS Setup
|
|
9
|
-
|
|
10
|
-
**Impact: CRITICAL (Type-safe alternative CSS framework)**
|
|
11
|
-
|
|
12
|
-
Type-safe CSS-in-JS가 필요할 때 Panda CSS를 사용하세요. Zero-runtime으로 Island와 완벽 호환됩니다.
|
|
13
|
-
|
|
14
|
-
**설치:**
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
bun add -d @pandacss/dev
|
|
18
|
-
bunx panda init
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
**panda.config.ts:**
|
|
22
|
-
|
|
23
|
-
```typescript
|
|
24
|
-
import { defineConfig } from "@pandacss/dev";
|
|
25
|
-
|
|
26
|
-
export default defineConfig({
|
|
27
|
-
preflight: true,
|
|
28
|
-
include: ["./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}"],
|
|
29
|
-
exclude: [],
|
|
30
|
-
|
|
31
|
-
theme: {
|
|
32
|
-
extend: {
|
|
33
|
-
tokens: {
|
|
34
|
-
colors: {
|
|
35
|
-
mandu: {
|
|
36
|
-
primary: { value: "#3b82f6" },
|
|
37
|
-
secondary: { value: "#64748b" },
|
|
38
|
-
accent: { value: "#f59e0b" },
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
radii: {
|
|
42
|
-
mandu: { value: "0.5rem" },
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
semanticTokens: {
|
|
46
|
-
colors: {
|
|
47
|
-
background: {
|
|
48
|
-
value: { base: "{colors.white}", _dark: "{colors.zinc.900}" },
|
|
49
|
-
},
|
|
50
|
-
foreground: {
|
|
51
|
-
value: { base: "{colors.zinc.900}", _dark: "{colors.white}" },
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
outdir: "styled-system",
|
|
59
|
-
});
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**package.json 스크립트:**
|
|
63
|
-
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"scripts": {
|
|
67
|
-
"prepare": "panda codegen",
|
|
68
|
-
"dev": "panda --watch & bun run serve"
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## 사용 예시
|
|
74
|
-
|
|
75
|
-
```tsx
|
|
76
|
-
// app/button/client.tsx
|
|
77
|
-
"use client";
|
|
78
|
-
|
|
79
|
-
import { css, cva } from "@/styled-system/css";
|
|
80
|
-
|
|
81
|
-
const button = cva({
|
|
82
|
-
base: {
|
|
83
|
-
display: "inline-flex",
|
|
84
|
-
alignItems: "center",
|
|
85
|
-
justifyContent: "center",
|
|
86
|
-
borderRadius: "mandu",
|
|
87
|
-
fontWeight: "medium",
|
|
88
|
-
transition: "colors",
|
|
89
|
-
cursor: "pointer",
|
|
90
|
-
},
|
|
91
|
-
variants: {
|
|
92
|
-
variant: {
|
|
93
|
-
default: {
|
|
94
|
-
bg: "mandu.primary",
|
|
95
|
-
color: "white",
|
|
96
|
-
_hover: { bg: "mandu.primary/90" },
|
|
97
|
-
},
|
|
98
|
-
outline: {
|
|
99
|
-
border: "1px solid",
|
|
100
|
-
borderColor: "mandu.primary",
|
|
101
|
-
color: "mandu.primary",
|
|
102
|
-
_hover: { bg: "mandu.primary/10" },
|
|
103
|
-
},
|
|
104
|
-
ghost: {
|
|
105
|
-
_hover: { bg: "mandu.secondary/20" },
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
size: {
|
|
109
|
-
sm: { h: "8", px: "3", fontSize: "sm" },
|
|
110
|
-
md: { h: "10", px: "4" },
|
|
111
|
-
lg: { h: "12", px: "6", fontSize: "lg" },
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
defaultVariants: {
|
|
115
|
-
variant: "default",
|
|
116
|
-
size: "md",
|
|
117
|
-
},
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
121
|
-
variant?: "default" | "outline" | "ghost";
|
|
122
|
-
size?: "sm" | "md" | "lg";
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export function ButtonIsland({ variant, size, className, ...props }: ButtonProps) {
|
|
126
|
-
return (
|
|
127
|
-
<button className={button({ variant, size })} {...props} />
|
|
128
|
-
);
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
## Inline Styles
|
|
133
|
-
|
|
134
|
-
```tsx
|
|
135
|
-
import { css } from "@/styled-system/css";
|
|
136
|
-
|
|
137
|
-
export function CardIsland() {
|
|
138
|
-
return (
|
|
139
|
-
<div
|
|
140
|
-
className={css({
|
|
141
|
-
p: "4",
|
|
142
|
-
rounded: "mandu",
|
|
143
|
-
bg: "background",
|
|
144
|
-
shadow: "md",
|
|
145
|
-
_hover: { shadow: "lg" },
|
|
146
|
-
})}
|
|
147
|
-
>
|
|
148
|
-
Content
|
|
149
|
-
</div>
|
|
150
|
-
);
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Tailwind와의 비교
|
|
155
|
-
|
|
156
|
-
| 기능 | Tailwind | Panda |
|
|
157
|
-
|------|----------|-------|
|
|
158
|
-
| Type-safe | ❌ | ✅ |
|
|
159
|
-
| Zero-runtime | ✅ | ✅ |
|
|
160
|
-
| 생태계 | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
|
|
161
|
-
| DX | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
|
|
162
|
-
| 학습 곡선 | 낮음 | 중간 |
|
|
163
|
-
|
|
164
|
-
Reference: [Panda CSS Documentation](https://panda-css.com/docs)
|
|
1
|
+
---
|
|
2
|
+
title: Panda CSS Setup
|
|
3
|
+
impact: CRITICAL
|
|
4
|
+
impactDescription: Type-safe alternative CSS framework
|
|
5
|
+
tags: styling, panda, setup, type-safe
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Panda CSS Setup
|
|
9
|
+
|
|
10
|
+
**Impact: CRITICAL (Type-safe alternative CSS framework)**
|
|
11
|
+
|
|
12
|
+
Type-safe CSS-in-JS가 필요할 때 Panda CSS를 사용하세요. Zero-runtime으로 Island와 완벽 호환됩니다.
|
|
13
|
+
|
|
14
|
+
**설치:**
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bun add -d @pandacss/dev
|
|
18
|
+
bunx panda init
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**panda.config.ts:**
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { defineConfig } from "@pandacss/dev";
|
|
25
|
+
|
|
26
|
+
export default defineConfig({
|
|
27
|
+
preflight: true,
|
|
28
|
+
include: ["./app/**/*.{ts,tsx}", "./components/**/*.{ts,tsx}"],
|
|
29
|
+
exclude: [],
|
|
30
|
+
|
|
31
|
+
theme: {
|
|
32
|
+
extend: {
|
|
33
|
+
tokens: {
|
|
34
|
+
colors: {
|
|
35
|
+
mandu: {
|
|
36
|
+
primary: { value: "#3b82f6" },
|
|
37
|
+
secondary: { value: "#64748b" },
|
|
38
|
+
accent: { value: "#f59e0b" },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
radii: {
|
|
42
|
+
mandu: { value: "0.5rem" },
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
semanticTokens: {
|
|
46
|
+
colors: {
|
|
47
|
+
background: {
|
|
48
|
+
value: { base: "{colors.white}", _dark: "{colors.zinc.900}" },
|
|
49
|
+
},
|
|
50
|
+
foreground: {
|
|
51
|
+
value: { base: "{colors.zinc.900}", _dark: "{colors.white}" },
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
outdir: "styled-system",
|
|
59
|
+
});
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**package.json 스크립트:**
|
|
63
|
+
|
|
64
|
+
```json
|
|
65
|
+
{
|
|
66
|
+
"scripts": {
|
|
67
|
+
"prepare": "panda codegen",
|
|
68
|
+
"dev": "panda --watch & bun run serve"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## 사용 예시
|
|
74
|
+
|
|
75
|
+
```tsx
|
|
76
|
+
// app/button/client.tsx
|
|
77
|
+
"use client";
|
|
78
|
+
|
|
79
|
+
import { css, cva } from "@/styled-system/css";
|
|
80
|
+
|
|
81
|
+
const button = cva({
|
|
82
|
+
base: {
|
|
83
|
+
display: "inline-flex",
|
|
84
|
+
alignItems: "center",
|
|
85
|
+
justifyContent: "center",
|
|
86
|
+
borderRadius: "mandu",
|
|
87
|
+
fontWeight: "medium",
|
|
88
|
+
transition: "colors",
|
|
89
|
+
cursor: "pointer",
|
|
90
|
+
},
|
|
91
|
+
variants: {
|
|
92
|
+
variant: {
|
|
93
|
+
default: {
|
|
94
|
+
bg: "mandu.primary",
|
|
95
|
+
color: "white",
|
|
96
|
+
_hover: { bg: "mandu.primary/90" },
|
|
97
|
+
},
|
|
98
|
+
outline: {
|
|
99
|
+
border: "1px solid",
|
|
100
|
+
borderColor: "mandu.primary",
|
|
101
|
+
color: "mandu.primary",
|
|
102
|
+
_hover: { bg: "mandu.primary/10" },
|
|
103
|
+
},
|
|
104
|
+
ghost: {
|
|
105
|
+
_hover: { bg: "mandu.secondary/20" },
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
size: {
|
|
109
|
+
sm: { h: "8", px: "3", fontSize: "sm" },
|
|
110
|
+
md: { h: "10", px: "4" },
|
|
111
|
+
lg: { h: "12", px: "6", fontSize: "lg" },
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
defaultVariants: {
|
|
115
|
+
variant: "default",
|
|
116
|
+
size: "md",
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
121
|
+
variant?: "default" | "outline" | "ghost";
|
|
122
|
+
size?: "sm" | "md" | "lg";
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function ButtonIsland({ variant, size, className, ...props }: ButtonProps) {
|
|
126
|
+
return (
|
|
127
|
+
<button className={button({ variant, size })} {...props} />
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Inline Styles
|
|
133
|
+
|
|
134
|
+
```tsx
|
|
135
|
+
import { css } from "@/styled-system/css";
|
|
136
|
+
|
|
137
|
+
export function CardIsland() {
|
|
138
|
+
return (
|
|
139
|
+
<div
|
|
140
|
+
className={css({
|
|
141
|
+
p: "4",
|
|
142
|
+
rounded: "mandu",
|
|
143
|
+
bg: "background",
|
|
144
|
+
shadow: "md",
|
|
145
|
+
_hover: { shadow: "lg" },
|
|
146
|
+
})}
|
|
147
|
+
>
|
|
148
|
+
Content
|
|
149
|
+
</div>
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Tailwind와의 비교
|
|
155
|
+
|
|
156
|
+
| 기능 | Tailwind | Panda |
|
|
157
|
+
|------|----------|-------|
|
|
158
|
+
| Type-safe | ❌ | ✅ |
|
|
159
|
+
| Zero-runtime | ✅ | ✅ |
|
|
160
|
+
| 생태계 | ⭐⭐⭐⭐⭐ | ⭐⭐⭐ |
|
|
161
|
+
| DX | ⭐⭐⭐⭐⭐ | ⭐⭐⭐⭐ |
|
|
162
|
+
| 학습 곡선 | 낮음 | 중간 |
|
|
163
|
+
|
|
164
|
+
Reference: [Panda CSS Documentation](https://panda-css.com/docs)
|