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

fix: preserve xml comments in decomposed files #1288

Merged
merged 4 commits into from Apr 30, 2024

Conversation

mshanemc
Copy link
Contributor

What does this PR do?

preserves xml comments for decomposed metadata (we do xml => json , then merge in json, then json => xml). fast-xml-parser was stripping out comments when converting to json. this PR sets a comments property so that the converted json includes the comment (in a special field) and sets the same prop on the xmlBuilder so that the comment gets back into the xml.

What issues does this PR fix or reference?

@W-15544382@
forcedotcom/cli#2830

@mshanemc mshanemc requested a review from a team as a code owner April 19, 2024 15:12
@WillieRuemmele
Copy link
Member

QA Notes


✅ back out XML_COMMENT_PROP_NAME, yarn build, expect yarn test:snapshot to fail, it does

@WillieRuemmele
Copy link
Member

QA Notes


✅ : original QA
✅ : play around with the regex to confirm it's correct
✅ : remove the \s variations
✅ : multi line comments preserved
✅ : multiple multi-line comments not separated by xml content

@WillieRuemmele WillieRuemmele merged commit ba1dc28 into main Apr 30, 2024
68 checks passed
@WillieRuemmele WillieRuemmele deleted the sm/preserve-comments-alternative branch April 30, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants