Coder Social home page Coder Social logo

6.6-rc2 : App name with underscore symbol and storefront js can't be build successfully. Theme compilation error 'directory does not exist' about shopware HOT 4 CLOSED

averet-lea avatar averet-lea commented on June 9, 2024 1
6.6-rc2 : App name with underscore symbol and storefront js can't be build successfully. Theme compilation error 'directory does not exist'

from shopware.

Comments (4)

tobiasberge avatar tobiasberge commented on June 9, 2024 1

Hi @averet-lea,

thank you for testing and for your feedback. 👍 I would say if you already have an app with this naming and everything works for you at the moment, it is fine to keep it this way. I can totally understand that it can be a headache to change it afterwards. But for future Apps/Plugins I would stick with PascalCase.

We also adjusted the app docs now to make it more clear.

If the issue is resolved for you, you can already close it. In the meantime we will check what change fixed it and post another comment.

from shopware.

shopware-issue-bot avatar shopware-issue-bot commented on June 9, 2024

We found the following existing issues which may help or are related to your topic:

from shopware.

tobiasberge avatar tobiasberge commented on June 9, 2024

Hi @averet-lea,

sorry for my late reply.

Thank you for providing a test app, thats much appreciated. 👍

We would actually recommend to use PascalCase/UpperCamelCase for app as well as plugin names. But admittedly it is not that explicitly told in the app base guide as it is in the plugin base guide at the moment. In the app docs all examples are PascalCase wheras the plugin docs additionally state "written in UpperCamelCase".

https://developer.shopware.com/docs/guides/plugins/plugins/plugin-base-guide.html#name-your-plugin

The new sub-folder inside dist/storefront/js/your-app-technical-name/ is expected in 6.6 and will be copied later into /public/theme. This is needed so webpack knows from which folder async JS files are supposed to be loaed. Each app has its own folder for separation and to prevent naming conflicts. With the async JS possibility there can now be more generated JS dist files in an app/plugin. Previously everything was merged into the all.js in 6.5.

Your example repo was supposed to be used as an app, right? Because it also has a composer.json but no plugin class so I was not 100% sure. But installing as app worked out fine.

I was not able to reproduce the issue The "custom/apps/TestABC_DEF/Resources/app/storefront/dist/storefront/js/test-a-b-c_-d-e-f" directory does not exist.

  • Installed and activated as an app
  • Run composer build:js:storefront (Also runs theme:compile)
  • Compiled as expected with output:
# Plugin "TestABC_DEF": Injected successfully

 ✔ Shopware 6 Storefront
   Compiled successfully in 1.32s

 ✔ TestABC_DEF


shopware-6-storefront:
  78 assets
  617 modules
  shopware-6-storefront (webpack 5.89.0) compiled successfully in 1339 ms

test-a-b-c--d-e-f:
  1 asset
  10 modules
  test-a-b-c--d-e-f (webpack 5.89.0) compiled successfully in 349 ms
> cd src/Storefront/Resources/app/storefront && node copy-to-vendor.js
- copied "/Users/tobiasberge/www/platform/src/Storefront/Resources/app/storefront/node_modules/tiny-slider" to "/Users/tobiasberge/www/platform/src/Storefront/Resources/app/storefront/vendor/tiny-slider"
- copied "/Users/tobiasberge/www/platform/src/Storefront/Resources/app/storefront/node_modules/bootstrap" to "/Users/tobiasberge/www/platform/src/Storefront/Resources/app/storefront/vendor/bootstrap"
- copied "/Users/tobiasberge/www/platform/src/Storefront/Resources/app/storefront/node_modules/flatpickr" to "/Users/tobiasberge/www/platform/src/Storefront/Resources/app/storefront/vendor/flatpickr"

✓ Done, all directories / files copied successfully.
Execution time: 167.880917ms
> @php bin/console theme:compile
Start theme compilation

 Compiling theme for sales channel for : 018e13c4f03670739042fc11ef720fcb

 ! [NOTE] Took 1.931193 seconds

I can also see the console.log with init as well as the apps <script> tag.

image

image

Maybe you can try again with the latest rc-4 or trunk since it was tested with rc-2.

And you always have the option to rename everything to PascalCase then you are on the safe side. This works the same in 6.5 and 6.6.

from shopware.

averet-lea avatar averet-lea commented on June 9, 2024

Hello @tobiasberge,
Thank you very much for your detailed answer!
Sorry for replying only now (missed the notification).

I've just tried it with rc-4 (using bin/build-storefront.sh) and now it works correctly.
So maybe something was wrong with rc-2, rc-3.

It's definitely a good idea about renaming to PascalCase, but what if we already have an app registered in Shopware Store and it's technical name has underscore in it's name (the hint there says that 'the technical name is unique and can't be changed afterwards')? I suppose it will be hard to change the name there:)
But certainly for new extensions we should follow PascalCase.

So, as a conclusion: no more bug in 6.6.0.0-rc-4.
Of course, it would be nice to know what the cause was, but at least everything works now.

Should I close the issue, or will you do it with some comment from your side (or some further investigation if required)?

from shopware.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.