Skip to content

Commit 7fe2361

Browse files
committed
⬆️ update deps
node-fetch to v3
1 parent 7399d15 commit 7fe2361

File tree

4 files changed

+264
-290
lines changed

4 files changed

+264
-290
lines changed

package.json

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -362,32 +362,31 @@
362362
},
363363
"devDependencies": {
364364
"@types/glob": "^7.2.0",
365-
"@types/js-yaml": "^4.0.3",
365+
"@types/js-yaml": "^4.0.5",
366366
"@types/mocha": "^9.0.0",
367-
"node-fetch": "^3.x",
368367
"@types/vscode": "^1.61.0",
369368
"@types/webpack-env": "^1.16.2",
370-
"@typescript-eslint/eslint-plugin": "^5.2.0",
371-
"@typescript-eslint/parser": "^5.2.0",
369+
"@typescript-eslint/eslint-plugin": "^5.5.0",
370+
"@typescript-eslint/parser": "^5.5.0",
372371
"@vscode/test-web": "^0.0.15",
373372
"assert": "^2.0.0",
374373
"del": "^6.0.0",
375374
"download": "^8.0.0",
376375
"emulators": "^0.72.0",
377-
"eslint": "^8.1.0",
376+
"eslint": "^8.4.0",
378377
"glob": "^7.2.0",
379378
"js-yaml": "^4.0.0",
380379
"jszip": "^3.7.1",
381380
"mocha": "^9.1.3",
382-
"node-fetch": "^2.x",
381+
"node-fetch": "^3.x",
383382
"path-browserify": "^1.0.1",
384383
"process": "^0.11.10",
385384
"rimraf": "^3.0.2",
386385
"ts-loader": "^9.2.6",
387-
"typescript": "^4.4.4",
386+
"typescript": "^4.5.2",
388387
"vscode-test": "^1.4.1",
389388
"vscode-uri": "^3.0.2",
390-
"webpack": "^5.60.0",
389+
"webpack": "^5.64.4",
391390
"webpack-cli": "^4.9.1"
392391
},
393392
"repository": {

src/utils/downloadFile.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
* API for downloading information from web
33
*/
44
import { logger } from "./logger";
5-
import * as fetch from 'node-fetch';
65

76
export async function downloadFromMultiSources(urls: string[]): Promise<string | undefined> {
87
for (const url of urls) {
98
try {
10-
const data = await fetch.default(url);
9+
const data = await fetch(url);
1110
const val = await data.text();
1211
if (val) {
1312
return val;

webpack.config.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
'use strict';
99

1010
const path = require('path');
11+
const webpack = require('webpack');
1112
/** @typedef {import('webpack').Configuration} WebpackConfig **/
1213

1314
/** @type WebpackConfig */
@@ -46,13 +47,16 @@ const config = {
4647
}]
4748
}]
4849
},
50+
plugins: [
51+
new webpack.ProvidePlugin({
52+
fetch: 'node-fetch',
53+
}),
54+
],
4955
optimization: {
5056
minimize: true
5157
}
5258
};
5359

54-
const webpack = require('webpack');
55-
5660
/** @type WebpackConfig */
5761
const webExtensionConfig = {
5862
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
@@ -101,7 +105,6 @@ const webExtensionConfig = {
101105
],
102106
externals: {
103107
vscode: 'commonjs vscode', // ignored because it doesn't exist
104-
'node-fetch': 'window fetch'
105108
},
106109
performance: {
107110
hints: false,

0 commit comments

Comments
 (0)