Skip to content

Commit c869d63

Browse files
committed
fix: remove jest types
1 parent 5348a3a commit c869d63

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

.github/workflows/code_health.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,13 @@ jobs:
7474
node-version-file: package.json
7575
cache: "npm"
7676
- name: Install dependencies & build
77-
run: npm ci --omit=dev --include=@modelcontextprotocol/inspector
78-
- run: npm run inspect -- --cli --method tools/list --connectionString "mongodb://localhost"
77+
run: npm ci
78+
- name: Remove dev dependencies
79+
run: |
80+
rm -rf node_modules
81+
npm pkg set scripts.prepare="exit 0"
82+
npm install --omit=dev
83+
- run: npx -y @modelcontextprotocol/inspector --cli --method tools/list -- node dist/index.js --connectionString "mongodb://localhost"
7984

8085
coverage:
8186
name: Report Coverage

src/telemetry/telemetry.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ApiClient } from "../common/atlas/apiClient.js";
66
import { MACHINE_METADATA } from "./constants.js";
77
import { EventCache } from "./eventCache.js";
88
import { createHmac } from "crypto";
9-
import { machineId } from "node-machine-id";
9+
import nodeMachineId from "node-machine-id";
1010
import { DeferredPromise } from "../deferred-promise.js";
1111

1212
type EventResult = {
@@ -39,6 +39,9 @@ export class Telemetry {
3939
}
4040

4141
private async start(): Promise<void> {
42+
if (!Telemetry.isTelemetryEnabled()) {
43+
return;
44+
}
4245
this.deviceIdPromise = DeferredPromise.fromPromise(this.getDeviceId(), {
4346
timeout: DEVICE_ID_TIMEOUT,
4447
onTimeout: (resolve) => {
@@ -66,7 +69,7 @@ export class Telemetry {
6669
return this.commonProperties.device_id;
6770
}
6871

69-
const originalId = await machineId(true);
72+
const originalId = await nodeMachineId.machineId(true);
7073

7174
// Create a hashed format from the all uppercase version of the machine ID
7275
// to match it exactly with the denisbrodbeck/machineid library that Atlas CLI uses.

tsconfig.build.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"strict": true,
99
"strictNullChecks": true,
1010
"esModuleInterop": true,
11-
"types": ["node", "jest"],
11+
"types": ["node"],
1212
"sourceMap": true,
1313
"skipLibCheck": true,
1414
"resolveJsonModule": true,

0 commit comments

Comments
 (0)