Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .changeset/plugin-type-tsdoc-objectql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@objectstack/core": patch
---

docs(core): correct `Plugin.type`'s TSDoc enumeration — it omitted `objectql` (#13762)

`Plugin.type` is typed `string` in `@objectstack/core`, so its TSDoc is the only
enumeration a plugin author reading the interface ever sees; nothing type-checks
them against it. That comment listed seven values while the declared set is
eight: `PluginSchema.type` in `@objectstack/spec` is
`z.enum(['standard', ...CORE_PLUGIN_TYPES])`, and `CORE_PLUGIN_TYPES` carries
`objectql` — the type `packages/objectql/src/plugin.ts` declares on the engine
plugin essentially every runtime loads first.

The comment now lists all eight and names `CORE_PLUGIN_TYPES` as the
authoritative set. The same omission in the hand-written
`content/docs/plugins/anatomy.mdx` transcription of this interface is corrected
in the same change.
2 changes: 1 addition & 1 deletion content/docs/plugins/anatomy.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export interface Plugin {

/**
* Plugin Type (Optional)
* One of: standard, ui, driver, server, app, theme, agent.
* One of: standard, ui, driver, server, app, theme, agent, objectql.
* @default 'standard'
*/
type?: string;
Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ export interface Plugin {
version?: string;

/**
* Plugin type (standard, ui, driver, server, app, theme, agent)
* Plugin type (standard, ui, driver, server, app, theme, agent, objectql)
*
* Authoritative set: `CORE_PLUGIN_TYPES` in `@objectstack/spec`
* (`kernel/plugin.zod.ts`), which `PluginSchema.type` enumerates as
* `z.enum(['standard', ...CORE_PLUGIN_TYPES])`. This field is typed
* `string`, so nothing type-checks an author against the list above —
* keep the two in step when the declared set changes.
* @default 'standard'
*/
type?: string;
Expand Down
Loading