Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
neclimdul committed Jun 13, 2023
2 parents 71474fe + cbf4b6f commit 83bdd2c
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ The format is based on [Keep a Changelog][] and this project adheres to the

### Security

## [2.0.1] - 2021-12-15
### Changed
- Add support for composer/installers 2.x

## [2.0.0] - 2020-08-11
### Added
- Add `.editorconfig`, `.gitignore`, `.lando.yml`, `phpcs.xml` and `phpunit.xml`
Expand Down
30 changes: 25 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,25 @@ automatically required as well if not already required.
To support additional package types, add an array of these types in the
`extra` property in your `composer.json`:

with [`composer/installers`][] < v1.0.13:
```json
{
"extra": {
"installer-types": ["library"]
}
}
```
with [`composer/installers`][] >= v1.0.13:
```json
{
"extra": {
"installer-types": ["drupal-library"]
}
}
```
Then refer to that type when adding to `installer-paths`:

Then, you can add mappings for packages of these types in the same way that you
would add package types that are supported by [`composer/installers`][]:

with [`composer/installers`][] < v1.0.13:
```json
{
"extra": {
Expand All @@ -59,6 +67,18 @@ would add package types that are supported by [`composer/installers`][]:
}
}
```
with [`composer/installers`][] >= v1.0.13:
```json
{
"extra": {
"installer-types": ["drupal-library"],
"installer-paths": {
"special/package/": ["my/package"],
"path/to/libraries/{$name}/": ["type:drupal-library"]
}
}
}
```

By default, packages that do not specify a `type` will be considered the type
`library`. Adding support for this type allows any of these packages to be
Expand All @@ -68,9 +88,9 @@ If a type has been added to `installer-types`, the plugin will attempt to find
an explicit installer path in the mapping. If there is no match either by name
or by type, the default installer path for all packages will be used instead.

Please see the README for [`composer/installers`][] to see the supported syntax
**Please see the README for [`composer/installers`][] to see the supported syntax
for package and type matching as well as the supported replacement tokens in
the path (e.g. `{$name}`).
the path (e.g. `{$name}`).**

## License

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"require": {
"php": ">=7.1",
"composer-plugin-api": "^1.1 || ^2.0",
"composer/installers": "^1.0"
"composer/installers": "^1.0 || ^2.0"
},
"require-dev": {
"composer/composer": "^2.0",
Expand Down

0 comments on commit 83bdd2c

Please sign in to comment.