The CWA is in heavy development
The CWA is still in alpha and not ready for production - some code and implementations are likely to change. If you would like to try out the CWA, please enjoy what we have provided and feel free to provide feedback, or get involved on GitHub.
DraftBuilding Your Ui

cwa make:component

Scaffold a new CWA display component from the command line — generates the Vue file with the correct useCwaComponent boilerplate and prints the matching API command.

cwa make:component is an interactive CLI that scaffolds a CWA component. It creates the Vue display file and prints the PHP command to generate the matching API entity.

npx cwa make:component

If @cwa/nuxt is listed as a dependency in your project, you can also run:

cwa make:component

Prompts

Component name

A PascalCase identifier. This becomes the file name and directory name.

Component name (PascalCase, e.g. BlogPost): HeroBlock

Output path: app/cwa/components/HeroBlock/HeroBlock.vue

Component type

Selects which built-in plugin to wire up:

ChoicePluginUse when
BasicnonePlain data display
ImagewithImage()Entity has #[Uploadable] (file/image)
CollectionwithCollection()Entity extends or wraps a collection

API behaviours

Three yes/no prompts that control flags passed to make:api-component:

PromptFlagWhat it adds
--timestamped--timestampedcreatedAt / updatedAt columns
--publishable--publishableDraft / publish lifecycle
--uploadable--uploadableFile upload field (defaults to yes for Image type)

What gets generated

The Vue file is written to app/cwa/components/<Name>/<Name>.vue. The script block is pre-wired to useCwaComponent based on the chosen type:

<template>
  <!-- TODO: add your template -->
</template>

<script setup lang="ts">
import type { IriProp } from '#cwa/composables/cwa-resource'

const props = defineProps<IriProp>()
const { resource, exposeMeta } = useCwaComponent(props)
defineExpose(exposeMeta)
</script>

Next steps printed after generation

After writing the file, the CLI prints two reminders:

1. Create the API entity — run in your API project:

php bin/console make:api-component HeroBlock --timestamped --publishable

2. Register in nuxt.config.ts — add the component type under cwa.resources:

// nuxt.config.ts
export default defineNuxtConfig({
  cwa: {
    resources: {
      HeroBlock: {
        name: 'Hero Block',
        description: 'Full-width hero with headline and CTA'
      }
    }
  }
})

What the CLI does not generate

  • The admin editing tab (admin/<Name>.vue) — write this manually following the Your First Component guide
  • The nuxt.config entry — printed as a reminder but not written automatically