Skip to content

Commit

Permalink
[DOCS] Add documentation for new project-level Composer command
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed Mar 19, 2023
1 parent c0f8cde commit 1e77407
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 24 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
]
myst_enable_extensions = [
"colon_fence",
"deflist",
"substitution"
]
myst_heading_anchors = 3
Expand Down
44 changes: 22 additions & 22 deletions docs/usage/composer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,46 @@
* [Composer][1] >= 2.1
* [PHP][2] >= 8.1

## Basic usage
## Global usage

This project should always be used together with the [`create-project`][3]
Composer command:
For a quick start, the project can be used together with Composer's
built-in [`create-project`][3] command:

```bash
composer create-project cpsit/project-builder <projectname>
composer create-project cpsit/project-builder --no-dev <projectname>
```

Replace `<projectname>` with the actual name of your new project. This will
be the folder name where to install and set up your project.

```{seealso}
For more command options, refer to the documentation of the
[`create-project`][3] command.
```{tip}
Add the `-v` (or `--verbose`) command option to get a verbose
output of processing steps.
```

## Recommended usage
## Project-level usage

We recommend using the command like follows:
The project can also be integrated into an existing project as a Composer
plugin:

```bash
composer create-project cpsit/project-builder \
--prefer-dist \
--no-dev \
<projectname>
composer require --dev cpsit/project-builder
```

This implies usage of the following options:
Once installed, an additional Composer command `project:create` is available:

* **`--prefer-dist`** ensures that only distributed files are installed
skipping files that are only relevant for development of this repository
* **`--no-dev`** speeds up the installation process by skipping
dev-requirements (those are only required for development purposes)

```{tip}
Add the `-v` (or `--verbose`) command option to get a verbose
output of processing steps.
```bash
composer project:create <target-directory> [-f|--force]
```

The following command parameters are available:

**`target-directory`**
: Path to a directory where to create the new project

**`-f`, `--force`**
: Force project creation even if target directory is not empty

[1]: https://getcomposer.org/
[2]: https://www.php.net/
[3]: https://getcomposer.org/doc/03-cli.md#create-project
6 changes: 4 additions & 2 deletions docs/usage/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ where to install and set up your new project. Make sure to always mount
the volume to `/app`.

```{note}
In the entrypoint, `composer create-project` is executed. It already
contains all [recommended command options](composer.md#recommended-usage).
In the Docker entrypoint,
[`composer project:create`](composer.md#project-level-usage) is executed.
You can pass all available command parameters as Docker command (except
for `target-directory`, which is explicitly set to `/app` within the container).
```

## Available image tags
Expand Down

0 comments on commit 1e77407

Please sign in to comment.