Foxy is a Composer plugin that aggregates frontend dependencies declared by Composer packages into one package.json and delegates installation to Bun, npm, pnpm, or Yarn.
- PHP 8.3 or later.
- Composer 2.10.2 or later.
- One supported frontend manager: Bun, npm, pnpm, or Yarn.
- Node.js when using npm, pnpm, or Yarn.
Authorize the Composer plugin and install Foxy 0.3:
composer config allow-plugins.php-forge/foxy true
composer require php-forge/foxy:^0.3Selecting a manager explicitly is recommended for reproducible local and CI behavior:
{
"require": {
"php-forge/foxy": "^0.3"
},
"config": {
"allow-plugins": {
"php-forge/foxy": true
},
"foxy": {
"manager": "npm"
}
}
}Valid manager values are bun, npm, pnpm, and yarn. When manager is omitted, Foxy first looks for one
recognized native lockfile and then checks available executables. Configure the manager explicitly when the project
contains lockfiles from more than one manager.
Foxy is framework agnostic and works with any Composer-based PHP application that meets the requirements above. No framework integration or application template is required. Composer packages that opt in contribute their frontend dependencies, and Foxy merges them whenever Composer installs or updates the project.
Composer may remain at the repository root while frontend tooling runs from web/:
{
"config": {
"allow-plugins": {
"php-forge/foxy": true
},
"foxy": {
"manager": "npm",
"root-package-json-dir": "web"
}
}
}Foxy reads and writes web/package.json and runs the selected manager from web/. Relative paths are resolved from
the Composer project directory.