Problem
Users who scaffold a new project via npx create-sonicjs my-app are not aware that plugins won't be picked up unless the plugin registry is generated or routes are manually mounted.
This came up in Discord — a user couldn't get plugins working because neither the plugin development docs nor the default template mention the required setup step.
What's missing
Plugins require one of the following to work:
- Generate the plugin registry via
generate-plugin-registry.mjs, or
- Manually mount plugin routes in
src/index.ts:
// Mount plugin routes
if (contactFormPlugin.routes) {
for (const route of contactFormPlugin.routes) {
app.route(route.path, route.handler)
}
}
// Mount core app last
app.route('/', coreApp)
Suggested fix
- Add a clear callout in the plugin development docs explaining the registry generation step
- Update the
create-sonicjs template or its README to mention this requirement
- Consider adding a note in the getting started guide for plugin consumers
Source
Discord community feedback.
Problem
Users who scaffold a new project via
npx create-sonicjs my-appare not aware that plugins won't be picked up unless the plugin registry is generated or routes are manually mounted.This came up in Discord — a user couldn't get plugins working because neither the plugin development docs nor the default template mention the required setup step.
What's missing
Plugins require one of the following to work:
generate-plugin-registry.mjs, orsrc/index.ts:Suggested fix
create-sonicjstemplate or its README to mention this requirementSource
Discord community feedback.