Saltearse al contenido

pluginHandler

Esta página aún no está disponible en tu idioma.

const defaultPlugin: StudioCMSPlugin;

Defined in: studiocms/packages/studiocms/src/pluginHandler.ts:44^

Default StudioCMS Plugin

NOTE - Internal use only

The default StudioCMS Plugin that comes with StudioCMS.

The StudioCMS Docs^ for more information on how to use StudioCMS.


const pluginHandler: HookUtility<"astro:config:setup", [Options], Promise<{
extraRoutes: Route[];
integrations: {
integration: AstroIntegration;
}[];
messages: Messages;
oAuthProvidersConfigured: boolean;
safePluginList: {
frontendNavigationLinks: {
href: string;
label: string;
}[];
identifier: string;
name: string;
pageTypes: {
apiEndpoint: string;
description: string;
fields: (... | ... | ... | ... | ... | ...)[];
identifier: string;
label: string;
pageContentComponent: string;
rendererComponent: string;
}[];
settingsPage: {
endpoint: string;
fields: (
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultChecked: ... | ... | ...;
input: "checkbox";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
size: ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "input";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ... | ... | ... | ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "textarea";
label: string;
name: string;
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
color: ... | ... | ... | ... | ... | ... | ...;
defaultValue: ... | ...;
direction: ... | ... | ...;
input: "radio";
label: string;
name: string;
options: ...[];
readOnly: ... | ... | ...;
required: ... | ... | ...;
}
| {
defaultValue: ... | ...;
input: "select";
label: string;
name: string;
options: ...[];
placeholder: ... | ...;
readOnly: ... | ... | ...;
required: ... | ... | ...;
type: ... | ... | ...;
}
| {
alignCenter: ... | ... | ...;
fields: ...[];
gapSize: ... | ... | ... | ...;
input: "row";
label: string;
name: string;
readOnly: ... | ... | ...;
required: ... | ... | ...;
})[];
};
}[];
}>>;

Defined in: studiocms/packages/studiocms/src/pluginHandler.ts:211^

Handles the setup and configuration of StudioCMS plugins during the Astro build process.

This utility function is registered for the astro:config:setup hook and is responsible for:

  • Initializing and validating StudioCMS plugins, including checking minimum version requirements.
  • Collecting integrations, dashboard grid items, dashboard pages, plugin endpoints, renderers, image services, and other plugin-related data.
  • Invoking plugin hooks (studiocms:astro:config, studiocms:config:setup) to allow plugins to register their features and integrations.
  • Setting up virtual imports for plugin components, endpoints, renderers, and image services for use in the StudioCMS dashboard and editor.
  • Managing sitemap and robots.txt integrations based on plugin and configuration options.
  • Verifying plugin dependencies and requirements.
  • Logging information about installed plugins and their configuration.

Parameters provided by Astro during the config setup phase, including the logger.

StudioCMS configuration options, including plugins, dashboard route, robots.txt config, and other settings.

An object containing:

  • integrations: Array of Astro integrations to be registered.
  • extraRoutes: Additional routes to be injected into the Astro app (e.g., dashboard plugin pages).
  • safePluginList: List of validated and processed plugins with their safe configuration data.
  • messages: Informational messages about the plugin setup process.

If a plugin specifies an invalid minimum version requirement or if no rendering plugins are found.

If no rendering plugins are installed.