Skip to content

Commit 8db66a6

Browse files
committed
[10.x] Updated readme.
1 parent c3397b9 commit 8db66a6

File tree

1 file changed

+52
-47
lines changed

1 file changed

+52
-47
lines changed

Diff for: README.md

+52-47
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,98 @@
11
# Composer template for Drupal projects
22

33
[![CI](https://github.com/drupal-composer/drupal-project/actions/workflows/ci.yml/badge.svg?branch=10.x)](https://github.com/drupal-composer/drupal-project/actions/workflows/ci.yml)
4+
![LICENSE](https://img.shields.io/github/license/drupal-composer/drupal-project)
45

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

8-
## Usage
9+
> [!IMPORTANT]
10+
> [Drupal 11 branch](https://github.com/drupal-composer/drupal-project/tree/11.x) is available!
11+
12+
## What does the template do?
13+
14+
* Drupal will be installed in the `web` directory.
15+
* Generated composer autoloader `vendor/autoload.php` is used instead of
16+
`web/vendor/autoload.php` provided by Drupal core.
17+
* Modules (packages of type `drupal-module`) will be placed in `web/modules/contrib` directory.
18+
* Themes (packages of type `drupal-theme`) will be placed in `web/themes/contrib` directory.
19+
* Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib` directory.
20+
* Creates default writable versions of `settings.php` and `services.yml`.
21+
* Creates `web/sites/default/files` directory.
22+
* Drush is installed for use as `vendor/bin/drush`.
23+
* Provides an [example](.env.example) of the `.env` file.
924

10-
First you need to [install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx).
25+
## Installing
1126

12-
> Note: The instructions below refer to the [global Composer installation](https://getcomposer.org/doc/00-intro.md#globally).
27+
> [!NOTE]
28+
> The instructions below refer to the [global Composer installation](https://getcomposer.org/doc/00-intro.md#globally).
1329
You might need to replace `composer` with `php composer.phar` (or similar)
1430
for your setup.
1531

16-
After that you can create the project:
32+
Create your project:
1733

18-
```
34+
```bash
1935
composer create-project drupal-composer/drupal-project:10.x-dev some-dir --no-interaction
2036
```
2137

22-
With `composer require ...` you can download new dependencies to your
23-
installation.
24-
25-
```
26-
cd some-dir
27-
composer require drupal/devel
28-
```
29-
3038
The `composer create-project` command passes ownership of all files to the
3139
project that is created. You should create a new Git repository, and commit
3240
all files not excluded by the `.gitignore` file.
3341

34-
## What does the template do?
42+
## Usage
3543

36-
When installing the given `composer.json` some tasks are taken care of:
44+
### Adding new dependencies
3745

38-
* Drupal will be installed in the `web`-directory.
39-
* Autoloader is implemented to use the generated composer autoloader in `vendor/autoload.php`,
40-
instead of the one provided by Drupal (`web/vendor/autoload.php`).
41-
* Modules (packages of type `drupal-module`) will be placed in `web/modules/contrib/`
42-
* Theme (packages of type `drupal-theme`) will be placed in `web/themes/contrib/`
43-
* Profiles (packages of type `drupal-profile`) will be placed in `web/profiles/contrib/`
44-
* Creates default writable versions of `settings.php` and `services.yml`.
45-
* Creates `web/sites/default/files`-directory.
46-
* Latest version of drush is installed locally for use at `vendor/bin/drush`.
47-
* Latest version of DrupalConsole is installed locally for use at `vendor/bin/drupal`.
48-
* Creates environment variables based on your .env file. See [.env.example](.env.example).
46+
Use `composer require` to include and download dependencies for your project.
4947

50-
## Updating Drupal Core
48+
```bash
49+
cd some-dir
50+
composer require drupal/devel
51+
```
52+
53+
### Updating Drupal Core
5154

5255
This project will attempt to keep all of your Drupal Core files up-to-date; the
5356
project [drupal/core-composer-scaffold](https://github.com/drupal/core-composer-scaffold)
54-
is used to ensure that your scaffold files are updated every time drupal/core is
55-
updated. If you customize any of the "scaffolding" files (commonly `.htaccess`),
57+
is used to ensure that your scaffold files are updated every time `drupal/core`
58+
is updated.
59+
60+
If you customize any of the "scaffolding" files (commonly `.htaccess`),
5661
you may need to merge conflicts if any of your modified files are updated in a
5762
new release of Drupal core.
5863

59-
Follow the steps below to update your core files.
64+
Follow the steps below to update your Drupal core files.
6065

6166
1. Run `composer update "drupal/core-*" --with-dependencies` to update Drupal Core and its dependencies.
6267
2. Run `git diff` to determine if any of the scaffolding files have changed.
6368
Review the files for any changes and restore any customizations to
6469
`.htaccess` or `robots.txt`.
65-
1. Commit everything all together in a single commit, so `web` will remain in
70+
3. Commit everything all together in a single commit, so `web` will remain in
6671
sync with the `core` when checking out branches or running `git bisect`.
67-
1. In the event that there are non-trivial conflicts in step 2, you may wish
72+
4. In the event that there are non-trivial conflicts in step 2, you may wish
6873
to perform these steps on a branch, and use `git merge` to combine the
6974
updated core files with your customized files. This facilitates the use
7075
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;
7176
keeping all of your modifications at the beginning or end of the file is a
7277
good strategy to keep merges easy.
7378

74-
## FAQ
79+
## FAQs
7580

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

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

8186
### Should I commit the scaffolding files?
8287

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

9297
```json
9398
"scripts": {
@@ -102,14 +107,14 @@ post-update command in your composer.json:
102107
},
103108
```
104109

105-
### How can I apply patches to downloaded modules?
110+
### How can I apply patches to included dependencies?
106111

107-
If you need to apply patches (depending on the project being modified, a pull
108-
request is often a better solution), you can do so with the
109-
[composer-patches](https://github.com/cweagans/composer-patches) plugin.
112+
If you need to apply patches, you can do so with the
113+
[composer-patches](https://github.com/cweagans/composer-patches) plugin included
114+
in this project.
110115

111-
To add a patch to drupal module foobar insert the patches section in the extra
112-
section of composer.json:
116+
To add a patch to Drupal module `foobar`, insert the `patches` section in the
117+
`extra` section of `composer.json`:
113118

114119
```json
115120
"extra": {

0 commit comments

Comments
 (0)