DEV Community

Pawel Wolanski
Pawel Wolanski

Posted on

SAP Fiori Generator gimmicks

Working with SAP CAP framework sometimes leaves bitter-sweet taste.

Cannot Generate SAP Fiori Application in VS Code

SAP Fiori CAP applications do not have clear or documented application configuration file, which is used for cds or SAP's Yeoman (dead?) Fiori app generator @sap/generator-fiori.
Recently, I have spent significant time to figure out why I am unable to add another application using that generator. Apparently there is an if condition based on package.json dependency check. When I added @sap/cds to package.json, it started to detect it as valid Node.js project.

...
    "@sap/cds": ">=7"
...
Enter fullscreen mode Exit fullscreen mode

From the other side, cds CLI does not check it at all, BUT... it checks if in project root folder is able to find pom.xml it detects it as a Java CAP project. Otherwise, it treats that as Node.js.

The critical issue with figuring it out is:

  • application behavior it is not documented,
  • both of these utility apps are NOT open-source
  • @sap/generator-fiori it transpiled from TypeScript and not possible to review,
    • (cds CLI fortunately is pure JS tho)

Note

I get it. If I generated new project from the scratch using cds and copy-paste all CAP model/service configuration, I would avoid that situation. I did at the end, but we are not living in perfect greenfield world and even when CAP is pretty new, you still have to have someone to take care of brownfield.

Top comments (0)