open-ux-tools icon indicating copy to clipboard operation
open-ux-tools copied to clipboard

FEATURE - Consider the html5-repo when adding the cds-ui5-plugin

Open tobiasqueck opened this issue 1 month ago • 0 comments

As a developer of a CAP project, I want to locally test my project as close as possible to the productive setup, so that I can reduce the risk of issues that would go undetected into a productive deployment

Description

When enabling a cap project as monorepo and adding the cds-ui5-plugin then we should utilize a new feature to rewrite the mountpath to have the app mounted at the same path as it would be when being deployed to the html5-repo service, so that the local setup reflects the productive setup. The mountpath can be set as part of the customConfiguration of a ui5.yaml.

The html5-repo service only supports alphanumeric characters in the name and is generated based on the app id (by simply removing everything invalid). Example, if an app has the id my.test.bookhop then the following should be added to the yaml.

customConfiguration:
  cds-plugin-ui5:
    mountPath: /mytestbookshop

Technical Design

  • enhance the cap-config-writer
    • if the app id has any non-alphanumeric character then add the adding custom config to the yaml
  • since this might not be the only custom config we are adding, a generic addCustomConfig function should be exposed by the ui5-config module

Acceptance Criteria

GivenWhenThen format (https://martinfowler.com/bliki/GivenWhenThen.html)

Given I have a CAP project containing an app with id my.example and another one with nodots when I execute a command to add the cds-ui5-plugin then my app with id my.example will have the custom config in the ui5.yaml but nodots won't

Notes

Tasks

  • [ ] add new generic function to ui5-config
  • [ ] add feature to cap-config-writer
  • [ ] Unit Tests added
  • [ ] Test Cases defined

tobiasqueck avatar May 27 '24 08:05 tobiasqueck