Work in order. Type-check after each step; do not batch several steps into one unverified change.
-
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.
-
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.
-
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.
-
Theming (R1, R2, R3). Replace ThemeProvider with the stylesheets and attributes, delete StyleProvider and static-css wiring. Templates per setup in references/theming.md.
-
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.
-
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.
-
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.
-
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.