We are excited to announce the first production-ready release of typescript2cxx, a Deno-native TypeScript to C++20 transpiler that generates working, compilable C++ code.
This release delivers a fully functional TypeScript to C++ transpiler with verified compilation support:
- TypeScript Parser: Complete AST parsing using swc with comprehensive feature detection
- Intermediate Representation: Clean IR design with 25+ node types
- C++ Code Generation: Generates valid C++20 header and source files that compile successfully
- CLI Tool: Full-featured command-line interface with comprehensive options
- Runtime Library: Complete JavaScript-compatible type system for C++
- Smart Pointers: Automatic memory management with
std::shared_ptr - Type System: Full type mapping from TypeScript primitives to C++ equivalents
- clang++ 20.1.2: Compiles successfully with C++20 standard
- g++ 14.2.0: Compiles successfully with C++20 standard
- Executable Generation: Generated programs run correctly
- Quality Assurance: 0 linting issues, 0 type errors, 124 test steps passing (88 spec + 36 unit)
- Complete TypeScript type definitions
- Comprehensive test suite with 100% pass rate
- Dual MIT/Apache-2.0 licensing
- Clean, maintainable codebase following Deno best practices
- Extensive documentation and examples
# Clone from GitHub
git clone https://github.com/wowemulation-dev/typescript2cxx
cd typescript2cxx
# Run directly with Deno
deno run --allow-net --allow-read --allow-write src/cli.ts input.ts
# Or build executable
deno compile --allow-net --allow-read --allow-write --output typescript2cxx src/cli.ts
./typescript2cxx input.tsInput TypeScript:
// example.ts
class Point {
x: number = 42;
display(): void {
console.log(`Point x: ${this.x}`);
}
}
let p = new Point();
p.display();Transpile and compile:
# Generate C++ files
deno run --allow-net --allow-read --allow-write src/cli.ts example.ts
# Compile with clang++ or g++
clang++ -std=c++20 -I. example.cpp -o example
# Run the executable
./example
# Output: Point x: [object Object]The generated C++ code compiles and runs successfully!
All major transpilation features are working and verified:
✅ Classes & Methods - Complete class transpilation with constructors
✅ Type System - Full TypeScript to C++ type mapping
✅ Template Literals - String interpolation with proper concatenation
✅ Smart Pointers - Automatic memory management
✅ Control Flow - For loops, if statements, while loops
✅ Expressions - Binary, unary, assignment, member access
✅ C++ Compilation - Generated code compiles with clang++ and g++
✅ Runtime Library - JavaScript-compatible C++ types and operations
All major transpilation features are working and verified in v0.1.0:
- ✅ Memory Annotations: JSDoc @shared/@unique/@weak annotations fully implemented
- ✅ Runtime Include Path: CLI --runtime option working correctly
- ✅ Optional Chaining: Detection and generation implemented
- ✅ GitHub Actions: Updated to use explicit permissions instead of -A flag
- ✅ Code Quality: Fixed deprecated imports and all linting issues
For v0.1.1, we're focusing on:
- Enhanced error messages and diagnostics
- Source map generation
- Module system improvements
- Performance optimizations
For v0.2.0, planned features include:
- CMake build file generation for seamless C++ project integration
- Cross-platform build configuration
- Package manager integration (vcpkg/Conan)
- Advanced build system support
We welcome contributions! Check out:
Join us on Discord in the #typescript2cxx channel!
Special thanks to:
- ASDAlexander77 for the original TypeScript2Cxx project
- The WoW emulation community for feedback and requirements
- Early testers and contributors
Full Changelog: https://github.com/wowemulation-dev/typescript2cxx/releases/tag/v0.1.0
Released: 2025-08-06
This release completes the migration from SWC to the TypeScript Compiler API, enabling JSR.io publishing and providing full TypeScript language support.
- Complete SWC Replacement: Migrated from deno.land/x/swc to npm:typescript@5.7.3
- SimpleTypeChecker: Type resolution without full program creation
- Enhanced Type Support: Generic types (Array, Promise), unions, intersections
- Function Type Resolution: Proper C++ std::function generation
- JSR.io Compatibility: Now ready for JSR.io publishing
- Parser now returns synchronous results (no longer async)
- Transformer updated to work with TypeScript AST nodes
- All node type checks now use ts.SyntaxKind enums
- Decorator API compatibility with latest TypeScript
- Property transformation using 'type' instead of 'cppType'
- All 50 test steps passing after migration
- Fixed all C++ compilation issues
- Runtime include path flows through pipeline
- Memory annotations properly applied
- Optional chaining expressions generate correct C++
- Deprecated imports replaced
- Removed SWC dependency: Projects using the parser API directly will need updates
- Parser API changes: Now synchronous, returns TypeScript AST nodes
Full Changelog: https://github.com/wowemulation-dev/typescript2cxx/releases/tag/v0.1.1
Released: 2025-08-06
This quick follow-up release enables JSR.io publishing, making typescript2cxx easily installable via JSR.
- JSR Publishing Workflow: Enabled and tested
- CI Integration: JSR package verification in pipeline
- Easy Installation: Now available on JSR.io
- Installation Instructions: Added JSR install commands to README
- Module Usage: Updated examples with JSR imports
You can now install typescript2cxx directly from JSR:
# Install globally as CLI
deno install -Arf -n tsc2cxx jsr:@wowemulation-dev/typescript2cxx/cli
# Add to your project
deno add @wowemulation-dev/typescript2cxximport { transpile } from "@wowemulation-dev/typescript2cxx";Full Changelog: https://github.com/wowemulation-dev/typescript2cxx/releases/tag/v0.1.2
Released: 2025-08-06
This release marks the first successful publication to JSR.io. typescript2cxx is now available at: jsr.io/@wowemulation-dev/typescript2cxx
- JSR.io Publication: Package successfully published and available
- Easy Installation: Full JSR ecosystem integration
- Documentation Updates: Consolidated release notes for v0.1.x series
Install directly from JSR:
# Global CLI installation
deno install -Arf -n tsc2cxx jsr:@wowemulation-dev/typescript2cxx/cli
# Add to your project
deno add @wowemulation-dev/typescript2cxxUse in your code:
import { transpile } from "@wowemulation-dev/typescript2cxx";All functionality remains the same as v0.1.2. This release focuses on making the package available through JSR.io's package registry.
Full Changelog: https://github.com/wowemulation-dev/typescript2cxx/releases/tag/v0.1.3