@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,19 @@
1
+ 'use client';
2
+
3
+ import { createZustandI18n } from '@hua-labs/i18n-core-zustand';
4
+ import { useAppStore } from '@/store/useAppStore';
5
+
6
+ // Client Component 내에서 I18nProvider 생성
7
+ // Server Component에서 함수를 전달하는 문제를 방지하기 위해 Client Component로 분리
8
+ const I18nProvider = createZustandI18n(useAppStore, {
9
+ fallbackLanguage: 'en',
10
+ namespaces: ['common'],
11
+ translationLoader: 'api',
12
+ translationApiPath: '/api/translations',
13
+ defaultLanguage: 'ko',
14
+ debug: process.env.NODE_ENV === 'development'
15
+ });
16
+
17
+ export function I18nProviderWrapper({ children }: { children: React.ReactNode }) {
18
+ return <I18nProvider>{children}</I18nProvider>;
19
+ }
@@ -0,0 +1,11 @@
1
+ import { createZustandI18n } from '@hua-labs/i18n-core-zustand';
2
+ import { useAppStore } from '../store/useAppStore';
3
+
4
+ export const I18nProvider = createZustandI18n(useAppStore, {
5
+ fallbackLanguage: 'en',
6
+ namespaces: ['common'],
7
+ translationLoader: 'api',
8
+ translationApiPath: '/api/translations',
9
+ defaultLanguage: 'ko',
10
+ debug: process.env.NODE_ENV === 'development'
11
+ });
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Next.js Middleware Example
3
+ *
4
+ * ⚠️ Edge Runtime Note: This file runs on Edge Runtime.
5
+ * If you don't need middleware, you can delete this file.
6
+ *
7
+ * To use this middleware:
8
+ * 1. Rename this file to middleware.ts
9
+ * 2. Uncomment the code below
10
+ * 3. Make sure Edge Runtime is explicitly set
11
+ */
12
+
13
+ // import { createI18nMiddleware } from '@hua-labs/hua-ux/framework';
14
+
15
+ // Edge Runtime 명시 (Vercel 자동 감지 방지)
16
+ // export const runtime = 'edge';
17
+
18
+ // export default createI18nMiddleware({
19
+ // defaultLanguage: 'ko',
20
+ // supportedLanguages: ['ko', 'en'],
21
+ // detectionStrategy: 'header',
22
+ // });
@@ -0,0 +1,36 @@
1
+ import type { NextConfig } from "next";
2
+
3
+ /**
4
+ * Next.js Configuration
5
+ *
6
+ * hua-ux 프레임워크는 기본 설정으로 동작합니다.
7
+ * 필요시 여기에 Next.js 설정을 추가할 수 있습니다.
8
+ *
9
+ * hua-ux framework works with default settings.
10
+ * You can add Next.js configuration here if needed.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const nextConfig: NextConfig = {
15
+ * images: {
16
+ * domains: ['example.com'],
17
+ * },
18
+ * redirects: async () => {
19
+ * return [
20
+ * { source: '/old', destination: '/new', permanent: true },
21
+ * ];
22
+ * },
23
+ * };
24
+ * ```
25
+ */
26
+ const nextConfig: NextConfig = {
27
+ // hua-ux 프레임워크는 추가 설정이 필요 없지만,
28
+ // 필요시 여기에 Next.js 설정을 추가할 수 있습니다.
29
+ // 예: images, redirects, rewrites, headers 등
30
+ //
31
+ // hua-ux framework doesn't require additional configuration,
32
+ // but you can add Next.js settings here if needed.
33
+ // Examples: images, redirects, rewrites, headers, etc.
34
+ };
35
+
36
+ export default nextConfig;
@@ -0,0 +1,6 @@
1
+ module.exports = {
2
+ plugins: {
3
+ '@tailwindcss/postcss': {},
4
+ autoprefixer: {},
5
+ },
6
+ };
@@ -0,0 +1,8 @@
1
+ import { createI18nStore } from '@hua-labs/state/integrations/i18n';
2
+
3
+ export const useAppStore = createI18nStore({
4
+ defaultLanguage: 'ko',
5
+ supportedLanguages: ['ko', 'en'],
6
+ persist: true,
7
+ ssr: true,
8
+ });
@@ -0,0 +1,8 @@
1
+ /** @type {import('tailwindcss').Config} */
2
+ module.exports = {
3
+ content: [
4
+ './app/**/*.{ts,tsx}',
5
+ './components/**/*.{ts,tsx}',
6
+ ],
7
+ // Tailwind 4: Theme variables should be moved to @theme in globals.css
8
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "welcome": "Welcome",
3
+ "title": "HUA UX App",
4
+ "getStarted": "Get Started",
5
+ "learnMore": "Learn More"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "welcome": "환영합니다",
3
+ "title": "HUA UX 앱",
4
+ "getStarted": "시작하기",
5
+ "learnMore": "더 알아보기"
6
+ }
@@ -0,0 +1,41 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2017",
4
+ "lib": [
5
+ "dom",
6
+ "dom.iterable",
7
+ "esnext"
8
+ ],
9
+ "allowJs": true,
10
+ "skipLibCheck": true,
11
+ "strict": true,
12
+ "noEmit": true,
13
+ "esModuleInterop": true,
14
+ "module": "esnext",
15
+ "moduleResolution": "bundler",
16
+ "resolveJsonModule": true,
17
+ "isolatedModules": true,
18
+ "jsx": "react-jsx",
19
+ "incremental": true,
20
+ "plugins": [
21
+ {
22
+ "name": "next"
23
+ }
24
+ ],
25
+ "paths": {
26
+ "@/*": [
27
+ "./*"
28
+ ]
29
+ }
30
+ },
31
+ "include": [
32
+ "next-env.d.ts",
33
+ "**/*.ts",
34
+ "**/*.tsx",
35
+ ".next/types/**/*.ts",
36
+ ".next/dev/types/**/*.ts"
37
+ ],
38
+ "exclude": [
39
+ "node_modules"
40
+ ]
41
+ }