PHPackages                             myerscode/package-discovery - 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. myerscode/package-discovery

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

myerscode/package-discovery
===========================

A package to help find plugins for your product through Composer meta data!

2025.0.0(1y ago)2625MITPHPPHP ^8.4CI passing

Since Sep 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/myerscode/package-discovery)[ Packagist](https://packagist.org/packages/myerscode/package-discovery)[ RSS](/packages/myerscode-package-discovery/feed)WikiDiscussions main Synced 1mo ago

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

Package Discovery
=================

[](#package-discovery)

> A service to help easily find plugins for your services, using Composer metadata!

[![Latest Stable Version](https://camo.githubusercontent.com/011f52eb5808556384b437902fd105c141950998cf5d815d03b1977021866141/68747470733a2f2f706f7365722e707567782e6f72672f6d79657273636f64652f7061636b6167652d646973636f766572792f762f737461626c65)](https://packagist.org/packages/myerscode/package-discovery)[![Total Downloads](https://camo.githubusercontent.com/aa7c70d28c93d0fc127388f43f5d01ad7765aa411debf9fe9e27417f6b541c05/68747470733a2f2f706f7365722e707567782e6f72672f6d79657273636f64652f7061636b6167652d646973636f766572792f646f776e6c6f616473)](https://packagist.org/packages/myerscode/package-discovery)[![License](https://camo.githubusercontent.com/c4bdf6b378d6352e09ff3d8f7ca83fda05ee9bec42af533c3c5fc5c08fe64468/68747470733a2f2f706f7365722e707567782e6f72672f6d79657273636f64652f7061636b6167652d646973636f766572792f6c6963656e7365)](https://packagist.org/packages/myerscode/package-discovery)[![Tests](https://github.com/myerscode/package-discovery/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/myerscode/package-discovery/actions/workflows/tests.yml/badge.svg?branch=main)[![codecov](https://camo.githubusercontent.com/d473a834eb14c7597e0e47a7659aabfd6d5e7f35dab89fd3bdfaf752324e9b0a/68747470733a2f2f636f6465636f762e696f2f67682f6d79657273636f64652f7061636b6167652d646973636f766572792f67726170682f62616467652e7376673f746f6b656e3d59523059485645524e56)](https://codecov.io/gh/myerscode/utilities-strings)

Install
-------

[](#install)

You can install this package via composer:

```
composer require myerscode/package-discovery
```

Usage
-----

[](#usage)

Publishing projects just need to add appropriate metadata in their package, which can be then detected by a consuming project. A project which wants to disover projects will need to instantiate a `Finder` to look up the project namespace. You will then be able to consume the found metadata in the project as desired.

### Publishing project

[](#publishing-project)

In your `package.json` file, add a object in the `extras` object, with a key that relates to the project namespace you want to discover it.

```
{
  "name": "myerscode/corgis",
  "extra": {
    "myerscode": {
      "corgis": ["Gerald", "Rupert"],
      "providers": [
        "Myerscode\\Corgis\\CorgiProvider"
      ]
    }
  }
}
```

### Consuming project

[](#consuming-project)

Using the `Finder` class, initiate passing in the root path, relative to the `vendor` directory.

Then use the `discover` method to find all packages that have the given name in its extras field.

```
$finder = new Finder(__DIR__);

// would find all installed packages that have a myerscode namespace in the extras
$packages = $finder->discover('myerscode');
```

After discovering package you would have an array of metadata for each one discovered.

```
[
  "myerscode/corgis" => [
      "corgis": ["Gerald", "Rupert"],
      "providers": [
        "Myerscode\\Corgis\\CorgiProvider"
      ]
  ]
]
```

### Avoiding discovery

[](#avoiding-discovery)

If you don't want to discover a specific project, then you can add some metadata in the consuming package to prevent this.

You would do this by adding the package name to `avoid` under the projects namespace in the extras field of `package.json`.

```
{
  "name": "myerscode/demo-project",
  "extra": {
    "myerscode": {
      "avoid": [
        "myerscode/corgis"
      ]
    }
  }
}
```

If you want to avoid loading in all discoverable packages, simply add `*` in the avoid field.

```
{
  "name": "myerscode/demo-project",
  "extra": {
    "myerscode": {
      "avoid": [ "*" ]
    }
  }
}
```

Locating a package
------------------

[](#locating-a-package)

When you want to find out where a package is located on the disk, you can use the `locate` method to look up its absolute path.

```
$finder = new Finder(__DIR__);

echo $finder->locate('myerscode/test-package');

// /User/fred/project-name/vendor/myerscode/test-package
```

Getting package meta for a service
----------------------------------

[](#getting-package-meta-for-a-service)

To get package meta for a specific service call the `packageMetaForService` method, passing the package name and the service name.

```
$finder = new Finder(__DIR__);

echo $finder->packageMetaForService('myerscode/test-package', 'myerscode');

[
    "corgis": ["Gerald", "Rupert"],
    "providers": [
        "Myerscode\\Corgis\\CorgiProvider"
    ]
]
```

Getting package extra
---------------------

[](#getting-package-extra)

To get all the extras data for a package call the `packageExtra` method.

```
$finder = new Finder(__DIR__);

echo $finder->packageExtra('myerscode/test-package');

[
    "myerscode" => [
        "corgis": ["Gerald", "Rupert"],
        "providers": [
            "Myerscode\\Corgis\\CorgiProvider"
        ]
    ]
]
```

Issues
------

[](#issues)

Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/myerscode/package-discovery/issues).

Contributing
------------

[](#contributing)

See the Myerscode [contributing](https://github.com/myerscode/docs/blob/master/contributing.md) page for information.

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance43

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity66

Established project with proven stability

 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 ~871 days

Total

2

Last Release

457d ago

Major Versions

1.0.0 → 2025.0.02025-02-13

PHP version history (2 changes)1.0.0PHP ^8.1

2025.0.0PHP ^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/a3d9923c8c4269fbe7076613da7e814719743f643cb115b441ccee8aeaa1290e?d=identicon)[oniice](/maintainers/oniice)

---

Top Contributors

[![oniice](https://avatars.githubusercontent.com/u/2676321?v=4)](https://github.com/oniice "oniice (18 commits)")

---

Tags

composerdiscoverypluginsmeta

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/myerscode-package-discovery/health.svg)

```
[![Health](https://phpackages.com/badges/myerscode-package-discovery/health.svg)](https://phpackages.com/packages/myerscode-package-discovery)
```

###  Alternatives

[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k289.5M63](/packages/jean85-pretty-package-versions)[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[bamarni/composer-bin-plugin

No conflicts for your bin dependencies

52722.0M859](/packages/bamarni-composer-bin-plugin)[composer/metadata-minifier

Small utility library that handles metadata minification and expansion.

181115.0M13](/packages/composer-metadata-minifier)[shipmonk/composer-dependency-analyser

Fast detection of composer dependency issues (dead dependencies, shadow dependencies, misplaced dependencies)

6076.7M435](/packages/shipmonk-composer-dependency-analyser)

PHPackages © 2026

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