@hua-labs/create-hua-ux 0.1.0-alpha.0.1

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.
Files changed (46) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +183 -0
  3. package/dist/bin/create-hua-ux.d.ts +9 -0
  4. package/dist/bin/create-hua-ux.d.ts.map +1 -0
  5. package/dist/bin/create-hua-ux.js +37 -0
  6. package/dist/constants/versions.d.ts +55 -0
  7. package/dist/constants/versions.d.ts.map +1 -0
  8. package/dist/constants/versions.js +57 -0
  9. package/dist/create-project.d.ts +18 -0
  10. package/dist/create-project.d.ts.map +1 -0
  11. package/dist/create-project.js +237 -0
  12. package/dist/doctor.d.ts +21 -0
  13. package/dist/doctor.d.ts.map +1 -0
  14. package/dist/doctor.js +259 -0
  15. package/dist/index.d.ts +9 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +177 -0
  18. package/dist/utils.d.ts +108 -0
  19. package/dist/utils.d.ts.map +1 -0
  20. package/dist/utils.js +896 -0
  21. package/dist/version.d.ts +9 -0
  22. package/dist/version.d.ts.map +1 -0
  23. package/dist/version.js +11 -0
  24. package/package.json +46 -0
  25. package/templates/nextjs/.claude/project-context.md +310 -0
  26. package/templates/nextjs/.claude/skills/hua-ux-framework/SKILL.md +187 -0
  27. package/templates/nextjs/.cursorrules +302 -0
  28. package/templates/nextjs/.eslintrc.json +1 -0
  29. package/templates/nextjs/README.md +431 -0
  30. package/templates/nextjs/ai-context.md +332 -0
  31. package/templates/nextjs/app/api/translations/[language]/[namespace]/route.ts +86 -0
  32. package/templates/nextjs/app/globals.css +24 -0
  33. package/templates/nextjs/app/layout-with-geo.example.tsx +106 -0
  34. package/templates/nextjs/app/layout.tsx +30 -0
  35. package/templates/nextjs/app/page-with-geo.example.tsx +80 -0
  36. package/templates/nextjs/app/page.tsx +28 -0
  37. package/templates/nextjs/components/I18nProviderWrapper.tsx +19 -0
  38. package/templates/nextjs/lib/i18n-setup.ts +11 -0
  39. package/templates/nextjs/middleware.ts.example +22 -0
  40. package/templates/nextjs/next.config.ts +36 -0
  41. package/templates/nextjs/postcss.config.js +6 -0
  42. package/templates/nextjs/store/useAppStore.ts +8 -0
  43. package/templates/nextjs/tailwind.config.js +8 -0
  44. package/templates/nextjs/translations/en/common.json +6 -0
  45. package/templates/nextjs/translations/ko/common.json +6 -0
  46. package/templates/nextjs/tsconfig.json +41 -0
@@ -0,0 +1,431 @@
1
+ # hua-ux 프로젝트 / hua-ux Project
2
+
3
+ 이 프로젝트는 **hua-ux** 프레임워크로 생성되었습니다.
4
+ This project was created with the **hua-ux** framework.
5
+
6
+ ## 시작하기 / Getting Started
7
+
8
+ ### 개발 서버 실행 / Run Development Server
9
+
10
+ ```bash
11
+ pnpm install
12
+ pnpm dev
13
+ ```
14
+
15
+ 브라우저에서 [http://localhost:3000](http://localhost:3000)을 열어 확인하세요.
16
+ Open [http://localhost:3000](http://localhost:3000) in your browser to view the app.
17
+
18
+ ### 빌드 / Build
19
+
20
+ ```bash
21
+ pnpm build
22
+ pnpm start
23
+ ```
24
+
25
+ ## hua-ux 사용 가이드 / hua-ux Usage Guide
26
+
27
+ ### 0. GEO (AI 검색 엔진 최적화) / GEO (Generative Engine Optimization)
28
+
29
+ **GEO**는 ChatGPT, Claude, Gemini, Perplexity 같은 AI 검색 엔진이 당신의 소프트웨어를 잘 찾고 추천하도록 최적화하는 기능입니다.
30
+
31
+ **GEO** helps AI search engines (ChatGPT, Claude, Gemini, Perplexity) discover and recommend your software.
32
+
33
+ **예제 파일**:
34
+ - `app/layout-with-geo.example.tsx` - GEO가 포함된 레이아웃 예제
35
+ - `app/page-with-geo.example.tsx` - GEO가 포함된 페이지 예제
36
+
37
+ ### 1. 프로젝트 구조 / Project Structure
38
+
39
+ ```
40
+ .
41
+ ├── app/ # Next.js App Router
42
+ │ ├── layout.tsx # 루트 레이아웃 (HuaUxLayout 사용)
43
+ │ ├── page.tsx # 홈 페이지
44
+ │ └── api/ # API 라우트
45
+ │ └── translations/ # 번역 API
46
+ ├── lib/ # 유틸리티
47
+ │ └── i18n-setup.ts # i18n 설정
48
+ ├── store/ # 상태 관리
49
+ │ └── useAppStore.ts # Zustand 스토어
50
+ ├── translations/ # 번역 파일
51
+ │ ├── ko/
52
+ │ └── en/
53
+ └── hua-ux.config.ts # hua-ux 설정 파일
54
+ ```
55
+
56
+ ### 2. 설정 파일 / Configuration File (`hua-ux.config.ts`)
57
+
58
+ 프로젝트 루트의 `hua-ux.config.ts`에서 프레임워크를 설정합니다.
59
+ Configure the framework in `hua-ux.config.ts` at the project root:
60
+
61
+ ```typescript
62
+ import { defineConfig } from '@hua-labs/hua-ux/framework';
63
+
64
+ export default defineConfig({
65
+ // 프리셋: 'product' (빠른 전환) 또는 'marketing' (드라마틱한 모션)
66
+ preset: 'product',
67
+
68
+ // i18n 설정
69
+ i18n: {
70
+ defaultLanguage: 'ko',
71
+ supportedLanguages: ['ko', 'en'],
72
+ namespaces: ['common'],
73
+ translationLoader: 'api',
74
+ translationApiPath: '/api/translations',
75
+ },
76
+
77
+ // 모션 설정
78
+ motion: {
79
+ defaultPreset: 'product',
80
+ enableAnimations: true,
81
+ },
82
+
83
+ // 상태 관리 설정
84
+ state: {
85
+ persist: true,
86
+ ssr: true,
87
+ },
88
+
89
+ // 브랜딩 설정 (선택사항)
90
+ branding: {
91
+ colors: {
92
+ primary: '#3b82f6',
93
+ secondary: '#8b5cf6',
94
+ },
95
+ },
96
+ });
97
+ ```
98
+
99
+ ### 3. 페이지 작성하기 / Writing Pages
100
+
101
+ #### 기본 페이지 / Basic Page
102
+
103
+ ```tsx
104
+ // app/page.tsx
105
+ 'use client';
106
+
107
+ import { HuaUxPage } from '@hua-labs/hua-ux/framework';
108
+ import { Button, Card } from '@hua-labs/hua-ux';
109
+
110
+ export default function HomePage() {
111
+ return (
112
+ <HuaUxPage title="홈" description="환영합니다">
113
+ <Card>
114
+ <h1>안녕하세요!</h1>
115
+ <Button>시작하기</Button>
116
+ </Card>
117
+ </HuaUxPage>
118
+ );
119
+ }
120
+ ```
121
+
122
+ #### SEO 메타데이터가 포함된 페이지 / Page with SEO Metadata
123
+
124
+ SEO를 위해 Next.js `metadata` export를 사용하는 것을 권장합니다:
125
+
126
+ ```tsx
127
+ // app/page.tsx (Server Component)
128
+ import { generatePageMetadata } from '@hua-labs/hua-ux/framework';
129
+ import { HomePageContent } from './HomePageContent';
130
+
131
+ export const metadata = generatePageMetadata({
132
+ title: '홈',
133
+ description: '환영합니다',
134
+ seo: {
135
+ keywords: ['키워드1', '키워드2'],
136
+ ogImage: '/og-image.png',
137
+ },
138
+ });
139
+
140
+ export default function HomePage() {
141
+ return <HomePageContent />;
142
+ }
143
+ ```
144
+
145
+ #### GEO (AI 검색 엔진 최적화)가 포함된 페이지 / Page with GEO
146
+
147
+ ChatGPT, Claude, Gemini, Perplexity 같은 AI 검색 엔진이 당신의 앱을 잘 찾고 추천하도록 GEO를 추가할 수 있습니다:
148
+
149
+ ```tsx
150
+ // app/page.tsx (Server Component)
151
+ import { generateGEOMetadata, renderJSONLD } from '@hua-labs/hua-ux/framework';
152
+ import Script from 'next/script';
153
+ import { HomePageContent } from './page-content';
154
+
155
+ // GEO 메타데이터 생성
156
+ const geoMeta = generateGEOMetadata({
157
+ name: 'My App',
158
+ description: 'Built with hua-ux framework',
159
+ version: '1.0.0',
160
+ applicationCategory: ['UX Framework', 'Developer Tool'],
161
+ programmingLanguage: ['TypeScript', 'React', 'Next.js'],
162
+ features: ['i18n', 'Motion', 'Accessibility'],
163
+ keywords: ['nextjs', 'react', 'ux'],
164
+ });
165
+
166
+ export const metadata = {
167
+ title: 'My App',
168
+ description: geoMeta.meta.find(m => m.name === 'description')?.content,
169
+ };
170
+
171
+ export default function HomePage() {
172
+ return (
173
+ <>
174
+ <Script {...renderJSONLD(geoMeta.jsonLd[0])} />
175
+ <HomePageContent />
176
+ </>
177
+ );
178
+ }
179
+ ```
180
+
181
+ 자세한 예제는 `app/layout-with-geo.example.tsx`와 `app/page-with-geo.example.tsx`를 참고하세요.
182
+
183
+ ```tsx
184
+ // app/HomePageContent.tsx (Client Component)
185
+ 'use client';
186
+
187
+ import { HuaUxPage } from '@hua-labs/hua-ux/framework';
188
+
189
+ export function HomePageContent() {
190
+ return (
191
+ <HuaUxPage title="홈" description="환영합니다">
192
+ <h1>안녕하세요!</h1>
193
+ </HuaUxPage>
194
+ );
195
+ }
196
+ ```
197
+
198
+ #### SEO와 i18n이 포함된 페이지 / Page with SEO and i18n
199
+
200
+ ```tsx
201
+ // app/about/page.tsx
202
+ 'use client';
203
+
204
+ import { HuaUxPage } from '@hua-labs/hua-ux/framework';
205
+
206
+ export default function AboutPage() {
207
+ return (
208
+ <HuaUxPage
209
+ title="회사 소개"
210
+ description="우리 회사에 대해 알아보세요"
211
+ seo={{
212
+ title: "회사 소개 | 우리 회사",
213
+ description: "우리 회사의 역사와 비전을 소개합니다",
214
+ keywords: ["회사", "소개", "비전"],
215
+ }}
216
+ i18nKey="about"
217
+ >
218
+ <div>
219
+ <h1>회사 소개</h1>
220
+ <p>우리 회사는...</p>
221
+ </div>
222
+ </HuaUxPage>
223
+ );
224
+ }
225
+ ```
226
+
227
+ ### 4. UI 컴포넌트 사용하기 / Using UI Components
228
+
229
+ ```tsx
230
+ import { Button, Card, Input, Modal } from '@hua-labs/hua-ux';
231
+
232
+ // Button
233
+ <Button variant="default">기본 버튼</Button>
234
+ <Button variant="outline">아웃라인 버튼</Button>
235
+ <Button variant="ghost">고스트 버튼</Button>
236
+
237
+ // Card
238
+ <Card>
239
+ <CardHeader>
240
+ <CardTitle>제목</CardTitle>
241
+ <CardDescription>설명</CardDescription>
242
+ </CardHeader>
243
+ <CardContent>내용</CardContent>
244
+ </Card>
245
+ ```
246
+
247
+ **브랜딩 자동 적용 / Automatic Branding**: `hua-ux.config.ts`에서 `branding.colors`를 설정하면 Button과 Card가 자동으로 브랜드 색상을 사용합니다.
248
+ When you set `branding.colors` in `hua-ux.config.ts`, Button and Card components automatically use your brand colors.
249
+
250
+ ### 5. 모션 애니메이션 사용하기 / Using Motion Animations
251
+
252
+ ```tsx
253
+ import { useFadeIn, useSlideUp, useScaleIn } from '@hua-labs/hua-ux';
254
+
255
+ export default function AnimatedPage() {
256
+ const fadeInRef = useFadeIn();
257
+ const slideUpRef = useSlideUp();
258
+ const scaleInRef = useScaleIn();
259
+
260
+ return (
261
+ <div>
262
+ <div ref={fadeInRef}>페이드 인</div>
263
+ <div ref={slideUpRef}>슬라이드 업</div>
264
+ <div ref={scaleInRef}>스케일 인</div>
265
+ </div>
266
+ );
267
+ }
268
+ ```
269
+
270
+ **사용 가능한 모션 훅 / Available Motion Hooks**:
271
+ - `useFadeIn` - 페이드 인 / Fade in
272
+ - `useSlideUp` - 아래에서 위로 슬라이드 / Slide up from bottom
273
+ - `useSlideDown` - 위에서 아래로 슬라이드 / Slide down from top
274
+ - `useScaleIn` - 스케일 인 / Scale in
275
+ - `useBounceIn` - 바운스 인 / Bounce in
276
+ - `useHoverMotion` - 호버 모션 / Hover motion
277
+ - `useScrollReveal` - 스크롤 리빌 / Scroll reveal
278
+
279
+ ### 6. 다국어 지원 (i18n) / Internationalization (i18n)
280
+
281
+ #### 번역 파일 작성 / Writing Translation Files
282
+
283
+ ```json
284
+ // translations/ko/common.json
285
+ {
286
+ "welcome": "환영합니다",
287
+ "getStarted": "시작하기",
288
+ "learnMore": "더 알아보기"
289
+ }
290
+
291
+ // translations/en/common.json
292
+ {
293
+ "welcome": "Welcome",
294
+ "getStarted": "Get Started",
295
+ "learnMore": "Learn More"
296
+ }
297
+ ```
298
+
299
+ #### 컴포넌트에서 사용 / Using in Components
300
+
301
+ ```tsx
302
+ import { useTranslation } from '@hua-labs/i18n-core';
303
+
304
+ export default function MyComponent() {
305
+ const { t } = useTranslation();
306
+
307
+ return (
308
+ <div>
309
+ <h1>{t('common:welcome')}</h1>
310
+ <Button>{t('common:getStarted')}</Button>
311
+ </div>
312
+ );
313
+ }
314
+ ```
315
+
316
+ #### 언어 변경 / Changing Language
317
+
318
+ ```tsx
319
+ import { useAppStore } from '@/store/useAppStore';
320
+
321
+ export default function LanguageSwitcher() {
322
+ const language = useAppStore((state) => state.language);
323
+ const setLanguage = useAppStore((state) => state.setLanguage);
324
+
325
+ return (
326
+ <button onClick={() => setLanguage(language === 'ko' ? 'en' : 'ko')}>
327
+ {language === 'ko' ? 'English' : '한국어'}
328
+ </button>
329
+ );
330
+ }
331
+ ```
332
+
333
+ ### 7. 상태 관리 (Zustand) / State Management (Zustand)
334
+
335
+ ```tsx
336
+ // store/useAppStore.ts
337
+ import { createHuaStore } from '@hua-labs/state';
338
+
339
+ interface AppState {
340
+ count: number;
341
+ increment: () => void;
342
+ decrement: () => void;
343
+ }
344
+
345
+ export const useAppStore = createHuaStore<AppState>(
346
+ (set) => ({
347
+ count: 0,
348
+ increment: () => set((state) => ({ count: state.count + 1 })),
349
+ decrement: () => set((state) => ({ count: state.count - 1 })),
350
+ }),
351
+ {
352
+ persist: true,
353
+ persistKey: 'app-storage',
354
+ ssr: true,
355
+ }
356
+ );
357
+
358
+ // 사용 / Usage
359
+ import { useAppStore } from '@/store/useAppStore';
360
+
361
+ export default function Counter() {
362
+ const count = useAppStore((state) => state.count);
363
+ const increment = useAppStore((state) => state.increment);
364
+
365
+ return (
366
+ <div>
367
+ <p>Count: {count}</p>
368
+ <button onClick={increment}>+</button>
369
+ </div>
370
+ );
371
+ }
372
+ ```
373
+
374
+ ## 브랜딩 커스터마이징 / Branding Customization
375
+
376
+ `hua-ux.config.ts`에서 브랜드 색상을 설정하면 Button과 Card가 자동으로 적용됩니다.
377
+ Set brand colors in `hua-ux.config.ts` and Button and Card will automatically use them:
378
+
379
+ ```typescript
380
+ export default defineConfig({
381
+ branding: {
382
+ colors: {
383
+ primary: '#FF5733', // 메인 색상
384
+ secondary: '#33C3F0', // 보조 색상
385
+ accent: '#FFC300', // 강조 색상
386
+ },
387
+ },
388
+ });
389
+ ```
390
+
391
+ ## 더 알아보기 / Learn More
392
+
393
+ - [hua-ux 공식 문서 / Official Documentation](https://github.com/HUA-Labs/HUA-Labs-public)
394
+ - [UI 컴포넌트 가이드 / UI Components Guide](https://github.com/HUA-Labs/HUA-Labs-public/tree/main/packages/hua-ui)
395
+ - [Motion 훅 가이드 / Motion Hooks Guide](https://github.com/HUA-Labs/HUA-Labs-public/tree/main/packages/hua-motion-core)
396
+ - [i18n 가이드 / i18n Guide](https://github.com/HUA-Labs/HUA-Labs-public/tree/main/packages/hua-i18n-core)
397
+
398
+ ## 개발 팁 / Development Tips
399
+
400
+ ### 프리셋 변경 / Changing Presets
401
+
402
+ - **product**: 빠른 전환, 최소 지연 (제품 페이지용) / Fast transitions, minimal delays (for product pages)
403
+ - **marketing**: 드라마틱한 모션, 긴 지연 (랜딩 페이지용) / Dramatic motions, longer delays (for landing pages)
404
+
405
+ ```typescript
406
+ export default defineConfig({
407
+ preset: 'marketing', // 또는 'product'
408
+ });
409
+ ```
410
+
411
+ ### 모션 비활성화 / Disabling Animations
412
+
413
+ 개발 중 모션을 일시적으로 비활성화하려면:
414
+ To temporarily disable animations during development:
415
+
416
+ ```typescript
417
+ export default defineConfig({
418
+ motion: {
419
+ enableAnimations: false,
420
+ },
421
+ });
422
+ ```
423
+
424
+ ### 번역 API 커스터마이징 / Customizing Translation API
425
+
426
+ `app/api/translations/route.ts`에서 번역 로딩 로직을 커스터마이징할 수 있습니다.
427
+ You can customize the translation loading logic in `app/api/translations/route.ts`.
428
+
429
+ ## 라이선스 / License
430
+
431
+ MIT