Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the mysql2 package peer dependency (#695)
This peer dependency was previously added to fix the build for the OpenTelemetry mysql2 package instrumentation. In the TypeScript build of this package it would import the mysql2 types in the `@opentelemetry/instrumentation-mysql2` package, which we import. The `@opentelemetry/instrumentation-mysql2` package itself has no runtime dependency on the mysql2 package, and neither does `@opentelemetry/auto-instrumentations-node`. Which got me interested to find out how that package works if we're experiencing the problem described in PR #688 > Control packages peer dependencies > We need mysql2 as a peer dependency of the package because the > OpenTelemetry instrumentation library requires it. This could be fixed > with introspection using require-in-the-middle. Instead I've moved it to the devDependencies list to fix the build and remove the dependency for users that do not use the mysql2 package in their app. I've then tested it in a TypeScript example app appsignal/opentelemetry#29 that doesn't use mysql2. The AppSignal package works without mysql2 as a peer dependency in this scenario.
- Loading branch information