yawik / standard

Starting point for Yawik Application
https://yawik.org
MIT License
2 stars 0 forks source link

using zf component installer #3

Open TiSiE opened 5 years ago

TiSiE commented 5 years ago

yawik/standard should require the zendframework/zend-component-installer ^2.0

That will enhance / simplify the following:


I know, the component installer will display prompts during the installation which is generally bad for automatic build processes - but luckily that can be circumvented by using the no-interactions flag of composer.

kilip commented 5 years ago

Assets installation will include a newly installed module currently, as the module is not injected, the install assets command run will not know nothing about the new module, so you have to manually run the command after you added the module to the configuration.

Looks like a better way to do this assets is by creating a Composer Plugin. What do you think @TiSiE do you want to add this Composer plugin in Install module, or should we create a new package for this Composer plugin?

TiSiE commented 5 years ago

I don't get what you mean. Replace the yawik assets-install command? And how will a plugin work? I'm a little confused at the moment...

kilip commented 5 years ago

@TiSie right now assets-install command only detect injected modules in modules.config.php. So it can not detect Yawik modules that are available but not injected yet.

The best way to detect this non injected yawik modules is by creating a composer plugin which can detect type: yawik-module in composer.json

We can use existing code, and create composer plugin that can use that code.

I forget that we can not use existing modules for this plugin. Composer only register plugin that have type: composer-plugin in composer.json. so we need create a new repo: yawik/composer

kilip commented 5 years ago

@TiSiE I have created new repo: yawik/composer-plugin, and it's already integrated into yawik/standard: https://travis-ci.org/yawik/standard/jobs/454337856#L1513

This module will install/uninstall assets automatically during composer command, just like zend-component-installer. Unit tests for this plugin still required, I will working on that later.

TiSiE commented 5 years ago

@kilip Yes, I got it now. And the plugin works fine.

But the 'npm install' command is removed from the '@auto-scripts'. Without this command, there will be no public/dist directory

kilip commented 5 years ago

Yes, i accidentally remove that npm command. I will fix that in my next push