2017 © Pedro Peláez
 

composer-plugin discovery

Composer plugin for automatic project configuration and creation.

image

narrowspark/discovery

Composer plugin for automatic project configuration and creation.

  • Sunday, July 29, 2018
  • by dani33
  • Repository
  • 1 Watchers
  • 0 Stars
  • 91 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 12 Versions
  • 1 % Grown

The README.md

Narrowspark Automatic

, (*1)

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., (*2)

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 an Automatic extended app, your Application can perform tasks before and after the execution of Composer tasks., (*3)

Consider the following example:, (*4)

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., (*5)

Note The automatic.json and composer.json extra key automatic are used to configure Narrowspark Automatic with configurators, script executors, custom-configurators, and more., (*6)

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., (*7)

Note Narrowspark Automatic keeps tracks of the configuration, in a automatic.lock file, which must be committed to your code repository., (*8)

Using Narrowspark Automatic in New Applications

Include Narrowspark Automatic as a required dependency to your app with this command: composer require narrospark/automatic., (*9)

Using Narrowspark Automatic for Skeleton Application

Narrowspark Automatic supports skeleton generation. For example this is your composer.json file:, (*10)

{
    "type": "project",
    "license": "MIT",
    "require": {
        "php": "^7.2",
        "ext-mbstring": "*",
        "narrowspark/automatic": "^0.3.5",
        "narrowspark/skeleton-generators": "^0.1.0"
    },
    "extra": {
        "app-dir": "app",
        "config-dir": "config",
        "database-dir": "database",
        "public-dir": "public",
        "resources-dir": "resources",
        "routes-dir": "routes",
        "storage-dir": "storage",
        "tests-dir": "tests"
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "exclude-from-classmap": [
            "tests/"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

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., (*11)

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., (*12)

Read the skeleton documentation to learn everything about how to create skeletons for your own app., (*13)

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:, (*14)

{
    "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"
    ]
}

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

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 app file., (*16)

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., (*17)

Read the configuration documentation to learn everything about how to create configuration for your own packages., (*18)

Automatic extends Composer

Narrowspark Automatic adds a parallel downloader with the feature to skip old dependencies tags for a download boost., (*19)

With the below example you can see how to add a skip tag to Narrowspark Automatic, with this it will skip all tags of cakephp that are older then 3.5., (*20)

{
    "extra": {
        "automatic": {
            "require": {
                "cakephp/cakephp": ">=3.5"
            }
        }
    }
}

You can skip auto discovery for packages with this Narrowspark Automatic key dont-discover in your composer.json extra automatic section. Use the package name to skip the auto discovery, like in this example:, (*21)

{
    "extra" : {
        "dont-discover": [
            "viserio/console"
        ]
    }
}

Auto discovery will now be skipped for viserio/console., (*22)

Automatic Security Audit

Narrowspark Automatic shows you on every composer install and composer update known security vulnerabilities for your installed dependencies based on FriendsOfPHP/security-advisories database., (*23)

If you like to change the default HTTP timeout = 20 for the downloader, add audit to your composer.json extra section, like in this example:, (*24)

{
    "extra" : {
        "audit": {
            "timeout": "30"
        }
    }
}

Testing

You need to run: bash $ php vendor/bin/phpunit, (*25)

Versioning

This library follows semantic versioning, and additions to the code ruleset are performed in major releases., (*26)

Changelog

Please have a look at CHANGELOG.md., (*27)

Contributing

Please have a look at CONTRIBUTING.md., (*28)

Code of Conduct

Please have a look at CODE_OF_CONDUCT.md., (*29)

Credits

License

This package is licensed using the MIT License., (*30)

Please have a look at LICENSE.md., (*31)

The Versions

29/07 2018

dev-master

9999999-dev http://github.com/narrowspark/discovery

Composer plugin for automatic project configuration and creation.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • composer-plugin-api ^1.0
  • ext-mbstring *

 

The Development Requires

composer-plugin discovery narrowspark viserio

27/07 2018

v0.1.7

0.1.7.0 http://github.com/narrowspark/discovery

Composer plugin for automatic project configuration and creation.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • ext-mbstring *
  • composer-plugin-api ^1.0

 

The Development Requires

composer-plugin discovery narrowspark viserio

25/07 2018

v0.1.6

0.1.6.0 http://github.com/narrowspark/discovery

Composer plugin for automatic project configuration and creation.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • ext-mbstring *
  • composer-plugin-api ^1.0

 

The Development Requires

composer-plugin discovery narrowspark viserio

11/07 2018

v0.1.5

0.1.5.0 http://github.com/narrowspark/discovery

Composer plugin for automatic project configuration and creation.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • ext-mbstring *
  • composer-plugin-api ^1.0

 

The Development Requires

composer-plugin discovery narrowspark viserio

10/07 2018

v0.1.4

0.1.4.0 http://github.com/narrowspark/discovery

Composer plugin for automatic project configuration and creation.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • ext-mbstring *
  • composer-plugin-api ^1.0

 

The Development Requires

composer-plugin discovery narrowspark viserio

11/05 2018

v0.1.3

0.1.3.0 http://github.com/narrowspark/discovery

Composer plugin for automatic project configuration and creation.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • ext-mbstring *
  • composer-plugin-api ^1.0

 

The Development Requires

composer-plugin discovery narrowspark viserio

11/05 2018

v0.1.2

0.1.2.0 http://github.com/narrowspark/discovery

Composer plugin for automatic project configuration and creation.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • ext-mbstring *
  • composer-plugin-api ^1.0

 

The Development Requires

composer-plugin discovery narrowspark viserio

08/05 2018

v0.1.1

0.1.1.0 http://github.com/narrowspark/discovery

Composer plugin for narrowspark automated configuration.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • ext-mbstring *
  • composer-plugin-api ^1.0

 

The Development Requires

composer-plugin discovery narrowspark viserio

08/05 2018

v0.1.0

0.1.0.0 http://github.com/narrowspark/discovery

Composer plugin for narrowspark automated configuration.

  Sources   Download

MIT

The Requires

  • php ^7.2
  • ext-mbstring *
  • composer-plugin-api ^1.0

 

The Development Requires

composer-plugin discovery narrowspark viserio

01/05 2018

dev-issue-12

dev-issue-12 http://github.com/narrowspark/discovery

Composer plugin for narrowspark automated configuration.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer-plugin discovery narrowspark viserio

29/04 2018

dev-issue-11

dev-issue-11 http://github.com/narrowspark/discovery

Composer plugin for narrowspark automated configuration.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer-plugin discovery narrowspark viserio

29/04 2018

dev-issue-8

dev-issue-8 http://github.com/narrowspark/discovery

Composer plugin for narrowspark automated configuration.

  Sources   Download

MIT

The Requires

 

The Development Requires

composer-plugin discovery narrowspark viserio