From f2e92ae1738be8fb26d738f46e01e15ca6b5fa6a Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Fri, 23 Aug 2024 09:27:57 -0700 Subject: [PATCH] feat(instr-tedious): support tedious@19 https://github.com/tediousjs/tedious/releases/tag/v19.0.0 tedious@19 bumps the min supported Node.js to 18.17.0. Refs: #2400 --- plugins/node/instrumentation-tedious/.tav.yml | 7 +++++++ plugins/node/instrumentation-tedious/README.md | 2 +- .../node/instrumentation-tedious/src/instrumentation.ts | 2 +- .../instrumentation-tedious/test/instrumentation.test.ts | 6 +++++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/node/instrumentation-tedious/.tav.yml b/plugins/node/instrumentation-tedious/.tav.yml index 3d86950ef7..f61f4456f7 100644 --- a/plugins/node/instrumentation-tedious/.tav.yml +++ b/plugins/node/instrumentation-tedious/.tav.yml @@ -24,3 +24,10 @@ tedious: # TypeScript v5 to use. This peerDependencies can be removed when this # package updates to TypeScript v5. peerDependencies: typescript@5 + - versions: + include: ">=19 <20" + mode: latest-majors + node: '>=18.17' + commands: npm run test + # See typescript@5 note above. + peerDependencies: typescript@5 diff --git a/plugins/node/instrumentation-tedious/README.md b/plugins/node/instrumentation-tedious/README.md index 457aac618a..740b4da52f 100644 --- a/plugins/node/instrumentation-tedious/README.md +++ b/plugins/node/instrumentation-tedious/README.md @@ -17,7 +17,7 @@ npm install --save @opentelemetry/instrumentation-tedious ## Supported Versions -- [tedious](https://www.npmjs.com/package/tedious) `>=1.11.0 <19` +- [tedious](https://www.npmjs.com/package/tedious) `>=1.11.0 <20` ## Usage diff --git a/plugins/node/instrumentation-tedious/src/instrumentation.ts b/plugins/node/instrumentation-tedious/src/instrumentation.ts index a1fcd25c4d..7313334193 100644 --- a/plugins/node/instrumentation-tedious/src/instrumentation.ts +++ b/plugins/node/instrumentation-tedious/src/instrumentation.ts @@ -78,7 +78,7 @@ export class TediousInstrumentation extends InstrumentationBase=1.11.0 <19'], + ['>=1.11.0 <20'], (moduleExports: typeof tedious) => { const ConnectionPrototype: any = moduleExports.Connection.prototype; for (const method of PATCHED_METHODS) { diff --git a/plugins/node/instrumentation-tedious/test/instrumentation.test.ts b/plugins/node/instrumentation-tedious/test/instrumentation.test.ts index ff9b8a5409..f9419cc4c6 100644 --- a/plugins/node/instrumentation-tedious/test/instrumentation.test.ts +++ b/plugins/node/instrumentation-tedious/test/instrumentation.test.ts @@ -79,7 +79,11 @@ const incompatVersions = (semver.lt(processVersion, '15.0.0') && semver.gte(tediousVersion, '16.0.0')) || // tedious@17 removed support for node v16 and v19 https://github.com/tediousjs/tedious/releases/tag/v17.0.0 - (semver.lt(processVersion, '17.0.0') && semver.gte(tediousVersion, '17.0.0')); + (semver.lt(processVersion, '17.0.0') && + semver.gte(tediousVersion, '17.0.0')) || + // tedious@19 removed support for node <18.17.0 https://github.com/tediousjs/tedious/releases/tag/v19.0.0 + (semver.lt(processVersion, '18.17.0') && + semver.gte(tediousVersion, '19.0.0')); describe('tedious', () => { let tedious: any;