PHPackages                             steady-ua/unicorn - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. steady-ua/unicorn

ActiveComposer-plugin[Utility &amp; Helpers](/categories/utility)

steady-ua/unicorn
=================

Composer monorepo plugin

v1.9.0(7mo ago)055MITPHPPHP &gt;=8.0

Since Oct 27Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/SteadyUA/unicorn)[ Packagist](https://packagist.org/packages/steady-ua/unicorn)[ RSS](/packages/steady-ua-unicorn/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependencies (3)Versions (10)Used By (0)

unicorn
=======

[](#unicorn)

The `composer` plugin organizes a mono-repository of php packages.
Ensures the consistency of all dependencies on the same package version.
Adds tools for working with shared dependencies.

1. [Concept](#concept)
2. [Installation](#installation)
3. [Usage](#usage)
4. [Commands](#commands)
5. [The unicorn.json shema](#the-unicornjson-schema)

Concept
-------

[](#concept)

For example, we have two projects:

- the `web` project serves http requests
- the `worker` project for background processes

Both projects use common packages placed in the `packages` directory

```
 web/
    index.php
    composer.json
 worker/
    console.php
    composer.json
 packages/
    foo/
        composer.json
    bar/
        composer.json
 unicorn.json

```

`composer` - provides the ability to include local packages by specifying your own `path` repository.
But there are a number of limitations, such as:

- in each `composer.json` file you must describe all local repositories.
- each package has its own local file, and it is possible that packages of different versions are used.
- difficult to analyze package usage.
- difficult to update dependencies used in different packages.

The `steady-ua/unicorn` plugin removes these restrictions and provides tools for analyzing and updating dependencies.

In the root folder, you need to place the `unicorn.json` file. It describes all the common repositories.

```
{
    "repositories": [
        {
            "type": "path",
            "url": "./web"
        },
        {
            "type": "path",
            "url": "./worker"
        },
        {
            "type": "path",
            "url": "./packages/*"
        }
    ]
}
```

> Optionally, other types of private repositories can be specified.

Now any local package can include packages from these repositories.
No more need to describe the `path` repositories in each package.

A shared folder `uni_vendor` is created where all required packages are installed.
All dependent packages create symbolic links to them.

This is to ensure that all dependencies use the same version.
And it speeds up installation.

The used versions are fixed in the `unicorn.lock` file and will be used during installation.

> When deploying an application, instead of symbolic links, you can copy the necessary packages.
> Command [composer uni:build](#composer-unibuild)

Installation
------------

[](#installation)

Compatible with `composer` version `2.3` or later.
Currently does not work on `windows` operating system.
The plugin must be installed globally.

```
composer global require steady-ua/unicorn

```

Usage
-----

[](#usage)

After creating the `unicorn.json` file, just use `composer` as usual.

The `unicorn.lock` file is recommended to be kept under a version control system (eg GIT). The `uni_vendor` directory, like the `vendor` directories, is recommended to be excluded. The generated `composer.lock` files should also be excluded.

If a version conflict occurs when including a dependent package, an error will be displayed.

Use next commands to solve problems.

Commands
--------

[](#commands)

### composer uni:install

[](#composer-uniinstall)

```
composer uni:install [options] [--] [...]

```

When called without parameters. If the `uni_vendor` directory does not exist, install all dependencies. Otherwise, it will check the consistency of package requirements.

You can specify a list of local packages. In this case, for each package, the command will be executed `composer install`

### composer uni:update

[](#composer-uniupdate)

```
compose uni:update ...

```

Update required packages in all dependents.

With this command, you can also change the constraint. e.g. `foo/bar:^1.0 or foo/bar=^1.0 or "foo/bar ^1.0"`. This will edit the `composer.json` files.

During the execution, the `composer.json` files will be changed.
In case of an error, the files will be returned to their original state.

Additionally, [you can specify](#post-update-scripts) a list of scripts that will be executed after the changes.

### composer uni:version

[](#composer-universion)

```
uni:version [ major | minor | patch ]

```

Bump version of package.

Upgrades a package and updates all dependencies.

During the execution, the `composer.json` files will be changed.
In case of an error, the files will be returned to their original state.

Additionally, [you can specify](#post-update-scripts) a list of scripts that will be executed after the changes.

### composer uni:run

[](#composer-unirun)

```
uni:run [options] [--] [...]

```

Runs the scripts defined in unicorn.json, for all packages dependent on the current.

#### Options:

[](#options)

- `-s, --self` Also run script for the current package.
- `-r, --recursive` Recursively resolves dependencies up to the root.
- `-a, --all` Run for all local packages.
- `-l, --list` List scripts.

### composer uni:why

[](#composer-uniwhy)

Shows which packages cause the given package to be installed.

### composer uni:why-not

[](#composer-uniwhy-not)

Shows which packages prevent the given package from being installed.

### composer uni:show

[](#composer-unishow)

Shows information about packages.

### composer uni:namespace

[](#composer-uninamespace)

Suggest package by namespace pattern.

### composer uni:build

[](#composer-unibuild)

```
composer uni:build

```

Builds a local package in the specified directory. All required packages will be copied instead of symlinked.

It is [possible to set options](#build-install-options) for executing the command `composer install`

The unicorn.json schema
-----------------------

[](#the-unicornjson-schema)

Located at the root of the mono-repository.

### repositories

[](#repositories)

Custom package repositories to use.

The format is the same as [Composer](https://getcomposer.org/doc/04-schema.md#repositories)

Example:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "./web-api-project"
        },
        {
            "type": "path",
            "url": "./packages/*"
        }
    ]
}
```

> You can group packages into subdirectories.
> Then the url will be like this `"url": "./packages/*/*"`

### extra

[](#extra)

#### build-install-options

[](#build-install-options)

Type: string

Additional options to be passed to the command `composer install` for [uni:build](#composer-unibuild)

Example:

```
{
    "extra": {
        "build-install-options": "--no-dev --optimize-autoloader"
    }
}
```

#### post-update-scripts

[](#post-update-scripts)

Type: array

The name of the scripts that will be executed for all changed packages during the execution of commands: [uni:update](#composer-uniupdate), [uni:version](#composer-universion).

Example:

```
{
    "extra": {
        "post-update-scripts": ["test", "phpstan"]
    }
}
```

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance69

Regular maintenance activity

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~89 days

Recently: every ~163 days

Total

9

Last Release

211d ago

PHP version history (2 changes)v1.5.0PHP &gt;=7.4

v1.5.3PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9801a242ca8f016a50ef320b394026a16a4610a78c18eefb0495ea6f7c14d42e?d=identicon)[SteadyUA](/maintainers/SteadyUA)

---

Top Contributors

[![SteadyUA](https://avatars.githubusercontent.com/u/24442579?v=4)](https://github.com/SteadyUA "SteadyUA (19 commits)")

### Embed Badge

![Health badge](/badges/steady-ua-unicorn/health.svg)

```
[![Health](https://phpackages.com/badges/steady-ua-unicorn/health.svg)](https://phpackages.com/packages/steady-ua-unicorn)
```

###  Alternatives

[roave/backward-compatibility-check

Tool to compare two revisions of a public API to check for BC breaks

5953.3M55](/packages/roave-backward-compatibility-check)[vaimo/composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and patch command for testing/troubleshooting added patches.

2994.3M14](/packages/vaimo-composer-patches)[ramsey/conventional-commits

A PHP library for creating and validating commit messages according to the Conventional Commits specification. Includes a CaptainHook action!

1931.2M120](/packages/ramsey-conventional-commits)[friendsofphp/pickle

Installer for PHP extension, supports pecl package or install from src tree directly

1.7k3.3k](/packages/friendsofphp-pickle)[php-soap/wsdl

Deals with WSDLs

173.5M12](/packages/php-soap-wsdl)[magento/composer

Magento composer library helps to instantiate Composer application and run composer commands.

317.7M8](/packages/magento-composer)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
