Skip to content

Commit 8ed953c

Browse files
authored
Merge pull request #58 from aliasadidev/replace-xml-2-js-package
Replace xml 2 js package
2 parents 0623c30 + e1832d1 commit 8ed953c

File tree

12 files changed

+952
-50
lines changed

12 files changed

+952
-50
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
# Version 2.0.6 - Jan 14, 2023
4+
#### Fixed
5+
* Fixed known bugs
36

47
## Version 2.0.5 - Nov 9, 2022
58
#### Fixed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55

66

7-
[![Marketplace](https://vsmarketplacebadge.apphb.com/version-short/aliasadidev.nugetpackagemanagergui.svg)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
8-
[![Installs](https://vsmarketplacebadge.apphb.com/installs-short/aliasadidev.nugetpackagemanagergui.svg)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
9-
[![Downloads](https://vsmarketplacebadge.apphb.com/downloads-short/aliasadidev.nugetpackagemanagergui.svg)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
10-
[![Rating](https://vsmarketplacebadge.apphb.com/rating-short/aliasadidev.nugetpackagemanagergui.svg)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
7+
[![Install](https://img.shields.io/visual-studio-marketplace/i/aliasadidev.nugetpackagemanagergui)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
8+
[![Download](https://img.shields.io/visual-studio-marketplace/d/aliasadidev.nugetpackagemanagergui)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
9+
[![Rating](https://img.shields.io/visual-studio-marketplace/r/aliasadidev.nugetpackagemanagergui)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
10+
[![Version](https://img.shields.io/visual-studio-marketplace/v/aliasadidev.nugetpackagemanagergui)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
11+
[![Issues](https://img.shields.io/github/issues/aliasadidev/vscode-npm-gui)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
12+
[![Closed Issues](https://img.shields.io/github/issues-closed/aliasadidev/vscode-npm-gui)](https://marketplace.visualstudio.com/items?itemName=aliasadidev.nugetpackagemanagergui)
1113

1214

1315
## Features
@@ -18,7 +20,7 @@
1820
- Update all packages with one click
1921
- Remove a package from the projects
2022
- Search and install new packages from NuGet Server
21-
- Support several NuGet servers (`NuGet`, `BaGet`, `GitLab`, `Nexus`, `Azure`, `JFrog`, `ProGet`)
23+
- Support several NuGet servers (`NuGet`, `BaGet`, `GitLab`, `Nexus`, `Azure`, `ProGet`)
2224
- Compatible with Linux and Windows
2325
- Indenting XML output
2426
- Support basic authentication for private registries
@@ -92,6 +94,11 @@
9294

9395
# What's New
9496

97+
# Version 2.0.6 - Jan 14, 2023
98+
#### Fixed
99+
* Fixed known bugs
100+
* Use a custom XML module and remove xml-js package
101+
95102
## Version 2.0.5 - Nov 9, 2022
96103
#### Fixed
97104
* Fixed the empty screen in VS Code version 1.73.0

package-lock.json

Lines changed: 4 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "An extension for Visual Studio Code that lets you easily update/remove/install packages from NuGet server for .NET Core 1.1+/.Net5+ projects",
55
"author": "Ali Asadi ([email protected])",
66
"publisher": "aliasadidev",
7-
"version": "2.0.5",
7+
"version": "2.0.6",
88
"preview": true,
99
"icon": "images/icon.png",
1010
"license": "MIT",
@@ -19,7 +19,6 @@
1919
"nuget package",
2020
"dotnet 5",
2121
"dotnet 6",
22-
"jfrog",
2322
"gitlab",
2423
"github",
2524
"azure"
@@ -182,7 +181,7 @@
182181
"https-proxy-agent": "^5.0.0",
183182
"node-fetch": "^2.6.1",
184183
"utf8": "^3.0.0",
185-
"xml-js": "^1.6.11"
184+
"sax": "^1.2.4"
186185
},
187186
"__metadata": {
188187
"id": "697a8357-0d3b-4765-8ec9-3a394c9e82c7",

src/models/project-file.model.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ export interface Element {
2222
* The text of element
2323
*/
2424
text?: string;
25+
26+
/**
27+
* The tag is self closing
28+
*/
29+
isSelfClosing?: boolean;
2530
}
2631

2732

src/models/xml.model.ts

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
export interface Attributes {
2+
[key: string]: string | number | undefined
3+
}
4+
5+
export interface DeclarationAttributes {
6+
version?: string | number
7+
encoding?: 'utf-8' | string
8+
standalone?: 'yes' | 'no'
9+
}
10+
11+
export interface ElementCompact {
12+
[key: string]: any
13+
_declaration?: {
14+
_attributes?: DeclarationAttributes
15+
}
16+
_instruction?: {
17+
[key: string]: string
18+
}
19+
_attributes?: Attributes
20+
_cdata?: string
21+
_doctype?: string
22+
_comment?: string
23+
_text?: string | number
24+
}
25+
26+
export interface Element {
27+
declaration?: {
28+
attributes?: DeclarationAttributes
29+
}
30+
instruction?: string
31+
attributes?: Attributes
32+
cdata?: string
33+
doctype?: string
34+
comment?: string
35+
text?: string | number | boolean
36+
type?: string
37+
name?: string
38+
elements?: Array<Element>
39+
}
40+
41+
declare namespace Options {
42+
interface XML2JSON extends XML2JS {
43+
spaces?: number | string
44+
}
45+
46+
interface XML2JS extends ChangingKeyNames, IgnoreOptions {
47+
compact?: boolean
48+
trim?: boolean
49+
sanitize?: boolean
50+
nativeType?: boolean
51+
addParent?: boolean
52+
alwaysArray?: boolean | Array<string>
53+
alwaysChildren?: boolean
54+
instructionHasAttributes?: boolean
55+
captureSpacesBetweenElements?: boolean
56+
doctypeFn?: (value: string, parentElement: object) => void;
57+
instructionFn?: (
58+
instructionValue: string,
59+
instructionName: string,
60+
parentElement: string
61+
) => void;
62+
cdataFn?: (value: string, parentElement: object) => void;
63+
commentFn?: (value: string, parentElement: object) => void;
64+
textFn?: (value: string, parentElement: object) => void;
65+
instructionNameFn?: (
66+
instructionName: string,
67+
instructionValue: string,
68+
parentElement: string
69+
) => void;
70+
elementNameFn?: (value: string, parentElement: object) => void;
71+
attributeNameFn?: (
72+
attributeName: string,
73+
attributeValue: string,
74+
parentElement: string
75+
) => void;
76+
attributeValueFn?: (
77+
attributeValue: string,
78+
attributeName: string,
79+
parentElement: string
80+
) => void;
81+
attributesFn?: (value: string, parentElement: string) => void;
82+
}
83+
84+
interface JS2XML extends ChangingKeyNames, IgnoreOptions {
85+
spaces?: number | string
86+
compact?: boolean
87+
indentText?: boolean
88+
indentCdata?: boolean
89+
indentAttributes?: boolean
90+
indentInstruction?: boolean
91+
fullTagEmptyElement?: boolean
92+
noQuotesForNativeAttributes?: boolean
93+
doctypeFn?: (value: string, currentElementName: string, currentElementObj: object) => void;
94+
instructionFn?: (
95+
instructionValue: string,
96+
instructionName: string,
97+
currentElementName: string,
98+
currentElementObj: object
99+
) => void;
100+
cdataFn?: (value: string, currentElementName: string, currentElementObj: object) => void;
101+
commentFn?: (value: string, currentElementName: string, currentElementObj: object) => void;
102+
textFn?: (value: string, currentElementName: string, currentElementObj: object) => void;
103+
instructionNameFn?: (
104+
instructionName: string,
105+
instructionValue: string,
106+
currentElementName: string,
107+
currentElementObj: object
108+
) => void;
109+
elementNameFn?: (value: string, currentElementName: string, currentElementObj: object) => void;
110+
attributeNameFn?: (
111+
attributeName: string,
112+
attributeValue: string,
113+
currentElementName: string,
114+
currentElementObj: object
115+
) => void;
116+
attributeValueFn?: (
117+
attributeValue: string,
118+
attributeName: string,
119+
currentElementName: string,
120+
currentElementObj: object
121+
) => void;
122+
attributesFn?: (value: string, currentElementName: string, currentElementObj: object) => void;
123+
fullTagEmptyElementFn?: (currentElementName: string, currentElementObj: object) => void;
124+
}
125+
126+
interface IgnoreOptions {
127+
ignoreDeclaration?: boolean
128+
ignoreInstruction?: boolean
129+
ignoreAttributes?: boolean
130+
ignoreComment?: boolean
131+
ignoreCdata?: boolean
132+
ignoreDoctype?: boolean
133+
ignoreText?: boolean
134+
}
135+
136+
interface ChangingKeyNames {
137+
declarationKey?: string
138+
instructionKey?: string
139+
attributesKey?: string
140+
textKey?: string
141+
cdataKey?: string
142+
doctypeKey?: string
143+
commentKey?: string
144+
parentKey?: string
145+
typeKey?: string
146+
nameKey?: string
147+
elementsKey?: string
148+
}
149+
}

0 commit comments

Comments
 (0)