saschakiefer / generator-openui5

yeoman generator for OpenUI5 applications and assets
Other
64 stars 17 forks source link

Option for ui Library #53

Closed saschakiefer closed 10 years ago

saschakiefer commented 10 years ago

The generated views load by default: sap.ui.commons as UI Library. When generating a fiori app, the ui library that is needed is sap.m. The consequence is, that a view does not work out of the box. Should we ask the user for the library to use, or should we try to extract that from the bootstrap.

js1972 commented 10 years ago

Good idea. Let add a mobile? option. If mobile is chosen then not only can the view gen use the sap.m lib but also the template can instantiate a page as well as that will be standard boilerplate...

On Fri, Feb 21, 2014 at 1:05 AM, saschakiefer notifications@github.com wrote:

The generated views load by default: sap.ui.commons as UI Library. When generating a fiori app, the ui library that is needed is sap.m.

The consequence is, that a view does not work out of the box. Should we ask the user for the library to use, or should we try to extract that from the bootstrap.

Reply to this email directly or view it on GitHub: https://github.com/saschakiefer/generator-openui5/issues/53

saschakiefer commented 10 years ago

I would opt for trying to detect the kind of app (e.g. by is sap.m referenced) and maybe let the user confirm it (or not). I think we have to pay attention, that we don't ask for too much from the user, especially, if we can derive the information. Agree to the page stuff.

I already have the detectin for the namespace added to to base script and could easily add a global property detecting the sap.m library in the bootstrap.

js1972 commented 10 years ago

This is done in the pull-request for the globals branch. However the view test is a bit ugly as it issues an error that it can't find index.html to the terminal - even though its a success test run. I quickly looked at on-the-fly creating a dummy index.html for the view test using this.write() (part of generator) part it seems that function does not exist in the context of the beforeEach()...

Its not a problem but would be nice to refactor to handle this..

js1972 commented 10 years ago

This should be closed. The fact that the test is not pretty is a different matter... It works. Closing...