This skill helps the user migrate the project from Wot UI v1 (wot-design-uni) to Wot UI v2 (@wot-ui/ui)。
Full migration guide:Chinese / English。
Scope of responsibility
- Scan v1 usage, replace package names/paths, migrate component APIs, migrate the form validation system and built-in icon names, and fix incompatible changes.
- Not responsible forcreating new business pages or refactoring business logic; only make the minimum necessary compatibility replacements.
- Not responsible forinstalling dependencies; the user performs this in the terminal.
First interaction confirmation
Before starting any operation, first confirm the following three points with the user (skip the corresponding question if it can already be inferred from context):
- Installation method: npm or uni_modules? (affects import paths and easycom configuration)
- Target:
- A. Full migration(project not yet upgraded) → execute according to phases 1–7
- B. Fix errors after upgrade(already upgraded but encountering compilation/runtime errors) → first read
errors.mdto locate the problem
- Target platform: H5 / WeChat Mini Program / Alipay Mini Program? (affects style isolation and easycom verification methods)
Quick path
Based on the problem described by the user, load the corresponding sub-file directly:
| Keyword | Sub-file |
|---|---|
| Error message / compilation error / module not found / is not defined / abnormal after upgrade | errors.md |
| Form / Form / schema / zodAdapter / FormRules / validation / required asterisk | form.md |
| Package name / easycom / Volar / vite plugin / internationalization / path replacement / uni_modules | infra.md |
| Sass / theme / Design Token / CSS variables / style overrides / dark mode / ConfigProvider | styles.md |
| Dialog / MessageBox / Empty / StatusTip / Cascader / ColPicker / Keyboard / NumberKeyboard / Button / Tag / Radio / Checkbox / Search / Grid / Fab / Badge / Slider / Tabs / Steps / Swiper / Tooltip / Popover / Collapse / Cell / Input / Textarea / PickerView / ImgCropper / CountTo / Segmented | components.md |
| Icon / icon / wd-icon / icon / iconClass / activeIcon / inactiveIcon / prefixIcon / suffixIcon / empty icon | components.md 's "Icon migration" and icons.json |
Core changes quick reference table
| Type | v1 | v2 |
|---|---|---|
| npm package name | wot-design-uni |
@wot-ui/ui |
| uni_modules directory | wot-design-uni |
wot-ui |
| Dialog component | wd-message-box |
wd-dialog |
| Dialog Hook | useMessage |
useDialog |
| Empty prompt | wd-status-tip |
wd-empty |
| Multi-column picker | wd-col-picker |
wd-cascader |
| Number keyboard | wd-number-keyboard |
wd-keyboard |
| Form validation | rules / FormRules |
schema / FormSchema |
| Button variant | plain / type="text" / type="icon" |
variant / icon button |
| Button danger color | type="error" |
type="danger" |
| Tag variant | plain |
variant="plain" |
| Radio/checkbox form | shape / inline / cell |
type / direction / manual combination wd-cell |
| Search box light style | light |
variant="light" |
| GridItem click | @itemclick |
@click |
| Utility function path | components/common/util |
common/util |
| Built-in icon names | v1 icon set | According to icons.json manual review results |
Migration process
Recommended order: dependency upgrade → path replacement → Form pages → high-impact components → medium/low-impact components → icons and low-impact properties → styles and themes → regression testing.
After completing each stage, confirm with the user before proceeding to the next stage.
Stage 1: Scan and Diagnose
-
Determine the user's installation method (
npmoruni_modules)。 -
Confirm project configuration:
pages.jsoneasycom、tsconfig.jsontype declarations, Vite plugin auto-import. -
Search for old v1 usages:
rg "wot-design-uni|wd-message-box|useMessage|wd-status-tip|wd-col-picker|wd-number-keyboard|wd-icon|icon-class|iconClass|active-icon|activeIcon|inactive-icon|inactiveIcon|prefix-icon|prefixIcon|suffix-icon|suffixIcon|@itemclick|shape=|inline|\scell\b|\slight\b|type=\"error\"|type=\"icon\"|type=\"text\"|\splain\b|classPrefix|components/common/util|hide-label|hide-min-max|autoLineWidth|disabled-color|setRoate|useContentSlot|useMoreSlot|\bshow=" -
If the project has forms, additionally search for:
rg "wd-form|FormRules|:rules=|rules=|errorType|resetOnChange" -
Report the list of findings to the user, sorted by impact level:
- High impact: Form (structure + validation system), Dialog (formerly MessageBox), ColPicker, NumberKeyboard
- Medium impact: Button, Tag, Radio/Checkbox, Search, Grid, Fab, built-in icon names
- Low impact: camelCase prop names, minor prop adjustments for Badge/Slider/Tabs/Steps/Swiper, etc.
Stage 2: Dependency and Path Replacement
See infra.md(package name, easycom, Volar, Vite plugin, i18n) and styles.md(Sass upgrade). After reading, return toStage 3to continue.
Stage 3: High-Impact Component Migration
See components.md(MessageBox→Dialog、StatusTip→Empty、ColPicker→Cascader、NumberKeyboard→Keyboard)。
For the Form form system, see form.md. After reading, return toStage 4to continue.
Stage 4: Medium-Impact Component Migration
See components.md(Button, Tag, Radio/Checkbox, Search, Grid, Fab). After reading, return toStage 5to continue.
Stage 5: Low-Impact Prop and Icon Migration
See components.md(Badge, Slider, Tabs, Steps, Swiper, Tooltip, Popover, Collapse, DatetimePickerView, ImgCropper, CountTo, Segmented, PickerView, icon migration, camelCase prop names). When migrating icons, you must read icons.json, and only replace confirmed mappings; "no counterpart" and dynamically bound items are left for manual decision. After reading, return toStage 6to continue.
Stage 6: Style and Theme Migration
See styles.md(theme file imports, global variable overrides, ConfigProvider, style override priority, dark mode). After reading, proceed toStage 7regression verification.
Stage 7: Regression Verification
- Whether H5 and the target mini-program platform compile normally
-
easycomWhether allwd-*components resolve correctly -
Toast、Dialog、NotifyWhether functional calls such as those have instances declared in the page - Whether form submission, single-field validation, reset, hidden fields, and async validation work properly
- Whether the display text and submitted values of selector-type form items are correct
-
ButtonWhether thetype、variant、roundand height are as expected -
TagWhether thevarianthas been migrated fromplainmigration -
Radio/CheckboxWhether theshape、inline、cellhas been migrated -
SearchWhether thelighthas been migrated tovariant="light" -
GridItemWhether the click event has been migrated fromitemclicktoclick -
Cell、Input、TextareaWhether the form-related props have been migrated towd-form-item -
PickerView、ImgCropper、CountToWhether instance methods such as those can still be called normally -
Badge、Slider、Tabs、Steps、SwiperWhether old props such as those have been migrated -
DialogWhether click-mask-to-close, the Prompt return value, and the button configuration meet expectations - Whether dark mode, theme variables, and brand color overrides take effect
- Does the popup layer have style isolation issues on the mini program side?
- Do custom override styles still take effect?
- Are all static built-in icon names handled according to
icons.json, and has no global replacement been performed on business strings? - "No corresponding", dynamic binding, and
iconClass/activeIcon/inactiveIcon/prefixIcon/suffixIconhave been listed separately and manually confirmed? - Are the business semantics and visual results of the icons correct, and is the name casing kept accurate?
- Does the change in icon button height affect the page layout?