dox_builder 3.2.2
dox_builder: ^3.2.2 copied to clipboard
Dox builder for dox framework
dox_builder #
Code generator for Dox apps. It runs with build_runner.
Part of Dox, a web backend framework for Dart. Source code: github.com/dartondox/dox.
Install #
Add it as a dev dependency. A new app made with dox create already has it.
dart pub add dev:dox_builder dev:build_runner
To see what is ready and what may still change, read Status and roadmap.
How it is used #
You do not call this package from your code. Run the generator:
dart run build_runner build # or: dox build_runner:build
dart run build_runner watch # or: dox build_runner:watch
It writes:
- The
.g.dartpart of each@DoxModelmodel (the<Name>Generatorclass). - The
.g.dartpart of each@Dtoclass ($<Name>Dto, the checks and the JSON Schema). - The
.g.dartpart of the@DoxEnvenv class. lib/generated/container.g.dart: every@Inject()class, router, provider and model binder, forAppConfig(container: registerContainer).lib/generated/dtos.g.dart: every DTO of the app, forAppConfig(dtos: dtos). An app with no DTO gets an empty list.lib/generated/openapi.g.dart: the OpenAPI docs, read from the routes, controllers, DTOs and models.lib/generated/jobs.g.dart: every@Job()class, forQueueConfig(jobs: jobRegistry)of dox_queue. It also lists the mail jobs of dox_mailer when the app uses it. Only in an app with dox_queue in itspubspec.yaml.
A bad DTO (a field that is not final, a type that is not supported, a bad regex) stops the build with a clear error.
Documentation #
License #
MIT. See LICENSE.