Update docs and add new aliases for unpack and eject

This commit is contained in:
Stevie Mayhew 2019-07-31 11:00:34 +12:00
parent 88cd7ed3a0
commit 85146843b6
2 changed files with 17 additions and 9 deletions

View File

@ -37,28 +37,35 @@ $ composer create-project silverstripe/recipe-cms ./myssproject ^1.0@dev
## Inlining recipes ## Inlining recipes
You can "inline" either a previously installed recipe, or a new one that you would like to include You can "inline" (aliased as "unpack" and "eject") either a previously installed recipe, or a new one that you would
dependencies for in your main project. By inlining a recipe, you promote its requirements, as well as like to include dependencies for in your main project. By inlining a recipe, you promote its requirements, as well as
its project files, up into your main project, and remove the recipe itself from your dependencies. its project files, up into your main project, and remove the recipe itself from your dependencies.
This can be done with either `update-recipe`, which will update a recipe, or `require-recipe` which will This can be done with either `update-recipe`, which will update a recipe, or `require-recipe` which will
install a new recipe. install a new recipe.
Note that if you wish to run this command you must first install either a recipe via normal composer
commands, or install the recipe plugin:
```shell ```shell
$ composer init
$ composer require silverstripe/recipe-plugin ^0.1
$ composer require-recipe silverstripe/recipe-cms ^1.0@dev $ composer require-recipe silverstripe/recipe-cms ^1.0@dev
``` ```
or or
```shell
$ composer unpack silverstripe/recipe-cms
```
or
```shell
$ composer eject silverstripe/recipe-cms
```
Note that if you wish to run this command you must first install either a recipe via normal composer
commands, or install the recipe plugin:
```shell ```shell
$ composer init $ composer init
$ composer require silverstripe/recipe-cms ^1.0@dev $ composer require silverstripe/recipe-cms ^1.0@dev
$ composer update-recipe silverstripe/recipe-cms
``` ```
## Removing recipe dependencies or files ## Removing recipe dependencies or files
@ -89,7 +96,7 @@ To remove a file, simply delete it from the folder your project is installed in,
`project-files-installed` (as this is how composer knows what not to re-install). `project-files-installed` (as this is how composer knows what not to re-install).
Likewise to remove a module, use `composer remove <module>` and it will be removed. As above, don't Likewise to remove a module, use `composer remove <module>` and it will be removed. As above, don't
modify `project-dependencies-instaleld`, otherwise that module will be re-installed on subsequent modify `project-dependencies-installed`, otherwise that module will be re-installed on subsequent
`composer update-recipe`. `composer update-recipe`.
## Un-doing a deleted project file / dependency ## Un-doing a deleted project file / dependency

View File

@ -19,6 +19,7 @@ class RequireRecipeCommand extends BaseCommand
{ {
$this->setName('require-recipe'); $this->setName('require-recipe');
$this->setDescription('Invoke this command to inline a recipe into your root composer.json'); $this->setDescription('Invoke this command to inline a recipe into your root composer.json');
$this->setAliases(['eject', 'unpack']);
$this->addArgument( $this->addArgument(
'recipe', 'recipe',
InputArgument::REQUIRED, InputArgument::REQUIRED,