PHPackages                             joachim-n/drupal-project-contrib-development - 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. joachim-n/drupal-project-contrib-development

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

joachim-n/drupal-project-contrib-development
============================================

15931[4 issues](https://github.com/joachim-n/drupal-project-contrib-development/issues)[1 PRs](https://github.com/joachim-n/drupal-project-contrib-development/pulls)PHP

Since Jun 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/joachim-n/drupal-project-contrib-development)[ Packagist](https://packagist.org/packages/joachim-n/drupal-project-contrib-development)[ RSS](/packages/joachim-n-drupal-project-contrib-development/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Drupal Contrib Development
==========================

[](#drupal-contrib-development)

This is a set of tools for developing Drupal contrib modules and themes in the context of a project.

Modules and themes are moved or created as git clones, and then brought into the Composer project as [Composer path repositories](https://getcomposer.org/doc/05-repositories.md#path). The advantage of this over using the Composer `--prefer-source` option is that with `--prefer-source` Composer considers itself the owner of the code and may remove branches or delete the whole thing, whereas it considers the source of a path repository to be outside of its control and leaves it alone.

Features
--------

[](#features)

### Swich to clone command

[](#swich-to-clone-command)

This is a Composer command which switches a Drupal module from being installed normally to using a git clone that is symlinked into the project.

This allows testing and developing a contrib module in the context of a project.

For example, suppose your Widgets.Com website is using the drupal\_cats module, but you have found a bug in it. You can make changes to the drupal\_cats module files, but they are not under version control, so you cannot make a MR on drupal.org from them. You could copy them to a separate git clone of drupal\_cats, but that quickly becomes tedious with multiple files. Furthermore, your project's installed copy of drupal\_cats is at a fixed release (hopefully!), and the code you want to fix may have changed in the latest HEAD.

The Switch to clone command makes this all simple to do:

1. Your project has the drupal/drupal\_cats package installed with Composer.
2. Do `composer drupal-contrib:switch-clone drupal_cats`. This does the following:
    1. The drupal\_cats git repository is cloned into the `./repos` folder in your project.
    2. A Composer path repository is added to your project's `composer.json`, which points to this git clone. This should *not* be added to version control; it is only needed temporarily while you work on code in the contrib module's git clone.
    3. Composer is updated to use the drupal/drupal\_cats from this repository. This creates a symlink from the `./repos/drupal_cats` folder into the project's `./modules/contrib` folder, replacing the previously installed version of the drupal\_cats module.
3. You can now use the git clone of drupal\_cats as normal:
    - Make a feature branch for your fix.
    - Check out a fork branch from drupal.org to evaluate a fix.
    - Test your code in the context of your project.
    - Push your changes to a drupal.org merge request.

When your fix is ready, use the `drupal-contrib:switch-package` command to switch your project back to using the distribution version of the drupal/drupal\_cats package. (Alternatively, you can manually remove the 'drupal\_cats' path repository from your `composer.json`, and do `composer update drupal/drupal_cats`.)

If you need to perform any Composer operations in the meantime, you may need to temporarily switch the drupal\_cats git repository to the main development branch or the release tag where it was checked out to begin with, in order to satisfy Composer's package version requirements.

### Switch back to package release command

[](#switch-back-to-package-release-command)

This is a Composer command which switches a Drupal module from being installed as a symlink to a git clone, to be being installed normally from a package release.

Use this command to reverse the effect of the `composer drupal-contrib:switch-clone` command, and restore your project's usage of the module to normal operation.

1. Your project has the drupal/drupal\_cats package installed from a symlink.
2. Do `composer drupal-contrib:switch-package drupal_cats`. This does the following:
    1. The Composer path repository which points to the git clone is removed from `composer.json`.
    2. Composer is updated to download the drupal/drupal\_cats package.

The git repository for the module is not changed or deleted. You can change back to using this with the `drupal-contrib:switch-clone` command.

### Make and apply patch command

[](#make-and-apply-patch-command)

This is a Composer command which applies your work in a module's git clone to the project as a patch.

Use this when you have finished work on a bug or a feature in a contrib module, and want to apply this fix to your project's codebase. The diff from a drupal.org merge request is not always suitable in this scenario, as the merge request will be on the development branch of the module, and the diff for this might not apply to the version that your project it using. Instead, this command takes a diff from the feature branch to the release that your project has installed.

This requires the project to have the `cweagans/composer-patches` package installed.

1. Your project has the drupal/drupal\_cats package installed with Composer, and a git clone at repos/drupal\_cats which has your work in a feature branch.
2. Do `composer drupal-contrib:apply-patch-from-branch drupal_cats`. This does the following:
    1. A git diff is taken from the feature branch in `repos/drupal_cat`s to the current version of the installed package.
    2. The git diff is written to a patch file in `/patches`.
    3. Composer is updated to apply the patch to the drupal/drupal\_cats package.

You should also contribute your fix back to drupal.org as a merge request!

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

[](#installation)

Install with Composer:

```
composer require joachim-n/drupal-project-contrib-development

```

Roadmap
-------

[](#roadmap)

- Get the issue title to use in the patch name and composer.json description.
- Add other useful things.

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance23

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity21

Early-stage or recently created project

 Bus Factor1

Top contributor holds 94.4% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/21043d4af2cb62a3e316647f63749d05fcbab1c9bd5e67ffa2079b0117e8f65a?d=identicon)[joachim-n](/maintainers/joachim-n)

---

Top Contributors

[![joachim-n](https://avatars.githubusercontent.com/u/105262?v=4)](https://github.com/joachim-n "joachim-n (17 commits)")[![webflo](https://avatars.githubusercontent.com/u/123946?v=4)](https://github.com/webflo "webflo (1 commits)")

### Embed Badge

![Health badge](/badges/joachim-n-drupal-project-contrib-development/health.svg)

```
[![Health](https://phpackages.com/badges/joachim-n-drupal-project-contrib-development/health.svg)](https://phpackages.com/packages/joachim-n-drupal-project-contrib-development)
```

###  Alternatives

[in2code/in2publish_core

Content publishing extension to connect stage and production server

40143.4k](/packages/in2code-in2publish-core)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4778.9k](/packages/tiamo-phpas2)[wapmorgan/php-rpm-packager

RPM packager for PHP applications.

106.6k](/packages/wapmorgan-php-rpm-packager)

PHPackages © 2026

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