typewriter v0.5.2 introduced a dynamic plugin architecture. In v1.0.0 this remains experimental : local plugin loading is available, but there is no plugin add command, registry marketplace, or stable community plugin ABI.
Plugin authors implement the EmitterPlugin trait from the typewriter-plugin crate
Plugins are compiled as shared libraries (.so / .dylib / .dll)
The CLI dynamically loads plugins at startup via libloading
Plugins provide TypeMapper implementations just like built-in emitters
┌─────────────────┐ ┌──────────────────┐
│ typebridge CLI │──────▶│ PluginRegistry │
└─────────────────┘ └────────┬─────────┘
│
┌──────────────┼──────────────┐
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ Ruby │ │ PHP │ │ Dart │
│ .so/.dll│ │ .so/.dll│ │ .so/.dll│
└──────────┘ └──────────┘ └──────────┘
Component Crate Purpose
EmitterPlugin traittypewriter-pluginInterface for plugin implementations
declare_plugin! macrotypewriter-pluginGenerates C ABI entry points
PluginRegistrytypewriter-engineLoads and manages plugins
PluginConfigtypewriter-pluginPlugin-specific config from TOML
Plugin Language ID Extension Description
typewriter-plugin-rubyruby.rbiSorbet type signatures
typewriter-plugin-phpphp.phpPHP 8.1+ readonly classes
typewriter-plugin-dartdart.dartjson_serializable classes
CLI only — plugins are loaded at CLI startup, not during cargo build proc-macro expansion
No hot reload — plugins are loaded once; restart CLI after changes
ABI versioning — plugins must match PLUGIN_API_VERSION, and the ABI is not stable in v1.0.0