Skip to content

Commit

Permalink
fix: Update import-in-the-middle (open-telemetry#4745)
Browse files Browse the repository at this point in the history
* fix: Update `import-in-the-middle`

* changelog and lint

* lint

* changes from code review

Co-authored-by: Marc Pichler <[email protected]>

---------

Co-authored-by: Marc Pichler <[email protected]>
  • Loading branch information
2 people authored and Zirak committed Sep 14, 2024
1 parent 9ad8fb6 commit 2993ae3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 15 deletions.
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ All notable changes to experimental packages in this project will be documented

### :bug: (Bug Fix)

* fix(instrumentation): Update `import-in-the-middle` to fix [numerous bugs](https:/DataDog/import-in-the-middle/pull/91) [#4745](https:/open-telemetry/opentelemetry-js/pull/4745) @timfish

### :books: (Refine Doc)

* docs(instrumentation): better docs for supportedVersions option [#4693](https:/open-telemetry/opentelemetry-js/pull/4693) @blumamir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"dependencies": {
"@opentelemetry/api-logs": "0.51.1",
"@types/shimmer": "^1.0.2",
"import-in-the-middle": "1.7.4",
"import-in-the-middle": "1.8.0",
"require-in-the-middle": "^7.1.1",
"semver": "^7.5.2",
"shimmer": "^1.2.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,12 +309,11 @@ export abstract class InstrumentationBase<
: this._requireInTheMiddleSingleton.register(module.name, onRequire);

this._hooks.push(hook);
const esmHook =
new (ImportInTheMiddle as unknown as typeof ImportInTheMiddle.default)(
[module.name],
{ internals: false },
<HookFn>hookFn
);
const esmHook = new (
ImportInTheMiddle as unknown as {
Hook: typeof ImportInTheMiddle.default;
}
).Hook([module.name], { internals: false }, <HookFn>hookFn);
this._hooks.push(esmHook);
}
}
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2993ae3

Please sign in to comment.