componentRegistry/handler
Esta página aún no está disponible en tu idioma.
Variables
Section titled “Variables”componentRegistryHandler
Section titled “componentRegistryHandler”const componentRegistryHandler: HookUtility<"astro:config:setup", [componentRegistryHandlerOptions], Promise<any>>;
Defined in: studiocms/packages/studiocms/src/componentRegistry/handler.ts:41^
Handles the setup and registration of components in the StudioCMS component registry during the Astro config setup phase.
This utility:
- Logs the start and progress of the registry setup.
- Iterates over the provided component registry, validating and resolving component paths.
- Registers valid
.astro
components in the registry. - Extracts and maps component props for all registered components.
- Adds virtual imports for component keys, props, and runtime exports.
The Astro integration setup parameters, including logger and config.
Options for the handler, including the component registry, verbosity, and registry name.
Returns
Section titled “Returns”An asynchronous effect that sets up the component registry and provides virtual imports for use in the project.
Remarks
Section titled “Remarks”- Only components with string values ending in
.astro
are registered. - Component keys are normalized to lowercase and hyphens are converted to underscores for safe usage.
- Virtual imports are added for both the registry and its runtime.