feat(plugins): Add unified plugin registrations#457
Conversation
Let apps define one plugin set and pass it to both Nitro and createApp. Manifest-only plugins use package-name strings, while trusted plugins carry inline manifests and hooks from app code. Remove split YAML registration for trusted hooks and move GitHub and Scheduler to JavaScript plugin definitions. This keeps trusted runtime behavior explicit without forcing manifest-only packages to write unused code. Fixes GH-453 Co-Authored-By: GPT-5 Codex <codex@openai.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Let juniorNitro point at a runtime-safe plugin module so apps only declare enabled plugins once. createApp now reads that module through #junior/config while preserving explicit package enablement. This keeps trusted hook functions available at runtime without importing nitro.config.ts into the server bundle. Refs GH-453 Co-Authored-By: GPT-5 Codex <codex@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 08f141b. Configure here.
| nitro.options.virtual["#junior/config"] = async () => { | ||
| if (!options.loadPluginSet) { | ||
| return renderVirtualConfig(options); | ||
| } |
There was a problem hiding this comment.
Nitro inline set drops hooks
Medium Severity
Passing a defineJuniorPlugins(...) object directly to juniorNitro({ plugins }) emits a virtual config with catalog JSON and trusted plugin names but leaves pluginSet undefined. createApp() without plugins then loads no trusted registrations while validation still expects names bundled at build time, so boot fails for trusted plugins unless the same set is passed again to createApp.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 08f141b. Configure here.


Adds explicit plugin sets as the single enablement gate for Junior plugins. Installing a package is not enough; package content is discovered only when a package name or trusted factory is listed in
defineJuniorPlugins(...). Nitro now injects that enabled set through#junior/config, so the server entry no longer repeats the declaration.Before
Trusted plugins had to split metadata and hooks, and apps had separate build/runtime declarations:
The first unification pass made that safer, but still required wiring the same set twice:
After
Apps export one runtime-safe plugin set and point Nitro at that module.
createApp()reads the same enabled set from Nitro's virtual module:Trusted Plugins
GitHub and Scheduler now provide JavaScript registrations with inline manifests and trusted hooks. Manifest-only packages remain package-name strings. The separate
plugins.tsmodule stays intentional because trusted hooks are live functions; importingnitro.config.tsat runtime would pull build config into the server bundle, and serializing hooks is not viable.junior check, docs, package READMEs, generated API reference, and specs now point users at the explicitdefineJuniorPlugins(...)path instead of the removedpluginPackages/plugins.packagesshapes. Validated locally withpnpm typecheck,pnpm --filter @sentry/junior test,pnpm docs:check,pnpm skills:check,pnpm release:check, andpnpm --filter @sentry/junior-example exec nitro build.Fixes GH-453