Skip to content

Commit

Permalink
Merge pull request #147 from vmware/dependabot/npm_and_yarn/fast-xml-…
Browse files Browse the repository at this point in the history
…parser-4.1.2

Bump fast-xml-parser from 3.19.0 to 4.1.2
  • Loading branch information
VenelinBakalov authored Jun 3, 2024
2 parents 637ae49 + 75d377b commit 6173a5e
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 25 deletions.
8 changes: 4 additions & 4 deletions extension/src/client/lint/rule/ToolchainVersionRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
* SPDX-License-Identifier: MIT
*/

import * as xmlParser from "fast-xml-parser"
import * as semver from "semver"
import { Logger, PomFile } from "@vmware/vrdt-common"
import { XMLParser, XMLValidator } from "fast-xml-parser"
import * as semver from "semver"
import * as vscode from "vscode"

import { Patterns } from "../../constants"
Expand All @@ -20,7 +20,7 @@ export class ToolchainVersionRule extends PomLintRule {

apply(document: vscode.TextDocument): vscode.Diagnostic[] {
const pomXmlContent = document.getText()
if (!xmlParser.validate(pomXmlContent)) {
if (!XMLValidator.validate(pomXmlContent)) {
this.logger.info("Not valid XML")
return []
}
Expand Down Expand Up @@ -59,7 +59,7 @@ export class ToolchainVersionRule extends PomLintRule {
}

private extractParentVersion(pomXmlContent: string): string | null {
const pomXml = xmlParser.parse(pomXmlContent)
const pomXml = new XMLParser().parse(pomXmlContent)

if (!pomXml.project || !pomXml.project.parent) {
this.logger.warn("Missing parent tag")
Expand Down
6 changes: 3 additions & 3 deletions extension/src/client/provider/content/RemoteDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import * as path from "path"

import { Logger, VroRestClient } from "@vmware/vrdt-common"
import * as vscode from "vscode"
import * as AdmZip from "adm-zip"
import { XMLParser } from "fast-xml-parser"
import * as fs from "fs-extra"
import * as xmlParser from "fast-xml-parser"
import * as vscode from "vscode"

import { ContentLocation } from "./ContentLocation"

Expand Down Expand Up @@ -105,7 +105,7 @@ export class RemoteDocument {
"@t": string
"#text": string
}
let xml = xmlParser.parse(source, { ignoreAttributes: false, attributeNamePrefix: "@" })
let xml = new XMLParser({ ignoreAttributes: false, attributeNamePrefix: "@" }).parse(source)
xml = xml["dunes-script-module"]
let js = "/**\n"

Expand Down
8 changes: 4 additions & 4 deletions extension/src/client/system/ConfigurationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

import * as path from "path"

import * as chokidar from "chokidar"
import * as xmlParser from "fast-xml-parser"
import * as fs from "fs-extra"
import {
AutoWire,
BaseConfiguration,
Expand All @@ -16,6 +13,9 @@ import {
MavenProfileWrapper,
VrealizeSettings
} from "@vmware/vrdt-common"
import * as chokidar from "chokidar"
import { XMLParser } from "fast-xml-parser"
import * as fs from "fs-extra"
import * as vscode from "vscode"

import { BuiltInCommands } from "../constants"
Expand Down Expand Up @@ -105,7 +105,7 @@ export class ConfigurationManager extends BaseConfiguration implements Registrab
return
}

const settingsJson = xmlParser.parse(settingsXmlContent.toString("utf8"))
const settingsJson = new XMLParser().parse(settingsXmlContent.toString("utf8"))
const allProfiles = settingsJson?.settings?.profiles?.profile
const vroProfiles: MavenProfilesMap = {}

Expand Down
36 changes: 26 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
"adm-zip": "^0.5.4",
"chokidar": "~3.5.1",
"di": "^0.0.1",
"fast-xml-parser": "3.19.0",
"fast-xml-parser": "4.1.2",
"fs-extra": "~9.1.0",
"jsonc-parser": "^3.0.0",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/node/vrdt-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"typescript": "~4.2.3"
},
"dependencies": {
"fast-xml-parser": "3.19.0",
"fast-xml-parser": "4.1.2",
"fs-extra": "~9.1.0",
"glob": "^7.1.6",
"jwt-decode": "^3.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/node/vrdt-common/src/maven/PomFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: MIT
*/

import * as xmlParser from "fast-xml-parser"
import { XMLParser } from "fast-xml-parser"
import * as fs from "fs-extra"

export class PomFile {
Expand Down Expand Up @@ -56,7 +56,7 @@ export class PomFile {

constructor(public readonly filePath: string) {
const pomContent = fs.readFileSync(filePath, { encoding: "utf8" })
this.jsonContent = xmlParser.parse(pomContent)
this.jsonContent = new XMLParser().parse(pomContent)

if (!this.jsonContent.project || !this.jsonContent.project.parent) {
throw new Error(`Missing parent tag [file = ${filePath}]`)
Expand Down

0 comments on commit 6173a5e

Please sign in to comment.