Skip to content

feat(cli): add --seed-react-version option to add and add-all#1720

Merged
junghyeonsu merged 1 commit into
devfrom
kingston-v1
Jun 24, 2026
Merged

feat(cli): add --seed-react-version option to add and add-all#1720
junghyeonsu merged 1 commit into
devfrom
kingston-v1

Conversation

@junghyeonsu

@junghyeonsu junghyeonsu commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

요약

add / add-all--seed-react-version 옵션을 추가했어요. 설치한 SEED React 버전만 지정하면 해당 버전의 스니펫 레지스트리 주소를 CLI가 자동으로 찾아줍니다. 정확한 --baseUrl을 외울 필요가 없어요.

# 기존: 정확한 배포 URL을 직접 알아야 함
npx @seed-design/cli@latest add --baseUrl https://v1-2.seed-design.io ui:action-button

# 추가: 버전만 지정하면 baseUrl을 CLI가 찾아줌
npx @seed-design/cli@latest add --seed-react-version 1.2 ui:action-button

동작

  • X.Yhttps://vX-Y.seed-design.io 로 매핑 (patch는 무시, major-minor만 사용)
  • frameworkreact로 고정
  • --baseUrl / --framework보다 우선 (이 둘은 레거시로 유지)

설계 노트: 왜 React 전용인가

버전 도메인(vX-Y.seed-design.io)은 React/모노레포 버전 라인 기준이에요. @seed-design/lynx-react는 현재 0.2.0으로 완전히 별개 라인이라 버전→도메인 매핑이 무의미합니다. 그래서 --seed-lynx-version은 만들지 않았고, lynx는 기본값(latest)을 쓰거나 필요 시 --baseUrl로 직접 지정합니다.

변경 파일

  • packages/cli/src/utils/registry-source.ts (신규): seedVersionToBaseUrl, resolveSeedVersion
  • packages/cli/src/commands/add.ts, add-all.ts: 옵션 + 해석 로직
  • packages/cli/src/tests/registry-source.test.ts (신규): resolver 단위 테스트
  • 문서: commands.mdx, migration.md

검증

  • resolver 단위 테스트 (CLI 테스트 통과)
  • bun --filter @seed-design/cli build 통과, biome 클린
  • 매핑 URL 실제 도달 확인: v1-0 / v1-2 / latest react 200, v1-2 lynx 200

참고 (이 PR 범위 밖, 별도 후속)

  • v1-1.seed-design.io(= 1.1 브랜치 배포)에는 framework-scoped 레지스트리(__registry__/react/)가 없어 --seed-react-version 1.1은 404예요. 백포트 PR #1657이 OPEN이지만 충돌로 머지 안 된 상태 → 1.1 재배포 필요. (v1-0/v1-2는 정상)
  • 최신(2.x)은 seed-design.io에서 서빙되고 v2-0 도메인은 없어요. 최신 스니펫은 옵션 없이 기본값을 쓰면 됩니다.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • addadd-all 명령에서 --seed-react-version 옵션을 지원해, 설치한 SEED React 버전에 맞는 스니펫 레지스트리를 자동으로 찾을 수 있습니다.
    • 버전 옵션이 --baseUrl--framework보다 우선 적용됩니다.
  • Documentation

    • CLI 사용 문서와 마이그레이션 가이드에 버전 기반 설치 예시와 안내를 추가/갱신했습니다.
    • 호환 스니펫 설치 흐름을 버전 옵션 중심으로 정리했습니다.

@changeset-bot

changeset-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d86868b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@seed-design/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a6768565-1de9-49cc-9da3-ccc9c81789ab

📥 Commits

Reviewing files that changed from the base of the PR and between b3b6fb2 and d86868b.

📒 Files selected for processing (6)
  • .changeset/cli-seed-version-option.md
  • docs/content/react/getting-started/cli/commands.mdx
  • packages/cli/src/commands/add-all.ts
  • packages/cli/src/commands/add.ts
  • packages/cli/src/utils/registry-source.ts
  • skills/seed-design/references/migration.md
✅ Files skipped from review due to trivial changes (3)
  • .changeset/cli-seed-version-option.md
  • docs/content/react/getting-started/cli/commands.mdx
  • skills/seed-design/references/migration.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/cli/src/commands/add.ts
  • packages/cli/src/commands/add-all.ts

📝 Walkthrough

Walkthrough

@seed-design/cliaddadd-all 명령에 --seed-react-version 옵션을 추가했습니다. 신규 resolveSeedVersion 유틸이 버전 키를 고정 base URL로 변환하며, 이 값이 기존 --baseUrl/--framework 옵션보다 우선 적용됩니다. 관련 문서와 changeset도 함께 갱신되었습니다.

Changes

--seed-react-version 옵션 추가

Layer / File(s) Summary
registry-source 버전 맵 및 resolveSeedVersion 구현
packages/cli/src/utils/registry-source.ts
SEED_REACT_VERSION_BASE_URLS 맵에 minor 버전별 고정 base URL을 하드코딩하고, resolveSeedVersion이 버전 값 유무에 따라 { framework: "react", baseUrl } 또는 null을 반환하도록 구현. 맵에 없는 버전 입력 시 CliError를 throw하며 hint에 사용 가능한 버전 목록 포함.
add / add-all 명령 옵션 연결
packages/cli/src/commands/add.ts, packages/cli/src/commands/add-all.ts
두 명령의 옵션 스키마에 seedReactVersion 필드를 추가하고 CLI 파서에 --seed-react-version 옵션 등록. resolveSeedVersion 결과를 baseUrl·framework 결정 시 최우선으로 반영하도록 실행 로직 변경.
문서 및 변경 로그 갱신
docs/content/react/getting-started/cli/commands.mdx, skills/seed-design/references/migration.md, .changeset/cli-seed-version-option.md
add/add-all 명령 옵션 표에 --seed-react-version 항목 추가, migration.md의 스니펫 설치 안내를 버전 옵션 기반으로 교체, changeset에 minor 릴리스 설명 추가.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 버전을 외치면 URL이 짠!
--seed-react-version 한 줄이면 끝~
맵에 없는 버전엔 힌트도 쏙,
문서도 바뀌고 로그도 탁!
토끼가 뛰듯 코드도 업뎃 완료 🌱

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목이 add/add-all CLI에 --seed-react-version 옵션을 추가한 핵심 변경을 정확하고 간결하게 요약합니다.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch kingston-v1

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 markdownlint-cli2 (0.22.1)
.changeset/cli-seed-version-option.md

markdownlint-cli2 v0.22.1 (markdownlint v0.40.0)
Error: Unable to use configuration file '/coderabbit-0.markdownlint-cli2.jsonc'; ENOENT: no such file or directory, open '/coderabbit-0.markdownlint-cli2.jsonc'
at throwForConfigurationFile (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:48:9)
at readOptionsOrConfig (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:169:5)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:927:21)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
[cause]: Error: ENOENT: no such file or directory, open '/coderabbit-0.markdownlint-cli2.jsonc'
at async open (node:internal/fs/promises:640:25)
at async Object.readFile (node:internal/fs/promises:1287:14)
at async readOptionsOrConfig (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:141:17)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:927:21)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/coderabbit-0.markdownlint-cli2.jsonc'
}
}

skills/seed-design/references/migration.md

markdownlint-cli2 v0.22.1 (markdownlint v0.40.0)
Error: Unable to use configuration file '/coderabbit-1.markdownlint-cli2.jsonc'; ENOENT: no such file or directory, open '/coderabbit-1.markdownlint-cli2.jsonc'
at throwForConfigurationFile (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:48:9)
at readOptionsOrConfig (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:169:5)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:927:21)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
[cause]: Error: ENOENT: no such file or directory, open '/coderabbit-1.markdownlint-cli2.jsonc'
at async open (node:internal/fs/promises:640:25)
at async Object.readFile (node:internal/fs/promises:1287:14)
at async readOptionsOrConfig (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:141:17)
at async main (file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.mjs:927:21)
at async file:///usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2-bin.mjs:14:22 {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/coderabbit-1.markdownlint-cli2.jsonc'
}
}


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Alpha Preview (Stackflow SPA)

@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Alpha Preview (Storybook)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/cli/src/utils/registry-source.ts`:
- Around line 38-40: The condition checking opts.seedReactVersion uses a truthy
check, which causes empty strings to be ignored and bypass validation. Change
the condition from a truthy check to explicitly check whether
opts.seedReactVersion is not undefined (using !== undefined or typeof check), so
that empty string inputs will be passed to the seedVersionToBaseUrl function
where proper validation and error handling occurs, as designed in the function
and verified by the test in registry-source.test.ts.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f010e4b5-6206-468c-9ec0-0cdd9d6e1630

📥 Commits

Reviewing files that changed from the base of the PR and between f367be9 and f9c1cd3.

📒 Files selected for processing (7)
  • .changeset/cli-seed-version-option.md
  • docs/content/react/getting-started/cli/commands.mdx
  • packages/cli/src/commands/add-all.ts
  • packages/cli/src/commands/add.ts
  • packages/cli/src/tests/registry-source.test.ts
  • packages/cli/src/utils/registry-source.ts
  • skills/seed-design/references/migration.md

Comment thread packages/cli/src/utils/registry-source.ts Outdated
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Alpha Preview (Docs)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
packages/cli/src/utils/registry-source.ts (1)

38-40: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

--seed-react-version "" 입력이 검증 없이 무시됩니다.

현재 truthy 체크라서 빈 문자열이 들어오면 null로 빠져 기본 레지스트리 경로로 진행됩니다. seedVersionToBaseUrl 함수는 빈 문자열을 입력받으면 에러를 던지도록 설계되어 있으므로(테스트 registry-source.test.ts:21), 옵션을 명시한 경우에는 undefined 여부로 분기해 빈 문자열도 버전 검증을 타도록 변경해주세요.

제안 수정안
 export function resolveSeedVersion(opts: {
   seedReactVersion?: string;
 }): { framework: "react"; baseUrl: string } | null {
-  if (opts.seedReactVersion) {
+  if (opts.seedReactVersion !== undefined) {
     return { framework: "react", baseUrl: seedVersionToBaseUrl(opts.seedReactVersion) };
   }

   return null;
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/cli/src/utils/registry-source.ts` around lines 38 - 40, The current
truthy check for opts.seedReactVersion in the if condition allows empty strings
to bypass validation. Change the condition from checking truthiness of
opts.seedReactVersion to explicitly checking if it is not undefined. This
ensures that empty strings are passed to the seedVersionToBaseUrl function,
which is designed to validate and throw an error for invalid inputs including
empty strings, as verified by the test in registry-source.test.ts line 21.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Duplicate comments:
In `@packages/cli/src/utils/registry-source.ts`:
- Around line 38-40: The current truthy check for opts.seedReactVersion in the
if condition allows empty strings to bypass validation. Change the condition
from checking truthiness of opts.seedReactVersion to explicitly checking if it
is not undefined. This ensures that empty strings are passed to the
seedVersionToBaseUrl function, which is designed to validate and throw an error
for invalid inputs including empty strings, as verified by the test in
registry-source.test.ts line 21.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 80ee09f4-607f-4fa0-941d-ecc27775e1b3

📥 Commits

Reviewing files that changed from the base of the PR and between f9c1cd3 and 44087a9.

📒 Files selected for processing (7)
  • .changeset/cli-seed-version-option.md
  • docs/content/react/getting-started/cli/commands.mdx
  • packages/cli/src/commands/add-all.ts
  • packages/cli/src/commands/add.ts
  • packages/cli/src/tests/registry-source.test.ts
  • packages/cli/src/utils/registry-source.ts
  • skills/seed-design/references/migration.md
✅ Files skipped from review due to trivial changes (3)
  • .changeset/cli-seed-version-option.md
  • skills/seed-design/references/migration.md
  • docs/content/react/getting-started/cli/commands.mdx
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/cli/src/tests/registry-source.test.ts
  • packages/cli/src/commands/add-all.ts
  • packages/cli/src/commands/add.ts

Comment thread packages/cli/src/utils/registry-source.ts Outdated
Maps a supported SEED React version (1.0/1.1/1.2) to its archived registry domain (https://v1-2.seed-design.io) so users don't need the exact baseUrl; unsupported versions throw with the allowed list. Sets framework=react and takes precedence over --baseUrl/--framework.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@junghyeonsu junghyeonsu merged commit b9a2956 into dev Jun 24, 2026
10 checks passed
@junghyeonsu junghyeonsu deleted the kingston-v1 branch June 24, 2026 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants