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.
- package/README.md +19 -2
- package/bin/sh-ui.mjs +7 -0
- package/data/changelog/versions.json +26 -0
- package/package.json +13 -2
- package/src/create/cli-args.js +63 -0
- package/src/create/generator.js +542 -0
- package/src/create/index.mjs +68 -0
- package/src/create/plugins/index.js +17 -0
- package/src/create/plugins/nextIntl.js +197 -0
- package/src/create/plugins/sentry.js +689 -0
- package/src/create/theme/decode.js +66 -0
- package/src/create/theme/inject.js +111 -0
- package/src/mcp.mjs +81 -27
- package/src/paths.mjs +5 -0
- package/templates/flutter-standalone/README.md +34 -0
- package/templates/flutter-standalone/analysis_options.yaml +1 -0
- package/templates/flutter-standalone/lib/main.dart +103 -0
- package/templates/flutter-standalone/lib/sh_ui/foundation/sh_ui_tokens.dart +389 -0
- package/templates/flutter-standalone/pubspec.yaml +20 -0
- package/templates/flutter-standalone/sh-ui.config.json +15 -0
- package/templates/monorepo/.dockerignore +7 -0
- package/templates/monorepo/.eslintrc.js +8 -0
- package/templates/monorepo/.prettierrc +17 -0
- package/templates/monorepo/README.md +103 -0
- package/templates/monorepo/package.json +24 -0
- package/templates/monorepo/packages/eslint-config/base.js +31 -0
- package/templates/monorepo/packages/eslint-config/fsd.js +119 -0
- package/templates/monorepo/packages/eslint-config/next.js +65 -0
- package/templates/monorepo/packages/eslint-config/package.json +31 -0
- package/templates/monorepo/packages/eslint-config/react-internal.js +36 -0
- package/templates/monorepo/packages/typescript-config/base.json +20 -0
- package/templates/monorepo/packages/typescript-config/nextjs.json +13 -0
- package/templates/monorepo/packages/typescript-config/package.json +5 -0
- package/templates/monorepo/packages/typescript-config/react-library.json +8 -0
- package/templates/monorepo/packages/ui/ui-apps/.gitkeep +0 -0
- package/templates/monorepo/packages/ui/ui-core/eslint.config.js +3 -0
- package/templates/monorepo/packages/ui/ui-core/package.json +23 -0
- package/templates/monorepo/packages/ui/ui-core/src/lib/utils.ts +6 -0
- package/templates/monorepo/packages/ui/ui-core/tsconfig.json +11 -0
- package/templates/monorepo/pnpm-workspace.yaml +5 -0
- package/templates/monorepo/tsconfig.json +3 -0
- package/templates/monorepo/turbo.json +26 -0
- package/templates/nextjs-app/.env.example +2 -0
- package/templates/nextjs-app/Dockerfile +11 -0
- package/templates/nextjs-app/README.md +64 -0
- package/templates/nextjs-app/app/layout.tsx +22 -0
- package/templates/nextjs-app/app/page.tsx +7 -0
- package/templates/nextjs-app/eslint.config.js +10 -0
- package/templates/nextjs-app/next.config.ts +12 -0
- package/templates/nextjs-app/package.json +45 -0
- package/templates/nextjs-app/postcss.config.mjs +1 -0
- package/templates/nextjs-app/src/app/layouts/.gitkeep +0 -0
- package/templates/nextjs-app/src/app/providers/GlobalProvider/index.tsx +23 -0
- package/templates/nextjs-app/src/app/providers/index.tsx +1 -0
- package/templates/nextjs-app/src/app/providers/tanstack/QueryClientProvider.tsx +27 -0
- package/templates/nextjs-app/src/app/providers/tanstack/TanstackDevtoolsProvider.tsx +13 -0
- package/templates/nextjs-app/src/app/providers/theme/ThemeProviders.tsx +12 -0
- package/templates/nextjs-app/src/entities/.gitkeep +0 -0
- package/templates/nextjs-app/src/features/.gitkeep +0 -0
- package/templates/nextjs-app/src/shared/api/.gitkeep +0 -0
- package/templates/nextjs-app/src/shared/config/.gitkeep +0 -0
- package/templates/nextjs-app/src/shared/hooks/.gitkeep +0 -0
- package/templates/nextjs-app/src/shared/lib/.gitkeep +0 -0
- package/templates/nextjs-app/src/shared/model/.gitkeep +0 -0
- package/templates/nextjs-app/src/shared/ui/.gitkeep +0 -0
- package/templates/nextjs-app/src/views/.gitkeep +0 -0
- package/templates/nextjs-app/src/widgets/.gitkeep +0 -0
- package/templates/nextjs-app/tsconfig.json +23 -0
- package/templates/nextjs-app/vitest.config.ts +15 -0
- package/templates/nextjs-app/vitest.setup.ts +1 -0
- package/templates/nextjs-standalone/.env.example +2 -0
- package/templates/nextjs-standalone/.prettierrc +17 -0
- package/templates/nextjs-standalone/README.md +77 -0
- package/templates/nextjs-standalone/app/globals.css +33 -0
- package/templates/nextjs-standalone/app/layout.tsx +22 -0
- package/templates/nextjs-standalone/app/page.tsx +7 -0
- package/templates/nextjs-standalone/eslint.config.js +162 -0
- package/templates/nextjs-standalone/next.config.ts +10 -0
- package/templates/nextjs-standalone/package.json +66 -0
- package/templates/nextjs-standalone/postcss.config.mjs +5 -0
- package/templates/nextjs-standalone/sh-ui.config.json +19 -0
- package/templates/nextjs-standalone/src/app/layouts/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/app/providers/GlobalProvider/index.tsx +23 -0
- package/templates/nextjs-standalone/src/app/providers/index.tsx +1 -0
- package/templates/nextjs-standalone/src/app/providers/tanstack/QueryClientProvider.tsx +27 -0
- package/templates/nextjs-standalone/src/app/providers/tanstack/TanstackDevtoolsProvider.tsx +13 -0
- package/templates/nextjs-standalone/src/app/providers/theme/ThemeProviders.tsx +12 -0
- package/templates/nextjs-standalone/src/entities/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/features/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/shared/api/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/shared/config/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/shared/hooks/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/shared/lib/utils.ts +6 -0
- package/templates/nextjs-standalone/src/shared/model/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/shared/styles/tokens.css +95 -0
- package/templates/nextjs-standalone/src/shared/ui/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/views/.gitkeep +0 -0
- package/templates/nextjs-standalone/src/widgets/.gitkeep +0 -0
- package/templates/nextjs-standalone/tsconfig.json +39 -0
- package/templates/nextjs-standalone/vitest.config.ts +15 -0
- package/templates/nextjs-standalone/vitest.setup.ts +1 -0
- package/templates/ui-app-template/eslint.config.js +3 -0
- package/templates/ui-app-template/package.json +38 -0
- package/templates/ui-app-template/postcss.config.mjs +5 -0
- package/templates/ui-app-template/sh-ui.config.json +14 -0
- package/templates/ui-app-template/src/components/.gitkeep +0 -0
- package/templates/ui-app-template/src/hooks/.gitkeep +0 -0
- package/templates/ui-app-template/src/lib/.gitkeep +0 -0
- package/templates/ui-app-template/src/styles/globals.css +37 -0
- package/templates/ui-app-template/src/styles/tokens.css +95 -0
- package/templates/ui-app-template/tsconfig.json +11 -0
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# sh-ui-cli
|
|
2
2
|
|
|
3
|
-
sh-ui 디자인 시스템의
|
|
3
|
+
sh-ui 디자인 시스템의 통합 CLI. **프로젝트 스캐폴드**(create) + **컴포넌트 추가**(add/list/remove) + **IDE-내 AI용 MCP 서버**.
|
|
4
|
+
|
|
5
|
+
> v0.23.0 부터 `sh-ui-create` 가 이 패키지로 통합됐습니다. 기존 `sh-ui-create` 사용자는 자동으로 `sh-ui create` 로 위임됩니다.
|
|
4
6
|
|
|
5
7
|
## 설치
|
|
6
8
|
|
|
@@ -14,6 +16,21 @@ npx sh-ui-cli <command>
|
|
|
14
16
|
|
|
15
17
|
## 사용법
|
|
16
18
|
|
|
19
|
+
### create — 프로젝트 스캐폴드
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# 대화형
|
|
23
|
+
npm create sh-ui my-app
|
|
24
|
+
npx sh-ui-cli create
|
|
25
|
+
|
|
26
|
+
# 비대화형 (에이전트 / CI)
|
|
27
|
+
npx sh-ui-cli create my-app --platform next --structure standalone --yes
|
|
28
|
+
npx sh-ui-cli create my-app --platform next --structure monorepo --plugins sentry,next-intl --yes
|
|
29
|
+
npx sh-ui-cli create my-app --platform flutter --yes
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
전체 옵션은 `npx sh-ui-cli create --help`. TTY 없는 환경에서는 누락된 필수 플래그가 있으면 prompt 대신 즉시 에러로 종료한다.
|
|
33
|
+
|
|
17
34
|
### init — 설정 파일 생성
|
|
18
35
|
|
|
19
36
|
```bash
|
|
@@ -150,7 +167,7 @@ npx -y sh-ui-cli mcp init --client claude-code --scope user
|
|
|
150
167
|
## 더 알아보기
|
|
151
168
|
|
|
152
169
|
- sh-ui 디자인 시스템: https://github.com/sanghyeonKim0201/sh-ui
|
|
153
|
-
- `sh-ui-
|
|
170
|
+
- 변경 내역: `npx sh-ui-cli` 의 `sh_ui_get_changelog` MCP 툴 또는 GitHub Releases
|
|
154
171
|
|
|
155
172
|
## 라이선스
|
|
156
173
|
|
package/bin/sh-ui.mjs
CHANGED
|
@@ -7,6 +7,8 @@ import { remove } from "../src/remove.mjs";
|
|
|
7
7
|
const [, , cmd, ...rest] = process.argv;
|
|
8
8
|
|
|
9
9
|
const usage = `사용법:
|
|
10
|
+
sh-ui create [name] [options] Next.js / Flutter 프로젝트 스캐폴드
|
|
11
|
+
sh-ui create --help 로 옵션 전체 확인
|
|
10
12
|
sh-ui init 설정 파일(sh-ui.config.json) 생성
|
|
11
13
|
sh-ui add <component...> 컴포넌트 소스를 프로젝트로 복사하고
|
|
12
14
|
필요한 외부 패키지를 자동 설치
|
|
@@ -26,6 +28,11 @@ const usage = `사용법:
|
|
|
26
28
|
|
|
27
29
|
try {
|
|
28
30
|
switch (cmd) {
|
|
31
|
+
case "create": {
|
|
32
|
+
const { runCreate } = await import("../src/create/index.mjs");
|
|
33
|
+
await runCreate(rest);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
29
36
|
case "init":
|
|
30
37
|
await init({ cwd: process.cwd(), args: rest });
|
|
31
38
|
break;
|
|
@@ -2,6 +2,32 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$description": "sh-ui 릴리즈 노트 단일 소스. docs(React)와 showcase(Flutter)가 함께 읽는다. 새 릴리즈마다 맨 앞에 추가.",
|
|
4
4
|
"versions": [
|
|
5
|
+
{
|
|
6
|
+
"version": "0.23.1",
|
|
7
|
+
"date": "2026-04-28",
|
|
8
|
+
"title": "sh-ui-create 패키지 완전 삭제 — 단일 sh-ui-cli",
|
|
9
|
+
"type": "patch",
|
|
10
|
+
"highlights": [
|
|
11
|
+
"베타 단계라 sh-ui-create 사용자가 없으므로 deprecate shim 도 폐기 — packages/create 디렉토리 + npm 의 sh-ui-create 패키지 둘 다 정리",
|
|
12
|
+
"publish workflow 매트릭스에서 create 제거 — 앞으로 sh-ui-cli 만 발행",
|
|
13
|
+
"문서 일괄 갱신: README, getting-started, CLI 레퍼런스, 플레이그라운드 명령 컴포저 모두 `npx sh-ui-cli create` 로 통일"
|
|
14
|
+
],
|
|
15
|
+
"url": "https://github.com/sanghyeonKim0201/sh-ui/releases/tag/v0.23.1"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"version": "0.23.0",
|
|
19
|
+
"date": "2026-04-28",
|
|
20
|
+
"title": "sh-ui-create 가 sh-ui-cli 로 통합 — 단일 CLI",
|
|
21
|
+
"type": "minor",
|
|
22
|
+
"highlights": [
|
|
23
|
+
"프로젝트 스캐폴드가 sh-ui-cli 의 새 서브커맨드로 흡수: `npx sh-ui-cli create my-app --platform next --structure standalone --yes`",
|
|
24
|
+
"MCP 에 `sh_ui_create_project` 툴 신규 — IDE-내 AI 가 Bash 우회 없이 MCP 만으로 새 프로젝트 스캐폴드 가능. force/cwd/plugins/theme 모두 인자로 노출",
|
|
25
|
+
"MCP instructions 가 외부 CLI 안내 대신 통합된 명령·새 툴을 가리키도록 정리 — 단일 진실원천, 드리프트 위험 제거",
|
|
26
|
+
"기존 `sh-ui-create` 패키지는 v0.20.0 deprecated shim 으로 유지 — `npx sh-ui-create` 호출은 자동으로 `npx sh-ui-cli create` 로 위임되어 호환 유지",
|
|
27
|
+
"내부: 템플릿/스캐폴드 로직/스캐폴드 테스트(52건) 가 packages/cli/{templates,src/create,test}/ 로 이동, paths.mjs 에 getTemplatesRoot() 추가"
|
|
28
|
+
],
|
|
29
|
+
"url": "https://github.com/sanghyeonKim0201/sh-ui/releases/tag/v0.23.0"
|
|
30
|
+
},
|
|
5
31
|
{
|
|
6
32
|
"version": "0.22.2",
|
|
7
33
|
"date": "2026-04-28",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sh-ui-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "sh-ui CLI —
|
|
3
|
+
"version": "0.23.1",
|
|
4
|
+
"description": "sh-ui CLI — 프로젝트 스캐폴드(create) + 컴포넌트 추가(add/list/remove) + IDE-내 AI용 MCP 서버",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -16,14 +16,23 @@
|
|
|
16
16
|
"sh-ui",
|
|
17
17
|
"cli",
|
|
18
18
|
"mcp",
|
|
19
|
+
"scaffold",
|
|
20
|
+
"create",
|
|
21
|
+
"nextjs",
|
|
22
|
+
"flutter",
|
|
19
23
|
"design-system",
|
|
20
24
|
"registry",
|
|
21
25
|
"components"
|
|
22
26
|
],
|
|
23
27
|
"dependencies": {
|
|
28
|
+
"@inquirer/prompts": "^7.0.0",
|
|
24
29
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
30
|
+
"fs-extra": "^11.2.0",
|
|
25
31
|
"zod": "^3.25.0"
|
|
26
32
|
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"vitest": "^3.2.4"
|
|
35
|
+
},
|
|
27
36
|
"publishConfig": {
|
|
28
37
|
"access": "public"
|
|
29
38
|
},
|
|
@@ -33,12 +42,14 @@
|
|
|
33
42
|
},
|
|
34
43
|
"scripts": {
|
|
35
44
|
"bundle-data": "node scripts/copy-data.mjs",
|
|
45
|
+
"test": "vitest run",
|
|
36
46
|
"prepublishOnly": "node scripts/copy-data.mjs && node --check bin/sh-ui.mjs"
|
|
37
47
|
},
|
|
38
48
|
"files": [
|
|
39
49
|
"bin",
|
|
40
50
|
"src",
|
|
41
51
|
"data",
|
|
52
|
+
"templates",
|
|
42
53
|
"LICENSE",
|
|
43
54
|
"README.md"
|
|
44
55
|
]
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
const VALID_PLATFORMS = ['next', 'flutter'];
|
|
2
|
+
const VALID_STRUCTURES = ['standalone', 'monorepo'];
|
|
3
|
+
const VALID_PLUGINS = ['sentry', 'next-intl'];
|
|
4
|
+
|
|
5
|
+
const VALUE_FLAGS = ['platform', 'structure', 'plugins', 'theme', 'app'];
|
|
6
|
+
const BOOL_FLAGS = ['yes', 'help'];
|
|
7
|
+
|
|
8
|
+
const SUBCOMMANDS = ['add-app', 'add-component'];
|
|
9
|
+
|
|
10
|
+
export const parseArgs = (argv) => {
|
|
11
|
+
const rest = argv.slice(2);
|
|
12
|
+
let command = 'create';
|
|
13
|
+
if (rest.length > 0 && SUBCOMMANDS.includes(rest[0])) {
|
|
14
|
+
command = rest.shift();
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const flags = {};
|
|
18
|
+
const positional = [];
|
|
19
|
+
|
|
20
|
+
for (let i = 0; i < rest.length; i++) {
|
|
21
|
+
const arg = rest[i];
|
|
22
|
+
if (arg === '-h') {
|
|
23
|
+
flags.help = true;
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
if (!arg.startsWith('--')) {
|
|
27
|
+
positional.push(arg);
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
30
|
+
const name = arg.slice(2);
|
|
31
|
+
if (BOOL_FLAGS.includes(name)) {
|
|
32
|
+
flags[name] = true;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
if (!VALUE_FLAGS.includes(name)) {
|
|
36
|
+
throw new Error(`알 수 없는 플래그: --${name}`);
|
|
37
|
+
}
|
|
38
|
+
const value = rest[i + 1];
|
|
39
|
+
if (value === undefined || value.startsWith('--')) {
|
|
40
|
+
throw new Error(`--${name} 값 필요`);
|
|
41
|
+
}
|
|
42
|
+
i++;
|
|
43
|
+
if (name === 'plugins') {
|
|
44
|
+
const list = value === '' ? [] : value.split(',').map((s) => s.trim()).filter(Boolean);
|
|
45
|
+
for (const p of list) {
|
|
46
|
+
if (!VALID_PLUGINS.includes(p)) {
|
|
47
|
+
throw new Error(`알 수 없는 플러그인: ${p}`);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
flags.plugins = list;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (name === 'platform' && !VALID_PLATFORMS.includes(value)) {
|
|
54
|
+
throw new Error(`--platform 은 ${VALID_PLATFORMS.join('/')} 중 하나여야 함 (받은 값: ${value})`);
|
|
55
|
+
}
|
|
56
|
+
if (name === 'structure' && !VALID_STRUCTURES.includes(value)) {
|
|
57
|
+
throw new Error(`--structure 는 ${VALID_STRUCTURES.join('/')} 중 하나여야 함 (받은 값: ${value})`);
|
|
58
|
+
}
|
|
59
|
+
flags[name] = value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return { command, flags, positional };
|
|
63
|
+
};
|