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

ActiveProject

ramsalt/drupal-project
======================

Project template for Drupal 11 projects with Composer

11.x-dev(1y ago)6337↓100%1[2 PRs](https://github.com/ramsalt/drupal-project/pulls)GPL-2.0-or-laterPHPPHP &gt;=8.3CI passing

Since Mar 8Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/ramsalt/drupal-project)[ Packagist](https://packagist.org/packages/ramsalt/drupal-project)[ RSS](/packages/ramsalt-drupal-project/feed)WikiDiscussions 11.x Synced 2mo ago

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

Composer template for Drupal projects
=====================================

[](#composer-template-for-drupal-projects)

[![CI](https://github.com/ramsalt/drupal-project/actions/workflows/ci.yml/badge.svg?branch=10.x)](https://github.com/ramsalt/drupal-project/actions/workflows/ci.yml)

This project template provides a starter kit for managing your site dependencies with [Composer](https://getcomposer.org/).

What does the template do?
--------------------------

[](#what-does-the-template-do)

- Drupal will be installed in the `web` directory.
- Generated composer autoloader `vendor/autoload.php` is used instead of `web/vendor/autoload.php` provided by Drupal core.
- Modules (packages of type `drupal-module`) will be placed in `web/modules/contrib` directory.
- Themes (packages of type `drupal-theme`) will be placed in `web/themes/contrib` directory.
- Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib` directory.
- Creates default writable versions of `settings.php` and `services.yml`.
- Creates `web/sites/default/files` directory.
- Drush is installed for use as `vendor/bin/drush`.
- Provides an [example](.env.example) of the `.env` file.

Installing
----------

[](#installing)

Note

The instructions below refer to the [global Composer installation](https://getcomposer.org/doc/00-intro.md#globally). You might need to replace `composer` with `php composer.phar` (or similar) for your setup.

Create your project:

```
composer create-project ramsalt/drupal-project:11.x-dev some-dir --no-interaction
```

The `composer create-project` command passes ownership of all files to the project that is created. You should create a new Git repository, and commit all files not excluded by the `.gitignore` file.

Usage
-----

[](#usage)

### Adding new dependencies

[](#adding-new-dependencies)

Use `composer require` to include and download dependencies for your project.

```
cd some-dir
composer require drupal/devel
```

By default, this project is set to install only stable releases of dependencies, as specified by `"minimum-stability": "stable"` in `composer.json`. If you need to use non-stable releases (e.g., `alpha`, `beta`, `RC`), you can modify the version constraint to allow for such versions. For instance, to require a beta version of a module:

```
composer require drupal/devel:1.0.0-beta1
```

Alternatively, you can globally adjust the stability settings by modifying `composer.json` to include the desired stability level and explicitly allow it:

```
{
    "minimum-stability": "beta",
    "prefer-stable": true
}
```

This configuration ensures that stable releases are preferred, but allows the installation of non-stable packages when necessary.

### Adding libraries

[](#adding-libraries)

You can manage front-end asset libraries with Composer thanks to the [asset-packagist repository](https://asset-packagist.org/). Composer will detect and install new versions of a library that meet the stated constraints.

```
composer require bower-asset/dropzone
```

### Custom installation paths for libraries

[](#custom-installation-paths-for-libraries)

The installation path of a specific library can be controlled by adding it to the `extra.installer-paths` configuration preceding `web/libraries/{$name}`. For example, the `chosen` Drupal module expects the `chosen` library to be located on `web/libraries/chosen`, but `composer require npm-asset/chosen-js`installs the library into `web/libraries/chosen-js`. The following configuration overrides installation it into the expected directory:

```
{
    "extra": {
        "installer-paths": {
            "web/libraries/chosen": [
                "npm-asset/chosen-js"
            ],
            "web/libraries/{$name}": [
                "type:drupal-library",
                "type:npm-asset",
                "type:bower-asset"
            ]
        }
    }
}
```

For more details, see

### Updating Drupal Core

[](#updating-drupal-core)

This project will attempt to keep all of your Drupal Core files up-to-date; the project [drupal/core-composer-scaffold](https://github.com/drupal/core-composer-scaffold)is used to ensure that your scaffold files are updated every time `drupal/core`is updated.

If you customize any of the "scaffolding" files (commonly `.htaccess`), you may need to merge conflicts if any of your modified files are updated in a new release of Drupal core.

Follow the steps below to update your Drupal core files.

1. Run `composer update "drupal/core-*" --with-dependencies` to update Drupal Core and its dependencies.
2. Run `git diff` to determine if any of the scaffolding files have changed. Review the files for any changes and restore any customizations to `.htaccess` or `robots.txt`.
3. Commit everything all together in a single commit, so `web` will remain in sync with the `core` when checking out branches or running `git bisect`.
4. In the event that there are non-trivial conflicts in step 2, you may wish to perform these steps on a branch, and use `git merge` to combine the updated core files with your customized files. This facilitates the use of a [three-way merge tool such as kdiff3](http://www.gitshah.com/2010/12/how-to-setup-kdiff-as-diff-tool-for-git.html). This setup is not necessary if your changes are simple; keeping all of your modifications at the beginning or end of the file is a good strategy to keep merges easy.

FAQs
----

[](#faqs)

### Should I commit the contrib modules I download?

[](#should-i-commit-the-contrib-modules-i-download)

Composer recommends **no**. They provide [argumentation against but also workarounds if a project decides to do it anyway](https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md).

### Should I commit the scaffolding files?

[](#should-i-commit-the-scaffolding-files)

The [Drupal Composer Scaffold](https://github.com/drupal/core-composer-scaffold)plugin can download the scaffold files (like `index.php`, `update.php` etc.) to the `web` directory of your project. If you have not customized those files you could choose to not check them into your version control system (e.g. git). If that is the case for your project, it might be convenient to automatically run the drupal-scaffold plugin after every install or update of your project. You can achieve that by registering `@composer drupal:scaffold` as `post-install`and `post-update` command in your `composer.json`:

```
"scripts": {
    "post-install-cmd": [
        "@composer drupal:scaffold",
        "..."
    ],
    "post-update-cmd": [
        "@composer drupal:scaffold",
        "..."
    ]
},
```

### How can I apply patches to included dependencies?

[](#how-can-i-apply-patches-to-included-dependencies)

If you need to apply patches, you can do so with the [composer-patches](https://github.com/cweagans/composer-patches) plugin included in this project.

To add a patch to Drupal module `foobar`, insert the `patches` section in the `extra` section of `composer.json`:

```
"extra": {
    "patches": {
        "drupal/foobar": {
            "Patch description": "URL or local path to patch"
        }
    }
}
```

### How do I specify a PHP version?

[](#how-do-i-specify-a-php-version)

There are 2 places where Composer will be looking for PHP version requirements when resolving dependencies:

1. The `require.php` version value in `composer.json`.
2. The `config.platform` version value in `composer.json`.

The purpose of `require.php` is to set the minimum PHP language requirements for a package. For example, the minimum version required for Drupal 11.0 is `8.3` or above, which can be specified as `>=8.3`.

The purpose of `config.platform` is to set the PHP language requirements for the specific instance of the package running in the current environment. For example, while the minimum version required for Drupal 11 is `8.3` or above, the actual PHP version on the hosting provider could be `8.3.1`. The value of this field should provide your exact version of PHP with all 3 parts of the version.

#### Which versions to specify in my Drupal site?

[](#which-versions-to-specify-in-my-drupal-site)

This project includes `drupal/core` which already has `require.php` added. Your would inherit that constraint. There is no need to add `require.php` to your `composer.json`.

`config.platform` is a platform-specific. It is recommended to specify `config.platform` as a *specific version* (e.g.`8.3.1`) constraint to ensure that only the package versions supported by your current environment are used.

```
"config": {
    "platform": {
        "php": "8.3.1"
    }
},
```

###  Health Score

48

—

FairBetter than 94% of packages

Maintenance66

Regular maintenance activity

Popularity19

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity74

Established project with proven stability

 Bus Factor1

Top contributor holds 55.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 ~638 days

Total

5

Last Release

438d ago

Major Versions

7.x-dev → 8.x-dev2020-02-27

8.x-dev → 9.x-dev2024-05-22

9.x-dev → 10.x-dev2024-07-02

10.x-dev → 11.x-dev2025-03-03

PHP version history (4 changes)7.x-devPHP &gt;=5.2.5

8.x-devPHP &gt;=7.0.8

9.x-devPHP &gt;=7.4

10.x-devPHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/05bccdb85281776b28deafc2900b52fc8e12fcb25c3fd27870a5c5158db8da89?d=identicon)[szeidler](/maintainers/szeidler)

---

Top Contributors

[![webflo](https://avatars.githubusercontent.com/u/123946?v=4)](https://github.com/webflo "webflo (153 commits)")[![AlexSkrypnyk](https://avatars.githubusercontent.com/u/378794?v=4)](https://github.com/AlexSkrypnyk "AlexSkrypnyk (22 commits)")[![szeidler](https://avatars.githubusercontent.com/u/1475847?v=4)](https://github.com/szeidler "szeidler (22 commits)")[![doxigo](https://avatars.githubusercontent.com/u/811655?v=4)](https://github.com/doxigo "doxigo (12 commits)")[![weitzman](https://avatars.githubusercontent.com/u/7740?v=4)](https://github.com/weitzman "weitzman (11 commits)")[![greg-1-anderson](https://avatars.githubusercontent.com/u/612191?v=4)](https://github.com/greg-1-anderson "greg-1-anderson (6 commits)")[![pfrenssen](https://avatars.githubusercontent.com/u/442924?v=4)](https://github.com/pfrenssen "pfrenssen (6 commits)")[![jnoordsij](https://avatars.githubusercontent.com/u/45041769?v=4)](https://github.com/jnoordsij "jnoordsij (4 commits)")[![derhasi](https://avatars.githubusercontent.com/u/118502?v=4)](https://github.com/derhasi "derhasi (4 commits)")[![jmolivas](https://avatars.githubusercontent.com/u/366275?v=4)](https://github.com/jmolivas "jmolivas (3 commits)")[![normanlolx](https://avatars.githubusercontent.com/u/3585653?v=4)](https://github.com/normanlolx "normanlolx (3 commits)")[![zaporylie](https://avatars.githubusercontent.com/u/1690685?v=4)](https://github.com/zaporylie "zaporylie (2 commits)")[![bradjones1](https://avatars.githubusercontent.com/u/981966?v=4)](https://github.com/bradjones1 "bradjones1 (2 commits)")[![jcnventura](https://avatars.githubusercontent.com/u/329663?v=4)](https://github.com/jcnventura "jcnventura (2 commits)")[![joco-sp](https://avatars.githubusercontent.com/u/51315716?v=4)](https://github.com/joco-sp "joco-sp (2 commits)")[![jonhattan](https://avatars.githubusercontent.com/u/482058?v=4)](https://github.com/jonhattan "jonhattan (2 commits)")[![jorissteyn](https://avatars.githubusercontent.com/u/448056?v=4)](https://github.com/jorissteyn "jorissteyn (2 commits)")[![MPParsley](https://avatars.githubusercontent.com/u/1823998?v=4)](https://github.com/MPParsley "MPParsley (2 commits)")[![petk](https://avatars.githubusercontent.com/u/1614009?v=4)](https://github.com/petk "petk (2 commits)")[![tannguyen04](https://avatars.githubusercontent.com/u/2858879?v=4)](https://github.com/tannguyen04 "tannguyen04 (2 commits)")

---

Tags

boilerplatecomposercomposer-projectdrupal-8drupal-project

### Embed Badge

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

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

###  Alternatives

[drupal-composer/drupal-project

Project template for Drupal 10 projects with Composer

1.6k829.0k](/packages/drupal-composer-drupal-project)[fourkitchens/sous-drupal-project

Starter project for Sous a Drupal distribution featuring a theme based on Emulsify Design System.

151.0k](/packages/fourkitchens-sous-drupal-project)[drupalwxt/wxt

Project template for Drupal 10 sites built with the WxT distribution.

29159.8k8](/packages/drupalwxt-wxt)[markaspot/mark-a-spot

Mark-a-Spot is a Drupal distribution for crowdmapping and public civic issue tracking

661.1k](/packages/markaspot-mark-a-spot)

PHPackages © 2026

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