Drupal now supports recipe unpacking.
The Recipe Unpacking system is a Composer plugin that manages "drupal-recipe" packages. Recipes are special Composer packages designed to bootstrap Drupal projects with necessary dependencies. When a recipe is required, this plugin "unpacks" it by moving the recipe's dependencies directly into your project's root composer.json, and removes the recipe as a project dependency.
This is added automatically for new projects, but can also be added to existing projects using composer require drupal/core-recipe-unpack
and the drupal:recipe-unpack
command.