PHPackages                             wearejh/statics-merger - 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. wearejh/statics-merger

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

wearejh/statics-merger
======================

A composer plugin that symlinks static assets into the JH Magento Skeleton

4.0.3(9y ago)912.3k4MITPHP

Since Oct 1Pushed 9y ago19 watchersCompare

[ Source](https://github.com/WeareJH/statics-merger)[ Packagist](https://packagist.org/packages/wearejh/statics-merger)[ RSS](/packages/wearejh-statics-merger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (4)Versions (18)Used By (0)

Statics Merger
==============

[](#statics-merger)

[![Build Status](https://camo.githubusercontent.com/579a9b58885a4337bdbda8aa8d245f18a17a505b0fc78e47db6c817bbaf7aaa4/68747470733a2f2f7472617669732d63692e6f72672f57656172654a482f737461746963732d6d65726765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/WeareJH/statics-merger)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/9317cc70d6da8036532cfeec30803e0f8f02183e235ceeb2945b11d14164941c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f57656172654a482f737461746963732d6d65726765722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/WeareJH/statics-merger/)[![Scrutinizer Code Coverage](https://camo.githubusercontent.com/4ae4ea5c2820739ca436ef65fff65bd5c16ea808e9b3f5dceaa088ef0c73ebac/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f57656172654a482f737461746963732d6d65726765722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/WeareJH/statics-merger/)

A composer plugin aimed to simplify the workflow between the frontend and backend development teams. Static repositories that the frontend team use are added as a composer dependency to the project as type `static`.

The plugin hooks onto two composer commands `install` and `update` in which on completion will symlink all static packages as defined in their `composer.json` file.

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

[](#installation)

This module is installable via `Composer`. If you have used the Magento Skeleton as a base module then you can just require this project and all the rest is done for you.

### Magento 1

[](#magento-1)

```
$ cd project-root
$ ./composer.phar require "wearejh/statics-merger:^2.0.0"
```

### Magento 2

[](#magento-2)

```
$ cd project-root
$ ./composer.phar require "wearejh/statics-merger:^3.0.0"
```

### Upgrading 1.x to 2.x ?

[](#upgrading-1x-to-2x-)

It's recommended to first run `composer update statics-merger --no-plugins` after changing your composer.json and then run a `composer update nothing` to map the new configuration.

***Note:** Depending on the configuration changes you may also have to manually cleanup any remaining symlinks from the old mappings*

Usage
-----

[](#usage)

### Statics project

[](#statics-project)

*If the `composer.json` file is not already there, create one with relevant information and commit it to the repo.*

For this to work the statics repository requires the `composer.json` to have the `type` set to `static`.

#### Example Static Composer.json

[](#example-static-composerjson)

```
{
    "name": "wearejh/{project-name}-static",
    "type": "static",
    "description": "Main theme for {project-name}",
    "keywords": ["jh", "statics"],
    "authors": [
        {
            "name": "JH",
            "email": "hello@wearejh.com",
            "homepage": "http://www.wearejh.com"
        }
    ]
}
```

### Magento project

[](#magento-project)

Within your projects `composer.json` you will need to ensure you have a few configurations set up.

In your `require` you will need to add any statics that you want and if private also add the repo.

***Note:** It's great at handling multiple static repositories* 👍

```
"require": {
    "wearejh/{project-name}-static": "dev-master"
},
"repositories": [
    {
        "type": "git",
		"url": "git@jh.git.beanstalkapp.com:/jh/{project-name}-static.git"
    }
]
```

In your `extra` you need the `magento-root-dir` set correctly and have defined the `static-map` for each static repository.

```
"extra":{
    "magento-root-dir": "htdocs/",
    "static-map" : {
        "wearejh/{project-name}-static": {
            "package/theme": [
                {
                    "src": "public/assets",
                    "dest": "assets"
                },
                {
                    "src": "public/assets/img/favicon*",
                    "dest": "/"
                },
                {
                    "src": "assets/images/catalog",
                    "dest": "images/catalog"
                }
            ]
        }
    }
}
```

The first key is the name of the repository which you have used in the `require` section, while inside there each key is the `package/theme` in which the example would map to `skin/frontend/package/theme` within your `magento-root-dir.

The `package/theme` array contains several objects defining the `src and dest of the files. The src` value is relevant to the **root** of the **statics** repository while the `dest` is relevant to the `package/theme` defined in the **Magento project** such as `skin/frontend/package/theme/` within your `magento-root-dir`.

**Need to map a static repo to more than 1 package or theme?** No problem just add another `package/theme` array to your repos mappings, of course make sure you use a different name to any others to avoid overwriting.

#### Valid Mappings

[](#valid-mappings)

***Note:** Globs require the `dest` to be a folder and not a file, whereas files and directories need to point to there corresponding full path which allows you to rename them if required. If you leave the `dest` blank on a glob it will map to the same source directory structure within your `package/theme`*

##### Files

[](#files)

Link an image into a different directory structure and rename

```
{
    "src": "public/assets/img/awesome/cake.gif",
    "dest": "images/newcake.gif"
}
```

##### Directories

[](#directories)

Linking a whole directory keeping all sub-dirs &amp; files

```
{
    "src": "public/assets",
    "dest": "assets"
}
```

##### Globs

[](#globs)

You can also use globs which makes it pretty awesome! A great use case for this is favicons where you could have multiple at different resolutions with a set naming convention. To target them all you would simply use `favicon*` like in the default example below.

All favicons to root dir `skin/frontend/package/theme/`

```
{
    "src": "favicon*",
    "dest": "/"
}
```

#### Final Notes

[](#final-notes)

- Use tags to explicitly pull in the static repositories
- Don't forget to add the `package/theme` dir to your `.gitignore` otherwise you will add the statics files to the Magento repo, and everyone will hate you
- You can amend statics directly from the `vendor` dir and push straight to the main repo, WIN!
- Have fun !! 😄

Problems?
---------

[](#problems)

If you find any problems or edge cases which may need to be accounted for within this composer plugin just open up an issue with as much detail as possible so it can be recreated.

Running Tests
-------------

[](#running-tests)

```
$ cd vendor/wearejh/statics-merger
$ php composer.phar install
$ ./vendor/bin/phpunit
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 92.8% 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 ~63 days

Recently: every ~52 days

Total

15

Last Release

3357d ago

Major Versions

1.1.0 → 2.0.02015-02-16

2.2.3 → 3.0.02016-08-11

3.0.0 → 4.0.02017-03-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a5332bef5dfe8c03f82f4a4c94586bf35b2ec82f5f1f050a39ec0aa694a8668?d=identicon)[jh](/maintainers/jh)

---

Top Contributors

[![mikeymike](https://avatars.githubusercontent.com/u/2174476?v=4)](https://github.com/mikeymike "mikeymike (64 commits)")[![adam-paterson](https://avatars.githubusercontent.com/u/1008727?v=4)](https://github.com/adam-paterson "adam-paterson (1 commits)")[![AydinHassan](https://avatars.githubusercontent.com/u/2817002?v=4)](https://github.com/AydinHassan "AydinHassan (1 commits)")[![benjaminlill](https://avatars.githubusercontent.com/u/4182830?v=4)](https://github.com/benjaminlill "benjaminlill (1 commits)")[![knowj](https://avatars.githubusercontent.com/u/3459465?v=4)](https://github.com/knowj "knowj (1 commits)")[![shakyShane](https://avatars.githubusercontent.com/u/1643522?v=4)](https://github.com/shakyShane "shakyShane (1 commits)")

---

Tags

plugincomposercomposer-pluginstaticsjhmergerstatics-merger

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/wearejh-statics-merger/health.svg)

```
[![Health](https://phpackages.com/badges/wearejh-statics-merger/health.svg)](https://phpackages.com/packages/wearejh-statics-merger)
```

###  Alternatives

[ergebnis/composer-normalize

Provides a composer plugin for normalizing composer.json.

1.1k37.3M2.1k](/packages/ergebnis-composer-normalize)[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.3M16](/packages/vaimo-composer-patches)[pyrech/composer-changelogs

Display changelogs after each composer update

5904.0M25](/packages/pyrech-composer-changelogs)[mnsami/composer-custom-directory-installer

A composer plugin, to help install packages of different types in custom paths.

1395.0M52](/packages/mnsami-composer-custom-directory-installer)[ffraenz/private-composer-installer

A composer install helper for private packages

2331.7M5](/packages/ffraenz-private-composer-installer)[automattic/jetpack-autoloader

Creates a custom autoloader for a plugin or theme.

525.5M69](/packages/automattic-jetpack-autoloader)

PHPackages © 2026

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