Skip to content

feat: add smarthr-ui v94 to v95 migrator#1334

Draft
AtsushiM wants to merge 4 commits into
masterfrom
feat/add-v94-to-v95-migrator
Draft

feat: add smarthr-ui v94 to v95 migrator#1334
AtsushiM wants to merge 4 commits into
masterfrom
feat/add-v94-to-v95-migrator

Conversation

@AtsushiM
Copy link
Copy Markdown
Member

Summary

smarthr-ui v94→v95の移行ルールを追加しました。

対応する破壊的変更

  1. LanguageSwitcher, AppLauncher, InputFile: decorators属性の削除

    • 翻訳はsmarthr-ui内で自動的に対応
  2. FormDialog, ActionDialog: ボタン属性をObject形式に統合

    • actionText, actionTheme, actionDisabledactionButton
    • closeDisabledcloseButton
    • decorators.closeButtonLabelcloseButton
  3. MessageDialog: decorators削除とcloseButton属性への統一

    • decorators.closeButtonLabelcloseButton

自動修正可能なパターン

  • ✅ decorators属性の削除(LanguageSwitcher, AppLauncher, InputFile)
  • ✅ actionTextのみの場合はactionButtonにリネーム
  • ✅ 既に新属性がある場合は古い属性を削除

手動対応が必要なパターン

  • ❌ 複数のボタン属性を統合(actionText + actionTheme等)→ Object形式への変換が必要
  • ❌ decorators.closeButtonLabelの値抽出 → 値の解析が複雑

実装方針

複雑な変換が必要な場合、完全な自動修正を目指すと実装が複雑になりすぎるため、段階的なアプローチを採用しました:

  1. 単純なケースのみ自動修正: actionTextのみ → actionButtonにリネーム
  2. 複雑なケースはエラーのみ: エラーメッセージで手動対応を促す
  3. READMEで詳細な移行方法を説明: ユーザーが正確に対応できるようにする

Test plan

  • 単体テストが全てパス(170件)
  • 実プロダクトでの検証

参考

🤖 Generated with Claude Code

AtsushiM and others added 4 commits May 28, 2026 13:58
smarthr-ui v95の移行ルールを追加:
- LanguageSwitcher, AppLauncher, InputFileのdecorators削除
- FormDialog/ActionDialogのボタン属性をObject形式に統合
- MessageDialogのdecorators削除とcloseButton属性への統一

自動修正可能なパターン:
- decorators属性の削除(LanguageSwitcher, AppLauncher, InputFile)
- actionTextのみの場合はactionButtonにリネーム
- 既に新属性がある場合は古い属性を削除

手動対応が必要なパターン:
- 複数のボタン属性を統合(actionText + actionTheme等)
- decorators.closeButtonLabelの値抽出

参考: https://github.com/kufu/smarthr-ui/releases/tag/smarthr-ui-v95.0.0

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
AppLauncherはLanguageSwitcher/InputFileとは異なり、decoratorsを単純削除するのではなく、
decorators.triggerLabelをtriggerLabel属性に移行する必要がある。

修正内容:
- AppLauncher専用のチェッカーを追加
- decorators.triggerLabelの値抽出は複雑なためエラーのみ表示
- triggerLabel属性が既にある場合はdecorators削除を自動修正
- README、REFERENCE、テストケースを更新

参考: kufu/smarthr-ui#6233

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- actionText + actionTheme/actionDisabledの場合、Object形式へ自動変換
- decorators.closeButtonLabelから値を自動抽出(引数なしの関数のみ)
  - () => "OK" → "OK"
  - () => variable → {variable}
  - () => getLabel() → {getLabel()}
  - () => obj.prop → {obj.prop}
- テストケースを追加(関数呼び出し、オブジェクトプロパティなど)
- README.mdとREFERENCE.mdを更新

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- extractDecoratorValue関数を使用して値を抽出
- 固定値(リテラル)の場合 → decoratorsを削除(IntlProviderに任せる)
- 動的な値(変数、関数呼び出しなど)の場合 → triggerLabel属性に移行
- テストケースを追加(固定値、動的な値、引数あり、BlockStatementなど)
- README.mdとREFERENCE.mdを更新

例:
- () => "Apps" → decorators削除
- () => featureName → triggerLabel={featureName}
- () => getLabel() → triggerLabel={getLabel()}
- () => labels.app → triggerLabel={labels.app}

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant