New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing Composer Script Handler #1

Merged
merged 7 commits into from Jan 23, 2019

Conversation

Projects
None yet
3 participants
@mickaelandrieu
Copy link
Contributor

mickaelandrieu commented Jan 22, 2019

Questions Answers
Branch? master
Description? This feature is about the management of native modules using Composer while not rely on Composer directly to manage the modules' dependencies
Type? new feature
Category? CO
BC breaks? yes (doing composer require "some/module" won't install the module into "modules" folder)
Deprecations? yes (composer/installer)
Fixed ticket? PrestaShop/PrestaShop#11619
How to test? Empty the modules folder then execute composer install at the root of your shop.

How does it works?

You can add modules into extra.prestashop.modules section.
On install/update processes, the script handlers are able to install or update the modules in the right place without altering the Shop's dependencies.


$ composer install

[...]


> PrestaShop\PrestaShop\Core\Composer\ModuleHandler::install
PrestaShop Module installer
Looked into "prestashop/blockreassurance" module (version ^3)
Module "blockreassurance" is already installed, skipped.
Looked into "prestashop/contactform" module (version ^4)
Module "contactform" successfully installed!

Looked into "prestashop/dashactivity" module (version ^2)
Module "dashactivity" is already installed, skipped.
Looked into "prestashop/dashgoals" module (version ^2)
Module "dashgoals" is already installed, skipped.
@@ -1,8 +1,7 @@
{
"name": "prestashop/composer-module-plugin",
"name": "prestashop/composer-script-handler",

This comment has been minimized.

@jolelievre

jolelievre Jan 22, 2019

Contributor

it's weird that the package name doesn't match the repo no?

This comment has been minimized.

@mickaelandrieu

mickaelandrieu Jan 22, 2019

Author Contributor

Agreed, I'll ask @eternoendless to update it (it was supposed to be a plugin, now a script handler)

throw new \InvalidArgumentException('The extra.prestashop setting must be an array or a configuration object.');
}
$processor = new ModulesConfigurationProcessor($event->getIO());

This comment has been minimized.

@jolelievre

jolelievre Jan 22, 2019

Contributor

maybe you could give $rootPath in the constructor, this would simplify the processInstallation and processUpdate methods

@mickaelandrieu mickaelandrieu force-pushed the proposal-v2 branch from 0c2126f to cfaf43c Jan 22, 2019

@mickaelandrieu mickaelandrieu changed the title Introducing Composer Script Handler [Do not review it yet please]Introducing Composer Script Handler Jan 22, 2019

mickaelandrieu added some commits Jan 23, 2019

@mickaelandrieu mickaelandrieu force-pushed the proposal-v2 branch from f7dfb53 to cbc2f0f Jan 23, 2019

@codecov-io

This comment has been minimized.

Copy link

codecov-io commented Jan 23, 2019

Codecov Report

❗️ No coverage uploaded for pull request base (master@2dc7fa9). Click here to learn what that means.
The diff coverage is 3.7%.

Impacted file tree graph

@@           Coverage Diff           @@
##             master     #1   +/-   ##
=======================================
  Coverage          ?   3.7%           
  Complexity        ?     35           
=======================================
  Files             ?      7           
  Lines             ?    108           
  Branches          ?      0           
=======================================
  Hits              ?      4           
  Misses            ?    104           
  Partials          ?      0
Impacted Files Coverage Δ Complexity Δ
src/Exceptions/InvalidPackageException.php 0% <0%> (ø) 1 <1> (?)
src/ScriptHandler.php 0% <0%> (ø) 7 <7> (?)
src/Actions/Update.php 0% <0%> (ø) 3 <3> (?)
src/ProcessExecutor.php 0% <0%> (ø) 5 <5> (?)
src/Actions/CreateProject.php 0% <0%> (ø) 3 <3> (?)
src/Package.php 0% <0%> (ø) 8 <8> (?)
src/ConfigurationProcessor.php 16% <16%> (ø) 8 <8> (?)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2dc7fa9...4ffc805. Read the comment docs.

@mickaelandrieu mickaelandrieu force-pushed the proposal-v2 branch 2 times, most recently from feb648c to 9919ab2 Jan 23, 2019

@mickaelandrieu mickaelandrieu changed the title [Do not review it yet please]Introducing Composer Script Handler [WIP] Introducing Composer Script Handler Jan 23, 2019

@mickaelandrieu mickaelandrieu force-pushed the proposal-v2 branch 2 times, most recently from 79e1596 to 72e1254 Jan 23, 2019

@mickaelandrieu mickaelandrieu force-pushed the proposal-v2 branch from 72e1254 to 4ffc805 Jan 23, 2019

@mickaelandrieu mickaelandrieu merged commit 7693de5 into master Jan 23, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@mickaelandrieu mickaelandrieu deleted the proposal-v2 branch Jan 23, 2019

@mickaelandrieu mickaelandrieu changed the title [WIP] Introducing Composer Script Handler Introducing Composer Script Handler Jan 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment