PHPackages                             pronovix/drupal-project - 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. pronovix/drupal-project

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

pronovix/drupal-project
=======================

Project template for Drupal 8 projects with composer

8.x-dev(8y ago)091GPL-2.0+PHP

Since Feb 21Pushed 8y ago7 watchersCompare

[ Source](https://github.com/Pronovix/drupal-project)[ Packagist](https://packagist.org/packages/pronovix/drupal-project)[ RSS](/packages/pronovix-drupal-project/feed)WikiDiscussions 8.x Synced 2w ago

READMEChangelogDependencies (21)Versions (8)Used By (0)

Template for composer-based Drupal 8 projects with Drupal VM
============================================================

[](#template-for-composer-based-drupal-8-projects-with-drupal-vm)

This template is the fork of [drupal-composer](https://github.com/drupal-composer/drupal-project) and also contains [Drupal VM](https://github.com/geerlingguy/drupal-vm) as a git submodule.

For further information about these projects check the project pages.

Requirements
------------

[](#requirements)

- Install (latest stable) [Virtualbox](https://www.virtualbox.org/wiki/Downloads) on your host machine.
- Install [Vagrant](https://www.vagrantup.com/downloads.html) on your host machine with some of its plugins:
    - `vagrant plugin install vagrant-hostsupdater`
    - `vagrant plugin install vagrant-auto_network`
    - `vagrant plugin install vagrant-vbguest`
    - `vagrant plugin install vagrant-cachier`

Good to know
------------

[](#good-to-know)

- Composer installs the following files (these should NOT be committed):
    - Drupal core (latest stable drupal-8.x.x) in `docroot/` folder
    - Drupal libraries and contrib modules/profiles/themes in `docroot/` folder
    - PHP libs in the `vendor/` folder
    - PHP libs' binaries in the `bin/` folder
- As the gitroot will be NFS-mounted into the VM, any changes made to the files in it here will be available there as well.
- You can use XDebug.
- You can use `vagrant ssh` to SSH into a running Vagrant machine.
- You can specify paths for `package.json` files in `npm_package_json_paths` variable of `./config/config.yml` file for installing node.js packages while provisioning.
- You can easily enable Browsersync within the VM by specifying the `browsersync_port` and the `browsersync_config_target`variables in `./config/config.yml`. If you would like to use it globally, just add it to the globally installed Node.js packages. If you would like to use in from Gulp (or Grunt), you can include the necessary settings in `gulpfile.js` from the generated `browsersync.config.json` file. In the browser visit `vagrant_hostname`:`browsersync_port` (e.g. ) to reach the Browsersync server.

Working with an already existing project
----------------------------------------

[](#working-with-an-already-existing-project)

1. Clone the project `git clone some-project --recursive` (the `--recursive` switch is needed to have Drupal VM cloned as well).
2. Start the VM: `vagrant up`
3. For adding custom/contrib modules or patches, follow the below instructions.

Creating a new project
----------------------

[](#creating-a-new-project)

1. Clone this repository: `git clone https://github.com/Pronovix/drupal-project.git . --recursive`
2. Update the `vagrant_hostname` and `vagrant_machine_name` in `/config/config.yml` according to your project (these two must be unique on your host)
3. Start the VM: `vagrant up`

- It takes quite a bit of time to do it for the first time on your host, as it has to download the base image which is about 700MB (or more). Later on, provisioning a (new) VM is usually just a matter of 5-15 minutes, depending on the config of it (amount of packages to install, the number of Drupal modules, composer vs bandwidth, etc.).

4. For adding custom/contrib modules or patches, follow the below instructions.

### Notes

[](#notes)

- The `.htaccess` and `robots.txt` files are ignored by `drupal-scaffold` by default (so they get updated instead of getting overridden) and they are committed to the repository to make sure they exist in the file system.
- The scaffold files (except for `.htaccess` and `robots.txt`) and the other files that shouldn't be committed in a Drupal project (e.g. settings.php) are in the `.gitignore` file by default.

Adding a new contrib module
---------------------------

[](#adding-a-new-contrib-module)

1. SSH into the machine: `vagrant ssh`
2. In the VM, run `composer require drupal/some_module --no-interaction --prefer-dist -o`

- Adds a `some_module` module to `docroot/modules/contrib/` (per pronovix/drupal-project's `composer.json`)
- Adds the contrib modules that are dependencies of this module to the same folder (per `some_module.info.yml`)
- Adds the PHP libraries that are dependencies of this module to `vendor/` (per the module's own `composer.json`)
- The autoloader will be optimized (because of `-o`)

3. Add Composer files to git: `git add composer.json composer.lock`

- Do NOT add the code itself as it should be built by composer automatically
- The Pronovix/drupal-project MUST NOT have composer.lock, as it's a skeleton for other/real projects
- The other/real projects MUST have composer.lock committed, as it's the only way to ensure the very same codebase is built by composer in whatever environments

4. Commit these files: `git commit -m "Commit message."`.

Adding a contrib submodule (don't do it)
----------------------------------------

[](#adding-a-contrib-submodule-dont-do-it)

So you don't know the machine name of the project on drupal.org that provides a certain (sub)module you want to have? Not a problem, drupal.org's composer repository can resolve it for you:

1. In the VM: `composer require drupal/admin_toolbar_tools --no-interaction --prefer-dist -o`

- However, this approach is not recommended, as the submodule is the one that gets added to composer.json instead of the drupal.org project, which might be confusing. This above command will display something like "Installing drupal/admin\_toolbar (1.19.0)", which is the machine name of the drupal.org project – let's stick to that.

2. `git reset --hard`
3. `composer require drupal/admin_toolbar --no-interaction --prefer-dist -o`

- Well, that module is already part of the base package, but anyway :)

4. `git add composer.json composer.lock`
5. `git commit -m "New contrib: admin_toolbar.module."`

Adding a new custom module
--------------------------

[](#adding-a-new-custom-module)

1. Copy it into the `docroot/modules/custom/` folder.
2. Make sure its composer.json has the appropriate type info: `"type": "drupal-custom-module"`
3. Add the module to git: `git add modules/custom/custom_module` (custom modules SHOULD be committed to the repo)
4. Commit the module: `git commit -m "New custom module: custom_module."`

Applying patches to core or any contrib module
----------------------------------------------

[](#applying-patches-to-core-or-any-contrib-module)

1. Add a `patches` section into the `extra` section of your composer.json (if it hasn't been added yet) for each project you want to patch; each Drupal project should have a separate section and each patch should have a separate line (within the project section). So the end of your composer.json looks something like this:

```
"extra": {
    "installer-paths": {
        "docroot/core": ["type:drupal-core"],
        "docroot/libraries/{$name}": ["type:drupal-library"],
        "docroot/modules/contrib/{$name}": ["type:drupal-module"],
        "docroot/profiles/contrib/{$name}": ["type:drupal-profile"],
        "docroot/themes/contrib/{$name}": ["type:drupal-theme"],
        "drush/contrib/{$name}": ["type:drupal-drush"]
    },
    "patches": {
        "drupal/core": {
            "Use ROW_FORMAT=dynamic with InnoDB [#2857359]": "https://www.drupal.org/files/issues/row_format_dynamic_innodb_0.patch"
        },
        "drupal/node_clone": {
            "Configurations cannot be changed and publishing options missing [#2724919]": "https://www.drupal.org/files/issues/fix_set_data_on_admin_page-2724919-2.patch",
            "Warning: Invalid argument supplied for foreach() [#2712079]": "https://www.drupal.org/files/issues/update_settings_and_schema-2712079-3.patch"
        }
    }
}

```

2. Run `composer install` in the VM to apply the patch.

Writing tests
-------------

[](#writing-tests)

Put your tests into the features directory. Then run `vagrant ssh` and `cd .. && bin/behat`. If you need a specially prepared database to run tests, copy the dump to `docroot/mock.sql`.

Acknowledgements
----------------

[](#acknowledgements)

This is basically Proudly Found Elsewhere:

- [drupal-composer/drupal-project](https://github.com/drupal-composer/drupal-project) (our own pronovix/drupal-project is a fork of it)
- [Drupal VM](https://github.com/geerlingguy/drupal-vm) (it's added to our own repo as a git submodule)
- [Composer howto](https://www.drupal.org/docs/develop/using-composer) on drupal.org
- etc.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community25

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

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

###  Release Activity

Cadence

Every ~222 days

Total

2

Last Release

3145d ago

Major Versions

7.x-dev → 8.x-dev2017-11-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b934519ad88d26f2171de1abed39ae7441ac3f3947a3b25e4bc46aa41939ae6?d=identicon)[tamasd](/maintainers/tamasd)

![](https://avatars.githubusercontent.com/u/294106?v=4)[CSÉCSY László](/maintainers/boobaa)[@boobaa](https://github.com/boobaa)

---

Top Contributors

[![webflo](https://avatars.githubusercontent.com/u/123946?v=4)](https://github.com/webflo "webflo (113 commits)")[![boobaa](https://avatars.githubusercontent.com/u/294106?v=4)](https://github.com/boobaa "boobaa (23 commits)")[![kittiradovics](https://avatars.githubusercontent.com/u/15943108?v=4)](https://github.com/kittiradovics "kittiradovics (9 commits)")[![tamasd](https://avatars.githubusercontent.com/u/40811?v=4)](https://github.com/tamasd "tamasd (8 commits)")[![derhasi](https://avatars.githubusercontent.com/u/118502?v=4)](https://github.com/derhasi "derhasi (4 commits)")[![weitzman](https://avatars.githubusercontent.com/u/7740?v=4)](https://github.com/weitzman "weitzman (4 commits)")[![greg-1-anderson](https://avatars.githubusercontent.com/u/612191?v=4)](https://github.com/greg-1-anderson "greg-1-anderson (4 commits)")[![jmolivas](https://avatars.githubusercontent.com/u/366275?v=4)](https://github.com/jmolivas "jmolivas (3 commits)")[![pfrenssen](https://avatars.githubusercontent.com/u/442924?v=4)](https://github.com/pfrenssen "pfrenssen (3 commits)")[![jonhattan](https://avatars.githubusercontent.com/u/482058?v=4)](https://github.com/jonhattan "jonhattan (2 commits)")[![mxr576](https://avatars.githubusercontent.com/u/1755573?v=4)](https://github.com/mxr576 "mxr576 (2 commits)")[![jcnventura](https://avatars.githubusercontent.com/u/329663?v=4)](https://github.com/jcnventura "jcnventura (2 commits)")[![bradjones1](https://avatars.githubusercontent.com/u/981966?v=4)](https://github.com/bradjones1 "bradjones1 (2 commits)")[![jorissteyn](https://avatars.githubusercontent.com/u/448056?v=4)](https://github.com/jorissteyn "jorissteyn (2 commits)")[![opdavies](https://avatars.githubusercontent.com/u/339813?v=4)](https://github.com/opdavies "opdavies (1 commits)")[![rwanyoike](https://avatars.githubusercontent.com/u/3677497?v=4)](https://github.com/rwanyoike "rwanyoike (1 commits)")[![thom8](https://avatars.githubusercontent.com/u/331453?v=4)](https://github.com/thom8 "thom8 (1 commits)")[![tstoeckler](https://avatars.githubusercontent.com/u/3929504?v=4)](https://github.com/tstoeckler "tstoeckler (1 commits)")[![clouseau](https://avatars.githubusercontent.com/u/456917?v=4)](https://github.com/clouseau "clouseau (1 commits)")[![zaporylie](https://avatars.githubusercontent.com/u/1690685?v=4)](https://github.com/zaporylie "zaporylie (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/pronovix-drupal-project/health.svg)

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

###  Alternatives

[govcms/govcms

GovCMS Drupal Distribution

198102.2k3](/packages/govcms-govcms)[farmos/farmos

A web-based farm record keeping application.

1.3k7.0k1](/packages/farmos-farmos)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)

PHPackages © 2026

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