Download the PHP package sweetchuck/composer-suite without Composer
On this page you can find all versions of the php package sweetchuck/composer-suite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sweetchuck/composer-suite
More information about sweetchuck/composer-suite
Files in sweetchuck/composer-suite
Package composer-suite
Short Description Generates multiple variations of the original composer.json
License GPL-3.0-or-later
Homepage https://github.com/Sweetchuck/composer-suite
Informations about the package composer-suite
Composer Suites
Generates multiple variations of the original composer.json
- You have to define the differences in the composer.json#/extra/composer-suite, see the examples below.
- Next step is to generate the alternative composer.json files by running the
following command: \
composer -vv suite:generate
- Activate one of the alternative composer.json file by setting the
COMPOSER environment variable.
export COMPOSER='composer.my-suite-01.json'
composer update --lock
Other benefit is that, if there is any relative path in the composer.json
–
for example under the #/repositories/FOO/url
or anywhere under the #/extra
–
then those paths will work with the alternative composer.*.json files as well.
Example composer.json - multi-version dependency
Run: composer suite:generate
\
The generated files: \
composer.symfony4.json
composer.symfony5.json
Then
Example composer.json - local development
Use case
A certain third-party service has to be integrated into a framework.
Composer packages:
- RestAPI client (type: library)
- module/plugin for the framework (type: library)
- the framework (type: project)
Run: composer suite:generate
\
The generated file: \
composer.local.json
Then
Suites
You can have as many suites as many you want.
As the examples above show that, suites can be defined in the
composer.json#/extra/composer-suite
, but suite definitions can be stored in
external files as well. \
./.composer-suite/composer-suite.*.json
.
Then it is up to you if these files will be tracked by the VCS or not.
Example ./.composer-suite/composer-suite.foo.json
:
The name
key is optional. If it is omitted then, the suite name will be parsed
from the file name.
If two suites have the same name, then the one which comes from external file, has the highest priority.
Actions
You can define different array manipulation actions under the
extra/composer-suite/<suite-id>
keys.
An action has two main properties:
- type (string) Identifier of the action.
- config (mixed) The data type is usually array, but it depends on the
type
.
Action - replaceRecursive
Official PHP documentation: array_replace_recursive()
- parents: array
- items: array
Result:
Action - unset
Removes the specified elements.
- parents: array
Result:
In the "config.parents" array the last item can be an array:
Result:
Action - prepend
Adds new elements at the beginning of an array.
- parents: array
- items: array
Result:
Action - append
Adds new elements at the end of an array.
- parents: array
- items: array
Action - insertBefore
Insert one or more "items". The last item in the "parents" is the reference point.
- parents: array
- items: array
Action - insertAfter
Insert one or more "items". The last item in the "parents" is the reference point.
- parents: array
- items: array
Commands
This Composer plugin defines the following commands:
composer suite:list
composer suite:generate
Validate
You can check the status of the autogenerated files by running the official
COMPOSER='composer.json' composer validate
command. \
If one of the autogenerated file is exists AND out-of-date, then the exit
code will be other than 0
. \
This command does not report any problem about the missing composer.*.json files.
Links
Other
"$(composer config bin-dir)/codecept" _completion --generate-hook --program codecept | source /dev/stdin
All versions of composer-suite with dependencies
ext-json Version *
composer-plugin-api Version ^2.0
sweetchuck/composer-suite-handler Version ^1.0
symfony/filesystem Version ^4.4 || ^5.4 || ^6.0 || ^7.0
symfony/finder Version ^4.4 || ^5.0 || ^6.0 || ^7.0