Skip to content

Commit 01e73c5

Browse files
authored
refactor: update README.md, add version constraint v1.24.3 (#107)
1 parent 59d9ab3 commit 01e73c5

File tree

2 files changed

+30
-25
lines changed

2 files changed

+30
-25
lines changed

README.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
[![tests](https://github.com/ddev/ddev-drupal-contrib/actions/workflows/tests.yml/badge.svg)](https://github.com/ddev/ddev-drupal-contrib/actions/workflows/tests.yml) ![project is maintained](https://img.shields.io/maintenance/yes/2025.svg)
1+
[![add-on registry](https://img.shields.io/badge/DDEV-Add--on_Registry-blue)](https://addons.ddev.com)
2+
[![tests](https://github.com/ddev/ddev-drupal-contrib/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/ddev/ddev-drupal-contrib/actions/workflows/tests.yml?query=branch%3Amain)
3+
[![last commit](https://img.shields.io/github/last-commit/ddev/ddev-drupal-contrib)](https://github.com/ddev/ddev-drupal-contrib/commits)
4+
[![release](https://img.shields.io/github/v/release/ddev/ddev-drupal-contrib)](https://github.com/ddev/ddev-drupal-contrib/releases/latest)
25

36
# DDEV Drupal Contrib
47

@@ -11,27 +14,22 @@ DDEV integration for developing Drupal contrib projects. As a general philosophy
1114
2. `git clone` your contrib module
1215
3. cd [contrib module directory]
1316
4. Configure DDEV for Drupal using `ddev config --project-type=drupal --docroot=web --php-version=8.3 --corepack-enable --project-name=[module]` or select these options when prompted using `ddev config`
14-
- Remove underscores in the project name, or replace with hyphens. (DDEV will do this for you in v1.23.5+)
17+
- Remove underscores in the project name, or replace with hyphens. (DDEV will do this for you.)
1518
- See [Misc](#misc) for help on using alternate versions of Drupal core.
16-
5. Run `ddev add-on get ddev/ddev-drupal-contrib` (or `ddev get ddev/ddev-drupal-contrib` if your DDEV version is older than 1.23.5)
19+
5. Run `ddev add-on get ddev/ddev-drupal-contrib`
1720
6. Run `ddev start`
1821
7. Run `ddev poser`
1922
8. Run `ddev symlink-project`
2023
9. `ddev config --update` to detect expected Drupal and PHP versions.
2124
10. `ddev restart`
2225

23-
## Update
26+
After installation, make sure to commit the `.ddev` directory to version control.
2427

25-
For DDEV v1.23.5 or above run
28+
## Update
2629

27-
```sh
30+
```bash
2831
ddev add-on get ddev/ddev-drupal-contrib
29-
```
30-
31-
For earlier versions of DDEV run
32-
33-
```sh
34-
ddev get ddev/ddev-drupal-contrib
32+
ddev restart
3533
```
3634

3735
## Commands
@@ -73,24 +71,26 @@ Run tests on the `web/modules/custom` directory:
7371

7472
## Changing defaults
7573

76-
Override any environment variable value from [.ddev/config.contrib.yaml](config.contrib.yaml) by creating a `.ddev/config.local.yaml` (or [any filename lexicographically following config.contrib.yaml](https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#extending-configyaml-with-custom-configyaml-files)) file which has the same structure as [.ddev/config.contrib.yaml](config.contrib.yaml). Add your overrides under `web_environment`.
74+
Override any environment variable value from [.ddev/config.contrib.yaml](config.contrib.yaml) by creating a `.ddev/config.local.yaml` (or [any filename lexicographically following config.contrib.yaml](https://ddev.readthedocs.io/en/stable/users/extend/customization-extendibility/#extending-configyaml-with-custom-configyaml-files)) file which has the same structure as [.ddev/config.contrib.yaml](config.contrib.yaml). Add your overrides under `web_environment`.
7775

7876
### Changing the Drupal core version
7977

8078
In `.ddev/config.local.yaml` set the Drupal core version:
81-
```
79+
80+
```yaml
8281
web_environment:
8382
- DRUPAL_CORE=^11
8483
```
8584
8685
Then run `ddev restart` and then `ddev poser` to update the Drupal core version.
8786

88-
If Drupal core cannot be changed because the project is using an unsupported version of PHP, `ddev poser` will show a `composer` error. In that case, open `.ddev/config.yaml` and change the `PHP_VERSION` to a supported version; then run `ddev restart` and `ddev poser` again. Note that the project PHP version is set in `.ddev/config.yaml`, while the core version to use is set in `.ddev/config.local.yaml`.
87+
If Drupal core cannot be changed because the project is using an unsupported version of PHP, `ddev poser` will show a `composer` error. In that case, open `.ddev/config.yaml` and change the `PHP_VERSION` to a supported version; then run `ddev restart` and `ddev poser` again. Note that the project PHP version is set in `.ddev/config.yaml`, while the core version to use is set in `.ddev/config.local.yaml`.
8988

9089
### Changing the symlink location
9190

9291
In `.ddev/config.local.yaml` set the location relative to webroot (which usually is `web/`). Defaults to `modules/custom`
93-
```
92+
93+
```yaml
9494
web_environment:
9595
- ...
9696
- DRUPAL_PROJECTS_PATH=modules
@@ -127,7 +127,7 @@ You can set up a pre-commit hook that runs phpcbf:
127127
2. Add the following lines to the `pre-commit` file:
128128
129129
```bash
130-
#!/bin/bash
130+
#!/usr/bin/env bash
131131
132132
ddev phpcbf -q
133133
```
@@ -136,31 +136,31 @@ ddev phpcbf -q
136136

137137
## Add-on tests
138138

139-
Tests are done with Bats. It is a testing framework that uses Bash.
139+
Tests are done with Bats. It is a testing framework that uses Bash.
140140

141-
To run tests locally you need to first install bats' git submodules with:
141+
To run tests locally you need to first install bats' git submodules with:
142142

143-
```sh
143+
```bash
144144
git submodule update --init
145145
```
146146

147147
Then you can run within the root of this project:
148148

149-
```sh
149+
```bash
150150
./tests/bats/bin/bats ./tests
151151
```
152152

153-
Tests will be run using the default drupal core of the contrib. To test against a different Drupal core version, update the `TEST_DRUPAL_CORE` environment
153+
Tests will be run using the default drupal core of the contrib. To test against a different Drupal core version, update the `TEST_DRUPAL_CORE` environment
154154
variable.
155155

156156
i.e. `TEST_DRUPAL_CORE=11 ./tests/bats/bin/bats ./tests`.
157157

158-
Tests are triggered automatically on every push to the
158+
Tests are triggered automatically on every push to the
159159
repository, and periodically each night. The automated tests are agains all of
160160
the supported Drupal core versions.
161161

162-
Please make sure to attend to test failures when they happen. Others will be
163-
depending on you.
162+
Please make sure to attend to test failures when they happen. Others will be
163+
depending on you.
164164

165165
Also, consider adding tests to test for bugs or new features on your PR.
166166

@@ -180,4 +180,6 @@ type: drupal
180180
181181
Don't forget to run `ddev restart` if `.ddev/config.yaml` has been updated.
182182

183+
## Credits
184+
183185
**Contributed and maintained by [@weitzman](https://github.com/weitzman)**

install.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
name: ddev-drupal-contrib
2+
23
project_files:
34
- commands/web/eslint
45
- commands/web/expand-composer-json
@@ -11,3 +12,5 @@ project_files:
1112
- commands/web/stylelint
1213
- commands/web/symlink-project
1314
- config.contrib.yaml
15+
16+
ddev_version_constraint: '>= v1.24.3'

0 commit comments

Comments
 (0)