SAP / generator-easy-ui5

Meta-generator various project types within the UI5 Universe
https://blogs.sap.com/2021/04/09/easy-ui5-3.0-from-community-contributions-to-community-plugins/
Apache License 2.0
239 stars 72 forks source link

"Application Router @ Cloud Foundry" fails to start locally #32

Closed hosssa closed 4 years ago

hosssa commented 4 years ago

Easy-Ui5 version: 1.3.3

OS/version: Win 10

Browser/version (+device/version): n/a

Steps to reproduce the problem:

  1. "yo easy-ui5"

    {
    "generator-easy-ui5": {
    "projectname": "myApp",
    "namespace": "com.me",
    "platform": "Application Router @ Cloud Foundry",
    "viewtype": "XML",
    "viewname": "View",
    "ui5libs": "Content delivery network (SAPUI5)",
    "newdir": false,
    "namespaceURI": "com.me"
    }
    }
  2. "npm run start" fails with error: xs-app.json/routes/0: Format validation failed (approuter\webapp is not a directory)

  3. "npm run deploy" works fine

What is the expected result? What happens instead?

When I change localDir in approuter/xs-app.json as follows: "localDir": "../webapp" "npm run start" runs successfully but "npm run deploy" fails while starting the deployed app.

Possible solution

"npm run start" works fine with an empty approuter/webapp folder. So maybe this could be created during the generation process.

The content of the approuter/webapp folder should not be in the git repo, so maybe this can be added to .gitignore by default.

IObert commented 4 years ago

Hi,

thanks for reporting this one. This is not an issue but the expected behavior as npm (run) start is the command that will be used when the approuter runs in the cloud. If you want to run it locally, please use npm run local

hosssa commented 4 years ago

Hi,

I have executed npm run start in the base dir (not in approuter). The command being executed is: ui5 serve -o index.html and this fails with the described error.

IObert commented 4 years ago

I understand this now. Yes, this is a problem. For now, I'd recommend removing the cfdestination middleware from the ui5.yaml page. I'll also open a PR to suggest a fix for the middleware.

IObert commented 4 years ago

I took this cfdestination middleware out for now and I'll put it back as soon as the fix is shipped

IObert commented 4 years ago

I brought it back in and updated the dependency