Skip to content

Commit

Permalink
fix: mongodb types fails to compile with latest tsc v4.8 (open-teleme…
Browse files Browse the repository at this point in the history
…try#1141)

* fix(compile-examples): fixed compile examples error

* fix(compile-examples): align all typescipt versions to 4.3.5

* fix(compile-examples): align all typescipt versions to 4.3.5

* fix(compile-examples): moved @types/mongodb to a dev dependency
  • Loading branch information
osherv authored Aug 31, 2022
1 parent 11ab701 commit ec9ee13
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"rimraf": "3.0.2",
"sinon": "14.0.0",
"ts-mocha": "10.0.0",
"typescript": "^4.5.5"
"typescript": "4.3.5"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"devDependencies": {
"@types/express": "^4.17.13",
"ts-node": "^10.6.0",
"typescript": "^4.6.2"
"typescript": "4.3.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"cross-env": "^6.0.0",
"ts-node": "^10.6.0",
"typescript": "^4.6.2",
"typescript": "4.3.5",
"@types/koa": "^2.13.5"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"gts": "3.1.0",
"mocha": "7.2.0",
"mongodb": "3.6.11",
"@types/mongodb": "3.6.20",
"nyc": "15.1.0",
"rimraf": "3.0.2",
"test-all-versions": "5.0.1",
Expand All @@ -67,8 +68,7 @@
},
"dependencies": {
"@opentelemetry/instrumentation": "^0.31.0",
"@opentelemetry/semantic-conventions": "^1.0.0",
"@types/mongodb": "3.6.20"
"@opentelemetry/semantic-conventions": "^1.0.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/plugins/node/opentelemetry-instrumentation-mongodb#readme"
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import {
DbSystemValues,
SemanticAttributes,
} from '@opentelemetry/semantic-conventions';
import type * as mongodb from 'mongodb';
import {
CursorState,
MongodbCommandType,
Expand All @@ -47,9 +46,7 @@ import {
import { VERSION } from './version';

/** mongodb instrumentation plugin for OpenTelemetry */
export class MongoDBInstrumentation extends InstrumentationBase<
typeof mongodb
> {
export class MongoDBInstrumentation extends InstrumentationBase {
constructor(protected override _config: MongoDBInstrumentationConfig = {}) {
super('@opentelemetry/instrumentation-mongodb', VERSION, _config);
}
Expand All @@ -59,7 +56,7 @@ export class MongoDBInstrumentation extends InstrumentationBase<
const { v4Patch, v4Unpatch } = this._getV4Patches();

return [
new InstrumentationNodeModuleDefinition<typeof mongodb>(
new InstrumentationNodeModuleDefinition<any>(
'mongodb',
['>=3.3 <4'],
undefined,
Expand All @@ -73,7 +70,7 @@ export class MongoDBInstrumentation extends InstrumentationBase<
),
]
),
new InstrumentationNodeModuleDefinition<typeof mongodb>(
new InstrumentationNodeModuleDefinition<any>(
'mongodb',
['4.*'],
undefined,
Expand Down

0 comments on commit ec9ee13

Please sign in to comment.