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

Aperta
#621 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
50/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, typescript

Direzione di ricerca

Start by reading generate-plugin-registry.mjs to confirm what the registry step does, then find the plugin development docs and the create-sonicjs template README, which the issue says never mention it. The manual route-mounting snippet for src/index.ts is a second option to document. Done means a clear callout in the plugin docs and a note in the template README or getting-started guide explaining when the registry must be generated or routes mounted.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: documentation documentation priority: P2

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.

Lingua principale
TypeScript
Stelle
1.8k
Fork
219
Merge medio
2g 21h
PR unite (30g)
67

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di SonicJs-Org/sonicjs

Tutte le issue di SonicJs-Org/sonicjs

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.