BoxPistols / BoxPistols/BookStory

同名トークン/コンポーネントの重複が diff 計算で丸められる

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## 背景

`apps/web/src/lib/catalog-diff.ts` の `diffCatalogs` は `Map` でキー化しているため、同名のコンポーネント/トークンが複数ある場合、最後の 1 件だけが残り、他は diff 計算から消失します。

`catalog-validate.ts` 側では「重複」を **warning** として返していますが、warning は publish を止めません。結果として、重複したまま GitHub にコミットされ、コミットメッセージにも片方しか反映されない状態になります。

## 影響

- コミットメッセージの追加・削除カウントがズレる
- どちらの定義が「勝った」かが UI で読めない

## 提案

以下のいずれか。

1. `validateCatalog` で重複を **error に昇格**して publish を拒否する(厳格運用)
2. `diffCatalogs` 側で `Map` に変更し、重複も含めて diff に出す(観測重視)
3. `publish` API のレスポンスで重複の存在を明示し、UI でモーダル表示する(UX 寄り)

3 が一番穏当だが、根本解決には 1 が望ましい。Figma 側の運用ルールと合わせて方針決めが必要。

## 関連

- PR #2 のレビュー指摘から派生

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading apps/web/src/lib/catalog-diff.ts and diffCatalogs, then compare its duplicate handling with catalog-validate.ts and the review context from PR #2. Before implementation, decide whether publishing should reject duplicates, preserve them in diffs, or expose them through the publish API; done requires an agreed policy and corresponding behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
full-stack
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.