https://github.com/php-forge/foxy
A fast, reliable, and secure BUN/NPM/Yarn/PNpM bridge for Composer.
https://github.com/php-forge/foxy
assets bun npm php pnpm yarn
Last synced: about 18 hours ago
JSON representation
A fast, reliable, and secure BUN/NPM/Yarn/PNpM bridge for Composer.
- Host: GitHub
- URL: https://github.com/php-forge/foxy
- Owner: php-forge
- License: mit
- Created: 2024-01-19T19:54:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-13T13:04:08.000Z (11 months ago)
- Last Synced: 2025-03-29T13:09:33.920Z (10 months ago)
- Topics: assets, bun, npm, php, pnpm, yarn
- Language: PHP
- Homepage:
- Size: 229 KB
- Stars: 45
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
Awesome Lists containing this project
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
```bash
composer require php-forge/foxy:^0.1
```
Manager can be `bun`, `npm`, `yarn` or `pnpm`. For default, `npm` is used.
```json
{
"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):
[Yii2 app template](https://github.com/yiisoft/yii2-app-basic/tree/22)
```json
{
"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.
```json
{
"config": {
"foxy": {
"manager": "npm",
"root-package-json-dir": "web"
}
}
}
```
## Documentation
- [Guide](resources/doc/index.md)
- [Usage](resources/doc/usage.md)
- [Configuration](resources/doc/config.md)
- [Events](resources/doc/events.md)
- [FAQs](resources/doc/faqs.md)
- [Development Guide](docs/development.md)
- [Testing Guide](docs/testing.md)
- [Release Notes](https://github.com/php-forge/foxy/releases)
## Package information
[](https://www.php.net/releases/8.1/en.php)
[](https://packagist.org/packages/php-forge/foxy)
[](https://packagist.org/packages/php-forge/foxy)
## Quality code
[](https://codecov.io/gh/php-forge/foxy)
[](https://github.com/php-forge/foxy/actions/workflows/static.yml)
[](https://github.com/php-forge/foxy/actions/workflows/linter.yml)
[](https://github.com/php-forge/foxy/actions/workflows/dependency-check.yml)
## Our social networks
[](https://x.com/Terabytesoftw)
## License
[](LICENSE)