Skip to content

Commit e64ee37

Browse files
committed
🚑 use 2.x of node-fetch
latest node-fetch is esm only, so we can't load it node-fetch/node-fetch#1279 (comment) focusing vscode support of esm in microsoft/vscode#135450
1 parent ed1813c commit e64ee37

File tree

5 files changed

+684
-740
lines changed

5 files changed

+684
-740
lines changed

package.json

+19-18
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"icon": "resources/dosboxasm.png",
1717
"engines": {
18-
"vscode": "^1.49.0"
18+
"vscode": "^1.61.0"
1919
},
2020
"extensionDependencies": [
2121
"xsro.vscode-dosbox"
@@ -295,33 +295,34 @@
295295
"package": "vsce package"
296296
},
297297
"devDependencies": {
298-
"@types/glob": "^7.1.3",
299-
"@types/js-yaml": "^4.0.0",
298+
"@types/glob": "^7.2.0",
299+
"@types/js-yaml": "^4.0.3",
300300
"@types/mocha": "^9.0.0",
301-
"@types/vscode": "^1.49.0",
301+
"@types/node-fetch": "^2.x",
302+
"node-fetch": "^2.x",
303+
"@types/vscode": "^1.61.0",
302304
"@types/webpack-env": "^1.16.2",
303-
"@typescript-eslint/eslint-plugin": "^4.29.1",
304-
"@typescript-eslint/parser": "^4.29.1",
305-
"@vscode/test-web": "^0.0.13",
305+
"@typescript-eslint/eslint-plugin": "^5.2.0",
306+
"@typescript-eslint/parser": "^5.2.0",
307+
"@vscode/test-web": "^0.0.15",
306308
"assert": "^2.0.0",
307309
"del": "^6.0.0",
308310
"download": "^8.0.0",
309-
"emulators": "^0.67.0",
310-
"eslint": "^7.32.0",
311-
"glob": "^7.1.6",
311+
"emulators": "^0.72.0",
312+
"eslint": "^8.1.0",
313+
"glob": "^7.2.0",
312314
"js-yaml": "^4.0.0",
313315
"jszip": "^3.7.1",
314-
"mocha": "^9.0.3",
315-
"node-fetch": "^3.0.0",
316+
"mocha": "^9.1.3",
316317
"path-browserify": "^1.0.1",
317318
"process": "^0.11.10",
318319
"rimraf": "^3.0.2",
319-
"ts-loader": "^9.2.5",
320-
"typescript": "^4.3.5",
321-
"vsce": "^1.83.0",
320+
"ts-loader": "^9.2.6",
321+
"typescript": "^4.4.4",
322+
"vsce": "^1.100.2",
322323
"vscode-test": "^1.4.1",
323-
"webpack": "^5.50.0",
324-
"webpack-cli": "^4.7.2"
324+
"webpack": "^5.60.0",
325+
"webpack-cli": "^4.9.1"
325326
},
326327
"repository": {
327328
"type": "git",
@@ -332,4 +333,4 @@
332333
"email": "[email protected]"
333334
},
334335
"license": "MIT"
335-
}
336+
}

src/language/hoverFelix.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ export class FELIX {
2727

2828
static async create(fileuri: Uri): Promise<FELIX> {
2929
const arr = await fs.readFile(fileuri);
30-
const json = JSON.parse(arr.toString());
31-
return new FELIX(json);
30+
try {
31+
const json = JSON.parse(arr.toString());
32+
return new FELIX(json);
33+
} catch (e) {
34+
console.error(e, arr.toString());
35+
}
36+
throw new Error();
3237
}
3338

3439
constructor(private target: InstructionsJSON) {

src/utils/browser-fetch.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export default fetch;
1+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2+
declare const window: any;
3+
export const fetch = window.fetch;

tsconfig.json

-4
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
"module": "commonjs",
44
"target": "es2017",
55
"outDir": "dist",
6-
"lib": [
7-
// "es6",
8-
// "WebWorker"
9-
],
106
"sourceMap": true,
117
"rootDir": "src",
128
"strict": true /* enable all strict type-checking options */

0 commit comments

Comments
 (0)