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:

  • onBuildStart
  • onBuildEnd
  • onDevStart
  • onAgentsMdGenerate
  • onJobsCollect

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:

  • deployTarget
  • deploy(artifacts, ctx)

The patties deploy command selects from installed deploy plugins whose target matches the active build target.

Patties documentation · Licensed under MIT. · Design specs