sh-ui-cli 0.45.1 → 0.45.3
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/data/changelog/versions.json +25 -0
- package/data/registry/react/components/accordion/index.tailwind.tsx +5 -7
- package/data/registry/react/components/accordion/index.tsx +5 -7
- package/data/registry/react/components/avatar/index.tailwind.tsx +4 -6
- package/data/registry/react/components/avatar/index.tsx +4 -6
- package/data/registry/react/components/badge/index.tailwind.tsx +2 -4
- package/data/registry/react/components/badge/index.tsx +2 -4
- package/data/registry/react/components/breadcrumb/index.tailwind.tsx +8 -10
- package/data/registry/react/components/breadcrumb/index.tsx +8 -10
- package/data/registry/react/components/button/index.tailwind.tsx +2 -1
- package/data/registry/react/components/button/index.tsx +3 -4
- package/data/registry/react/components/calendar/index.tailwind.tsx +10 -12
- package/data/registry/react/components/calendar/index.tsx +9 -11
- package/data/registry/react/components/card/index.tailwind.tsx +8 -10
- package/data/registry/react/components/card/index.tsx +8 -10
- package/data/registry/react/components/carousel/index.tailwind.tsx +7 -9
- package/data/registry/react/components/carousel/index.tsx +7 -9
- package/data/registry/react/components/checkbox/index.tailwind.tsx +3 -5
- package/data/registry/react/components/checkbox/index.tsx +3 -5
- package/data/registry/react/components/code-editor/index.tailwind.tsx +2 -4
- package/data/registry/react/components/code-editor/index.tsx +2 -4
- package/data/registry/react/components/code-panel/index.tailwind.tsx +5 -7
- package/data/registry/react/components/code-panel/index.tsx +5 -7
- package/data/registry/react/components/color-picker/index.tailwind.tsx +7 -6
- package/data/registry/react/components/color-picker/index.tsx +7 -6
- package/data/registry/react/components/combobox/index.tailwind.tsx +8 -10
- package/data/registry/react/components/combobox/index.tsx +8 -10
- package/data/registry/react/components/context-menu/index.tailwind.tsx +10 -12
- package/data/registry/react/components/context-menu/index.tsx +10 -12
- package/data/registry/react/components/date-picker/index.tailwind.tsx +7 -9
- package/data/registry/react/components/date-picker/index.tsx +7 -9
- package/data/registry/react/components/dialog/index.tailwind.tsx +6 -8
- package/data/registry/react/components/dialog/index.tsx +6 -8
- package/data/registry/react/components/dropdown-menu/index.tailwind.tsx +10 -12
- package/data/registry/react/components/dropdown-menu/index.tsx +10 -12
- package/data/registry/react/components/file-upload/index.tailwind.tsx +6 -8
- package/data/registry/react/components/file-upload/index.tsx +6 -8
- package/data/registry/react/components/form/field.tailwind.tsx +2 -1
- package/data/registry/react/components/form/field.tsx +2 -3
- package/data/registry/react/components/header/index.tailwind.tsx +17 -19
- package/data/registry/react/components/header/index.tsx +17 -19
- package/data/registry/react/components/input/index.tailwind.tsx +4 -6
- package/data/registry/react/components/input/index.tsx +4 -6
- package/data/registry/react/components/label/index.tailwind.tsx +6 -8
- package/data/registry/react/components/label/index.tsx +6 -8
- package/data/registry/react/components/markdown-editor/index.tailwind.tsx +2 -4
- package/data/registry/react/components/markdown-editor/index.tsx +2 -4
- package/data/registry/react/components/menubar/index.tailwind.tsx +2 -4
- package/data/registry/react/components/menubar/index.tsx +2 -4
- package/data/registry/react/components/numeric-input/index.tailwind.tsx +2 -4
- package/data/registry/react/components/numeric-input/index.tsx +2 -4
- package/data/registry/react/components/page-toc/index.tailwind.tsx +3 -2
- package/data/registry/react/components/page-toc/index.tsx +2 -3
- package/data/registry/react/components/pagination/index.tailwind.tsx +8 -10
- package/data/registry/react/components/pagination/index.tsx +8 -10
- package/data/registry/react/components/popover/index.tailwind.tsx +4 -6
- package/data/registry/react/components/popover/index.tsx +4 -6
- package/data/registry/react/components/progress/index.tailwind.tsx +3 -5
- package/data/registry/react/components/progress/index.tsx +2 -4
- package/data/registry/react/components/radio/index.tailwind.tsx +3 -5
- package/data/registry/react/components/radio/index.tsx +3 -5
- package/data/registry/react/components/rich-text-editor/index.tailwind.tsx +3 -5
- package/data/registry/react/components/rich-text-editor/index.tsx +3 -5
- package/data/registry/react/components/select/index.tailwind.tsx +8 -10
- package/data/registry/react/components/select/index.tsx +8 -10
- package/data/registry/react/components/separator/index.tailwind.tsx +2 -4
- package/data/registry/react/components/separator/index.tsx +2 -4
- package/data/registry/react/components/sidebar/index.tailwind.tsx +32 -43
- package/data/registry/react/components/sidebar/index.tsx +29 -46
- package/data/registry/react/components/skeleton/index.tailwind.tsx +2 -4
- package/data/registry/react/components/skeleton/index.tsx +2 -4
- package/data/registry/react/components/slider/index.tailwind.tsx +5 -7
- package/data/registry/react/components/slider/index.tsx +5 -7
- package/data/registry/react/components/spinner/index.tailwind.tsx +3 -5
- package/data/registry/react/components/spinner/index.tsx +2 -4
- package/data/registry/react/components/switch/index.tailwind.tsx +3 -5
- package/data/registry/react/components/switch/index.tsx +2 -4
- package/data/registry/react/components/tabs/index.tailwind.tsx +6 -8
- package/data/registry/react/components/tabs/index.tsx +6 -8
- package/data/registry/react/components/textarea/index.tailwind.tsx +2 -4
- package/data/registry/react/components/textarea/index.tsx +2 -4
- package/data/registry/react/components/toggle/index.tailwind.tsx +4 -6
- package/data/registry/react/components/toggle/index.tsx +4 -6
- package/data/registry/react/components/tooltip/index.tailwind.tsx +2 -4
- package/data/registry/react/components/tooltip/index.tsx +2 -4
- package/data/registry/react/lib/cn.tailwind.ts +17 -0
- package/data/registry/react/peer-versions.json +3 -1
- package/data/registry/react/registry.json +159 -43
- package/package.json +1 -1
- package/src/add.mjs +25 -1
- package/src/mcp-init.mjs +13 -5
- package/src/mcp.mjs +20 -15
- package/templates/ui-app-template/sh-ui.config.json +5 -0
package/src/mcp-init.mjs
CHANGED
|
@@ -19,10 +19,18 @@ import { homedir, platform as osPlatform } from "node:os";
|
|
|
19
19
|
|
|
20
20
|
const CLIENTS = ["claude-code", "cursor", "claude-desktop"];
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
/**
|
|
23
|
+
* `npx -y <cliName> mcp` 형태의 MCP 엔트리 빌더.
|
|
24
|
+
* 패키지명을 package.json 에서 동적으로 읽어 cli rename 시에도 자동 따라감.
|
|
25
|
+
*/
|
|
26
|
+
async function buildShUiEntry() {
|
|
27
|
+
const pkgUrl = new URL("../package.json", import.meta.url);
|
|
28
|
+
const pkg = JSON.parse(await readFile(pkgUrl, "utf8"));
|
|
29
|
+
return {
|
|
30
|
+
command: "npx",
|
|
31
|
+
args: ["-y", pkg.name, "mcp"],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
26
34
|
|
|
27
35
|
/** 클라이언트·스코프별 설정 파일 절대 경로. */
|
|
28
36
|
function resolveConfigPath(client, scope, cwd) {
|
|
@@ -115,7 +123,7 @@ export async function mcpInit({ cwd, args }) {
|
|
|
115
123
|
}
|
|
116
124
|
|
|
117
125
|
const before = config.mcpServers["sh-ui"];
|
|
118
|
-
config.mcpServers["sh-ui"] =
|
|
126
|
+
config.mcpServers["sh-ui"] = await buildShUiEntry();
|
|
119
127
|
|
|
120
128
|
await mkdir(dirname(configPath), { recursive: true });
|
|
121
129
|
await writeFile(configPath, JSON.stringify(config, null, 2) + "\n", "utf8");
|
package/src/mcp.mjs
CHANGED
|
@@ -120,7 +120,22 @@ function resolveCwd(input) {
|
|
|
120
120
|
return input?.cwd ? resolve(input.cwd) : process.cwd();
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
/**
|
|
124
|
+
* 하드코딩 제거 — packages/cli/package.json 에서 version + name 을 시작 시점에 읽어 그대로 사용.
|
|
125
|
+
* mcp.mjs 가 src/ 에 있고 package.json 은 그 상위 (../package.json) 라 상대 URL 로 해석.
|
|
126
|
+
* 출고 모드 (data/ 번들) 에서도 동일 경로 (src/mcp.mjs ↔ package.json) 라 그대로 동작.
|
|
127
|
+
*
|
|
128
|
+
* version: McpServer 식별자 — 클라이언트가 캐시·진단용으로 표시
|
|
129
|
+
* name: SERVER_INSTRUCTIONS 의 `npx <cli> ...` 예시에 보간 — cli rename 시 자동 따라감
|
|
130
|
+
*/
|
|
131
|
+
async function readPackageMeta() {
|
|
132
|
+
const pkgUrl = new URL("../package.json", import.meta.url);
|
|
133
|
+
const pkg = JSON.parse(await readFile(pkgUrl, "utf8"));
|
|
134
|
+
return { version: pkg.version, name: pkg.name };
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function buildServerInstructions(cliName) {
|
|
138
|
+
return `sh-ui — Base UI 위에 빌드된 React/Flutter 디자인 시스템.
|
|
124
139
|
|
|
125
140
|
## 새 프로젝트를 만드는 경우
|
|
126
141
|
|
|
@@ -131,7 +146,7 @@ const SERVER_INSTRUCTIONS = `sh-ui — Base UI 위에 빌드된 React/Flutter
|
|
|
131
146
|
- 인터랙티브 프롬프트 없이 한 번에 스캐폴드 + 토큰 + sh-ui.config.json 생성
|
|
132
147
|
|
|
133
148
|
**2차 — Bash** (사용자가 직접 셸에서 돌리고 싶다고 명시할 때만):
|
|
134
|
-
npx
|
|
149
|
+
npx ${cliName} create my-app --platform next --structure standalone --yes
|
|
135
150
|
|
|
136
151
|
\`create-next-app\` + \`sh_ui_init\` 조합은 **쓰지 말 것** — 위 두 경로가 더 짧고 sh-ui 관용에 맞다.
|
|
137
152
|
|
|
@@ -149,25 +164,15 @@ const SERVER_INSTRUCTIONS = `sh-ui — Base UI 위에 빌드된 React/Flutter
|
|
|
149
164
|
- \`sh_ui_add_component\` / \`sh_ui_remove_component\` — 설치/삭제
|
|
150
165
|
- \`sh_ui_get_changelog\` — 최근 변경 내역
|
|
151
166
|
`;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* 하드코딩 제거 — packages/cli/package.json 의 version 을 시작 시점에 읽어 그대로 사용.
|
|
155
|
-
* mcp.mjs 가 src/ 에 있고 package.json 은 그 상위 (../package.json) 라 상대 URL 로 해석.
|
|
156
|
-
* 출고 모드 (data/ 번들) 에서도 동일 경로 (src/mcp.mjs ↔ package.json) 라 그대로 동작.
|
|
157
|
-
*/
|
|
158
|
-
async function readPackageVersion() {
|
|
159
|
-
const pkgUrl = new URL("../package.json", import.meta.url);
|
|
160
|
-
const pkg = JSON.parse(await readFile(pkgUrl, "utf8"));
|
|
161
|
-
return pkg.version;
|
|
162
167
|
}
|
|
163
168
|
|
|
164
169
|
export async function startMcpServer() {
|
|
165
|
-
const version = await
|
|
170
|
+
const { version, name: cliName } = await readPackageMeta();
|
|
166
171
|
const server = new McpServer(
|
|
167
172
|
{ name: "sh-ui", version },
|
|
168
173
|
{
|
|
169
174
|
capabilities: { tools: {} },
|
|
170
|
-
instructions:
|
|
175
|
+
instructions: buildServerInstructions(cliName),
|
|
171
176
|
},
|
|
172
177
|
);
|
|
173
178
|
|
|
@@ -187,7 +192,7 @@ export async function startMcpServer() {
|
|
|
187
192
|
{
|
|
188
193
|
description:
|
|
189
194
|
"빈 폴더에 sh-ui 프로젝트 스캐폴드 — Next.js (standalone/monorepo) 또는 Flutter. " +
|
|
190
|
-
|
|
195
|
+
`FSD 폴더 구조 + 토큰 + sh-ui.config.json 일괄 생성. 사용자가 '새 프로젝트' / '빈 폴더' / '스캐폴드부터' 류 요청을 하면 이 툴 사용 (Bash 로 npx ${cliName} create 직접 호출보다 우선).`,
|
|
191
196
|
inputSchema: {
|
|
192
197
|
name: z.string().min(1)
|
|
193
198
|
.describe("프로젝트 디렉토리 이름. 예: my-app"),
|