Skip to content

Commit 6b6c7a9

Browse files
committed
fix: Better compatibility with Express 5 by removing router dependency
Remove `router` dependency and mark `express` as peer dependency. This way we get rid of the security warnings when we npm install this package. We also allow the use of the Router that comes with whatever express version the host application has.
1 parent b56f6ee commit 6b6c7a9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
"prepublishOnly": "EXPRESS_MAJOR=4 mocha && EXPRESS_MAJOR=5 mocha",
2121
"postpublish": "git push origin && git push origin --tags"
2222
},
23+
"peerDependencies": {
24+
"express": ">= 4.17.0 < 6.0.0"
25+
},
26+
"peerDependenciesMeta": {
27+
"express": {
28+
"optional": true,
29+
"meta": "This package imports `router`, which comes with `express`."
30+
}
31+
},
2332
"devDependencies": {
2433
"express": "^4.18.2",
2534
"express4": "github:expressjs/express#4.19.2",
@@ -34,7 +43,6 @@
3443
"ajv-keywords": "^5.1.0",
3544
"http-errors": "^2.0.0",
3645
"path-to-regexp": "^6.2.1",
37-
"router": "^1.3.8",
3846
"serve-static": "^1.15.0",
3947
"swagger-parser": "^10.0.3",
4048
"swagger-ui-dist": "^5.11.8",

0 commit comments

Comments
 (0)