Skip to content

Commit

Permalink
Updates most dependencies to latest versions (#1642)
Browse files Browse the repository at this point in the history
Updates most of the dependencies to the latest versions (except for some core libraries), also includes fixes for some new linting rules. It also updates the node version for the CI workflows to 16.x as 14.x (previous) is not compatible with latest version of eslint-plugin.

The following dependencies ARE NOT updated in this PR as they will be addressed in individuals PR as they require some follow up when updating.

puppeteer-core": "13.1.2"
jest": "27.2.2"
vscode-languageclient": "7.0.0"
typescript": "4.4.3"
  • Loading branch information
vidorteg authored Aug 15, 2023
1 parent 43972b3 commit 4fbb965
Show file tree
Hide file tree
Showing 16 changed files with 6,232 additions and 4,921 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI_mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/CI_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

strategy:
matrix:
node-version: [14.x]
node-version: [16.x]

steps:
- uses: actions/checkout@v3
Expand Down
10,984 changes: 6,145 additions & 4,839 deletions package-lock.json

Large diffs are not rendered by default.

60 changes: 30 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -566,21 +566,21 @@
"group": "navigation"
}
],
"devtoolsContextMenu":[
"devtoolsContextMenu": [
{
"command":"vscode-edge-devtools-view.launchHtml",
"group":"navigation"
"command": "vscode-edge-devtools-view.launchHtml",
"group": "navigation"
},
{
"command":"vscode-edge-devtools-view.launchScreencast",
"group":"navigation"
"command": "vscode-edge-devtools-view.launchScreencast",
"group": "navigation"
}
]
},
"submenus": [
{
"id": "devtoolsContextMenu",
"label": "Open with Edge"
"id": "devtoolsContextMenu",
"label": "Open with Edge"
}
],
"viewsContainers": {
Expand Down Expand Up @@ -676,44 +676,44 @@
"test": "npm run lint && jest --config package.json --runInBand --env=jsdom"
},
"dependencies": {
"@vscode/codicons": "0.0.22",
"bufferutil": "4.0.4",
"lit-html": "^2.2.2",
"@vscode/codicons": "0.0.33",
"bufferutil": "4.0.7",
"lit-html": "^2.7.5",
"puppeteer-core": "13.1.2",
"utf-8-validate": "5.0.6",
"utf-8-validate": "6.0.3",
"vscode-chrome-debug-core": "6.8.11",
"vscode-extension-telemetry": "0.4.1",
"vscode-webhint": "2.1.10",
"ws": "8.2.2",
"vscode-webhint": "2.1.11",
"ws": "8.13.0",
"xmlhttprequest": "1.8.0"
},
"devDependencies": {
"@opentelemetry/tracing": "0.24.0",
"@types/copy-webpack-plugin": "8.0.1",
"@types/fs-extra": "9.0.13",
"@types/fs-extra": "11.0.1",
"@types/jest": "27.0.2",
"@types/node": "16.10.1",
"@types/node": "20.4.2",
"@types/puppeteer-core": "5.4.0",
"@types/vscode": "1.48.0",
"@types/ws": "8.2.0",
"@typescript-eslint/eslint-plugin": "4.32.0",
"@typescript-eslint/parser": "4.32.0",
"copy-webpack-plugin": "9.0.1",
"eslint": "7.32.0",
"eslint-plugin-import": "2.24.2",
"eslint-plugin-jsdoc": "36.1.0",
"@types/vscode": "1.53.0",
"@types/ws": "8.5.5",
"@typescript-eslint/eslint-plugin": "6.1.0",
"@typescript-eslint/parser": "6.1.0",
"copy-webpack-plugin": "11.0.0",
"eslint": "8.45.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-jsdoc": "46.4.4",
"eslint-plugin-prefer-arrow": "1.2.3",
"fs-extra": "10.0.0",
"fs-extra": "11.1.1",
"jest": "27.2.2",
"ts-jest": "27.0.5",
"ts-loader": "9.2.6",
"ts-loader": "9.4.4",
"typescript": "4.4.3",
"uglify-js": "3.14.2",
"unzipper": "0.10.11",
"vsce": "2.6.4",
"uglify-js": "3.17.4",
"unzipper": "0.10.14",
"@vscode/vsce": "^2.19.0",
"vscode-languageclient": "7.0.0",
"vscode-test": "1.6.1",
"webpack": "5.76.0",
"webpack-cli": "4.8.0"
"webpack": "5.88.2",
"webpack-cli": "5.1.4"
}
}
2 changes: 1 addition & 1 deletion src/cdpTargetsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class CDPTargetsProvider implements vscode.TreeDataProvider<CDPTarget> {
https.get(faviconUrl, (response: IncomingMessage) => {
if (response.headers['content-type'] && response.headers['content-type'].includes('icon')) {
const buffer: Uint8Array[] = [];
response.on('data', data => {
response.on('data', (data: Uint8Array) => {
buffer.push(data);
});

Expand Down
34 changes: 17 additions & 17 deletions src/devtoolsPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,28 @@ export class DevToolsPanel {
this.panelSocket = new PanelSocket(this.targetUrl, (e, msg) => this.postToDevTools(e, msg));
}
this.panelSocket.on('ready', () => this.onSocketReady());
this.panelSocket.on('websocket', msg => this.onSocketMessage(msg));
this.panelSocket.on('telemetry', msg => this.onSocketTelemetry(msg));
this.panelSocket.on('getState', msg => this.onSocketGetState(msg));
this.panelSocket.on('getVscodeSettings', msg => this.onSocketGetVscodeSettings(msg));
this.panelSocket.on('setState', msg => this.onSocketSetState(msg));
this.panelSocket.on('getUrl', msg => this.onSocketGetUrl(msg) as unknown as void);
this.panelSocket.on('openUrl', msg => this.onSocketOpenUrl(msg) as unknown as void);
this.panelSocket.on('openInEditor', msg => this.onSocketOpenInEditor(msg) as unknown as void);
this.panelSocket.on('websocket', (msg: string) => this.onSocketMessage(msg));
this.panelSocket.on('telemetry', (msg: string) => this.onSocketTelemetry(msg));
this.panelSocket.on('getState', (msg: string) => this.onSocketGetState(msg));
this.panelSocket.on('getVscodeSettings', (msg: string) => this.onSocketGetVscodeSettings(msg));
this.panelSocket.on('setState', (msg: string) => this.onSocketSetState(msg));
this.panelSocket.on('getUrl', (msg: string) => this.onSocketGetUrl(msg) as unknown as void);
this.panelSocket.on('openUrl', (msg: string) => this.onSocketOpenUrl(msg) as unknown as void);
this.panelSocket.on('openInEditor', (msg: string) => this.onSocketOpenInEditor(msg) as unknown as void);
this.panelSocket.on('toggleScreencast', () => this.toggleScreencast() as unknown as void);
this.panelSocket.on('cssMirrorContent', msg => this.onSocketCssMirrorContent(msg) as unknown as void);
this.panelSocket.on('cssMirrorContent', (msg: string) => this.onSocketCssMirrorContent(msg) as unknown as void);
this.panelSocket.on('close', () => this.onSocketClose());
this.panelSocket.on('copyText', msg => this.onSocketCopyText(msg));
this.panelSocket.on('focusEditor', msg => this.onSocketFocusEditor(msg));
this.panelSocket.on('focusEditorGroup', msg => this.onSocketFocusEditorGroup(msg));
this.panelSocket.on('copyText', (msg: string) => this.onSocketCopyText(msg));
this.panelSocket.on('focusEditor', (msg: string) => this.onSocketFocusEditor(msg));
this.panelSocket.on('focusEditorGroup', (msg: string) => this.onSocketFocusEditorGroup(msg));
this.panelSocket.on('replayConsoleMessages', () => this.onSocketReplayConsoleMessages());
this.panelSocket.on('devtoolsConnection', success => this.onSocketDevToolsConnection(success));
this.panelSocket.on('toggleCSSMirrorContent', msg => this.onToggleCSSMirrorContent(msg) as unknown as void);
this.panelSocket.on('devtoolsConnection', (success: string) => this.onSocketDevToolsConnection(success));
this.panelSocket.on('toggleCSSMirrorContent', (msg: string) => this.onToggleCSSMirrorContent(msg) as unknown as void);

// This Websocket is only used on initial connection to determine the browser version.
// The browser version is used to select the correct hashed version of the devtools
this.versionDetectionSocket = new BrowserVersionDetectionSocket(this.targetUrl);
this.versionDetectionSocket.on('setCdnParameters', msg => this.setCdnParameters(msg));
this.versionDetectionSocket.on('setCdnParameters', (msg: {revision: string; isHeadless: boolean}) => this.setCdnParameters(msg));

// Handle closing
this.panel.onDidDispose(() => {
Expand All @@ -124,7 +124,7 @@ export class DevToolsPanel {
}, this, this.disposables);

// Handle messages from the webview
this.panel.webview.onDidReceiveMessage(message => {
this.panel.webview.onDidReceiveMessage((message: string) => {
this.panelSocket.onMessageFromWebview(message);
}, this, this.disposables);

Expand Down Expand Up @@ -424,7 +424,7 @@ export class DevToolsPanel {
await ErrorReporter.showErrorDialog({
errorCode: ErrorCodes.Error,
title: 'Error while opening file in editor.',
message: e,
message: e instanceof Error && e.message ? e.message : `Unexpected error ${e}`,
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/errorReporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ErrorCodes } from './common/errorCodes';

export interface ErrorEventInterface {
title: string,
message: string | unknown,
message: string,
errorCode: ErrorCodes
}

Expand Down
9 changes: 5 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export function activate(context: vscode.ExtensionContext): void {
void launch(context);
}));

context.subscriptions.push(vscode.commands.registerCommand(`${SETTINGS_STORE_NAME}.attachToCurrentDebugTarget`, (debugSessionId, config): void => {
context.subscriptions.push(vscode.commands.registerCommand(`${SETTINGS_STORE_NAME}.attachToCurrentDebugTarget`, (debugSessionId: string | undefined, config: Partial<IUserConfig>): void => {
void attachToCurrentDebugTarget(context, debugSessionId, config);
}));

Expand Down Expand Up @@ -133,7 +133,7 @@ export function activate(context: vscode.ExtensionContext): void {

context.subscriptions.push(vscode.commands.registerCommand(
`${SETTINGS_VIEW_NAME}.toggleScreencast`,
(target?: CDPTarget, isJsDebugProxiedCDPConnection = false) => {
(target?: CDPTarget, isJsDebugProxiedCDPConnection: boolean = false) => {
if (!target){
const errorMessage = 'No target selected';
telemetryReporter.sendTelemetryErrorEvent('command/screencast/target', {message: errorMessage});
Expand Down Expand Up @@ -421,7 +421,7 @@ export async function attach(
void ErrorReporter.showErrorDialog({
errorCode: ErrorCodes.Error,
title: 'Error while getting a debug connection to the target',
message: e,
message: e instanceof Error && e.message ? e.message : `Unexpected error ${e}`,
});

matchedTargets = undefined;
Expand Down Expand Up @@ -481,8 +481,9 @@ export async function attach(
void ErrorReporter.showErrorDialog({
errorCode: ErrorCodes.Error,
title: 'Error while fetching list of available targets',
message: exceptionStack || 'No available targets to attach.',
message: exceptionStack as string || 'No available targets to attach.',
});

telemetryReporter.sendTelemetryEvent('command/attach/error/no_json_array', telemetryProps);
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/launchConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
SETTINGS_STORE_NAME,
SETTINGS_DEFAULT_URL,
} from './utils';
export type LaunchConfig = 'None' | 'Unsupported' | string;
export type CompoundConfig = {
name: string,
configurations: string[],
Expand Down Expand Up @@ -76,7 +75,7 @@ export const extensionConfigs: vscode.DebugConfiguration[] = [
];

export class LaunchConfigManager {
private launchConfig: LaunchConfig;
private launchConfig: string;
private isValidConfig: boolean;
private static launchConfigManagerInstance: LaunchConfigManager;

Expand All @@ -93,7 +92,7 @@ export class LaunchConfigManager {
return LaunchConfigManager.launchConfigManagerInstance;
}

getLaunchConfig(): LaunchConfig {
getLaunchConfig(): string {
this.updateLaunchConfig();
return this.launchConfig;
}
Expand Down
1 change: 1 addition & 0 deletions src/panelSocket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export class PanelSocket extends EventEmitter {
private onMessage(message: { data: WebSocket.Data }) {
if (this.isConnected) {
// Forward the message onto the devtools
// eslint-disable-next-line @typescript-eslint/no-base-to-string
this.postMessageToDevTools('message', message.data.toString());
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/screencastPanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class ScreencastPanel {
private readonly panel: vscode.WebviewPanel;
private readonly telemetryReporter: TelemetryReporter;
private isJsDebugProxiedCDPConnection = false;
private targetUrl: string
private targetUrl: string;
private panelSocket: PanelSocket;
private screencastStartTime;
static instance: ScreencastPanel | undefined;
Expand All @@ -52,8 +52,8 @@ export class ScreencastPanel {
this.panelSocket = new PanelSocket(this.targetUrl, (e, msg) => this.postToWebview(e, msg));
}
this.panelSocket.on('close', () => this.onSocketClose());
this.panelSocket.on('telemetry', message => this.onSocketTelemetry(message));
this.panelSocket.on('writeToClipboard', message => this.onSaveToClipboard(message));
this.panelSocket.on('telemetry', (message: string) => this.onSocketTelemetry(message));
this.panelSocket.on('writeToClipboard', (message: string) => this.onSaveToClipboard(message));
this.panelSocket.on('readClipboard', () => this.onGetClipboardText());

// Handle closing
Expand Down
8 changes: 5 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export async function getListOfTargets(hostname: string, port: number, useHttps:
void ErrorReporter.showErrorDialog({
errorCode: ErrorCodes.Error,
title: 'Error while parsing the list of targets.',
message: e,
message: e instanceof Error && e.message ? e.message : `Unexpected error ${e}`,
});
}
return result;
Expand Down Expand Up @@ -318,11 +318,12 @@ export async function getJsDebugCDPProxyWebsocketUrl(debugSessionId: string): Pr
if (e instanceof Error) {
return e;
}

// Throw remaining unhandled exceptions
void ErrorReporter.showErrorDialog({
errorCode: ErrorCodes.Error,
title: 'Error while creating the debug socket for CDP target.',
message: e,
message: `Unexpected error ${e}`,
});
}
}
Expand All @@ -333,7 +334,7 @@ export async function getJsDebugCDPProxyWebsocketUrl(debugSessionId: string): Pr
* @param context The vscode context
*/
export function createTelemetryReporter(_context: vscode.ExtensionContext): Readonly<TelemetryReporter> {
if (packageJson && _context.extensionMode === 1 /* Production */) {
if (packageJson && (_context.extensionMode === vscode.ExtensionMode.Production)) {
// Use the real telemetry reporter
return new TelemetryReporter(packageJson.name, packageJson.version, packageJson.aiKey);
}
Expand Down Expand Up @@ -724,6 +725,7 @@ export function reportExtensionSettings(telemetryReporter: Readonly<TelemetryRep
}
}
} else {
// eslint-disable-next-line @typescript-eslint/no-base-to-string
changedSettingsMap.set(settingName, settingValue.toString());
}
}
Expand Down
1 change: 1 addition & 0 deletions src/versionSocketConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class BrowserVersionDetectionSocket extends EventEmitter {

private onMessage(message: { data: WebSocket.Data }) {
// Determine if this is the browser.getVersion response and send revision hash to devtoolsPanel
// eslint-disable-next-line @typescript-eslint/no-base-to-string
const data = JSON.parse(message.data.toString()) as BrowserVersionCdpResponse;
this.emit('setCdnParameters', this.calcBrowserRevision(data));
// Dispose socket after version is determined
Expand Down
3 changes: 3 additions & 0 deletions test/helpers/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export function createFakeVSCode() {
CallHierarchyItem: jest.fn(),
CodeActionKind: jest.fn(),
Disposable: jest.fn(),
ExtensionMode: {
Production: 1
},
version: '1.60.0',
EventEmitter: jest.fn(),
Range: function Range() { /* constructor */ },
Expand Down
Loading

1 comment on commit 4fbb965

@Razyy24
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good bro

Please sign in to comment.