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

docs : follow google docs standard and fixed loading of aliases #132

Merged
merged 9 commits into from
Oct 22, 2019
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ infectionlog.txt

/build/logs
/vendor
/node_modules/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10.16.0
34 changes: 34 additions & 0 deletions .textlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"filters": {},
"rules": {
"en-capitalization": true,
"footnote-order": true,
"no-todo": true,
"no-dead-link": {
"ignore": [
"bc_data_*",
]
},
"no-empty-section": true,
"terminology": true,
"apostrophe": true,
"diacritics": true,
"@textlint-rule/no-invalid-control-character": true,
"@textlint-rule/no-unmatched-pair": true,
"abbr-within-parentheses": true,
"alex": {
"allow": [
"period",
"european",
"failure",
"fore",
"attack",
"execution",
"executed",
"remain",
"execute"
]
},
"@textlint-rule/preset-google": true
}
}
12 changes: 12 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ cache:
directories:
- $HOME/.composer/cache/files
- $HOME/.php-cs-fixer
- $HOME/node_modules

before_install:
- stty cols 120
Expand Down Expand Up @@ -71,6 +72,17 @@ jobs:
script:
- composer cs-check

- stage: Coding standard
php: 7.2
before_install:
- echo "skip"
install:
- npm install
before_script:
- echo "skip"
script:
- npm run lint

- stage: Static Analysis
php: 7.2
env: REMOVE_XDEBUG=false SETUP=high COMPOSER_VERSION=1.9.0
Expand Down
36 changes: 19 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,34 @@ Branch Status
[![Travis branch](https://img.shields.io/travis/narrowspark/automatic/master.svg?longCache=false&style=for-the-badge)](https://travis-ci.org/narrowspark/automatic)
[![Appveyor branch](https://img.shields.io/appveyor/ci/narrowspark/automatic/master.svg?longCache=false&style=for-the-badge)](https://ci.appveyor.com/project/narrowspark/automatic/branch/master)

Narrowspark Automatic automates the most common tasks of applications, like installing and removing bundles/providers, copying files, boosting dependencies downloads, creating skeletons and other Composer dependencies based configurations.
Narrowspark Automatic automates the most common tasks of applications, like installing and removing bundles or providers, copying files, boosting dependencies downloads, creating skeletons and other Composer dependencies based configurations.

How Does Narrowspark Automatic Work
------------

Narrowspark Automatic is a Composer plugin that modifies the behavior of the `require`, `update`, `create project`, and `remove` commands. When installing or removing dependencies in a Automatic-enabled application, your Application can perform tasks before and after the execution of Composer tasks.
Narrowspark Automatic is a Composer plugin that modifies the behavior of the `require`, `update`, `create project`, and `remove` commands.
When installing or removing dependencies in an Automatic extended app, your Application can perform tasks before and after the execution of Composer tasks.

Consider the following example:

```bash
cd your-project
composer require viserio/console
```

If you execute this command in your Application that doesn't support Narrowspark Automatic, this command will execute in the normal composer require behavior.
If you execute this command in your Application that doesnt support Narrowspark Automatic, this command will execute in the normal composer require behavior.

> NOTE: The `automatic.json` and composer.json extra key `automatic` are used to configure Narrowspark Automatic with configurators, script executors, custom-configurators and more.
> **Note** The `automatic.json` and composer.json extra key `automatic` are used to configure Narrowspark Automatic with configurators, script executors, custom-configurators, and more.

When Narrowspark Automatic is installed in your Application, it will check if a `automatic.json` file or a composer.json extra key with `automatic` exists.
In the above example, Automatic decided which automated tasks need to be run after the installation.

> NOTE: Narrowspark Automatic keeps tracks of the configuration, in a `automatic.lock` file, which must be committed to your code repository.
> **Note** Narrowspark Automatic keeps tracks of the configuration, in a `automatic.lock` file, which must be committed to your code repository.

Using Narrowspark Automatic in New Applications
------------

Include Narrowspark Automatic as a required dependency to your application with this command:
Include Narrowspark Automatic as a required dependency to your app with this command:
`composer require narrospark/automatic`.

Using Narrowspark Automatic for Skeleton Application
Expand Down Expand Up @@ -86,16 +88,16 @@ Narrowspark Automatic supports skeleton generation. For example this is your `co
Automatic search all packages for the package type: `automatic-skeleton`.
If packages are found with this type, all skeletons will be saved in the `automatic.lock` for the runtime.

This means you can execute the following command: `composer create-project your/project` to create a Automatic-enabled application, Automatic will ask which skeleton should be generated for your application.
This means you can execute the following command: `composer create-project your/project` to create an Automatic extended app, Automatic will ask which skeleton can be generated for your app.

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

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
{
"configurators": {
"providers": {
"providers": {
"Viserio\\Component\\Console\\Provider\\ConsoleServiceProvider": ["global"],
"Viserio\\Component\\Console\\Provider\\LazilyCommandsServiceProvider": ["global"]
},
Expand All @@ -109,15 +111,15 @@ Narrowspark Automatic tasks are defined in a `automatic.json` file or in the com
}
```

The `providers` and `proxies` option tells Narrowspark Automatic in which environments this `provider`, `proxy` should be enabled automatically (all in this case).
The `providers` and `proxies` option tells Narrowspark Automatic in which environments this `provider`, `proxy` can be turn on automatically (all in this case).

Finally the `script-extenders` option adds a new script executor to the Narrowspark Automatic `auto-scripts`.
Now you can run `viserio console` commands in the `auto-scripts` section of your `composer.json` application file.
Now you can run `viserio console` commands in the `auto-scripts` section of your `composer.json` app file.

The instructions defined in this `automatic.json` file are also used by Narrowspark Automatic when uninstalling dependencies (e.g. `composer remove viserio/console`) to undo all changes.
This means that Automatic can remove the Console Provider and Proxy from the application and remove the script executor from Narrowspark Automatic.
The instructions defined in this `automatic.json` file are also used by Narrowspark Automatic when uninstalling dependencies (for example `composer remove viserio/console`) to undo all changes.
This means that Automatic can remove the Console Provider and Proxy from the app and remove the script executor from Narrowspark Automatic.

Read the [configuration documentation](doc/CONFIGURATORS.md) to learn everything about how to create configuration for your own packages.
Read the [configuration documentation](docs/CONFIGURATORS.md) to learn everything about how to create configuration for your own packages.

Automatic extends Composer
------------
Expand Down Expand Up @@ -179,15 +181,15 @@ $ php vendor/bin/phpunit
Contributing
------------

If you would like to help take a look at the [list of issues](http://github.com/narrowspark/testing-helper/issues) and check our [Contributing](CONTRIBUTING.md) guild.
If you would like to help take a look at the [list of issues](https://github.com/narrowspark/testing-helper/issues) and check our [Contributing](CONTRIBUTING.md) guild.

> **Note:** Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
> **Note** Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Credits
-------------

- [Daniel Bannert](https://github.com/prisis)
- [All Contributors](../../contributors)
- [All Contributors](https://github.com/narrowspark/automatic/graphs/contributors)
- Narrowspark Automatic has been inspired by [symfony/flex](https://github.com/symfony/flex)

License
Expand Down
29 changes: 14 additions & 15 deletions doc/CONFIGURATORS.md → docs/CONFIGURATORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ 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`, `composer-auto-scripts`, `gitignore` and a special configurator `post-messages`.
Narrowspark Automatic comes with several types of tasks, which are called **configurators:** `copy`, `env`, `composer-scripts`, `composer-auto-scripts`, `gitignore` and a special configurator `post-messages`.

### Copy Configurator `copy`

Copies files or directories from the Composer package contents to your application. It's defined as an associative array where the key is the original file/directory and the value is the target file/directory.
Copies files or directories from the Composer package contents to your app. Its defined as an associative array where the key is the original file or directory and the value is the target file or directory.

This example copies the ``bin/check.php`` script of the package into the binary
directory of the application:
This example copies the `bin/check.php` script of the package into the binary
directory of the app:

```json
{
Expand All @@ -28,7 +28,7 @@ directory of the application:
}
```

The `%BIN_DIR%` string is a special value that it's turned into the absolute
The `%BIN_DIR%` string is a special value that its turned into the absolute
path of the binaries directory. You can access any variable defined in
the `extra` section of your root `composer.json` file:

Expand All @@ -47,7 +47,7 @@ Now you can use `%MY_SPECIAL_DIR%` in your configurator.
### Env Configurator `env`

Adds the given list of environment variables to the `.env` and `.env.dist`
files stored in the root of your application project:
files stored in the root of your app project:

```json
{
Expand All @@ -70,7 +70,7 @@ APP_ENV=dev

The `###> your-package-name-here ###` section separators are needed by Narrowspark Automatic
to detect the contents added by this dependency in case you uninstall it later.
> !!! Don't remove or modify these separators.
> !!! Dont remove or modify these separators.

### Composer Auto Scripts Configurator `composer-auto-scripts`

Expand Down Expand Up @@ -106,7 +106,7 @@ Only the composer `command`, `installer` and `package` events are supported, you
```

You can create your own script executor, create a new executor class in your `Automatic` folder, inside your Package. The class needs to extend `Narrowspark\Automatic\Common\ScriptExtender\AbstractScriptExtender`.
You have a example below:
You have an example below:

```php
<?php
Expand Down Expand Up @@ -136,9 +136,8 @@ final class ScriptExtender extends AbstractScriptExtender

### Gitignore Configurator `gitignore`

Adds patterns to the ``.gitignore`` file in your project. Define those
patterns as a simple array of strings (a `PHP_EOL` character is added after
each line):
Adds patterns to the `.gitignore` file in your project.
Define those patterns as an array of strings (a `\n` character is added after each line):

```json
{
Expand All @@ -154,7 +153,7 @@ each line):
```

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

### The package messages `post-messages`
Expand All @@ -163,7 +162,7 @@ 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
help messages or the next step actions.

* The contents must be defined in the `automatic` section of your package composer.json or the `automatic.json` file (a `PHP_EOL` character is added after each line). [Symfony Console styles and colors](https://symfony.com/doc/current/console/coloring.html) are supported too:
* The contents must be defined in the `automatic` section of your package composer.json or the `automatic.json` file (a `\n` character is added after each line). [Symfony Console styles and colors](https://symfony.com/doc/current/console/coloring.html) are supported too:

```json
{
Expand Down Expand Up @@ -244,11 +243,11 @@ This example shows you, how to add a new Package Configurator in your `composer.

After you choose a way, you can create your Configurator(s).

> NOTE: You can't overwrite registered configurators.
> **Note** You cant overwrite registered configurators.

To create a configurator you need to extend the `Narrowspark\Automatic\Common\Configurator\AbstractConfigurator` class.

The example below shows you, how your configurator class should look after the `Narrowspark\Automatic\Common\Configurator\AbstractConfigurator` was extend:
The example below shows you, how your configurator class must look after the `Narrowspark\Automatic\Common\Configurator\AbstractConfigurator` was extend:

```php
<?php
Expand Down
4 changes: 2 additions & 2 deletions doc/SKELETON.md → docs/SKELETON.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The following example shows how your `composer.json` can look:

To create a skeleton generator you need to extend the `Narrowspark\Automatic\Common\Generator\AbstractGenerator` class.

The example below shows you, how your generator class should look after the `Narrowspark\Automatic\Common\Generator\AbstractGenerator` was extend:
The example below shows you, how your generator class must look after the `Narrowspark\Automatic\Common\Generator\AbstractGenerator` was extend:

```php
<?php
Expand Down Expand Up @@ -101,4 +101,4 @@ class Generator extends AbstractGenerator
}
```

> NOTE: You can always register only one skeleton type of a generator.
> **Note** You can always register only one skeleton type of a generator.
Loading