Skip to content

Commit 12caf3f

Browse files
authored
Use Node 18, drop node-fetch (#4167)
1 parent bc3f65a commit 12caf3f

File tree

4 files changed

+37
-41
lines changed

4 files changed

+37
-41
lines changed

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.17
1+
18.15

package-lock.json

+27-31
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-7
Original file line numberDiff line numberDiff line change
@@ -2929,7 +2929,7 @@
29292929
]
29302930
},
29312931
"engines": {
2932-
"vscode": "^1.75.0"
2932+
"vscode": "^1.82.0"
29332933
},
29342934
"capabilities": {
29352935
"virtualWorkspaces": false,
@@ -2971,10 +2971,9 @@
29712971
"@types/fs-extra": "^11.0.1",
29722972
"@types/glob": "^7.2.0",
29732973
"@types/mocha": "^10.0.1",
2974-
"@types/node": "^16.18.24",
2975-
"@types/node-fetch": "^2.6.3",
2974+
"@types/node": "18.x",
29762975
"@types/semver": "^7.3.13",
2977-
"@types/vscode": "1.75.0",
2976+
"@types/vscode": "1.82.0",
29782977
"@types/xml2js": "^0.4.11",
29792978
"@typescript-eslint/eslint-plugin": "^5.59.0",
29802979
"@typescript-eslint/parser": "^5.59.0",
@@ -2999,17 +2998,16 @@
29992998
"@azure/storage-blob": "^12.14.0",
30002999
"@microsoft/compose-language-service": "^0.2.0",
30013000
"@microsoft/vscode-azext-azureappservice": "~2.0",
3002-
"@microsoft/vscode-azext-azureauth": "^1.3.0",
3001+
"@microsoft/vscode-azext-azureauth": "^1.4.0",
30033002
"@microsoft/vscode-azext-azureutils": "^2.0.0",
30043003
"@microsoft/vscode-azext-utils": "^2.1.1",
30053004
"@microsoft/vscode-container-client": "^0.1.1",
3006-
"@microsoft/vscode-docker-registries": "^0.1.7",
3005+
"@microsoft/vscode-docker-registries": "^0.1.8",
30073006
"dayjs": "^1.11.7",
30083007
"dockerfile-language-server-nodejs": "^0.11.0",
30093008
"fs-extra": "^11.1.1",
30103009
"gradle-to-js": "^2.0.1",
30113010
"handlebars": "^4.7.7",
3012-
"node-fetch": "^2.6.9",
30133011
"semver": "^7.5.2",
30143012
"tar": "^6.1.13",
30153013
"vscode-languageclient": "^8.1.0",

src/utils/httpRequest.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import * as fse from 'fs-extra';
7-
import { default as fetch, Request, RequestInit, Response } from 'node-fetch';
87
import { URL, URLSearchParams } from 'url';
98
import { l10n } from 'vscode';
109

@@ -133,7 +132,10 @@ export interface ResponseLike {
133132
export async function streamToFile(downloadUrl: string, fileName: string): Promise<void> {
134133
const response = await fetch(downloadUrl);
135134
const writeStream = fse.createWriteStream(fileName);
136-
response.body.pipe(writeStream);
135+
136+
for await (const chunk of response.body) {
137+
writeStream.write(chunk);
138+
}
137139

138140
return new Promise((resolve, reject) => {
139141
writeStream.on('close', () => {

0 commit comments

Comments
 (0)