Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TBI - Extract XML writer from fiori-annotation-api to a separate package #2640

Open
5 tasks
voicis opened this issue Nov 29, 2024 · 0 comments
Open
5 tasks
Labels
fe-fpm-writer @sap-ux/fe-fpm-writer fiori-annotation-api @sap-ux/fiori-annotation-api

Comments

@voicis
Copy link
Contributor

voicis commented Nov 29, 2024

Description (include screenshots)

In @sap-ux/fe-fpm-writer we need to update XML file content. Currently @xmldom/xmldom package is used, which is not aware of the existing formatting and just replaces the whole document, but that is not always desired. In @sap-ux/fiori-annotation-api we have an XML writer class which can do more fine grained changes and only update the required parts of the document. We should extract it into a separate package dedicated to writing into XML files, so it can be reused in other modules.

Value

Ability to reuse formatting and comment preserving XML writing APIs across tools.

Notes

XML writer https://github.com/SAP/open-ux-tools/blob/main/packages/fiori-annotation-api/src/xml/writer.ts
XML converter https://github.com/SAP/open-ux-tools/blob/main/packages/xml-odata-annotation-converter/src/printer/csdl-to-xml.ts

Tasks

  • Create a new package (proposed name @sap-ux/xml-writer)
  • Extract writer logic (change -> TextEdit)
  • Extract converter logic (AST -> text)
  • Refactor to remove the dependency to @sap-ux/odata-annotation-core-types
  • Use the new package in @sap-ux/fe-fpm-writer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fe-fpm-writer @sap-ux/fe-fpm-writer fiori-annotation-api @sap-ux/fiori-annotation-api
Projects
None yet
Development

No branches or pull requests

1 participant