Skip to content

feat(builder): improve types export and error handling#358

Closed
youngwinds wants to merge 1 commit intomainfrom
improve-types-and-error-handling
Closed

feat(builder): improve types export and error handling#358
youngwinds wants to merge 1 commit intomainfrom
improve-types-and-error-handling

Conversation

@youngwinds
Copy link
Collaborator

  • Export MeasureNodeBuilder and DimensionNodeBuilder for external use
  • Add validation and error handling to NodeBuilders
  • Add Zod validation in build() methods for type safety
  • Improve removeMeasure to return boolean for success/failure
  • Add setHierarchyType and setFormat to DimensionNodeBuilder
  • Add validation error tracking with getValidationErrors()

This improves code quality by:

  1. Making NodeBuilder classes publicly accessible
  2. Adding runtime validation with helpful error messages
  3. Ensuring type safety through Zod schema validation
  4. Providing better developer experience with error tracking

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Release
  • Site / documentation update
  • Demo update
  • Workflow
  • Other (about what?)

🔗 Related issue link

🔗 Related PR link

🐞 Bugserver case id

💡 Background and solution

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

- Export MeasureNodeBuilder and DimensionNodeBuilder for external use
- Add validation and error handling to NodeBuilders
- Add Zod validation in build() methods for type safety
- Improve removeMeasure to return boolean for success/failure
- Add setHierarchyType and setFormat to DimensionNodeBuilder
- Add validation error tracking with getValidationErrors()

This improves code quality by:
1. Making NodeBuilder classes publicly accessible
2. Adding runtime validation with helpful error messages
3. Ensuring type safety through Zod schema validation
4. Providing better developer experience with error tracking
@youngwinds youngwinds closed this Mar 4, 2026
@youngwinds
Copy link
Collaborator Author

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.

1 participant