$ composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interact
composer require cweagans/composer-patches
$ composer require "drupal/address ~8.1"
"extra": {
"installer-paths": {
"web/core": ["type:drupal-core"],
"web/libraries/{$name}": ["type:drupal-library"],
"web/modules/contrib/{$name}": ["type:drupal-module"],
"web/profiles/contrib/{$name}": ["type:drupal-profile"],
"web/themes/contrib/{$name}": ["type:drupal-theme"],
"drush/contrib/{$name}": ["type:drupal-drush"]
},
"patches": {
"drupal/address": {
"Drupal Addess fix default syncing": "https://www.drupal.org/files/issues/address_syncing.patch"
}
}
}
As you could see, the format is a straightforward entry in patches group, providing the package to patch and the URL of the patch to be download with a human comment.
composer install
or composer update
your patches will be applied, and you will get an output similar to the next image.