sh-ui-cli 0.22.2 → 0.23.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 (111) hide show
  1. package/README.md +19 -2
  2. package/bin/sh-ui.mjs +7 -0
  3. package/data/changelog/versions.json +26 -0
  4. package/package.json +13 -2
  5. package/src/create/cli-args.js +63 -0
  6. package/src/create/generator.js +542 -0
  7. package/src/create/index.mjs +68 -0
  8. package/src/create/plugins/index.js +17 -0
  9. package/src/create/plugins/nextIntl.js +197 -0
  10. package/src/create/plugins/sentry.js +689 -0
  11. package/src/create/theme/decode.js +66 -0
  12. package/src/create/theme/inject.js +111 -0
  13. package/src/mcp.mjs +81 -27
  14. package/src/paths.mjs +5 -0
  15. package/templates/flutter-standalone/README.md +34 -0
  16. package/templates/flutter-standalone/analysis_options.yaml +1 -0
  17. package/templates/flutter-standalone/lib/main.dart +103 -0
  18. package/templates/flutter-standalone/lib/sh_ui/foundation/sh_ui_tokens.dart +389 -0
  19. package/templates/flutter-standalone/pubspec.yaml +20 -0
  20. package/templates/flutter-standalone/sh-ui.config.json +15 -0
  21. package/templates/monorepo/.dockerignore +7 -0
  22. package/templates/monorepo/.eslintrc.js +8 -0
  23. package/templates/monorepo/.prettierrc +17 -0
  24. package/templates/monorepo/README.md +103 -0
  25. package/templates/monorepo/package.json +24 -0
  26. package/templates/monorepo/packages/eslint-config/base.js +31 -0
  27. package/templates/monorepo/packages/eslint-config/fsd.js +119 -0
  28. package/templates/monorepo/packages/eslint-config/next.js +65 -0
  29. package/templates/monorepo/packages/eslint-config/package.json +31 -0
  30. package/templates/monorepo/packages/eslint-config/react-internal.js +36 -0
  31. package/templates/monorepo/packages/typescript-config/base.json +20 -0
  32. package/templates/monorepo/packages/typescript-config/nextjs.json +13 -0
  33. package/templates/monorepo/packages/typescript-config/package.json +5 -0
  34. package/templates/monorepo/packages/typescript-config/react-library.json +8 -0
  35. package/templates/monorepo/packages/ui/ui-apps/.gitkeep +0 -0
  36. package/templates/monorepo/packages/ui/ui-core/eslint.config.js +3 -0
  37. package/templates/monorepo/packages/ui/ui-core/package.json +23 -0
  38. package/templates/monorepo/packages/ui/ui-core/src/lib/utils.ts +6 -0
  39. package/templates/monorepo/packages/ui/ui-core/tsconfig.json +11 -0
  40. package/templates/monorepo/pnpm-workspace.yaml +5 -0
  41. package/templates/monorepo/tsconfig.json +3 -0
  42. package/templates/monorepo/turbo.json +26 -0
  43. package/templates/nextjs-app/.env.example +2 -0
  44. package/templates/nextjs-app/Dockerfile +11 -0
  45. package/templates/nextjs-app/README.md +64 -0
  46. package/templates/nextjs-app/app/layout.tsx +22 -0
  47. package/templates/nextjs-app/app/page.tsx +7 -0
  48. package/templates/nextjs-app/eslint.config.js +10 -0
  49. package/templates/nextjs-app/next.config.ts +12 -0
  50. package/templates/nextjs-app/package.json +45 -0
  51. package/templates/nextjs-app/postcss.config.mjs +1 -0
  52. package/templates/nextjs-app/src/app/layouts/.gitkeep +0 -0
  53. package/templates/nextjs-app/src/app/providers/GlobalProvider/index.tsx +23 -0
  54. package/templates/nextjs-app/src/app/providers/index.tsx +1 -0
  55. package/templates/nextjs-app/src/app/providers/tanstack/QueryClientProvider.tsx +27 -0
  56. package/templates/nextjs-app/src/app/providers/tanstack/TanstackDevtoolsProvider.tsx +13 -0
  57. package/templates/nextjs-app/src/app/providers/theme/ThemeProviders.tsx +12 -0
  58. package/templates/nextjs-app/src/entities/.gitkeep +0 -0
  59. package/templates/nextjs-app/src/features/.gitkeep +0 -0
  60. package/templates/nextjs-app/src/shared/api/.gitkeep +0 -0
  61. package/templates/nextjs-app/src/shared/config/.gitkeep +0 -0
  62. package/templates/nextjs-app/src/shared/hooks/.gitkeep +0 -0
  63. package/templates/nextjs-app/src/shared/lib/.gitkeep +0 -0
  64. package/templates/nextjs-app/src/shared/model/.gitkeep +0 -0
  65. package/templates/nextjs-app/src/shared/ui/.gitkeep +0 -0
  66. package/templates/nextjs-app/src/views/.gitkeep +0 -0
  67. package/templates/nextjs-app/src/widgets/.gitkeep +0 -0
  68. package/templates/nextjs-app/tsconfig.json +23 -0
  69. package/templates/nextjs-app/vitest.config.ts +15 -0
  70. package/templates/nextjs-app/vitest.setup.ts +1 -0
  71. package/templates/nextjs-standalone/.env.example +2 -0
  72. package/templates/nextjs-standalone/.prettierrc +17 -0
  73. package/templates/nextjs-standalone/README.md +77 -0
  74. package/templates/nextjs-standalone/app/globals.css +33 -0
  75. package/templates/nextjs-standalone/app/layout.tsx +22 -0
  76. package/templates/nextjs-standalone/app/page.tsx +7 -0
  77. package/templates/nextjs-standalone/eslint.config.js +162 -0
  78. package/templates/nextjs-standalone/next.config.ts +10 -0
  79. package/templates/nextjs-standalone/package.json +66 -0
  80. package/templates/nextjs-standalone/postcss.config.mjs +5 -0
  81. package/templates/nextjs-standalone/sh-ui.config.json +19 -0
  82. package/templates/nextjs-standalone/src/app/layouts/.gitkeep +0 -0
  83. package/templates/nextjs-standalone/src/app/providers/GlobalProvider/index.tsx +23 -0
  84. package/templates/nextjs-standalone/src/app/providers/index.tsx +1 -0
  85. package/templates/nextjs-standalone/src/app/providers/tanstack/QueryClientProvider.tsx +27 -0
  86. package/templates/nextjs-standalone/src/app/providers/tanstack/TanstackDevtoolsProvider.tsx +13 -0
  87. package/templates/nextjs-standalone/src/app/providers/theme/ThemeProviders.tsx +12 -0
  88. package/templates/nextjs-standalone/src/entities/.gitkeep +0 -0
  89. package/templates/nextjs-standalone/src/features/.gitkeep +0 -0
  90. package/templates/nextjs-standalone/src/shared/api/.gitkeep +0 -0
  91. package/templates/nextjs-standalone/src/shared/config/.gitkeep +0 -0
  92. package/templates/nextjs-standalone/src/shared/hooks/.gitkeep +0 -0
  93. package/templates/nextjs-standalone/src/shared/lib/utils.ts +6 -0
  94. package/templates/nextjs-standalone/src/shared/model/.gitkeep +0 -0
  95. package/templates/nextjs-standalone/src/shared/styles/tokens.css +95 -0
  96. package/templates/nextjs-standalone/src/shared/ui/.gitkeep +0 -0
  97. package/templates/nextjs-standalone/src/views/.gitkeep +0 -0
  98. package/templates/nextjs-standalone/src/widgets/.gitkeep +0 -0
  99. package/templates/nextjs-standalone/tsconfig.json +39 -0
  100. package/templates/nextjs-standalone/vitest.config.ts +15 -0
  101. package/templates/nextjs-standalone/vitest.setup.ts +1 -0
  102. package/templates/ui-app-template/eslint.config.js +3 -0
  103. package/templates/ui-app-template/package.json +38 -0
  104. package/templates/ui-app-template/postcss.config.mjs +5 -0
  105. package/templates/ui-app-template/sh-ui.config.json +14 -0
  106. package/templates/ui-app-template/src/components/.gitkeep +0 -0
  107. package/templates/ui-app-template/src/hooks/.gitkeep +0 -0
  108. package/templates/ui-app-template/src/lib/.gitkeep +0 -0
  109. package/templates/ui-app-template/src/styles/globals.css +37 -0
  110. package/templates/ui-app-template/src/styles/tokens.css +95 -0
  111. package/templates/ui-app-template/tsconfig.json +11 -0
@@ -0,0 +1,197 @@
1
+ export const nextIntlPlugin = {
2
+ name: 'next-intl',
3
+ label: 'next-intl (다국어 지원)',
4
+ priority: 2,
5
+
6
+ dependencies: {
7
+ 'next-intl': '^4.8.3',
8
+ },
9
+
10
+ // ─── next.config.ts 관련 ───
11
+
12
+ imports: [
13
+ `import createNextIntlPlugin from 'next-intl/plugin';`,
14
+ ],
15
+
16
+ preExport: [
17
+ `const withNextIntl = createNextIntlPlugin('./src/shared/config/i18n/request.ts');`,
18
+ ],
19
+
20
+ wrapExport(expr) {
21
+ return `withNextIntl(${expr})`;
22
+ },
23
+
24
+ envVars: [],
25
+
26
+ turboEnvVars: [],
27
+
28
+ // ─── 공유 파일 조각 (providers 합성용) ───
29
+
30
+ providerImports: [
31
+ `import { NextIntlClientProvider } from 'next-intl';`,
32
+ ],
33
+ providerWrappers: ['NextIntlClientProvider'],
34
+
35
+ // ─── 라우트 구조 변환 ───
36
+
37
+ transforms: [
38
+ { type: 'move', from: 'app/page.tsx', to: 'app/[locale]/page.tsx' },
39
+ { type: 'move', from: 'app/error.tsx', to: 'app/[locale]/error.tsx' },
40
+ {
41
+ type: 'replace',
42
+ path: 'app/layout.tsx',
43
+ content: `export default async function RootLayout({
44
+ children,
45
+ }: {
46
+ children: React.ReactNode;
47
+ }) {
48
+ return children;
49
+ }
50
+ `,
51
+ },
52
+ ],
53
+
54
+ // ─── 독립 파일 ───
55
+
56
+ files: {
57
+ 'src/shared/config/i18n/routing.ts': `import { defineRouting } from 'next-intl/routing';
58
+
59
+ export const routing = defineRouting({
60
+ locales: ['ko', 'en'],
61
+ defaultLocale: 'ko',
62
+ });
63
+ `,
64
+
65
+ 'src/shared/config/i18n/request.ts': `import { getRequestConfig } from 'next-intl/server';
66
+ import { hasLocale } from 'next-intl';
67
+ import { routing } from './routing';
68
+
69
+ export default getRequestConfig(async ({ requestLocale }) => {
70
+ const requested = await requestLocale;
71
+ const locale = hasLocale(routing.locales, requested)
72
+ ? requested
73
+ : routing.defaultLocale;
74
+
75
+ return {
76
+ locale,
77
+ messages: (await import(\`./messages/\${locale}.json\`)).default,
78
+ };
79
+ });
80
+ `,
81
+
82
+ 'src/shared/config/i18n/navigation.ts': `import { createNavigation } from 'next-intl/navigation';
83
+ import { routing } from './routing';
84
+
85
+ export const { Link, redirect, usePathname, useRouter, getPathname } =
86
+ createNavigation(routing);
87
+ `,
88
+
89
+ 'src/shared/config/i18n/messages/ko.json': `{
90
+ "common": {
91
+ "loading": "로딩 중...",
92
+ "error": "오류가 발생했습니다",
93
+ "confirm": "확인",
94
+ "cancel": "취소",
95
+ "save": "저장",
96
+ "delete": "삭제",
97
+ "edit": "수정",
98
+ "search": "검색",
99
+ "back": "뒤로"
100
+ },
101
+ "error": {
102
+ "title": "오류가 발생했습니다",
103
+ "description": "예상치 못한 오류가 발생했습니다. 다시 시도해주세요.",
104
+ "unexpectedError": "알 수 없는 오류",
105
+ "button": {
106
+ "tryAgain": "다시 시도",
107
+ "goHome": "홈으로 이동"
108
+ }
109
+ },
110
+ "notFound": {
111
+ "title": "페이지를 찾을 수 없습니다",
112
+ "description": "요청하신 페이지가 존재하지 않습니다.",
113
+ "button": {
114
+ "goHome": "홈으로 이동"
115
+ }
116
+ }
117
+ }
118
+ `,
119
+
120
+ 'src/shared/config/i18n/messages/en.json': `{
121
+ "common": {
122
+ "loading": "Loading...",
123
+ "error": "An error occurred",
124
+ "confirm": "Confirm",
125
+ "cancel": "Cancel",
126
+ "save": "Save",
127
+ "delete": "Delete",
128
+ "edit": "Edit",
129
+ "search": "Search",
130
+ "back": "Back"
131
+ },
132
+ "error": {
133
+ "title": "Something went wrong",
134
+ "description": "An unexpected error occurred. Please try again.",
135
+ "unexpectedError": "Unknown error",
136
+ "button": {
137
+ "tryAgain": "Try again",
138
+ "goHome": "Go home"
139
+ }
140
+ },
141
+ "notFound": {
142
+ "title": "Page not found",
143
+ "description": "The page you requested does not exist.",
144
+ "button": {
145
+ "goHome": "Go home"
146
+ }
147
+ }
148
+ }
149
+ `,
150
+
151
+ 'app/[locale]/layout.tsx': `import type { Metadata } from 'next';
152
+ import { hasLocale } from 'next-intl';
153
+ import { notFound } from 'next/navigation';
154
+ import { GlobalProvider } from '@/src/app/providers';
155
+ import { routing } from '@/src/shared/config/i18n/routing';
156
+
157
+ export const metadata: Metadata = {
158
+ title: 'My App',
159
+ description: 'My App Description',
160
+ };
161
+
162
+ export default async function LocaleLayout({
163
+ children,
164
+ params,
165
+ }: {
166
+ children: React.ReactNode;
167
+ params: Promise<{ locale: string }>;
168
+ }) {
169
+ const { locale } = await params;
170
+
171
+ if (!hasLocale(routing.locales, locale)) {
172
+ notFound();
173
+ }
174
+
175
+ return (
176
+ <html lang={locale} suppressHydrationWarning>
177
+ <body>
178
+ <GlobalProvider>{children}</GlobalProvider>
179
+ </body>
180
+ </html>
181
+ );
182
+ }
183
+ `,
184
+
185
+ 'proxy.ts': `import createIntlMiddleware from 'next-intl/middleware';
186
+ import { routing } from '@/src/shared/config/i18n/routing';
187
+
188
+ const intl = createIntlMiddleware(routing);
189
+
190
+ export default intl;
191
+
192
+ export const config = {
193
+ matcher: '/((?!api|trpc|_next|_vercel|monitoring|.*\\\\..*).*)',
194
+ };
195
+ `,
196
+ },
197
+ };