-
Notifications
You must be signed in to change notification settings - Fork 4
feat: introduce comprehensive dart source file generation #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: introduce comprehensive dart source file generation #31
Conversation
|
@jwelmac This is pretty good. I had this in the roadmap, but really excited to see you're thinking in this direction. I'll give this a proper review sometime today 🔥 |
|
Thank you @codekeyz. Looking forward to your feedback. |
|
@codekeyz |
|
@codekeyz |
|
@jwelmac There’s currently no plan to support this on the web. I do intend to add Flutter support, but that depends on successfully compiling V8 ( |
Yeah, ignore it. |
|
@jwelmac I've added some improvements & fixed the build failure. Please rebase your branch so I can review easily. |
|
Thanks for the updates and making the init optional. I was seriously contemplating that but thought that was outside the scope of changes here. |
- exclude file from tsc operations
- update runtime types path
15d4c55 to
dda981d
Compare
|
@codekeyz |
- use catalog and workspace for common dependencies
- update tests for new init signature
…oc comment line wrapping - simplify return documentation generation.
- prevents angle braces being read as html in dart
|
@codekeyz |
Description
This PR introduces a complete TypeScript SDK generation ecosystem for Globe Runtime, establishing a new recommended workflow:
@globe/runtime_types@globe/dart_source_generatorCLIThis significantly improves developer experience by eliminating the need for FFI boilerplate and providing end-to-end type safety across the JavaScript-Dart boundary.
What's New
1.
@globe/dart_source_generator- Code Generation CLINew package with complete implementation:
2.
@globe/runtime_types- Type-Safe SDK DefinitionEnhanced package with full type support:
index.js(271 lines) - Complete JSDoc type annotationsindex.d.ts(353 lines) - TypeScript declarationsREADME.md(366 lines) - Comprehensive API documentationdefineFunction(),defineSdk(),returnString(),streamString(), etc.3.
packages/globe_runtime/README.md- Updated Documentation@globe/dart_source_generator4.
examples/full_example- Complete Working Examplefull_example.ts)full_example_source.dart)Key Features
✅ AST-based type extraction and code generation
✅ Automatic TypeScript-to-Dart type mapping
✅ Watch mode and batch processing
✅ Preserve comments from JS/TS to Dart (with type conversion)
✅ Real-world working examples
Test Coverage
Comprehensive test suite covering AST parsing, code generation, type mapping, and CLI functionality.
Usage Example
Step 1: Define TypeScript SDK
Step 2: Generate Dart Source
Step 3: Use in Dart
Breaking Changes
✅ None - Entirely additive feature set
All existing Globe Runtime functionality remains unchanged and unaffected.
Backward Compatibility
✅ 100% Compatible