Repository navigation
refactor(web): rename FieldBase to ChoyFieldBase - #505
Conversation
Align the field shell with the Choy*Field naming so third-party modules can treat ChoyFieldBase as the stable kit extension point. Export the component and FormItemProps/FieldStateExpr from kit.ts; keep choy-field-base CSS/anchor tokens unchanged.
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing: 56
✨ Finishing Touches
Comment |
Reviewer's GuideThis refactor renames the product field shell from File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
| defineOptions({ name: 'ChoyFieldBase' }); | ||
|
|
||
| const { _t } = createTranslate('web', { scope: 'web/components/field/FieldBase' }); | ||
| const { _t } = createTranslate('web', { scope: 'web/components/field/ChoyFieldBase' }); |
There was a problem hiding this comment.
Missing file rename
The diff only changes defineOptions({ name: 'ChoyFieldBase' }) and the translate scope inside ChoyFieldBase.vue, but every import in the PR points to ./ChoyFieldBase.vue. If the file was not actually renamed from FieldBase.vue (no rename hunk is shown), all field components and tests will fail to resolve the module. Confirm the file rename is part of the commit; otherwise imports break at build/typecheck time.
There was a problem hiding this comment.
评估:不合理(误报)。
commit 928b1e85 里已有 rename hunk:
FieldBase.vue → ChoyFieldBase.vue(git show --summary 可见 rename ... (99%))。GitHub Files 视图有时会把 rename 压成「新文件 + 小 diff」,看起来像没改名,但模块路径是对的;本 PR CI typecheck/unit 也已通过。
| test('component options name is ChoyFieldBase (not legacy OFieldBase)', () => { | ||
| expect((ChoyFieldBase as any).name || (ChoyFieldBase as any).__name).toBe('ChoyFieldBase'); | ||
| }); |
There was a problem hiding this comment.
Stale test name
The new test asserts the component name is ChoyFieldBase but the test title still says "not legacy OFieldBase". This is a leftover from the old naming and is misleading; it should reference the legacy FieldBase name instead.
There was a problem hiding this comment.
评估:合理,已修。
测试标题已改为 not legacy FieldBase(20f2aea8)。
| defineOptions({ name: 'ChoyFieldBase' }); | ||
|
|
||
| const { _t } = createTranslate('web', { scope: 'web/components/field/FieldBase' }); | ||
| const { _t } = createTranslate('web', { scope: 'web/components/field/ChoyFieldBase' }); |
There was a problem hiding this comment.
Translate scope change
The translate scope changed from web/components/field/FieldBase to web/components/field/ChoyFieldBase. If translation catalogs are keyed by scope path, existing translations for this component will no longer resolve and labels/help text will fall back to raw keys. Verify the i18n catalog was updated or that scope is not used as a lookup key.
There was a problem hiding this comment.
评估:合理,已修。
catalog 确实按 msgctxt/scope 查找。已同步更新 modules/web/i18n/zh_CN.po 与 web.pot:FieldBase → ChoyFieldBase(20f2aea8),与 createTranslate(..., { scope: 'web/components/field/ChoyFieldBase' }) 对齐。未保留旧 scope(硬切,与本 PR 命名策略一致)。
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Update zh_CN.po/web.pot msgctxt and source refs so translate lookups match createTranslate scope, and clarify the component-name test title.
Review follow-up
关于 Actions 日志里的 element-plus 404来自
若要消掉这些 warn,需要单独改 bootstrap(去掉 EP)或扩展 |
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
Summary
FieldBase→ChoyFieldBase(file, component name, imports, test stubs) so the product field shell matches theChoy*Fieldfamily and is distinct from vendor/uiField*.ChoyFieldBaseplusFieldStateExpr/FormItemPropsfromkit.tsas the extension surface for custom field widgets.choy-field-baseCSS classes anddata-anchor="choy.field-base"unchanged.Test plan
./choysum test unit web --feSummary by Sourcery
Rename the web field shell to ChoyFieldBase and expose its extension types while preserving existing field styling and anchors.
New Features:
Enhancements:
Tests:
PR Type
Enhancement, Tests
Description
Rename
FieldBasetoChoyFieldBaseacross web field componentsExport
ChoyFieldBase,FieldStateExpr,FormItemPropsfromkit.tsUpdate component name, translate scope, and all field imports
Update unit tests and stubs to the new component identity
File Walkthrough
18 files
Rename component name and translate scopeExport ChoyFieldBase and field typesSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBaseSwitch template and import to ChoyFieldBase2 files
Update base tests to ChoyFieldBase identityUpdate store-mode mount tests to ChoyFieldBase34 files