Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Doc update #65

Merged
merged 1 commit into from
Sep 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,18 @@ This means you can execute the following command: `composer create-project your/

Read the [skeleton documentation](doc/SKELETON.md) to learn everything about how to create skeletons for your own application.

Narrowspark Automatic Configuration are defined in a `automatic.json` file or in the composer extra key `automatic` and can contain any number of other files and directories. For example, this is the `automatic.json` for `viserio/console`:
Narrowspark Automatic tasks are defined in a `automatic.json` file or in the composer extra key `automatic` and can contain any number of other files and directories. For example, this is the `automatic.json` for `viserio/console`:

```json
{
"providers": {
"Viserio\\Component\\Console\\Provider\\ConsoleServiceProvider": ["global"],
"Viserio\\Component\\Console\\Provider\\LazilyCommandsServiceProvider": ["global"]
},
"proxies": {
"Viserio\\Component\\Console\\Proxy\\Console": ["global"]
"configurators": {
"providers": {
"Viserio\\Component\\Console\\Provider\\ConsoleServiceProvider": ["global"],
"Viserio\\Component\\Console\\Provider\\LazilyCommandsServiceProvider": ["global"]
},
"proxies": {
"Viserio\\Component\\Console\\Proxy\\Console": ["global"]
}
},
"script-extenders": [
"Viserio\\Component\\Console\\Automatic\\CerebroScriptExtender"
Expand Down
38 changes: 23 additions & 15 deletions doc/CONFIGURATORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Configurators define the different tasks executed when installing a dependency,

The package only contain the tasks needed to install and configure the dependency, because Narrowspark Automatic Configurators are smart enough to reverse those tasks when uninstalling and unconfiguring the dependencies.

Narrowspark Automatic comes with several types of tasks, which are called **configurators**: `copy`, `env`, `composer-scripts`, `gitignore`, and `post-install-output`.
Narrowspark Automatic comes with several types of tasks, which are called **configurators**: `copy`, `env`, `composer-scripts`, `gitignore` and a special configurator `post-install-output`.

### Copy Configurator `copy`

Expand All @@ -20,8 +20,10 @@ directory of the application:

```json
{
"copy": {
"bin/check.php": "%BIN_DIR%/check.php"
"configurators": {
"copy": {
"bin/check.php": "%BIN_DIR%/check.php"
}
}
}
```
Expand Down Expand Up @@ -49,8 +51,10 @@ files stored in the root of your application project:

```json
{
"env": {
"APP_ENV": "dev"
"configurators": {
"env": {
"APP_ENV": "dev"
}
}
}
```
Expand All @@ -76,9 +80,11 @@ The value is an associative array where the key is the script to execute (includ

```json
{
"composer-scripts": {
"echo \"hallo\";": "php-script",
"bash -c \"echo hallo\"": "script"
"configurators": {
"composer-scripts": {
"echo \"hallo\";": "php-script",
"bash -c \"echo hallo\"": "script"
}
}
}
```
Expand Down Expand Up @@ -119,20 +125,22 @@ each line):

```json
{
"gitignore": [
".env",
"/public/bundles/",
"/var/",
"/vendor/"
]
"configurators": {
"gitignore": [
".env",
"/public/bundles/",
"/var/",
"/vendor/"
]
}
}
```

Similar to other configurators, the contents are copied into the `.gitignore`
file and wrapped with section separators (``###> your-package-name-here ###``)
that must not be removed or modified.

Post-install output Configurator `post-install-output`
The package messages `post-install-output`

Displays contents in the command console after the package has been installed.
Avoid outputting meaningless information and use it only when you need to show
Expand Down
2 changes: 1 addition & 1 deletion src/Automatic/Automatic.php
Original file line number Diff line number Diff line change
Expand Up @@ -1134,7 +1134,7 @@ private function showWarningOnRemainingConfigurators(

if (\count($packageConfigurators) !== 0) {
$this->container->get(IOInterface::class)->writeError(\sprintf(
'<warning>No configurators were run for [%s] in [%s]</warning>',
'<warning>Configurators [%s] did not run for package [%s]</warning>',
\implode(', ', $packageConfigurators),
$package->getPrettyName()
));
Expand Down