本文へ移動
cccskills
無料GitHub で公開日本語紹介

lobe-ui-v6-migration

@lobehub/ui 5.xのアプリを6.xへ移行し、依存関係やテーマ設定、コンポーネントの変更点を順に修正して動作を確認するスキルです。

原文原文の説明を見る

Upgrade an app from @lobehub/ui 5.x to 6.x: remove antd and antd-style, replace ThemeProvider with theme.css + data-theme attributes, move @lobehub/ui/base-ui imports to @lobehub/ui, and fix the component prop changes, driven by the @lobehub/ui-codemod report. Trigger on: upgrade or migrate @lobehub/ui to v6, lobe-ui v6 / 6.0 beta, remove antd from a lobe-ui app, "ThemeProvider is not exported", "Cannot find module '@lobehub/ui/base-ui'", antd-style removal, 升级 lobe-ui 6, 迁移 lobe-ui.

lobehub/lobe-uiスター 2,246(GitHub 2,246 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • @lobehub/ui 5.xから6.xへ移行したいとき
  • ThemeProviderやテーマ設定を置き換えたいとき
  • codemodの指摘とコンポーネント変更を確認したいとき

日本語での紹介

できること

@lobehub/ui 5.xから6.xへの移行作業を、調査、修正、確認の順に進めます。まずアプリの構成や依存関係、ThemeProviderなどの利用箇所を洗い出し、codemodを実行して変更候補と手作業が必要な項目を確認します。その後、テーマ設定をtheme.cssとdata-theme属性に置き換え、廃止されたインポートやコンポーネント、変更されたprops、スタイル指定を更新します。フォーム送信時に取得される値など、型チェックでは見つからない挙動の変化も確認対象です。

こんなときに便利

既存アプリを@lobehub/ui v6へアップグレードしたい開発者に向いています。ThemeProviderが見つからない、@lobehub/ui/base-uiを読み込めないといった移行時のエラーや、antd・antd-styleの削除に伴う修正を整理できます。codemodの結果を確認しながら、コンポーネントやテスト、ライト・ダーク表示まで段階的に点検したい場合にも使えます。

使い方の例

  • 「このアプリを@lobehub/ui 6.xへ移行してください」
  • 「codemodのレポートを確認して、手作業が必要な修正を進めてください」
  • 「ThemeProviderを使わないv6のテーマ設定に置き換えてください」

注意点

移行先は@lobehub/ui 6.xです。依存パッケージのインストールやcodemod、型チェック・lint・テストなどを行います。利用するパッケージマネージャーやワークスペース構成に合わせた確認が必要です。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(4)

  • SKILL.md6.8 KB
  • references/components.md51.9 KB
  • references/styling.md5.9 KB
  • references/theming.md6.2 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

lobe-ui v6 migration

v6 has no antd, no antd-style, no ThemeProvider and no @lobehub/ui/base-ui subpath. The codemod does the mechanical part; this skill covers the rest. The human guide is https://ui.lobehub.com/migration-v6 — every codemod report item links to a section of it.

Workflow

Work in order. Type-check after each step; do not batch several steps into one unverified change.

  1. Inventory. Read package.json (and workspace packages in a monorepo). Find the app entry points (main.tsx, app/layout.tsx, _app.tsx), SSR shells, and every place that renders ThemeProvider, StyleProvider, antd App or antd ConfigProvider. Note the package manager.

  2. Dependencies. Install @lobehub/ui@^6, @lobehub/icons@^6, @lobehub/fluent-emoji@^5 and motion@^14 (13 also works; keep motion@^13 if the app uses @lobehub/editor, whose peer range is ^13), plus @lobehub/charts@^6 / @lobehub/editor@^5 / @lobehub/tts@^6 if used. All of them are on the latest tag; do not install @beta. Use --registry=https://registry.npmjs.org and verify the resolved UI version in every consuming workspace (pnpm -r list @lobehub/ui --depth 0 for pnpm workspaces). Remove antd, antd-style, @ant-design/* and rc-* unless code outside lobe-ui still needs them (then keep them and say so in your summary). Check mirror synchronization, pnpm minimumReleaseAge and stale Vite optimization separately from source failures.

  3. Codemod. Run from the repository root (. also reaches build config and test mocks), then the project formatter:

    npx --registry=https://registry.npmjs.org @lobehub/ui-codemod@latest v6 . --dry
    

    The CLI prints a summary, next action and paths to Markdown / JSON reports and a preview patch in a fresh .lobe-ui-codemod/v6-*/ directory. Review the patch and rerun without --dry. Reports are always saved; --report <file.md> changes their paths, and existing output files are never overwritten. Use --json only when stdout must be JSON.

    Start with JSON schemaVersion, codemodVersion, mode, scope, summary and nextAction, then inspect task IDs, messages and occurrence counts before loading one task's locations. Resolve finding paths against scope.root; reports may live outside the project. Tasks group repeated instructions with stable IDs and retain every location; handle manual-fix before review, and do not interpret review hints as confirmed bugs. changed lists proposed files in dry-run and rewritten files in write mode. items preserves raw findings, errors lists parse failures, and nextSteps lists manual verification. Line numbers refer to transformed source even in dry-run. Exit code 0 does not mean migration success, and zero findings still requires nextSteps. IDs are not completion tracking; verify fixes against source on rerun.

  4. Theming (R1, R2, R3). Replace ThemeProvider with the stylesheets and attributes, delete StyleProvider and static-css wiring. Templates per setup in references/theming.md.

  5. Imports and components (R4, R5, R6, R10, R11, R12). Replace removed exports and antd components, then check props of every changed component. Mappings in references/components.md. R5 includes both specific prop findings and general review hints: inspect the task kind, open its locations and fix what changed. R10 / R11 / R12 name each removed Video / Table / ProTable / DatePicker prop with its replacement.

  6. Styling leftovers (R6 antd-style, R8, R9). createStyles, themeMode / setThemeMode, .ant-* selectors and --ant-* variables. The codemod scans JS/TS strings and CSS / Less / Sass without rewriting stylesheets, and gives verified slot / token hints where known. Search other file types, dynamically built selectors and ignored consumed sources manually. See references/styling.md.

  7. Forms. Grep submit paths that use @lobehub/ui/form (getValues(), onSubmit, onValuesChange). They receive the whole store, not only mounted fields; pick the fields you send explicitly. Do this even when type-check is clean — it is a silent behavior change.

  8. Tests and verification (R13). Compare relevant tests with a pre-upgrade baseline. Wrap motion consumers in MotionProvider motion={motion} / the app's ConfigProvider; keep real exports in partial mocks; query InputNumber by role instead of input order. Follow https://ui.lobehub.com/migration-v6#test-migration. Type-check and lint to zero errors. Re-run the codemod: it must rewrite nothing except merging @lobehub/ui imports you added, and every remaining item must be resolved or explained. Then compare light/dark × desktop/mobile, one popup, one form submit, accessible names, app-owned neutral scales and one page per changed component family. On 6.0.1 and later, check Switch aria attributes and InputPassword toggle localization explicitly. Remove temporary overrides only after verifying the replacement.

Rules

  • Never re-add antd or antd-style to silence an error. If a component has no counterpart, rebuild it from @lobehub/ui parts or ask the user.
  • Never target generated class names (StyleX hashes) or .ant-*. Customize through className, style, classNames / styles slots and documented data-* attributes.
  • Never pass ThemeProvider props to ConfigProvider; only customFonts, enableCustomFonts, direction, config, locale, resources and motion exist there.
  • Keep behavior, not markup: when a v6 component renders different DOM, fix the app's CSS that depended on the old DOM instead of forcing the old structure.
  • Unlayered global CSS in the app now beats component styles. If buttons or inputs look reset after the upgrade, move the app's resets into a layer (see references/styling.md).
  • Report what you could not migrate, with file and reason, instead of leaving a silent TODO.

Done when

  • No import from antd, antd-style, @ant-design/*, rc-* or @lobehub/ui/base-ui remains.
  • theme.css and style.css are imported once at the app root; data-theme is set before first paint on server-rendered pages.
  • Type-check, lint and tests pass; the codemod re-run rewrites nothing.
  • You listed every manual decision (removed component replaced, prop semantics changed, form submit narrowed) in your summary to the user.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

building-landing-home

無料概要あり

@lobehub/ui/awesomeのランディングページ用コンポーネントを組み合わせ、製品や文書サイトのホーム画面を構成してリンクや配色まで整えます。

  • 製品のランディングページを作りたいとき
  • lobedocsのトップページを作りたいとき
  • 動くコンポーネント例を配置したいとき
lobehub/lobe-ui2,2462026年10月26日 更新

local-testing

無料概要あり

lobe-uiのコンポーネントやドキュメントサイトをローカルブラウザーで確認し、表示や操作、テーマ、画面幅、実行時エラーを検証します。

  • 変更したコンポーネントをブラウザーで確認したいとき
  • デモの操作やテーマ表示を検証したいとき
  • モバイル表示のスクリーンショットを残したいとき
lobehub/lobe-ui2,2462026年10月26日 更新

tuning-color-palettes

無料概要あり

lobe-uiの色トークンを測定・再生成し、ブランド色や状態色の見え方、ライト・ダーク両テーマのコントラストを調整するスキルです。

  • ブランド色に合わせた色板を作りたいとき
  • 状態色のピンク・灰色・茶色寄りを直したいとき
  • ライト・ダークのコントラストを調整したいとき
lobehub/lobe-ui2,2462026年10月26日 更新

using-docs-kit

無料概要あり

@lobehub/docs-kitでドキュメントサイトを構築し、設定ファイルやコンポーネント解説、デモ、API表を整えてビルド時の検証まで行うスキルです。

  • ドキュメントサイトを新しく構築したいとき
  • デモやAPI表付きのコンポーネント文書を作りたいとき
  • dumiのドキュメントを移行したいとき
lobehub/lobe-ui2,2462026年10月26日 更新

lobehub のスキルをすべて見る

このスキルの問題を報告する