Skip to content

fix(examples/crm): remove as any cast from objectstack.config.ts#581

Merged
hotlong merged 3 commits intomainfrom
copilot/remove-as-any-from-config
Feb 18, 2026
Merged

fix(examples/crm): remove as any cast from objectstack.config.ts#581
hotlong merged 3 commits intomainfrom
copilot/remove-as-any-from-config

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

examples/crm/objectstack.config.ts ended with as any, bypassing defineStack type checking entirely. The config is already fully compliant with the expected type — the cast was unnecessary.

  • examples/crm/objectstack.config.ts: } as any)})
  • ROADMAP.md: Mark item complete under P0.1

All 4383 tests pass. No type errors in the config after removal.

Original prompt

This section details on the original issue you should resolve

<issue_title>[P1] examples/crm 配置移除 as any,实现类型安全</issue_title>
<issue_description>examples/crm/objectstack.config.ts 结尾存在 as any,绕过了 defineStack 类型检查,导致自定义字段、key 等元数据不规范时无法在编译期发现。

风险

  • 有 bug 时类型异常不会被 IDE/编译时发现,最终代码合入会导致线上渲染异常(如 columns/fields)
  • example 没有很好的示范效应。

修复建议

  • 保持所有元数据严格按 Parameters<typeof defineStack>[0] 类型定义。
  • 请调用 as Parameters<typeof defineStack>[0] 或完全去除 as any 并修正类型错误。
  • 配合类型校验,可提升大家的开发体验,减少不可见风险。

  • 修复完成需运行 test,确保 roadmap 相关已同步更新。</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui Ready Ready Preview, Comment Feb 18, 2026 6:48am
objectui-demo Ready Ready Preview, Comment Feb 18, 2026 6:48am
objectui-storybook Ready Ready Preview, Comment Feb 18, 2026 6:48am

Request Review

Copilot AI and others added 2 commits February 18, 2026 05:00
…r type safety

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix type safety by removing as any from CRM config fix(examples/crm): remove as any cast from objectstack.config.ts Feb 18, 2026
Copilot AI requested a review from hotlong February 18, 2026 05:13
@hotlong hotlong marked this pull request as ready for review February 18, 2026 05:14
Copilot AI review requested due to automatic review settings February 18, 2026 05:14
@hotlong hotlong merged commit 0e68f28 into main Feb 18, 2026
1 of 4 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes a type-safety bypass in the CRM example stack configuration by deleting an unnecessary as any cast, ensuring defineStack enforces the config shape at compile time. Also updates the project roadmap to reflect completion of the task.

Changes:

  • Remove trailing as any cast from examples/crm/objectstack.config.ts so defineStack type-checking is enforced.
  • Mark the corresponding roadmap item as completed under P0.1.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
examples/crm/objectstack.config.ts Drops the as any cast at the defineStack call site to restore compile-time validation.
ROADMAP.md Adds a checked roadmap entry indicating the CRM config type-safety fix is complete.

Copilot AI added a commit that referenced this pull request Feb 18, 2026
Add back the CRM type safety line from PR #581 that was merged into main
while keeping our MSW cleanup item marked as completed.

Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1] examples/crm 配置移除 as any,实现类型安全

3 participants