Skip to content

Commit e6b4a78

Browse files
fix: changes after testing
1 parent 0166a38 commit e6b4a78

File tree

4 files changed

+203
-432
lines changed

4 files changed

+203
-432
lines changed

package.json

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,10 @@
1818
"@xmldom/xmldom": "^0.9.8",
1919
"cli-progress": "^3.12.0",
2020
"diff": "^5.1.0",
21-
"form-data": "^4.0.4",
2221
"jsdom": "^25.0.0",
23-
"jsonwebtoken": "^9.0.2",
2422
"lodash.chunk": "^4.2.0",
25-
"marked": "^16.1.2",
26-
"minimatch": "^10.0.3",
27-
"nanoid": "^5.1.5",
2823
"open": "^8.4.2",
29-
"semver": "^7.7.2",
3024
"shelljs": "^0.8.5",
31-
"tough-cookie": "^5.1.2",
32-
"trim-newlines": "^5.0.0",
3325
"tslib": "^2"
3426
},
3527
"devDependencies": {
@@ -94,7 +86,13 @@
9486
"brace-expansion": "^2.0.2",
9587
"tmp": "^0.2.4",
9688
"request": "^2.88.2",
97-
"lodash.template": "^4.5.0"
89+
"lodash.template": "^4.5.0",
90+
"@babel/types": "^7.25.6",
91+
"@babel/traverse": "^7.25.6",
92+
"@babel/parser": "^7.25.6",
93+
"@babel/core": "^7.25.6",
94+
"@babel/template": "^7.25.6",
95+
"xml2js": "^0.5.0"
9896
},
9997
"engines": {
10098
"node": ">=12.0.0"
@@ -131,18 +129,18 @@
131129
},
132130
"repository": "salesforcecli/plugin-omnistudio-migration-tool",
133131
"scripts": {
134-
"build": "sf-build && yarn copy-assets",
132+
"build": "sf-build",
135133
"clean": "sf-clean",
136134
"clean-all": "sf-clean all",
137135
"clean:lib": "shx rm -rf lib && shx rm -rf coverage && shx rm -rf .nyc_output && shx rm -f oclif.manifest.json",
138-
"compile": "sf-compile && yarn copy-assets",
136+
"compile": "sf-compile",
139137
"copy-assets": "shx cp -r src/templates lib/ && shx cp -r src/styles lib/ && shx cp -r src/javascripts lib/",
140138
"docs": "sf-docs",
141139
"format": "sf-format",
142140
"lint": "sf-lint",
143141
"postpack": "shx rm -f oclif.manifest.json",
144142
"posttest": "yarn lint && yarn test:deprecation-policy && yarn test:command-reference",
145-
"prepack": "sf-prepack && yarn copy-assets",
143+
"prepack": "sf-prepack",
146144
"prepare": "sf-install",
147145
"pretest": "sf-compile-test",
148146
"test": "sf-test",

src/utils/XMLUtil.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,8 @@ export class XMLUtil {
5050

5151
// Parse XML string to JSON
5252
public parse(xmlString: string): any {
53-
try {
54-
const doc = this.parser.parseFromString(xmlString, 'text/xml');
55-
return this.xmlToJson(doc.documentElement as any);
56-
} catch (error) {
57-
// Return empty object for invalid XML instead of throwing
58-
return {};
59-
}
53+
const doc = this.parser.parseFromString(xmlString, 'text/xml');
54+
return this.xmlToJson(doc.documentElement as any);
6055
}
6156

6257
// Convert JSON object to XML

test/utils/XMLUtil.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ describe('XMLUtil', () => {
9393
});
9494
});
9595

96-
it('should handle invalid XML gracefully', () => {
96+
it('should throw for invalid xml', () => {
9797
const invalidXml = '<root><unclosed>';
9898

99-
// xmldom doesn't throw errors, it returns a document with errors
99+
// xmldom to throw error for mismatched tags after package update to @xmldom/xmldom.
100100
expect(() => {
101101
xmlUtil.parse(invalidXml);
102-
}).to.not.throw();
102+
}).to.throw();
103103
});
104104
});
105105

0 commit comments

Comments
 (0)