shopware app doesn't work in test environment without running build-storefront.js from console? - shopware6

I have an app for shopware 6 which has a javascript file.
After i upload it to my shopware6 site, install and activate it, it doesn't work unless i run the build-storefront.sh from console.
Is there a way to make the app work without running build-storefront.sh ?
I tested it with shopware 6.4.14.0

All assets like the javascript of your app need to be uploaded inside your app, so the app automatically works without the need to rebuild the storefront after installing your app.
Therefore to create a zip folder for publishing or for uploading you should always execute the build-storefront.sh script, either locally or in a CI step. That command should build all the necessary assets and put them under the Resources/app/storefront/dist folder inside your app.
Please ensure that that folder is included in the zip file you upload to your shop.

Related

.env variables working on expo published app but not from google play build

My app is working properly locally and also from the QR code on the Expo published app page.
On my production build on Google Play though, the .env files are undefined and not loading at all (I am using dotenv-react-native).
This may be due to the fact that my .env file was in .gitignore while I was building my first android build? I updated it with an OTA update after by creating a .easignore file and excluding the .env file. Does it not work with OTA updates? Do I need to rebuild the application or is it some other issue?

Nuxt & Capacitor - Unable to add android support

I have a Nuxt 2 app. I'm following the docs to add Capacitor and Android Support.
Everything is fine up to the point of running npx cap add android. The android folder is generated however there are errors in the terminal
√ Adding native android project in android in 342.51ms
√ Syncing Gradle in 944.40μp
√ add in 345.44ms
× copy android - failed!
[error] The web assets directory (.\.nuxt) must contain an index.html file.
It will be the entry point for the web portion of the Capacitor app.
√ Updating Android plugins in 33.68ms
× update android - failed!
[error] Error: ENOENT: no such file or directory, open
'<sourceroot>\android\app\src\main\assets\capacitor.plugins.json'
I’m not running Nuxt in static mode (due to routes and content pulled in dynamically from a CMS). So I run nuxt build which generates the output into a folder named .nuxt by default.
However nuxt build doesn’t create an index.html as an entry point, the nuxt build actually states Entrypoint app = server.js server.js.map. Hence the error above where it can’t find index.html in the .nuxt directory.
Does anyone know a way to resolve this? Or have implemented Capacitor with a Nuxt SPA?
I’ve found resources when using nuxt generate for a static app but not nuxt build for a spa like in my case.
I have a Nuxt2 web app with servers (app server and separate API server), also deployed as an Android app on the Play Store (in alpha testing). Both app flavours look and behave identical and use the same API server, as I desire.
IMHO, in the lifetime of your (universal) app, BOTH build and generate will get leveraged:
build, likely by whatever web app host you use (ie AWS, Heroku, etc), during deployment of the web app.
generate by yourself, when you're ready to submit to the app stores (Apple, Google, etc), making use of Capacitor.
Let's say you have a new feature to add to the app. On that day, you make git commits and increment your version number and when you're ready to deploy the update...
For the web app...
Make commit(s) and version number change
Deploy to your app host, which for most people, will also run the build step for you
The only time I ever run build locally is when I need to make final tests, troubleshoot bugs or make optimizations (e.g. lower final package size).
For the Android or iOS apps...
Make commit(s) and version number change
nuxt generate
Run Capacitor sync (however which way you do it (for me I use: npx cap sync)
Prepare the app store build & submit (however which way you do it)
What nuxt generate does for you, and what Capacitor needs, is a fully rendered snapshot of all your app views together, all at once. It's the equivalent of a web app user opening all your app's views all at once (e.g. 50 browser tabs), pulling all components/styles/etc into their local browser. This fully rendered app state ultimately gets bundled and is what will get submitted to the app store(s).
In Nuxt docs and terminal output, they seem to strongly suggest that if you're using nuxt generate, that you want to be using target: static, however I will say you should completely ignore this advice. Static is what you'd consider if you had a "brochureware" website or some recipe book app that you update once-in-awhile. It goes as far as in the terminal output of nuxt generate, even if I have target: server defined, you'll still see a line saying something along the lines of "Outputting for target static...". Just ignore it.
There is hardly anything static about a typical universal web app.
I personally use target: server with nuxt generate and I haven't seen any problems in the app (web or Android version).

How do I bundle one page in nextJS with a manual webpack config?

I'm using webpack on the server and want to bundle only one page that is compiled with nextJS.
Right now, the directory structure consists of several pages like:
app
about
contact
Is there any way to compile just the app directory, that is, compiled with NextJS? I'm using express to run the app and have access to the paths I need for the page

How can I force my app into the Applications/ folder?

I am currently developing a desktop app in OS X which has a requirement for Autostart on Boot. I have implemented autostart and it works well when I install my app and put it in the Applications/ folder, but I can't expect users to move the file. I am distributing the app using HockeyApp.
So I've started building .pkg files with Packages. This works great and was really easy, but fails to update when used in HockeyApp. After downloading the update, I get a message saying An error occurred while trying to extract the archive. Please try again later. [Cancel Update]
Things I have tried:
Signing the update
Not signing the update
Downloading the most recent version instead of updating (works perfectly fine)
Zipping the .pkg (Fails to upload to HockeyApp)
How can I force my app into the user's Applications/ folder? Should I just ask my handful of (technologically challenged) beta testers to delete their app and download the new version? Can I make a change to my .pkg method to make it work? Should I add code into the app which moves itself (Sounds hacky and painful)?
You cannot force the user to install into /Applications, however if you get the app to arrange the auto-start itself (for example via the App Preferences) then it should use the current location of the app (probably obtained from [[NSBundle mainBundle] bundlePath]) and that will work fine.
You might want to periodically check if the app has moved after this has been turned-on.

How to build in a redirect if the browser is not mobile

I want to redirect users to another page if they are loading my web app from a standard desktop browser. I've tried detection scripts using php and javascript in the index file which both work fine in the dev environment. The problem is when I use the 'sencha app build production' command to build the project I get errors. I'm assuming this is because the build script is somehow being redirected by these scripts when trying to build dependencies. I'm not sure how to fix this. I tried building it without the scripts then uploading the production build and adding the code to the uploaded files but the code added to the uploaded files seems to be ignored.
Either the builder is getting redirected or the builder cannot follow the code dependencies to build a single JS file.
You can create a device profile for desktop which will redirect in the launch function when the profile is active: Sencha Touch 2 device profiles