feat(CLI Tool): #3591700 Support `content-entity-reference` props in CLI and Workbench
- adds support for content-entity-reference props in CLI push and pull commands
- adds support for content-entity-reference props in eslint-config and CLI validate command
- adds support for content-entity-reference props previews in Workbench
- adds
/canvas/api/v0/ui/content-entity-reference/preview/{entity_type}/{entity}endpoint for providing resolved entityFields expressions against the entity selected for preview - expands CLI
agents-contextcommand to provide context for ai agents to work with content-entity-reference-props
AI-Generated: Yes (Used Codex CLI to iterate over the implementation).
Testing instructions
-
npm run build -w @drupal-canvas/cli -
npm run build -w @drupal-canvas/workbench -
npm link --workspaces - create a test project with
npx @drupal-canvas/create -t https://github.com/wotnak/nebula.git -r cer-props- the branch includes skill updates for working with content-entity-reference props -
npm link drupal-canvas @drupal-canvas/cli @drupal-canvas/workbench - prompt ai agent to create a component with props referencing content entities, for example
create component showing selected featured articles(assuming the configured drupal site has article nodes) - verify that created component has a content-entity-reference prop
- open Workbench
npx canvas-workbenchand verify that previews for created component work and the entity used for the preview can be selected - verify that the component passes validation and can be pushed to the site
npx canvas push -y - add the component to a page and save changes
-
npx canvas pull -yand verify pulled page includes the cer prop and preview for it is working in Workbench - verify the same for content templates and global regions
- prompt ai agent to create a new page with the new component and verify that the content-entity-reference prop is correctly added to the page
Closes #3591700
Edited by wotnak