Shopware 6 administration build only plugin - shopware

Is there a command to build only the administration part of a specified plugin? Right now I am building the whole administration to build the public resources for the plugin, which of course takes more time. Since every plugin has it's own resources, shouldn't it be possible to do this?

Since Shopware 6.4.8.0 it seems to be possible to only build the extensions (not a single one, but at least only extensions) by adding the environment variable SHOPWARE_ADMIN_BUILD_ONLY_EXTENSIONS=1

There are no out-of-the-box scripts to selectively build only one module.
The build is based on one single webpack config in vendor/shopware/administration/Resources/app/administration which includes each extension's code as as submodule.
If you are asking to speed up development, you might want to use bin/watch-administration.sh which should only rebuild changed files when you save them.

Related

Octoperf - Specifying custom / third-party dependencies - where does Octoperf pull dependencies from?

I am exploring the option of using Octoperf as a hosted solution.
One thing that I need is the ability to call some custom libraries (either Java or Javascript / Node.js).
In the SCRIPT PRE and SCRIPT POST examples in the Octoperf documentation I see calls being made to import com.google.common.base.Stopwatch. However, it is not clear to me how Octoperf knows where to pull this dependency from.
Does anyone know if there is a way to specify this and how?
this dependency in your example is already included in every JVM. If you need to add other dependencies in OctoPerf, just place them in the files menu of your project and they will be copied to lib/ext when the test is started:
https://doc.octoperf.com/design/edit-virtual-user/configuration/files/

How to override hybris platform files other than customize

So, I can see many files under customize folder under platform.
Is there any other way to oveerride platform in general other than putting it in customize folder?
If we have to override some OOTB file there are two ways:
1) If its in some extension, we can create customized extension and do our changes.
2) Add stuff into customize folder and do ant customize.
What if OOTB file is in platform? Is there any other way?
I expect to customize platform without adding it to customize folder.
Is the function/bean you want to override is injected through Spring?
If no, and you need to override say some jar, class or xml. You have choice of ant customize or buildcallbacks.xml
If yes, it's no different than overriding any other beans from parent extension. The only thing is that you will not need to create an extension dependency as platform is available globally.
For example : If you wish to override some function in DefaultCatalogDao to give your own implementation. You can do it like...
Create your own implementation extending the platform related service
Inject your custom bean with alias of the defaultCatalogDao
<alias alias="catalogDao" name="customCatalogDao"/>
<bean id="customCatalogDao" class="......CustomCatalogDao" parent="defaultCatalogDao"/>
For Commerce Cloud
You can change platform files using customize folder in Commerce Cloud V2 too. You would need to create a folder in your custom repository with name _CUSTOMIZE_ and then as you do in non cloud version, add your files (with exact folder structure as in platform).
Once you creare above folder, CCV2 build strategy automatically picks and deploys it, without any additional configuration.
Hope it helps!
Using buildcallbacks you can replace the files even the files in platform jar .
You can simply copy paste your file or write your own shell script to execute it and copy file to platform but how would it be different from ant customize. And why would you want to go away from standard hybris practices? Would that give you any extra benefit? I am sure that would only lead to issues during upgrade etc. Its not spring bean injection where you could tell your platform to use your implementation instead on other. There is no sense in wasting time in finding something which doesnt go along with product best practices.

What is the simplest way to share react components between projects?

How can I share components across multiple react projects without having to publish them on a public package manager like NPM?
Option 1: You can use npm and use private packages so they're not external facing. There are also artifactories and scoped packages that usually represent company-wide projects that can be public or private. See https://docs.npmjs.com/private-modules/intro and https://docs.npmjs.com/misc/scope.
Option 2: Essentially, you can develop projects with a flattened structure. You can then import various projects and/or components into other projects or folders. This is entirely dependent on your codebase and configuration. With this model though, a lot of times publishing to npm comes fairly naturally since each folder may be its own project with its own package.json.
Updated:
Option 3: Bit focuses on the composability of components from everything from the little things like a button to the actual view and app itself—each target is its own package. Overall, it's an opinionated, yet customizable framework that can enable quicker development, managed dependencies, and organized code.
Option 4: RushJS is a monorepo manager built by Microsoft that allows for flexibility of different kinds of apps and services utilizing pnpm underneath (as opposed to yarn and npm), which alleviates problems that stem from dependency issues.
Check out Bit:
Bit is an open-source cli tool for collaborating on isolated components across projects and repositories. Use Bit to distribute discrete components from a design library or a project into a standalone reusable package and utilize it across applications.
You could also upload them to a private git repo such a Github and then pull them in from there.
Ryanve has a nice example over here: https://stackoverflow.com/a/28729646/1592783
You could create a repo of shared components and then have your Node.js start script call a shell script to do a git pull from that repo and the move the shared components from that directory to your project's directory. That way, every time you call run 'npm start' you will have the latest version of the shared components loaded into your project

Using angular-ui-tinymce with JSPM - unable to load templates and plugins

I have the same problem that has already been documented on GitHub here. ui-tinymce references a number of dependencies which cannot be reached in my application.
GET http://localhost:8080/jspm_packages/github/tinymce/tinymce-dist#4.3.12/themes/modern/theme.min.js # angular.js:6084
tinymce.js:9426 Failed to load: /jspm_packages/github/tinymce/tinymce-dist#4.3.12/themes/modern/theme.min.js
I am able to use the workaround suggested in the github issue above, which changes the baseURL. This works fine in my development environment. However, when I run jspm bundle-sfx it does not pick up these dependencies and I am left in the same situation without templates or plugins.
What is the best way to address this? Can angular-ui-tinymce be broken down so that the dependent files are available in separate packages? Or should I just use gulp to get around this problem?
I tried using Gulp to concatenate the missing files, however this will not work because by default tinymce still expects the files to be at the relative locations which it uses in its own internal file structure.
I still think it would be helpful for Tinymce to provide separate packages for the most common themes, however I admit that there are a lot of themes and plugins so this would be a fair amount of work.
In the end the simplest thing to was to copy the theme and plugin files into the "correct" relative directories within my own source code. This way I can change the relative baseURL for tinymce and it will be correct when I run it in production as well as development environments.
This way I can run jspm bundle-sfx and it will bundle these files along with everything else. However you may have to import the files explicitly if you do not serve the area statically in your application. For example:
import 'sysadmin/app/tinymce/themes/modern/theme';

Script Create Package for Windows Store apps

I am maintaining a set of eleven Windows Store apps. I would like to automate the "Create Package" task, which I am currently doing through the wizard in Visual Studio, in order to produce test packages (signed with my test certificate).
Is there a way to script this task? I was thinking probably using MSBuild or PowerShell, my goal is to have a single script to run that would generate all my app packages and copy them all to a given target directory.
I found some documentation about using the wizard on MSDN, but nothing about scripting the task.
Any ideas?! Thanks.
MSBuild will create app packages for you, in the AppPackages folder. You can also do it manually using MakeAppx, but I've found it to be a bit more cumbersome.
Some things to note: There is a build target called Publish you should use (/t:Publish) when making the actual packages. You should look into the different command-line switches, such as DebugSymbols.
You'll likely want to use the 32-bit MSBuild, as I've had issues with the 64-bit and things like the Multilingual App Toolkit. Also in regards to the MApp Toolkit, make sure you do a full rebuild before building your app package. If an entry is not in a given language and is in another, the entry for the secondary language will be used, so you can end up with multiple languages all popping up on the same page.
Hope this helps and happy coding!

Resources