@drzl/template-orpc-service
v1.1.0
Published
<div align="center">
Readme
@drzl/template-orpc-service
oRPC router template wired to the generated Service layer.
💚 Sponsor DRZL
DRZL is crafted nights & weekends. Sponsorships keep the generators fast, tested, and free.
- Every dollar speeds up CI hardware and offsets long test runs on my aging laptop.
- Sponsors get roadmap input and priority responses in GitHub Issues.
- Prefer a quick overview? Check
docs/sponsor.mdfor the current goals and thank-yous.
Use
Reference from the oRPC generator:
generators: [
{
kind: 'orpc',
template: '@drzl/template-orpc-service',
validation: { library: 'valibot' },
databaseInjection: {
enabled: true,
databaseType: 'Database',
databaseTypeImport: { name: 'Database', from: 'src/db/db' },
},
servicesDir: 'src/services',
},
];Hooks (template API)
- filePath(table, ctx)
- routerName(table, ctx)
- procedures(table)
- imports?(tables, ctx)
- header?(table)
When databaseInjection.enabled is true, the template emits a dbMiddleware and expects context.db to be provided by your runtime (e.g., Cloudflare Workers via D1).
