Generated plugin docs mix tenant-scoped and unscoped setup
Steps to reproduce
- On current
main, runpnpm generate:docs:all. - Inspect any generated
docs/plugins/*/overview.mdxpage. The setup creates Corsair withoutmultiTenancy: true, but the examples later callcorsair.withTenant(...). - Inspect generated
api.mdxanddatabase.mdxpages. They callcorsair.<plugin>.apiandcorsair.<plugin>.dbdirectly, which conflicts with the tenant-scoped usage shown in the overview. - Inspect a generated webhook example. It creates a configured plugin instance as a standalone expression after
createCorsair(...), so that configured instance is not registered in the client'spluginsarray.
On the current tracked documentation this affects all 207 overview pages that use withTenant, 181 database pages, 207 API pages, and the generated webhook examples for plugins that expose them.
Expected behavior
Generated examples should describe one internally consistent setup:
- setup enables
multiTenancy: truebefore callingwithTenant; - API and database examples use the tenant-scoped client; and
- webhook configuration is registered in the
pluginsarray while preserving any auth or factory options already shown in setup.
The docs validator should also catch regressions in those invariants.
Corsair version
Current main (291ac57a)
Environment details
OS: Windows 11
Node: 22.x
Package manager: pnpm 10.xWhat part of Corsair is affected?
Documentation
Anything else
I found this while addressing the Google Sheets examples in #1252 / #1483. It predates that work and is generator-wide, so it should be fixed separately rather than expanding the plugin-scoped pull request.
I have locally verified a possible direction against all 260 generated plugin docs: update the generator and documentation contract, add validation for the tenant/setup relationship and direct API/database calls, and regenerate only the intended tracked outputs in a reviewable follow-up.
Source: corsairdev/corsair