wp-launchpad / launchpad

Launchpad is a framework for WordPress plugin that allows you to create a modern PHP plugin in no time.
https://wp-launchpad.gitbook.io/launchpad/
GNU General Public License v2.0
5 stars 0 forks source link

Make it easier to add protected dependency into the project #18

Open CrochetFeve0251 opened 2 months ago

CrochetFeve0251 commented 2 months ago

To add a dependency to the project today, it needs to be installed in multiple places.

Instead, we should a way to install a protected dependency in one step using cli.

For that we could create a new library for the cli which installs dependencies as development dependency, then registers them as protected inside Strauss and finally launch Composer to install the dependency.

Then that library can be called from a script inside the composer.json file so the user will be able to add a protected dependency in one command.

Another approach we could explore is to add a new parameter into composer so then we can execute the library while still using a Composer command.

CrochetFeve0251 commented 2 months ago

After some reflection on this feature, it looks like reversing the system would be a good idea.

Instead of adding a parameter of a command to protect the library, it would make more sense to protect them by default and add a command to protection them when needed or for dev dependencies.

CrochetFeve0251 commented 2 months ago

Looks like it is also possible doing that playing with event and keeping the main interface for the user being composer: