vanestack_generator 0.1.1+2
vanestack_generator: ^0.1.1+2 copied to clipboard
Code generator for VaneStack - generates route handlers and client SDK metadata.
vanestack_generator
Code generator for the VaneStack Dart backend framework.
This package is a build_runner builder that reads @Route annotations from your VaneStack server and generates:
routes.dart— Type-safe route handlers with request parsing, auth checks, and error handlingroutes_info.dart— Route metadata used by thegeneratecommand to produce the client SDK
Setup #
Add as a dev dependency alongside build_runner:
dev_dependencies:
build_runner: ^2.10.2
vanestack_generator: # see pub.dev for latest version
Usage #
dart run build_runner build
The generator automatically runs on the root package (via auto_apply: root_package). No build.yaml configuration is needed in your project.
How It Works #
- Scans all
.dartfiles for functions annotated with@Route - Generates wrapper handlers that parse path/body/query parameters, check auth, and handle errors
- Produces a
registerRoutes()function that wires all handlers into a Shelf router - Outputs route metadata for client SDK generation
Related Packages #
| Package | Description |
|---|---|
| vanestack | Server framework |
| vanestack_annotation | @Route annotation and HttpMethod enum |
| vanestack_common | Shared models and types |
| vanestack_client | Generated HTTP client SDK |