Releases: wowemulation-dev/typescript2cxx
v0.7.0
[0.7.0] - 2025-01-08
Added
- feat: Array higher-order methods (forEach, find, findIndex, some, every, includes)
- feat: Computed property names in object literals (
{[key]: value}) - feat: IIFE (Immediately Invoked Function Expressions) support
- feat: instanceof operator for runtime type checking
- feat: in operator for property existence checking
- feat: delete operator for property deletion
- feat: Full arrow function support with lambda generation
- feat: Object rest properties in destructuring (
const {a, ...rest} = obj) - feat: Array spread in array literals (
[...arr1, ...arr2])
Fixed
- fix: C++ reserved keywords properly escaped with underscore suffix
- fix: Added missing arithmetic operators to js::any (*, /, -, %)
- fix: Fixed === operator mapping to == in C++ generation
- fix: Lambda capture issues resolved for global scope operations
- fix: Better array method detection in code generator
Enhanced
- Enhanced js::any with comprehensive operator overloads
- Improved runtime helper functions for new operators
- Better type safety in array method implementations
v0.6.0
[0.6.0] - 2025-01-08
Added
- feat: Implement exponentiation operator (**) with std::pow and automatic cmath inclusion
- feat: Add numeric separators support (1_000_000, 3.14_159, 0xFF_EC, 0b1010_0001)
- feat: Enhanced destructuring assignment with fixed duplicate declarations
- feat: Advanced spread operator support with array concatenation
- feat: Add slice() methods to js::array and js::any for rest element support
- feat: Comprehensive test suites for modern JavaScript operators
- feat: Automatic empty array type deduction (js::arrayjs::any{})
Fixed
- fix: Destructuring code generation now only in source files (no duplicates in headers)
- fix: Empty array template deduction issues resolved
- fix: Spread operator fallback to addition (now uses proper ** mapping)
- fix: Add coverage files to .gitignore (cov_profile/, coverage.lcov)
Enhanced
- enhance: Runtime library with concat() methods for array spreading
- enhance: BinaryOp type system to include exponentiation operator
- enhance: Pre-release QA process with comprehensive checks
- enhance: Code formatting and linting compliance
v0.5.3
v0.5.3
Release v0.5.3
v0.5.2
v0.5.2
Release v0.5.2
v0.5.1
v0.5.1
Release v0.5.1
v0.5.0
[0.5.0] - 2025-08-07
Fixed
- fix: Circular dependency resolution in runtime/core.h
- fix: Type inference for binary expressions generating invalid extern declarations
- fix: Test runner absolute path resolution for runtime includes
- fix: Test execution permissions with full --allow-run flag
- fix: E2E compilation issues preventing C++ code from compiling
Changed
- refactor: Restructured runtime header to define simple types before complex types
- refactor: Enhanced code generator type inference for arithmetic operations
- refactor: Project Organization - Consolidated all output into unified
.output/directory structure- Replaced 8+ scattered directories (cmake-test-output, cov_profile, etc.) with organized subdirectories
- All generated files now in
.output/{coverage,dist,docs,cmake-tests,reports}/ - Moved CMake integration tests to
tests/integration/cmake-e2e.ts - Simplified .gitignore to single
.output/entry - Added
test:cmakeDeno task for E2E pipeline testing
- chore: Updated version to 0.5.0 in deno.json
Documentation
- docs: Created comprehensive release notes for v0.2.x, v0.3.x, and v0.4.x
- docs: Updated README with current project status and achievements
- docs: Enhanced feature compatibility tables
v0.4.0: Advanced Type System with Union Types, Intersection Types, and Type Guards
v0.4.0: Advanced Type System with Union Types, Intersection Types, and Type Guards
This major release completes Phase 3 of the typescript2cxx roadmap, introducing comprehensive Advanced Type System support that brings the transpiler closer to feature parity with modern TypeScript.
🎯 Major New Features
✨ Union Types (Complete Implementation)
- Typed Wrappers:
string | number→js::typed::StringOrNumber - Nullable Types:
T | null→js::typed::Nullable<T> - Optional Types:
T | undefined→js::typed::Nullable<T> - Complex Unions: Fallback to
js::anyfor unsupported combinations - Function Parameters & Return Types: Full union type support in function signatures
- Array Support:
(string | number)[]generates correctly typed arrays - Runtime Type-Safe Wrappers: Conversion methods between union components
✨ Type Guards (Foundation Complete)
typeofOperator: Runtime implementation withjs::typeof_op()- Type Predicate Functions: Built-in guards (
is_string,is_number,is_boolean, etc.) - Nullable Type Checking: Helpers for null/undefined checks
- Runtime Infrastructure: Complete type guard system for runtime type checking
- Expression Support:
typeof value === "string"generates correct C++ conditionals
✨ Intersection Types (Basic Support)
- Interface Intersection:
A & Bcombining multiple interfaces - Primitive & Object: Smart type selection prioritizing object types over primitives
- Multiple Intersections:
X & Y & Zsupport with first-type selection - Function Parameters: Intersection types work in function signatures
- C++ Compatible: Uses first/most specific type approach for C++ compatibility
🛠️ Technical Achievements
AST Processing Improvements
- Fixed
IfStatementAST processing to use correctnode.expressionproperty - Added dedicated
TypeOfExpressionsupport in transformer pipeline - Enhanced
transformExpressionwith propertypeofoperator handling - Improved error handling for unsupported expression types
Type Resolution Enhancements
- Extended
SimpleTypeCheckerwith union/intersection type resolution - Added smart type selection algorithms for intersection types
- Enhanced type mapping from TypeScript AST to C++ types
- Improved nullable type detection and handling
Code Generation
- New typed wrapper classes in
runtime/typed_wrappers.h - Enhanced
js::typeof_op()implementation for runtime type checking - Proper C++ code generation for union/intersection type expressions
- Type-safe conversion methods between union components
🧪 Comprehensive Testing
Test Coverage
- 7 comprehensive Union Types tests (100% passing)
- 5 comprehensive Intersection Types tests (100% passing)
- 19 Exception Handling tests (95% passing - 18/19)
- Full Type System Integration tests across all major features
Quality Assurance
- All linting checks pass with Deno lint
- Code formatting enforced with Deno fmt
- Extensive test coverage for edge cases and type combinations
- Cross-platform compatibility maintained
📚 Enhanced Documentation
Updated TODO.md
- Marked all Phase 3 (v0.4.0) features as completed
- Comprehensive feature status tracking
- Updated roadmap for Phase 4 (v1.0.0) features
Runtime Library Documentation
- Complete type wrapper usage examples
- Type guard implementation details
- Union/intersection type handling patterns
🔧 Bug Fixes
Critical Fixes
- typeof Operator: Fixed
typeof value === "string"generation (was generatingjs::null) - IfStatement Processing: Corrected AST node property access (
node.expressionvsnode.test) - Type Node Resolution: Fixed LiteralType handling for null literals
- Array Union Types: Fixed ParenthesizedType unwrapping for
(string | number)[]
Type System Fixes
- Nullable type detection now correctly identifies
T | nullpatterns - Function parameter union types generate proper typed wrappers
- Array element union types work correctly with ParenthesizedType support
- Fixed critical issue where null literals weren't being recognized in SimpleTypeChecker
🎯 v0.4.0 Completion Status
✅ Phase 3 Complete - Advanced Type System
- ✅ Union Types with typed wrappers
- ✅ Type Guards with typeof operator runtime support
- ✅ Intersection Types with smart type selection
- ✅ Testing Infrastructure with end-to-end C++ compilation
- ✅ Comprehensive test coverage for all type system features
📋 What's Next - Phase 4 (v1.0.0)
- Source maps for debugging support
- Module system with ES imports/exports
- Build system integration (CMake generation)
- Advanced memory management optimizations
- Performance optimization passes
🏆 Prototype Feature Parity Progress
This release brings typescript2cxx significantly closer to the capabilities of the reference implementations:
From ASDAlexander77/TypeScript2Cxx
- ✅ TypeScript Compiler API integration
- ✅ Advanced type system support
- ✅ Runtime type checking infrastructure
- ✅ Comprehensive test coverage
From tswov/typescript2cxx
- ✅ Direct TypeScript API usage
- ✅ Advanced type resolution
- ✅ Custom error handling
- ✅ Comprehensive code generation
📊 Performance & Compatibility
- 91+ test steps passing across all major features
- Zero breaking changes to existing v0.3.0 functionality
- Backward compatible with all previous runtime library features
- Cross-platform support maintained (Linux, macOS, Windows)
Installation:
deno add @wowemulation-dev/[email protected]Breaking Changes: None
Migration from v0.3.0: No changes required - v0.4.0 is fully backward compatible
🤖 Generated with Claude Code
Co-Authored-By: Claude [email protected]
v0.3.0
[0.3.0] - 2025-08-06
Added - Comprehensive JavaScript Runtime Library
Core Runtime Types
- feat: Complete js::string implementation - 30+ methods including charAt, slice, split, replace, trim, toUpperCase, toLowerCase, indexOf, etc.
- feat: Enhanced js::number - IEEE 754 double with NaN, Infinity constants, formatting methods
- feat: Full js::array implementation - forEach, map, filter, reduce, find, findIndex, includes, join, push, pop, slice, splice, etc.
- feat: js::object with prototype chain - Dynamic property access and inheritance support
- feat: js::any with std::variant - Dynamic typing system for mixed-type operations
Standard JavaScript Objects
- feat: Complete Math object - PI, E, abs, max, min, random, sin, cos, tan, sqrt, pow, floor, ceil, round, etc.
- feat: Full Date implementation - now, getFullYear, getMonth, getDate, toString, toISOString, getTime, etc.
- feat: RegExp object - Regular expression support with test, exec methods and flag handling
- feat: Enhanced console object - log, error, warn, info, debug, trace methods with proper formatting
- feat: JSON object - stringify and parse methods for object serialization
Global Functions & Utilities
- feat: Type parsing functions - parseInt with radix support (2-36), parseFloat with proper validation
- feat: Validation functions - isNaN, isFinite for number validation
- feat: URI functions - encodeURI, decodeURI, encodeURIComponent, decodeURIComponent
- feat: Type conversion utilities - Comprehensive JavaScript-to-C++ type mapping
Error System
- feat: Complete Error hierarchy - Error, TypeError, ReferenceError, SyntaxError, RangeError classes
- feat: Stack trace support - Error objects include message and stack information
- feat: Exception handling - Proper C++ exception integration for JavaScript errors
Code Generation Enhancements
- feat: Enhanced type mapping - Map Date, RegExp, Promise, Array to appropriate C++ types
- feat: Global identifier mapping - Math, Date, JSON, console mapped to js:: namespace
- feat: Improved literal generation - Proper handling of NaN, Infinity, null, undefined
- feat: Member access generation - Static method calls for Math::PI, Date::now, etc.
- feat: Template literal improvements - Better string interpolation and concatenation
Memory Management
- feat: Smart pointer optimization - js:: runtime types exclude smart pointer wrapping
- feat: Efficient object allocation - Optimized memory patterns for JavaScript objects
- feat: Reference counting - Proper cleanup for complex object relationships
Testing & Quality
- feat: Comprehensive test suite - 30+ test cases covering all runtime features
- feat: Runtime verification - Tests for string, number, array, object operations
- feat: Integration tests - Full transpilation pipeline testing with runtime features
Changed
- BREAKING: Enhanced runtime library with 1000+ lines of new C++ code
- BREAKING: Updated all type mappings to use comprehensive js:: runtime types
- refactor: Code generator now properly handles JavaScript standard objects
- refactor: Improved identifier mapping for built-in JavaScript globals
- refactor: Enhanced literal generation for JavaScript special values
- refactor: Member access generation supports static method calls
Fixed
- fix: Method call generation issues for string and array methods
- fix: NaN and Infinity literal generation
- fix: Math, Date, JSON static method access
- fix: Error constructor generation
- fix: Template literal interpolation with proper escaping
- fix: Object property access with dynamic keys
Performance
- perf: Optimized string operations with efficient C++ implementations
- perf: Fast array methods using modern C++ algorithms
- perf: Efficient object property access with hash maps
- perf: Memory-efficient type conversion utilities
Documentation
- docs: Updated README with comprehensive v0.3.0 runtime features
- docs: Added runtime library documentation with all available methods
- docs: Enhanced examples showcasing JavaScript runtime capabilities
- docs: Updated type mapping tables with new runtime types
Notes
This is a major release that implements a complete JavaScript runtime environment
in C++. The transpiler can now handle complex JavaScript operations including:
- Advanced string manipulation and parsing
- Full array processing with functional programming methods
- Mathematical computations with the complete Math object
- Date/time operations with timezone support
- Regular expression pattern matching
- JSON serialization and deserialization
- Comprehensive error handling and exceptions
- Dynamic typing with proper type conversions
The runtime library provides over 100 JavaScript methods and functions, making
it possible to transpile sophisticated JavaScript/TypeScript code while
maintaining full semantic compatibility.
v0.1.7
[0.1.7] - 2025-08-06
Fixed
- fix: Documentation formatting issues preventing JSR.io publish
- fix: Escaped JSDoc comments in code examples
- fix: Changed glob pattern example to avoid formatter errors
Notes
This release fixes documentation formatting that was preventing the package
from publishing to JSR.io. All QA checks now pass.
v0.1.6
[0.1.6] - 2025-08-06
Documentation
- docs: Enhanced module documentation for better JSR.io score
- docs: Added comprehensive JSDoc comments to all exported functions
- docs: Added usage examples and feature descriptions
- docs: Documented CLI module with installation and usage instructions
Notes
This release improves documentation to achieve a better JSR.io package score.
No functional changes.