Foundation is a StellarWP Composer monorepo for reusable PHP packages intended for libraries and WordPress plugin ecosystems.
Note
This monorepo splits each package out into their own sub-repository, if you only need a specific component you can install only that specific one.
composer require stellarwp/foundation- PHP 8.3+
Run all tests:
composer testRun just the unit test suite:
composer test:unitRun just the feature test suite:
composer test:featureGenerate the test coverage HTML dashboard (XDEBUG required to be enabled on your machine):
composer test:coverage-htmlCheck your code style:
composer lintAutomatically fix your code style:
composer formatStatic analysis:
composer analyzeBefore drafting the release, run the monorepo maintenance commands that apply to the release:
| Situation | Command | Why |
|---|---|---|
You are planning a major version release, for example 2.0 to 3.0. You should run this so any Foundation packages that depend on each other require the new major line, such as ^3.0. You may also run it for a minor release if one package must require APIs added in that new minor version. |
composer monorepo bump-interdependency <version> |
Updates package-to-package dependency constraints. Use the new minimum Composer constraint, such as ^3.0 or ^1.2. |
The dev-main branch alias needs to move to a new development line, usually after a minor or major release. For example, after releasing 1.1.0, update the alias from 1.1.x-dev to 1.2.x-dev. Do not run this before every patch release if the existing alias is still correct. |
composer monorepo package-alias |
Updates each package's extra.branch-alias using the format configured in monorepo-builder.php. |
| Neither of the above changed. | No monorepo maintenance command is needed. | Continue to drafting the release. |
After any needed command, commit the updated composer.json files. Then draft a new release on GitHub, following semver closely.
The monorepo split GitHub workflow will deploy each project's code to their sub-repository.
This uses Symplify's Monorepo Builder. There is a shortcut composer script you can
run to access their CLI: composer monorepo list to see the available commands.
- Copy the composer.json from one of the packages and modify the
nameandpsr-4autoload namespace. - Ensure you have the
close-pull-request.ymlGitHub workflow, a.gitattributes,.gitignoreandREADME.mdfiles. - Once you've added the specific dependencies your package needs to its composer.json, run
composer monorepo mergeand thencomposer updateand commit the changes. This will merge the dependencies into the root composer.json. - Create your new repository, add the description:
[READ ONLY] Subtree split of the Foundation <NEW_COMPONENT_NAME> component (see stellarwp/foundation)and disable wikis, issues, projects and pull requests.
Copyright © 2026 Nexcess Corp.
Licensed under the GNU General Public License v2.0 or later. See LICENSE for details.