diff --git a/.changeset/plugin-type-tsdoc-objectql.md b/.changeset/plugin-type-tsdoc-objectql.md new file mode 100644 index 0000000000..07ec42fac1 --- /dev/null +++ b/.changeset/plugin-type-tsdoc-objectql.md @@ -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. diff --git a/content/docs/plugins/anatomy.mdx b/content/docs/plugins/anatomy.mdx index 5dd05e46c0..3a63c34a47 100644 --- a/content/docs/plugins/anatomy.mdx +++ b/content/docs/plugins/anatomy.mdx @@ -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; diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 68238876fd..bff73a9ee5 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -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;