solidus_dev_support icon indicating copy to clipboard operation
solidus_dev_support copied to clipboard

Skip asset inclusion during installation when the assets don't exist

Open blocknotes opened this issue 6 years ago • 2 comments

An extension without assets will fail specs because the test_app is always created requiring the assets (even if they don't exist).

Running extension installation generator...
      append  vendor/assets/javascripts/spree/frontend/all.js
      append  vendor/assets/javascripts/spree/backend/all.js
      insert  vendor/assets/stylesheets/spree/frontend/all.css
      insert  vendor/assets/stylesheets/spree/backend/all.css

blocknotes avatar Dec 30 '19 09:12 blocknotes

We should add some options to the command I thinks, like: --skip-assets or --skip-frontend-assets, those should work for both the updates and the extension generation.

elia avatar Jan 17 '20 13:01 elia

What about adding a conditional when loading the files instead?

When generating a new extension one may not know from the beginning if assets will be needed... when updating an extension one would need to check if assets files exist and choose the right generator option - but there's still a chance that some manual tweaking would be required, as JS files may be there and CSS not 🤔

If assets need to be introduced later, one may not know that the easiest way to have them loaded is to rerun the solidus generator, and so would end up spending time trying to figure out the problem and how to load them.

I think that having the loaders always in place with conditional loading helps with consistency and would avoid much (if not all) active developer intervention.

spaghetticode avatar Jan 17 '20 13:01 spaghetticode