MobileWeb - do not minify - appcelerator

I am trying to export my project as a mobileweb app, but I do not want the code to minified as I need to run some tests on it.
I can't find a way to package the app without having it minified.
I have seen that if I run the app in the browser, it is not minified. However, I am not able to access the files in the file system as I have no idea to where http://127.0.0.1:8020/ points.
Does anyone knows how to export a mobileweb app without js minification?

You need to build your mobile web app from the command line using the following:
appc run -p mobileweb
or
ti build -p mobileweb
By default, the --deploy-type option will be set to development which will not minify the JS code.
At this point you can either set /path/to/your/project/build/mobileweb as your web root or copy the files in the build/mobileweb directory to your web server.

It appears mobileweb is not supported for the --skip-js-minify flag. It's only available for iOS and Android (CLI docs)
Example: titanium build -p ios --skip-js-minify
You can watch ticket TIMOB-14253 for updates.

Related

Angular Console: Can't create library

I'm trying to create a new library using v 8.1.0 of the Angular Console on Windows. The error I get is "ENOENT: no such file or directory, mkdir "c:\path\to\my\workspace\libs\new_library_name"
"c:\path\to\my\workspace\libs" exists already
new_library_name folder should be created by Angular Console
The command run by the console is ng generate #nrwl/angular:library new_library_name.
I've tried different names/paths, running as administrator, running inside VSCode and in the standalone console. No luck with anything. This used to work.
Also, if I create the folder c:\path\to\my\workspace\libs\new_library_name and then run the console again, I get an error ENOENT: no such file or directory c:\path\to\my\workspace\libs\new_library_name\ReadMe.md. Of course the ReadMe doesn't exist - it needs to be created by the console.
What am I doing wrong or where to look?
Problem solved. I had turned on Controlled Folder Access in Windows 10 and mistakenly included my project folder as a controlled folder, which prevented applications (Angular Console, Yarn, etc) from writing to the folder. Removed it from Controlled Access and all is working again.

Create staging environment for react native app

I am trying to follow this post for setting up a staging environment for my react native app. The post asks to add a new configuration calling Staging to the Xcode project and use that to build the project. I added the Staging config which is a duplicate of the Release config but I am not able to build the app using that config. I get following errors:
React/RCTBridgeModule.h file not found
I don't get this error in Debug and Release configuration. I read that react-native assigns special meaning to configurations name Debug and Release but I am not sure how to get around this problem. I also looked at react-native-config for setting up the staging environment but the initial setup looked a bit complicated to me and something that I didn't understand right away. Whereas the steps listed in the other post are pretty simple to understand which are basically to create a separate config and use the config used to run the app to figure out the environment that the app is running in.
If you have been able to create a staging environment for your react-native app using this approach or some other approach, please share.
Thanks!
I think you should look at this post https://github.com/Microsoft/react-native-code-push#ios
And my way to do it:
Install code-push
First, install the CodePush CLI:
npm install -g code-push-cli
Then go to root of your React Native project and use command line:
npm install --save react-native-code-push
Then link the libraries:
react-native link react-native-code-push
After that, we need to login in code-push with our account (you could find Mobile Center account here):
code-push login
You also could check if you're already logged in by using command:
code-push whoami
Create Deployment Keys
Before we deploy any updates, we need to register an app with the CodePush service using the following command:
code-push app add <appName> <os> <platform>
For example:
code-push app add myapp-ios ios react-native
code-push app add my-android android react-native
After then you should see what you just added in Mobile Center https://mobile.azure.com/apps
And next step is checking the Deployment Key by typing command line:
code-push deployment ls <appName> -k
For example:
code-push deployment ls myapp-ios -k
code-push deployment ls myapp-android -k
Link Deployment Key
To release an update we need to link Deployment Key to React Native project.
https://github.com/Microsoft/react-native-code-push#ios
Release an update
After Deployment Key is finally setting up, the last step is upload the first update.
Change index.ios.js and index.android.js file into:
import codePush from "react-native-code-push";
let codePushOptions = {
checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
installMode: codePush.InstallMode.ON_NEXT_RESUME,
};
class MyApp extends Component {
...
}
export default MyApp = codePush(codePushOptions)(MyApp);
And now type the command line:
code-push release-react <appName> <platform>
e.g.
code-push release-react myapp-ios ios
code-push release-react myapp-android android
After this step you will see the first version is uploading to Mobile Center
The rest is now getting very easy. Anytime we want to do an update, we just need to type code-push release-react command line and the code-push will do the silent update.
Push staging to Production also just one command job:
code-push promote <APP_NAME> Staging Production -r 100%

Run Script with xCode Server Bot

I am running a on-commit Bot to build, analyze, unit tes and archive my App and it works perfectly.
I have a script (*.sh) in my porject that I want to run at the end of a success analysis. I am using xcode 7.3 now and i tried the following:
In the trigger section call ./myscript.sh, but the bot could not find it.
I tried to add $SCROOT, still no luck
I tried to copy the script to bin but since the bot runs under that __xcbuild user it did not see it, and I do not want to mess with adding permission to /bin and /usr/bin
All I want is to run a script against the code the that the bot just pulled on success.
The source used by Xcode CI will be under a cache folder stored in an environment variable called:
$XCS_SOURCE_DIR
Your file should be somewhere under that path

Running Aurelia without a server in Firefox

I know a lot of 'recent' JS tech require a server to work, but is there a way to run a simple Aurelia hello world without a server installation, just opening index.html and see my hello world app shown in the browser. It works for angular 1.x and many other JavaScript libraries.
Is the System.import mechanism going to force me to use a server ? Or is there a workaround to read local files, I tried the usual hacks but it did not help as I still get Error: [Exception... "File error: Unrecognized path" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" but the path shown in the error (not pasted here) matches my local path.
The Aurelia starter pack recommends using Firefox to accomplish this goal if you are using the ES2016 starter kit. Firefox is the only browser that supports the use case you are asking about.
For any other browser, you will need to run a server. I recommend using the extremely simple to use http-server that runs on NodeJS.
From within your project directory type the following two commands:
npm install -g http-server
http-server
Then open your browser and navigate to http://localhost:8080 (8080 is http-server's default port. This port can be changed using the -p command line argument.

Deploying phoenix framework on heroku with webpack

I followed the docs in the official website. The problem is I use webpack as my bundler instead of brunch. The deployment is successful. I can even access the api routes. My only problem is the assets (js,css) in the homepage is not found. Locally, I can access the home page successfully when I run mix phoenix.server.
I tried peeking at the priv/static folder in heroku (using heroku run bash) where the files are moved after being compiled and saw the asset files there. Did I miss anything? or a configuration that I should put?
Here is the remote deploy output
http://pastebin.com/1mL1YWTS
Here is my custom compile file (to override phoenix-static buldpack)
http://pastebin.com/BGHf9xBK
Here is my webpack.config.js
http://pastebin.com/Xv2E1yCE
I have used webpack with the following compile:
./node_modules/.bin/webpack -p
mix phoenix.digest
You need to call mix phoenix.digest to generate a manifest that can be used in the static path helpers. http://hexdocs.pm/phoenix/Mix.Tasks.Phoenix.Digest.html#run/1

Resources