Showcase plugin
The showcase plugin is included with the repository so you can study a full-featured wpk project. It models a hiring portal with a single job resource, DataViews metadata, actions, and generated PHP controllers wired into a WordPress plugin.【F:examples/showcase/wpk.config.ts†L1-L140】
Why this example matters
The project exercises most of the shipped surface area:
- The
jobresource defines REST routes, cache keys, query parameter descriptors, and DataViews metadata that the CLI turns into React fixtures and PHP menu shims.【F:examples/showcase/wpk.config.ts†L1-L340】【F:packages/cli/src/builders/ts.ts†L1-L200】 - Actions in
src/actions/jobs/CreateJob.tscoordinate writes by calling the generated client, invalidating cache keys, and emitting domain events.【F:examples/showcase/src/actions/jobs/CreateJob.ts†L1-L80】 src/views/admin/JobsList.tsxrenders<ResourceDataView>against the generated runtime so you can see how the UI bindings work in practice.【F:examples/showcase/src/views/admin/JobsList.tsx†L1-L200】- After
wpk generateandwpk apply, PHP controllers live underinc/Rest/**and expose permission callbacks that map to the capability hints in the config.【F:examples/showcase/inc/Rest/JobController.php†L1-L200】【F:packages/cli/src/builders/php/resourceController.ts†L1-L220】
Run it locally
bash
pnpm install
pnpm playground:offline # optional WordPress sandbox
pnpm --filter @examples/showcase wpk generate
pnpm --filter @examples/showcase wpk apply
pnpm --filter @examples/showcase devAfter dev starts, visit Kernel → Showcase in your WordPress admin. The Jobs list screen reads from the generated resource and honours the DataViews defaults declared in the wpk config.
What to explore
wpk.config.ts- the single source of truth, including cache keys and DataViews metadata.src/resources/job.ts- the runtime resource definition consumed by the UI.src/index.ts- bootstraps the wpk and attaches UI bindings.inc/- generated PHP controllers afterwpk apply.
Use this example as a reference implementation when you structure your own plugin. It shows how the CLI output, React runtime, and PHP bridge stay aligned through the config.
