Skip to content

Commit 176f99c

Browse files
committed
chore: explore TypeScript 7 compatibility fixes
1 parent 212d1e2 commit 176f99c

148 files changed

Lines changed: 1208 additions & 506 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

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

package.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,12 @@
4242
"languages": [
4343
{
4444
"id": "rn-output-log",
45-
"aliases": ["RN Output Log"],
46-
"extensions": [".rn-output"]
45+
"aliases": [
46+
"RN Output Log"
47+
],
48+
"extensions": [
49+
".rn-output"
50+
]
4751
}
4852
],
4953
"walkthroughs": [
@@ -1417,7 +1421,8 @@
14171421
"compile-smoke-tests": "cd test/smoke && tsc",
14181422
"smoke-tests": "cd test/smoke && tsc && node ./node_modules/mocha/bin/_mocha --config ./.mocharc.js --reporter mocha-multi-reporters",
14191423
"smoke-build": "node gulp_scripts/smoke-build.js",
1420-
"smoke-build-test": "node gulp_scripts/smoke-build.js --test"
1424+
"smoke-build-test": "node gulp_scripts/smoke-build.js --test",
1425+
"postinstall": "patch-package"
14211426
},
14221427
"prettier": {
14231428
"trailingComma": "all",
@@ -1427,7 +1432,9 @@
14271432
"endOfLine": "auto",
14281433
"overrides": [
14291434
{
1430-
"files": ["*.md"],
1435+
"files": [
1436+
"*.md"
1437+
],
14311438
"options": {
14321439
"tabWidth": 2,
14331440
"printWidth": 80
@@ -1436,7 +1443,6 @@
14361443
]
14371444
},
14381445
"dependencies": {
1439-
"@vscode/debugadapter": "^1.63.0",
14401446
"@vscode/js-debug-browsers": "^1.1.2",
14411447
"command-exists": "1.2.9",
14421448
"configstore": "5.0.1",
@@ -1495,6 +1501,8 @@
14951501
"@types/ws": "0.0.39",
14961502
"@typescript-eslint/eslint-plugin": "^6.15.0",
14971503
"@typescript-eslint/parser": "^6.15.0",
1504+
"@typescript/native-preview": "^7.0.0-dev.20260302.1",
1505+
"@vscode/debugadapter": "^1.68.0",
14981506
"@vscode/test-electron": "^2.3.8",
14991507
"@vscode/vsce": "^2.19.0",
15001508
"ansi-colors": "3.2.4",
@@ -1525,6 +1533,7 @@
15251533
"mochawesome": "^7.1.3",
15261534
"ncp": "2.0.0",
15271535
"nyc": "^15.1.0",
1536+
"patch-package": "^8.0.1",
15281537
"playwright": "^1.56.1",
15291538
"plugin-error": "1.0.1",
15301539
"prettier": "2.4.0",
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@vscode/debugprotocol/lib/debugProtocol.d.ts b/node_modules/@vscode/debugprotocol/lib/debugProtocol.d.ts
2+
index 4204bc2..4013f23 100644
3+
--- a/node_modules/@vscode/debugprotocol/lib/debugProtocol.d.ts
4+
+++ b/node_modules/@vscode/debugprotocol/lib/debugProtocol.d.ts
5+
@@ -6,7 +6,7 @@
6+
/** Declaration module describing the VS Code debug protocol.
7+
Auto-generated from json schema. Do not edit manually.
8+
*/
9+
-export declare module DebugProtocol {
10+
+export declare namespace DebugProtocol {
11+
12+
/** Base class of requests, responses, and events. */
13+
interface ProtocolMessage {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/vscode-debugprotocol/lib/debugProtocol.d.ts b/node_modules/vscode-debugprotocol/lib/debugProtocol.d.ts
2+
index a6a9f8d..3081db4 100644
3+
--- a/node_modules/vscode-debugprotocol/lib/debugProtocol.d.ts
4+
+++ b/node_modules/vscode-debugprotocol/lib/debugProtocol.d.ts
5+
@@ -1,7 +1,7 @@
6+
/** Declaration module describing the VS Code debug protocol.
7+
Auto-generated from json schema. Do not edit manually.
8+
*/
9+
-export declare module DebugProtocol {
10+
+export declare namespace DebugProtocol {
11+
/** Base class of requests, responses, and events. */
12+
interface ProtocolMessage {
13+
/** Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request. */

src/cdp-proxy/CDPMessageHandlers/baseCDPMessageHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { Connection } from "vscode-cdp-proxy";
55
import { ICDPMessageHandler, ProcessedCDPMessage } from "./ICDPMessageHandler";
66

77
export abstract class BaseCDPMessageHandler implements ICDPMessageHandler {
8-
protected debuggerTarget: Connection | null;
9-
protected applicationTarget: Connection | null;
8+
protected debuggerTarget: Connection | null = null;
9+
protected applicationTarget: Connection | null = null;
1010

1111
public processDebuggerCDPMessage(event: any): ProcessedCDPMessage {
1212
return {

src/cdp-proxy/debuggerEndpointHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class DebuggerEndpointHelper {
5757
const internalError = ErrorHelper.getInternalError(
5858
InternalErrorCode.CouldNotConnectToDebugTarget,
5959
browserURL,
60-
err.message,
60+
(err as Error).message,
6161
);
6262

6363
if (cancellationToken.isCancellationRequested) {

src/cdp-proxy/reactNativeCDPProxy.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ export class ReactNativeCDPProxy {
2424
APPLICATION_REPLY: "Reply From Target To Debugger",
2525
};
2626

27-
private server: Server | null;
27+
private server: Server | null = null;
2828
private hostAddress: string;
2929
private port: number;
30-
private debuggerTarget: Connection | null;
31-
private applicationTarget: Connection | null;
30+
private debuggerTarget: Connection | null = null;
31+
private applicationTarget: Connection | null = null;
3232
private logger: OutputChannelLogger;
3333
private logLevel: LogLevel;
3434
private debuggerEndpointHelper: DebuggerEndpointHelper;
35-
private CDPMessageHandler: BaseCDPMessageHandler;
36-
private applicationTargetPort: number;
35+
private CDPMessageHandler!: BaseCDPMessageHandler;
36+
private applicationTargetPort: number = 0;
3737
private browserInspectUri: string;
3838
private cancellationToken: CancellationToken | undefined;
3939
private applicationTargetEventEmitter: EventEmitter<unknown> = new EventEmitter();

src/common/commandExecutor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export class CommandExecutor {
7272
});
7373
return stdout;
7474
} catch (reason) {
75-
return reason;
75+
return reason as string;
7676
}
7777
}
7878

src/common/entryPointHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class EntryPointHandler {
6767
Telemetry.init(appName, appVersion, reporter);
6868
return this.runFunction(appName, error, codeToRun, true, extProps);
6969
} catch (error) {
70-
this.logger.error(error);
70+
this.logger.error(error as string);
7171
throw error;
7272
}
7373
}

src/common/node/childProcess.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@ export class ChildProcess {
5959
command,
6060
options,
6161
// eslint-disable-next-line @typescript-eslint/no-unused-vars
62-
(error: Error, stdout: string, stderr: string) => {
62+
(
63+
error: nodeChildProcess.ExecException | null,
64+
stdout: string | Buffer,
65+
stderr: string | Buffer,
66+
) => {
6367
if (error) {
6468
reject(
6569
ErrorHelper.getNestedError(
@@ -69,7 +73,7 @@ export class ChildProcess {
6973
),
7074
);
7175
} else {
72-
resolve(stdout);
76+
resolve(stdout.toString());
7377
}
7478
},
7579
);

0 commit comments

Comments
 (0)