sh-ui-cli 0.67.0 → 0.67.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.
@@ -2,6 +2,18 @@
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.67.1",
7
+ "date": "2026-05-09",
8
+ "title": "patch — sh-ui add tokens 가 rose/emerald/violet preset 에서 throw 하던 회귀 수정",
9
+ "type": "patch",
10
+ "highlights": [
11
+ "**`sh-ui add tokens` 가 rose/emerald/violet preset 에서 `해석 실패: {color.rose.50}` 로 throw 하던 회귀 수정** — CLI 의 풍부한 preset (rose/emerald/violet) 은 packages/tokens 의 primitives.json 에 색 스케일이 없어 `buildTokens` 가 해석 불가. injectCssTheme 이 create 시점에 resolved hex 를 박아둔 tokens.css 를 단일 진실로 두고, 재실행 시 'custom' 과 동일하게 보존하도록 가드 확장.",
12
+ "**tokens.css 미존재 + non-buildable preset → 친절한 에러** — `sh-ui init --theme rose` 후 `sh-ui add tokens` 같은 흐름은 preset 사용법 안내와 함께 종료 (해결책: `sh-ui create --theme rose` 또는 theme.base 를 neutral/slate/zinc 로 변경).",
13
+ "**buildable bases (neutral/slate/zinc) 는 정상 빌드** — 회귀 가드 6개 (`add-tokens-presets.test.js`) — 보존 / 친절한 에러 / 정상 빌드 모두 검증."
14
+ ],
15
+ "url": "https://github.com/sanghyeonKim0201/sh-ui/releases/tag/v0.67.1"
16
+ },
5
17
  {
6
18
  "version": "0.67.0",
7
19
  "date": "2026-05-09",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sh-ui-cli",
3
- "version": "0.67.0",
3
+ "version": "0.67.1",
4
4
  "description": "sh-ui CLI — 프로젝트 스캐폴드(create) + 컴포넌트 추가(add/list/remove) + IDE-내 AI용 MCP 서버",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/add.mjs CHANGED
@@ -6,6 +6,7 @@ import { spawn } from "node:child_process";
6
6
  import { select } from "@inquirer/prompts";
7
7
  import { formatUnifiedDiff } from "./diff.mjs";
8
8
  import { getRegistryRoot, getTokensRoot, getPeerVersionsPath } from "./paths.mjs";
9
+ import { THEME_BASES } from "./constants.js";
9
10
 
10
11
  /**
11
12
  * 기존 파일과 registry 파일 내용이 다를 때 keep/overwrite 결정.
@@ -185,6 +186,29 @@ async function addTokens(config, cwd, diffMode, summary, conflictResolver) {
185
186
  return;
186
187
  }
187
188
 
189
+ // CLI 가 THEME_PRESETS 에서 알지만 primitives.json 의 THEME_BASES 에 없는 풍부한 preset
190
+ // (rose/emerald/violet 등) 도 buildTokens 가 `{color.rose.50}` 등을 해석할 수 없어 throw.
191
+ // create 시점에 injectCssTheme 이 resolved hex 를 박아둔 tokens.css 가 단일 진실 —
192
+ // sh-ui add tokens 는 보존만. base 가 buildable 하지 않으면 같은 정책 적용.
193
+ const base = config.theme?.base;
194
+ if (base && !THEME_BASES.includes(base)) {
195
+ if (!existsSync(dest)) {
196
+ throw new Error(
197
+ `'${base}' preset 의 tokens.css 가 아직 없습니다. 이 preset 은 ` +
198
+ `sh-ui add tokens 로 빌드 불가 (primitives 미정의 — buildable: ${THEME_BASES.join('/')}). ` +
199
+ `해결: sh-ui create --theme ${base} 로 새 프로젝트 스캐폴드, 또는 ` +
200
+ `sh-ui.config.json 의 theme.base 를 ${THEME_BASES.join('/')} 중 하나로 변경 후 재실행.`,
201
+ );
202
+ }
203
+ if (!diffMode) {
204
+ console.log(
205
+ `↷ tokens → ${relative(cwd, dest)} ('${base}' preset — tokens.css 보존, ` +
206
+ `색 조정은 파일 직접 편집 또는 sh-ui create --theme <new> 로 재스캐폴드)`
207
+ );
208
+ }
209
+ return;
210
+ }
211
+
188
212
  const { buildTokens } = await loadTokensBuilder();
189
213
  const content = await buildTokens(config);
190
214