PHPackages                             civicrm/composer-compile-plugin - 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. [DevOps &amp; Deployment](/categories/devops)
4. /
5. civicrm/composer-compile-plugin

ActiveComposer-plugin[DevOps &amp; Deployment](/categories/devops)

civicrm/composer-compile-plugin
===============================

Define a 'compile' event for all packages in the dependency-graph

v0.22(9mo ago)12560.6k↑12.6%10[1 PRs](https://github.com/civicrm/composer-compile-plugin/pulls)14MITPHPPHP &gt;=7.3CI passing

Since Sep 11Pushed 9mo ago17 watchersCompare

[ Source](https://github.com/civicrm/composer-compile-plugin)[ Packagist](https://packagist.org/packages/civicrm/composer-compile-plugin)[ RSS](/packages/civicrm-composer-compile-plugin/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (5)Versions (23)Used By (14)

Composer Compile Plugin
=======================

[](#composer-compile-plugin)

The "Compile" plugin enables developers of PHP libraries to define free-form "compilation" tasks, such as:

- Converting SCSS to CSS
- Generating PHP wrappers based on an XML schema

For site-builders who use these PHP libraries, compilation tasks run seamlessly during the regular download (`composer install`, etc).

For developers who publish PHP libraries, a task can be as simple as:

```
{
  "require": {"civicrm/composer-compile-plugin": "~0.14"},
  "extra": {
    "compile": [
      {"run": "@sh cd css; cat one.css two.css three.css > all.css"}
    ]
  }
}
```

Tasks may be defined in several ways, including:

- Shell command (`@sh cat file-{1,2,3} > big-file`)
- PHP method (`@php-method MyBuilder::build`)
- PHP eval (`@php-eval file_put_contents('big-file', make_big_file());`)
- PHP script file (`@php-script my-script.php`)
- Composer subcommand (`@composer dump-autoload`)

Features:

- Easy to enable. No manual configuration for downstream site-builders. Framework agnostic.
- Plays well with other `composer` tooling, like [forked repositories](https://matthewsetter.com/series/tooling/composer/forked-repositories/), [composer-patches](https://github.com/cweagans/composer-patches), [composer-locator](https://github.com/mindplay-dk/composer-locator), [composer-downloads](https://github.com/civicrm/composer-downloads-plugin), and the autoloader.
- Allows library repos to remain "clean" without committing build artifacts.
- Runs locally in PHP. Does not require external/hosted services or additional interpreters.
- Supports file monitoring for automatic rebuilds (`composer compile:watch`)
- Enforces permission model to address historical concerns about `composer` hooks and untrusted libraries.
- Integration-tests pass on both `composer` v1.10 and v2.0.

Documentation
-------------

[](#documentation)

- [site-build.md](doc/site-build.md): Managing the root package (for site-builders)
- [tasks.md](doc/tasks.md): Working with tasks (for library developers)
- [evaluation.md](doc/evaluation.md): Evaluate and compare against similar options
- [develop.md](doc/develop.md): How to work with `composer-compile-plugin.git` (for plugin-development)

See also
--------

[](#see-also)

- [composer-compile-lib](https://github.com/civicrm/composer-compile-lib): Small library of opinionated helpers/examples for specific compilation tasks -- meta-PHP, SCSS, etc
- [composer#1193](https://github.com/composer/composer/issues/1193): Old discussion thread about post-install hooks for dependencies

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance56

Moderate activity, may be stable

Popularity47

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~327 days

Total

22

Last Release

289d ago

PHP version history (3 changes)v0.1PHP &gt;=7.1

v0.18PHP &gt;=7.2

v0.22PHP &gt;=7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1336047?v=4)[Tim Otten](/maintainers/totten)[@totten](https://github.com/totten)

---

Top Contributors

[![totten](https://avatars.githubusercontent.com/u/1336047?v=4)](https://github.com/totten "totten (180 commits)")[![stesi561](https://avatars.githubusercontent.com/u/9410526?v=4)](https://github.com/stesi561 "stesi561 (9 commits)")[![seamuslee001](https://avatars.githubusercontent.com/u/6799125?v=4)](https://github.com/seamuslee001 "seamuslee001 (5 commits)")[![jackrabbithanna](https://avatars.githubusercontent.com/u/1508311?v=4)](https://github.com/jackrabbithanna "jackrabbithanna (2 commits)")[![colemanw](https://avatars.githubusercontent.com/u/2874912?v=4)](https://github.com/colemanw "colemanw (1 commits)")[![demeritcowboy](https://avatars.githubusercontent.com/u/2967821?v=4)](https://github.com/demeritcowboy "demeritcowboy (1 commits)")

---

Tags

buildcomposercomposer-pluginphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/civicrm-composer-compile-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/civicrm-composer-compile-plugin/health.svg)](https://phpackages.com/packages/civicrm-composer-compile-plugin)
```

###  Alternatives

[phpro/grumphp

A composer plugin that enables source code quality checks.

4.3k17.0M1.1k](/packages/phpro-grumphp)[drupal/core-composer-scaffold

A flexible Composer project scaffold builder.

5346.5M600](/packages/drupal-core-composer-scaffold)[drupal/core-project-message

Adds a message after Composer installation.

2125.4M213](/packages/drupal-core-project-message)[roots/wordpress-core-installer

A Composer custom installer to handle installing WordPress as a dependency

3917.0M59](/packages/roots-wordpress-core-installer)[phpro/grumphp-shim

GrumPHP Phar distribution

284.9M348](/packages/phpro-grumphp-shim)[drupal/core-vendor-hardening

Hardens the vendor directory for when it's in the docroot.

175.0M54](/packages/drupal-core-vendor-hardening)

PHPackages © 2026

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