What problem does it solve?
Provides a repeatable workflow for creating, copying, and integrating React components into a Drupal Canvas codebase so developers avoid inconsistent implementations, missing dependencies, and incomplete preview coverage.
Core Features & Use Cases
- Example-driven component creation: Start from a matching example in examples/components and copy it into src/components to preserve conventions and metadata.
- Recursive dependency resolution: Analyze imports to discover nested @/components dependencies and copy only the missing components without overwriting existing ones.
- Structure and preview enforcement: Ensure each component folder contains both index.jsx and component.yml and maintain or author mocks.json to preserve Workbench preview coverage; run validation before marking work complete.
- Use Cases: Adding a new UI element from an example, migrating examples into production components, or assembling complex components composed of nested examples.
Quick Start
Copy a similar example from examples/components into src/components, update the copied index.jsx and component.yml, ensure mocks.json provides preview states if needed, and run component validation.