production
production copied to clipboard
Stop if JQ is not installed
Running the build without JQ will only lead to more problems, so it is better to fail early
What problems do you experience exactly? Is it all related to the npm dependencies of plugins not being installed because of the missing jq
?
Yes exactly. We have a plugins.json but the build failed because (we believe) the npm install did not run for the plugins:
ERROR in /web/vendor/store.shopware.com/swagpaypal/src/Resources/app/storefront/src/swag-paypal.abstract-buttons.js
Module not found: Error: Can't resolve '@paypal/paypal-js' in '/web/vendor/store.shopware.com/swagpaypal/src/Resources/app/storefront/src'
So I think it is better to enforce the presence of jq
to avoid harder-to-debug errors afterwards.
What do you think?
I think that depends, as long as you don't have plugins that need additional npm dependenies you don't need jq
, but in order to be able to detect if there are plugins with npm dependencies jq
needs to be installed.
Okay, so maybe we should at least improve the warning. Anyways, I am a fan of things failing early, so I still would say it's fine to just require "jq".
We could also add a SKIP_DEPENDENCY_CHECK
flag one could set who is sure that there are no dependencies which would skip the whole jq
part.
Still a fan of fail-early and avoiding hard-to-debug issues :-)
I agree, this can be really time consuming and frustrating (for beginners) - I think a flag should be enough.
@keulinho what is your fear in adding the exit? Hosters that don't provide the extension or users that get stuck there?
I guess we should do that change for 6.5 somewhere at https://github.com/shopware/recipes/blob/main/shopware/storefront/6.4/bin/build-storefront.sh ?
Shall we go head with a SKIP_DEPENDENCY_CHECK flag?
I also spent a good amount of time figuring out that issue... That would be really really great to have it merged to the project. At least developers will quickly find out that there is a dependency required, instead of just silently erroring out.
By the way, jq
is not highly used on servers out there.
It would be nice to have these added to the list of requirements. We also had the issue with our hoster, and needed to convince them to install it. So if that went into the system requirements or recommendations, this could be a place to tell them or check by ourselves.