Skip to content

Commit

Permalink
fix: move mongodb to peerDependencies (#435)
Browse files Browse the repository at this point in the history
In order to allow `connect-mongo` to adapt to internal Typescript changes (that do not break the interface), we can specify `mongodb` as a peer dependency--allowing end users to use any version of mongodb they want as long as it's a minor release of driver version 4.1.x
  • Loading branch information
rfox12 committed Sep 17, 2021
1 parent 3e27376 commit 2a2cd78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Moved `mongodb` to a peer dependency (and also as a dev dependency for `connect-mongo` developers). `connect-mongo` is no longer pinned to a specific version of `mongodb`. This allows end users to avoid errors due to Typescript definition changes when moving to new versions of `mongodb`. Users can use any version of `mongodb` that provides a compatible (non-breaking) interface to `mongodb ^4.1.0`. Tested on `mongodb` `4.1.0` and `4.1.1`. Should fix: [#433](https://github.com/jdesboeufs/connect-mongo/issues/433) [#434](https://github.com/jdesboeufs/connect-mongo/issues/434) [#436](https://github.com/jdesboeufs/connect-mongo/issues/436)

## [4.5.0] - 2021-08-17

### **BREAKING CHANGES**
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,19 @@
"engines": {
"node": ">=10"
},
"peerDependencies": {
"mongodb": "^4.1.0"
},
"dependencies": {
"debug": "^4.3.1",
"kruptein": "^3.0.0",
"mongodb": "4.1.0"
"kruptein": "^3.0.0"
},
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@types/debug": "^4.1.7",
"@types/express": "^4.17.13",
"@types/express-session": "^1.17.4",
"@types/node": "^14.14.20",
Expand All @@ -91,6 +94,7 @@
"gh-pages": "^3.1.0",
"husky": "4",
"lint-staged": "^10.5.4",
"mongodb": "^4.1.0",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"open-cli": "^6.0.1",
Expand Down

0 comments on commit 2a2cd78

Please sign in to comment.