saschakiefer/generator-openui5 — pull request #13 by js1972 (2014-01-03 08:07:06+00:00)
Title: Added XML Views, Fiori-like app generation...

Hi Sascha,
I've made a few changes as per the following that you may be interested in. I pulled down your develop branch as the starting pioint.

- Added an option for XML view generation into the view generator (I think this is better than having separate generators for each type of view. We can easily add an html view option as well by adding another prompt and a html template file). This xml view just shows a basic button inside a panel to get a developer started.
- Added options to the app generator to scaffold a fiori app. The template is one of the sample master-detail apps that is kicking around with some changes (initially provided by @qmacro). After choosing "fiori" you're then asked for the type of app (currently only master-detail is available) and also the component namespace to use (which matches the data-sap-ui-resourceroots tag in index.html).
- Other minor changes to formatting to more follow idiomatic.js and to standardise on double-quotes for string delimiters (that's what jQuery uses - doesn't matter which delimiter is chosen so long as its consistent). Fixed up the test files which weren't working for me. Still need to do more work here and put in allot more test cases.

Current issues
- For some reason jshint complains with a strange error at line 0 of my script files stating: "Bad option: 'Ignores'". Can't find anything on the web about this issue. I'm wondering if its code-page related though. I created a new file and copied the contents across (bit-by-bit) and I don't get the error in the new file. WTF! I get the issue with the jshint sublime plugin as well as running jshint at the command line.
- I've had to add an npm module called "node-localstorage" for communication between the app generator and view generator. I need to send the view generator infomation after the user has entered the prompt questions and this is not possible when passing options in the hook for the view generator. I've looked around and some other yo generators use temp files for this purpose so node-localstorage is pretty easy and cool for that. Uses a temp ./scratch folder. The only reason I need to pass info across to the view generator is for a fiori app scaffold. when scaffolding a fiori app I don't want to use the view generator and there seems to be no easy way to stop the view generator running if the user has chosen the fiori option. So I pass a fiori boolean to the view generator and it just does nothing if its true. In the future it would probably be better to have the app generator call the view generator multiple times for each fiori view to generate them instead of just having them all as template files at the app level (but that was waaaay easier). ;-)
_In future I think the uiComponent generator should be mixed in here but I haven't had the time to look into it yet and there's not much in the way of examples to see how it all fits together..._

To-do
- Look into moving fiori app logic into uiComponent generator and calling uiComponent and hooking into it. would also need to invoke the view generator, but this is getting more complex as its all deeply nested. Currently this is just all templated out of the app generators as that's easy.
- Integrate the mock.json file with a sap.ui.app.MockServer instead of loading directly.

Regards... Jason.