lobe-ui-v6-migration
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.
-
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 rendersThemeProvider,StyleProvider, antdAppor antdConfigProvider. Note the package manager. -
Dependencies. Install
@lobehub/ui@^6,@lobehub/icons@^6,@lobehub/fluent-emoji@^5andmotion@^14(13 also works; keepmotion@^13if the app uses@lobehub/editor, whose peer range is^13), plus@lobehub/charts@^6/@lobehub/editor@^5/@lobehub/tts@^6if used. All of them are on thelatesttag; do not install@beta. Use--registry=https://registry.npmjs.organd verify the resolved UI version in every consuming workspace (pnpm -r list @lobehub/ui --depth 0for pnpm workspaces). Removeantd,antd-style,@ant-design/*andrc-*unless code outside lobe-ui still needs them (then keep them and say so in your summary). Check mirror synchronization, pnpmminimumReleaseAgeand 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 . --dryThe 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--jsononly when stdout must be JSON.Start with JSON
schemaVersion,codemodVersion,mode,scope,summaryandnextAction, then inspect task IDs, messages and occurrence counts before loading one task's locations. Resolve finding paths againstscope.root; reports may live outside the project. Tasks group repeated instructions with stable IDs and retain every location; handlemanual-fixbeforereview, and do not interpret review hints as confirmed bugs.changedlists proposed files in dry-run and rewritten files in write mode.itemspreserves raw findings,errorslists parse failures, andnextStepslists manual verification. Line numbers refer to transformed source even in dry-run. Exit code 0 does not mean migration success, and zero findings still requiresnextSteps. IDs are not completion tracking; verify fixes against source on rerun.