In order to write some tests for #180, I'd like to get an overview of the various package-selection-specific switches and how they go together (if at all).
In particular, we've got:
require-all
require
require-dependencies
require-dev-dependencies
minimum-stability
- Packages can be supplied on the command line
Additionally, the way replace is used (some bugs fixed recently) might come into play.
Update
Here's how I think that the various switches should go together.
At all stages, packages not matching the minimum-stability will be discarded and their dependencies will not be followed.
Step 1 – Initial package selection
require-all |
No package filter provided |
With package filter |
true |
Select all packages from all repos. |
From all repos, select packages by name (given as filter). |
false |
Select packages according to require list and version constraints. |
Take only those version constraints from the require list that are given in the filter. |
Step 2 – Add/follow dependencies
- If
require-dependencies and require-dev-dependencies is not set, nothing to do.
- Otherwise, for all (dev) dependencies for all selected packages:
- Add all packages that match (dev) dependency and version constraint to selection list.
- Recursively process newly added packages.
Caveats
- For "partial" (filtered) updates, merge found/processed packages into existing
packages.json. Also make sure we don't lose package versions not present in the update.
- Special handling for "Composer" type repositories with providers might apply.
- Alias packages can be ignored.
- Special handling for
provides/replace?
In order to write some tests for #180, I'd like to get an overview of the various package-selection-specific switches and how they go together (if at all).
In particular, we've got:
require-allrequirerequire-dependenciesrequire-dev-dependenciesminimum-stabilityAdditionally, the way
replaceis used (some bugs fixed recently) might come into play.Update
Here's how I think that the various switches should go together.
At all stages, packages not matching the
minimum-stabilitywill be discarded and their dependencies will not be followed.Step 1 – Initial package selection
require-alltruefalserequirelist and version constraints.requirelist that are given in the filter.Step 2 – Add/follow dependencies
require-dependenciesandrequire-dev-dependenciesis not set, nothing to do.Caveats
packages.json. Also make sure we don't lose package versions not present in the update.provides/replace?