Skip to content

Conversation

hellovai
Copy link
Contributor

  • Migrate TypeScript TypeBuilder to use baml_type_builder::TypeBuilder
  • Keep original method names while using new type builder
  • it works
  • everything compiles!
  • python works!

- Updated imports to use new type builder modules
- Changed constructor to require runtime parameter like Python version
- Updated method signatures to match new type builder API:
  - get_enum -> add_enum (with js_name = 'enum')
  - get_class -> add_class (with js_name = 'class')
  - set_type -> set_type (with js_name = 'type')
- Updated error handling to return napi::Result<T>
- Removed Default implementation since constructor requires runtime
- Fixed type wrapping for FieldType in get_type method
- Verified compilation succeeds
- Reverted method names to original:
  - get_enum (instead of add_enum)
  - get_class (instead of add_class)
  - set_type (kept as is)
- Removed js_name attributes since using original names
- Maintains backward compatibility with existing TypeScript API
- Still uses new baml_type_builder::TypeBuilder internally
Copy link

vercel bot commented Sep 19, 2025

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

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
promptfiddle Skipped Skipped Oct 16, 2025 10:55pm

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