specta-rs/tauri-specta — reverse-engineered prompt
Reverse engineered prompt
Build me a small Rust library for Tauri that makes app commands fully type safe between the Rust backend and the frontend. I want developers to define their Tauri commands once in Rust, then automatically generate matching frontend types so calling those commands from the UI feels safe and autocomplete friendly.
It should support the current Tauri v2 and Specta v2 flow, and include support for generating types for events too. Please include a simple example app that shows a few commands and events working end to end, with instructions for running it locally using pnpm and Tauri dev.
Keep the public API clean and developer friendly. Add tests for the Rust side, and make sure the generated types are written somewhere predictable for the frontend to import. Look up the current Tauri and Specta docs online if you need to.
Want more depth? Deep Reverse