Skip to content

Commit 0af8e14

Browse files
committed
fixup: check
1 parent 7c166bb commit 0af8e14

File tree

6 files changed

+13
-9
lines changed

6 files changed

+13
-9
lines changed

package-lock.json

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

packages/compass-web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@
121121
"mongodb": "^6.16.0",
122122
"mongodb-connection-string-url": "^3.0.1",
123123
"mongodb-data-service": "^22.26.0",
124+
"mongodb-log-writer": "^2.3.4",
124125
"mongodb-ns": "^2.4.2",
125126
"nyc": "^15.1.0",
126127
"os-browserify": "^0.3.0",

packages/compass-web/polyfills/@mongodb-js/devtools-proxy-support/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,4 @@ export function resetSystemCACache(): never {
2222

2323
// Explicitly web-compatible
2424
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
25-
// @ts-expect-error TS resolution doesn't match webpack resolution
2625
export * from '@mongodb-js/devtools-proxy-support/proxy-options';

packages/compass-web/polyfills/net/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-expect-error import vs require
12
import { ipVersion } from 'is-ip';
23
import type { ConnectionOptions } from 'mongodb-data-service';
34
import { Duplex } from 'stream';
@@ -150,6 +151,7 @@ class Socket extends Duplex {
150151
}
151152
}
152153

154+
// @ts-expect-error import vs require
153155
export { isIPv4, isIPv6 } from 'is-ip';
154156
export const isIP = (input: string) => ipVersion(input) ?? 0;
155157
export const createConnection = (options: { host: string; port: number }) => {

packages/compass-web/sandbox/sandbox-logger.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import createDebug from 'debug';
2+
import type { LogMessage } from '../src/logger-and-telemetry';
23

3-
const logging: { name: string; component: string; args: any[] }[] = ((
4-
globalThis as any
5-
).logging = []);
4+
const logging: LogMessage[] = ((globalThis as any).logging = []);
65

76
const debug = createDebug(`mongodb-compass:compass-web-sandbox`);
87

98
export const sandboxLogger = {
10-
log: (name: string, component: string, ...args: any[]) => {
11-
logging.push({ name, component, args });
9+
log: (event: any) => {
10+
logging.push(event);
1211
},
1312

1413
debug,

packages/compass-web/src/logger-and-telemetry.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@ export type TrackFunction = (
99
properties: Record<string, any>
1010
) => void;
1111

12-
export type LogFunction = (message: {
12+
export type LogMessage = {
1313
id: number;
14-
t?: { $date: string };
14+
t: { $date: string };
1515
s: 'F' | 'E' | 'W' | 'I' | 'D1' | 'D2' | 'D3' | 'D4' | 'D5';
1616
c: string;
1717
ctx: string;
1818
msg: string;
1919
attr?: any;
20-
}) => void;
20+
};
21+
export type LogFunction = (message: LogMessage) => void;
2122

2223
export type DebugFunction = (...args: any[]) => void;
2324

0 commit comments

Comments
 (0)