Getting started
Run the commands below from the monorepo root (the directory that contains package.json and pnpm-workspace.yaml).
Requirements
- Node.js — version in root
package.json→engines.node(currently^24.12.0) - pnpm — installation
- PHP and Composer — for PHP lint and PHPUnit-related workflows (versions per team standard; PHP 7.4+ has been used historically)
- Docker — for
@wordpress/env(for example Rancher Desktop)
Clone and install
git clone https://github.com/bcgov/bcew-monorepo.git
cd bcew-monorepo
pnpm install
composer install
pnpm composer-installInstalls root Node tooling, root Composer tooling (PHPCS, and so on), and per-project Composer dependencies where configured.
Build
Build all projects that define a build target:
pnpm buildBuild one project:
npx nx run <project-name>:buildList project names:
npx nx show projectsAfter checking out a branch
Because build artifacts are not committed, run these again whenever you check out or pull a branch (including when reviewing a PR):
pnpm install
pnpm buildSee Contributing workflow for more detail.
Local WordPress (wp-env)
From a project directory (plugin or theme with .wp-env.json):
npx nx wp-env-startOr use the underlying command from the project root after reading project.json targets. If a port is already in use, stop other wp-env instances or adjust the port in .wp-env.json.
Stop environments (all projects with the target). Safe to run when nothing is running — idle projects are skipped without error:
pnpm wp-env-stopFrom a single project directory:
npx nx wp-env-stopClean / reset environments (all projects with the target):
pnpm wp-env-cleanDocumentation site
pnpm docs:dev # develop with sync + watch
pnpm docs:build # production build
pnpm docs:previewSee Documentation site and Contributing docs.
Common issues
pnpm installfails withERR_PNPM_UNSUPPORTED_ENGINE— The repo setsengine-strict=truein.npmrc. Install the Node version required bypackage.jsonengines.node(currently^24.12.0), or override only for local experiments withpnpm install --engine-strict=false(not for CI).pnpm installfails for other reasons — Align Node version withengines; deletenode_modulesonly at root and retry.composer installfails — Ensure PHP extensions required by rootcomposer.jsonare available.- Port already allocated — Another
wp-envmay be running; runpnpm wp-env-stopfrom the repo root or change the port in the package’s.wp-env.json.
If pnpm check-engines fails in your environment, file an issue or see Onboarding validation for tracking.