Files
wp-headless/.github/copilot-instructions.md

2.1 KiB
Raw Permalink Blame History

Copilot instructions (wp-headless)

Overview

  • This project is a full WordPress install (core lives in wp-admin/ + wp-includes/). Treat core files as upstream: dont implement features by editing WordPress core or plugins.
  • Project-specific code lives in wp-content/themes/moonshine/:
  • “Headless” stack is assembled via custom theme and plugins:
    • wp-content/themes/moonshine/ provides the WordPress PHP theme logic and Nuxt frontend.
    • wp-content/plugins/wp-graphql/ provides the GraphQL endpoint (typically /graphql).
    • wp-content/plugins/wpgraphql-acf/ exposes ACF fields in the GraphQL schema.
    • wp-content/plugins/wp-graphql-headless-login/ provides GraphQL-based authentication flows.

Where to make changes

  • Changes should only be made in the Moonshine theme wp-content/themes/moonshine/
  • WordPress PHP theme logic lives in wp-content/themes/moonshine/includes/.
  • Nuxt frontend (Nuxt 4): wp-content/themes/moonshine/
    • App entry & routes: wp-content/themes/moonshine/app/ (catch-all route is app/pages/[...uri].vue).
    • Config: wp-content/themes/moonshine/nuxt.config.ts.
    • Package manager: pnpm (pnpm-lock.yaml is present).

Developer workflows

  • WP Headless - WordPress Composer project (root folder):
    • Install PHP deps (also manages WP plugins/themes via Composer repos): composer install.
    • Update PHP deps / WordPress plugins: composer update.
    • Composer uses an internal Satis repo (https://satis.ledevsimple.ca) plus wpackagist.org.
    • PHP linting (phpcs):composer lint
    • PHP beautifier (phpcbf): composer lintfix
  • Moonshine - Headless WordPress theme based on Nuxt 4 (wp-content/themes/moonshine/):
    • Dev: pnpm dev
    • Build: pnpm build
    • Lint (autofix): pnpm lint

Conventions to follow

  • Prefer adding project behavior via WordPress hooks/filters in the theme (moonshine_* functions) or via plugins—avoid editing WP core at all cost.
  • In the Nuxt app, prefer the repos ESLint/Tailwind conventions (VS Code settings treat *.css as TailwindCSS and support Nuxt UI ui attributes).