php-forge / foxy
Fast, reliable, and secure Bun/NPM/Yarn/pnpm bridge for Composer
Fund package maintenance!
terabytesoftw
Installs: 79 057
Dependents: 8
Suggesters: 0
Security: 0
Stars: 45
Watchers: 2
Forks: 1
Open Issues: 0
Type:composer-plugin
pkg:composer/php-forge/foxy
Requires
- php: ^8.1
- composer-plugin-api: ^2.0
- ext-ctype: *
- ext-mbstring: *
- composer/composer: ^2.8
- composer/semver: ^3.4
- symfony/console: ^6.0|^7.0
Requires (Dev)
- maglnet/composer-require-checker: ^4.7
- php-forge/coding-standard: ^0.1
- php-forge/support: ^0.3
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.1
- phpstan/phpstan-strict-rules: ^2.0.3
- phpunit/phpunit: ^10.5
- xepozz/internal-mocker: ^1.4
Suggests
- infection/infection: Mutation testing
This package is auto-updated.
Last update: 2026-01-27 14:16:43 UTC
README
Foxy
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.
Features
Installation
composer require php-forge/foxy:^0.1
Manager can be bun, npm, yarn or pnpm. For default, npm is used.
{
"require": {
"php-forge/foxy": "^0.1"
},
"config": {
"foxy": {
"manager": "bun"
}
}
}
Quick start
Standard PHP project (Yii2)
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"
}
}
}
Drupal layout (package.json under web/)
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"
}
}
}
Documentation
- ๐ Guide
- ๐ก Usage
- โ๏ธ Configuration
- ๐ Events
- โ FAQs
- ๐งช Testing Guide
- ๐ ๏ธ Development Guide