crouter
Plugin

Plugin overview

Expose application operations as native crtr commands with a typed HTTP plugin.

Authoring crtr HTTP plugins

@north-light/crouter-plugin turns one TypeScript command tree into both a Fetch handler and the archive accepted by crtr pkg plugin install --endpoint. Use it when an application should expose typed operations as native crtr commands without maintaining commands.json or a separate HTTP route definition.

Start with the package README for a complete plugin that a developer can paste into an empty file. Then read the page that matches the work at hand:

The package exports only LeafError, ManifestInvalidError, PluginDefinitionError, buildBundle, buildCommandManifest, createFetchHandler, defineBranch, defineLeaf, definePlugin, defineStreamingLeaf, field, kebab, and param. Those are the complete authoring surface.