The new discovery mechanism for code components used by @drupal-canvas/cli supports to different naming styles:

index-style component

src/components/hero/
  index.tsx
  component.yml

named component

src/
  card.tsx
  card.component.yml

Both work well in Workbench, but the push commands behaves incorrectly when the named component style is used in a codebase: It overrides all components in Canvas with the first one it founds.

Codebase to reproduce:

npx @drupal-canvas/create@latest --template https://github.com/balintbrews/canvas-starter.git --ref a34b580bc3339e7a5b15e212a0fe4dcf799863fc

Issue fork canvas-3580749

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

balintbrews created an issue. See original summary.

balintbrews’s picture

Priority: Critical » Normal

Reducing priority to Normal, because both templates in Drupal Canvas Create use the index-style naming, and also all Canvas agentic skills are written for that style.

nagwani’s picture

Issue tags: +triaged
balintbrews’s picture

Assigned: Unassigned » balintbrews

balintbrews’s picture

Assigned: balintbrews » Unassigned
Status: Active » Closed (outdated)
Related issues: +#3588661: Make CLI builds use shared Vite infrastructure

I fixed this while working on #3588661: Make CLI builds use shared Vite infrastructure, and apparently didn't manage to separate the fix from that branch.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.