Foxy is a Composer plugin that aggregates asset dependencies from Composer packages into a single package.json and runs Bun, npm, Yarn, or pnpm while preserving the Composer state on failures.
composer require php-forge/foxy:^0.1Manager can be bun, npm, yarn or pnpm. For default, npm is used.
{
"require": {
"php-forge/foxy": "^0.1"
},
"config": {
"foxy": {
"manager": "bun"
}
}
}In a standard PHP application, keep a package.json file at the project root. Foxy will merge asset dependencies from
installed Composer packages and run the configured manager during Composer install and update.
Example (Yii2 app template):
{
"require": {
"php-forge/foxy": "^0.1"
},
"config": {
"foxy": {
"manager": "npm"
}
}
}In a typical Drupal proof-of-concept workflow, Composer stays at the repository root while frontend tooling and builds
live under web/.
Foxy lets you keep that layout while still aggregating asset dependencies and running npm in the correct directory, with Composer state preserved if the install fails.
- Aggregates asset dependencies declared by Composer packages into a single npm install.
- Keeps asset tooling configuration consistent across local and CI environments.
- Restores Composer lock and PHP dependencies if npm exits with an error.
- Runs npm against the
web/package.json without moving Composer files.
{
"config": {
"foxy": {
"manager": "npm",
"root-package-json-dir": "web"
}
}
}Foxy is released under the MIT license. See the complete license in: