sm-rab
v1.0.9
Published
"assemble a deploy file similar to what rally-app-builder's build command does"
Downloads
31
Readme
________________________ Module overview ___________________________ Install this AFTER you install rally-app-builder. This module is meant to build your custom app into something that is more 'native' to rally. meaning it moves your app out of the iframe.
This de-iframing is needed especially for Ext.dd to work between custom apps and other custom apps or built in apps. Im sure the de-iframing is useful for other stuff too.
How this is accomplished is by manually moving the script/css files into the parent window's document's head element. Script execution order is preserved after the move. Also, you have control over the order you load external and local scripts (rab always puts external files first). Also, all the Rally.sdk.* classes have been modified and are injected into the parent window as well because Rally doesn't load these in the parent window.
__________________ INSTALLATION & RUNNING ___________________________
Install: npm install -g sm-rab Required Config: ./sm-config.json at base directory Output File: sm-deploy/sm-app.html
When you want to build the app, just run sm-rab instead of rab at the basedir and the output file will be sm-deploy/sm-app.html
The only thing this does is build. it does not have 'init', 'clone', 'watch'... or any of the other rab commands.
______________________ sm-config.json template ________________________ There are 5 fields in the JSON that you need. name, className are the same as in rab. jsBeforeSDK are the list of local/external js files to load before the injected Rally.sdk* classes get instantiated jsAfterSDk are the list of js files that go after the Rally.sdk* classes
you will always want to put your App.js class in the jsAfterSDK array.
css takes local or external css files as well. order is preserved.
EXAMPLE: { "name": "The App Name", "className": "Name of the Class that will be launched", "jsBeforeSDK":[ "https://external-urls", "or/relative/paths" ], "jsAfterSDK":[ "https://external-urls", "or/relative/paths" ], "css": [ "order/is/preserved", "https://external-urls", "or/relative/paths" ] }
______________________ Corner-cases/limitations________________________ in all your files that use Ext at all make sure you wrap your code in (function(){ var Ext = window.Ext4 || window.Ext;
//your code...
}()); because there are 2 Ext's living in the parent window: Ext (version 2 or something) and Ext4, which is what you must be using.
You cannot set the project scope per app using the built in rally settings. So your app must follow the global scope, but you can still add your own custom settings to store which project the app should be scoped to-- but this requires your own implementation, not the built in one.