Plugins
Patties includes a plugin system for build, dev, routing, middleware, jobs, and deployment.
Base plugin contract
A plugin has:
name- optional
compat - optional
setup(server, ctx) - optional
hooks
Use definePlugin() to author plugins and let Patties validate that the plugin has a name.
Setup capabilities
setup() receives a PluginServer that can:
- register routes with
route(pattern, methods) - add middleware with
use(middleware)
Hooks
Supported hooks:
onBuildStartonBuildEndonDevStartonAgentsMdGenerateonJobsCollect
Compatibility
If a plugin provides a compat semver range, Patties checks it against the framework version using Bun.semver.satisfies() when available.
Deploy plugins
Deploy plugins extend the base plugin shape with:
deployTargetdeploy(artifacts, ctx)
The patties deploy command selects from installed deploy plugins whose target matches the active build target.