fix: upgrade @types/sinon to unblock build in bigquery-storage#8098
fix: upgrade @types/sinon to unblock build in bigquery-storage#8098danieljbruce wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the @types/sinon dependency in package.json. A review comment identifies a version mismatch between the type definitions and the underlying library, suggesting a patch update within the v17 range instead of a major version bump to maintain type safety.
| "@types/mocha": "^10.0.10", | ||
| "@types/node": "^22.13.14", | ||
| "@types/sinon": "^17.0.4", | ||
| "@types/sinon": "^21.0.0", |
There was a problem hiding this comment.
Upgrading @types/sinon to ^21.0.0 while the underlying sinon library remains on an older version (v17) creates a mismatch between the type definitions and the actual runtime API. This can lead to the TypeScript compiler failing to catch incompatible method calls or incorrectly validating parameters. To maintain type safety, it is recommended to use a patch version within the v17 range (e.g., ^17.0.5) that addresses the fake-timers dependency issue, or to upgrade the sinon package itself to v21.
| "@types/sinon": "^21.0.0", | |
| "@types/sinon": "^17.0.5", |
There was a problem hiding this comment.
^17.05 isn't even a valid version (https://www.npmjs.com/package/@types/sinon?activeTab=versions). Also, sinon is at v21.
danieljbruce
left a comment
There was a problem hiding this comment.
See if gemini responds.
| "@types/mocha": "^10.0.10", | ||
| "@types/node": "^22.13.14", | ||
| "@types/sinon": "^17.0.4", | ||
| "@types/sinon": "^21.0.0", |
There was a problem hiding this comment.
^17.05 isn't even a valid version (https://www.npmjs.com/package/@types/sinon?activeTab=versions). Also, sinon is at v21.
Description
Even though @types/sinon is pinned, it relies on the type definitions provided by @sinonjs/fake-timers. In fake-timers the
FakeTimerInstallOptsinterface was recently removed which breaks the old version of @types/sinon that relies on this interface. We should increase the version number to unblock the build.Impact
Unblocks the build so that we can run the system tests and unit tests with bigquery-storage
Additional Information
The main difference for the upgrade is that the upgraded version seems to only work with Node 18+, but since this targets the devDependencies then this will only affect development environments and we only support Node 18+ anyway.