Skip to content

Repository files navigation

PHP Forge

Foxy


PHPUnit Mutation Testing Easy Coding Standard Security

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.

Features

Foxy features: dependency aggregation, native manager support and selection, flexible roots, protected mock directories, failure recovery, defensive I/O, and stable execution.

Requirements

  • 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.

Installation

Authorize the Composer plugin and install Foxy 0.3:

composer config allow-plugins.php-forge/foxy true
composer require php-forge/foxy:^0.3

Selecting 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.

Quick start

Composer-based PHP application

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.

Project with package.json under web/

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.

Documentation

Package information

PHP Latest Stable Version Total Downloads

Code quality

Codecov PHPStan Level 5 Quality Dependency Check

Community

Follow on X

License

License

About

A fast, reliable, and secure BUN/NPM/Yarn/PNpM bridge for Composer.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

45 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

Generated from yii-tools/template