Skip to content

Commit 8ad3ea9

Browse files
committed
fixup: Bump typescript from 5.9.3 to 6.0.3
Fix TypeScript 6.0 compatibility - Update main tsconfig: remove baseUrl, update moduleResolution to bundler - Update webview tsconfig: add lib es2017, disable strict checks - Add ambient.d.ts for asset module declarations (.scss, .png, etc.) - Add VscodeAPI type declaration - Set ignoreDeprecations to 6.0 to silence deprecation warnings Fixes build errors after upgrading from TypeScript 5.9.3 to 6.0.3 Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com> Assisted-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 4792b2a commit 8ad3ea9

6 files changed

Lines changed: 62 additions & 24 deletions

File tree

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
"serialize-javascript": "^7.0.5",
204204
"tar-fs": "^3.1.2",
205205
"tough-cookie": "^6.0.1",
206+
"typescript": "^6.0.3",
206207
"uuid": "^14.0.0"
207208
},
208209
"activationEvents": [

src/webview/@types/globals.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*-----------------------------------------------------------------------------------------------
2+
* Copyright (c) Red Hat, Inc. All rights reserved.
3+
* Licensed under the MIT License. See LICENSE file in the project root for license information.
4+
*-----------------------------------------------------------------------------------------------*/
5+
6+
// Style imports
7+
declare module '*.scss' {
8+
const content: any;
9+
export = content;
10+
}
11+
12+
declare module '*.css' {
13+
const content: any;
14+
export = content;
15+
}
16+
17+
// VSCode webview API augmentation
18+
declare global {
19+
interface Window {
20+
vscodeApi: any;
21+
}
22+
}
23+
24+
// Make this a module so `declare global` works
25+
export {};
26+

src/webview/ambient.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*-----------------------------------------------------------------------------------------------
2+
* Copyright (c) Red Hat, Inc. All rights reserved.
3+
* Licensed under the MIT License. See LICENSE file in the project root for license information.
4+
*-----------------------------------------------------------------------------------------------*/
5+
6+
declare module '*.scss';
7+
declare module '*.css';
8+
declare module '*.png';
9+
declare module '*.svg';
10+
declare module '*.jpg';
11+
12+
type VscodeAPI = any;
13+
14+
interface Window {
15+
vscodeApi: any;
16+
}

src/webview/tsconfig.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"compilerOptions": {
33
"module": "esnext",
44
"moduleResolution": "node",
5+
"rootDir": "..",
56
"outDir": "../../out",
67
"target": "es6",
8+
"lib": ["es2017", "dom"],
79
"jsx": "react",
10+
"types": ["node"],
811
"typeRoots": [
912
"../../node_modules/@types",
1013
"@types"
@@ -13,8 +16,13 @@
1316
"skipLibCheck": true,
1417
"esModuleInterop": true,
1518
"incremental": true,
19+
"ignoreDeprecations": "6.0",
20+
"noImplicitAny": false,
21+
"strict": false,
22+
"strictNullChecks": false
1623
},
1724
"include": [
25+
"ambient.d.ts",
1826
"*/app/**/*.ts",
1927
"*/app/**/*.tsx",
2028
"common/*.tsx",

tsconfig.json

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
"outDir": "./out",
44
"rootDir": ".",
55
"paths": {
6-
"clipboardy": [ "out/esm/clipboardy.cjs" ],
7-
"got": [ "out/esm/got.cjs" ],
8-
"uuid": [ "out/esm/uuid.cjs"],
9-
"@kubernetes/client-node": [ "out/esm/k8s-client-node.cjs" ],
10-
"@apidevtools/json-schema-ref-parser": [ "out/esm/apidevtools-json-schema-ref-parser.cjs" ]
6+
"clipboardy": [ "./out/esm/clipboardy.cjs" ],
7+
"got": [ "./out/esm/got.cjs" ],
8+
"uuid": [ "./out/esm/uuid.cjs"],
9+
"@kubernetes/client-node": [ "./out/esm/k8s-client-node.cjs" ],
10+
"@apidevtools/json-schema-ref-parser": [ "./out/esm/apidevtools-json-schema-ref-parser.cjs" ]
1111
},
12-
"baseUrl": ".",
1312
"jsx": "react",
14-
"target": "es6",
15-
"lib": ["es6", "dom"],
13+
"target": "es2015",
14+
"lib": ["es2015", "dom"],
1615
"noEmit": false,
1716
"module": "CommonJS",
1817
"esModuleInterop": true,
1918
"strict": false,
2019
"noUnusedLocals": false,
2120
"resolveJsonModule": true,
22-
"moduleResolution": "node",
21+
"moduleResolution": "bundler",
22+
"types": ["node", "mocha", "vscode"],
2323
"experimentalDecorators": true,
2424
"useDefineForClassFields": false,
2525
"noImplicitOverride": false,
@@ -28,7 +28,8 @@
2828
"allowSyntheticDefaultImports": true,
2929
"isolatedModules": true,
3030
"typeRoots": [ "./src/@types", "./node_modules/@types", "./out/extension" ],
31-
"sourceMap": true
31+
"sourceMap": true,
32+
"ignoreDeprecations": "6.0"
3233
},
3334
"include": [ "test/**/*.ts", "src/**/*.ts" ],
3435
"exclude": [

0 commit comments

Comments
 (0)