Skip to content

Docs: document plugin registry generation step for create-sonicjs users #621

@lane711

Description

@lane711

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:

  1. Generate the plugin registry via generate-plugin-registry.mjs, or
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions