Closed viktorprogger closed 3 years ago
Seems to be entirely possible with PRE_PACKAGE_INSTALL
and PRE_PACKAGE_UPDATE
that are executed before new files are fetched into vendor. This way we can get config we're updating from and, indeed, we don't need dist
in this case.
Interactive IO is possible as well with:
/** @var IOInterface $io */
$io->ask('bla-bla');
As an additional option config asks we can have an option to skip copying default config (or all default configs). That will be useful for having totally custom configs that aren't related to what's in the packages.
In my opinion we can fully remove
dist
directories/files from a project instead of #42. Not just remove, but replace with another functionality.I see 6 use-cases to activate this package as a composer plugin:
composer install
whencomposer.lock
existscomposer install
whencomposer.lock
does not existcomposer update
composer require
an existing package, but in another versioncomposer require
a new packagecomposer require yiisoft/config
config
package should provide the choice for a user (read below about it).config
package should copy all the configurations from thevendor
directory (for a single package in case 5 and for all the packages in case 6), and ask a user what to do when a file with the required name exists in a project.Let's talk about the logic when the plugin sees some differences
When there are some differences, the plugin should ask a user what to do. All available variants are:
vendor
directory after package updating/requiring).When a composer command is executed in a non-interactive mode, then the
config
package should automatically choose the default variant.