From 26b651327ad7befdeb6ea3f4c739855c5e87c7b3 Mon Sep 17 00:00:00 2001 From: Samuel Demirdjian Date: Thu, 6 Feb 2025 15:07:18 -0800 Subject: [PATCH 1/2] 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. --- package.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index cbb4009..ae6ecbd 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,15 @@ "prepublishOnly": "EXPRESS_MAJOR=4 mocha && EXPRESS_MAJOR=5 mocha", "postpublish": "git push origin && git push origin --tags" }, + "peerDependencies": { + "express": ">= 4.17.3 < 6.0.0" + }, + "peerDependenciesMeta": { + "express": { + "optional": true, + "meta": "This package imports `router`, which comes with `express`." + } + }, "devDependencies": { "express": "^4.18.2", "express4": "github:expressjs/express#4.19.2", @@ -34,7 +43,6 @@ "ajv-keywords": "^5.1.0", "http-errors": "^2.0.0", "path-to-regexp": "^6.2.1", - "router": "^1.3.8", "serve-static": "^1.15.0", "swagger-parser": "^10.0.3", "swagger-ui-dist": "^5.11.8", From c2f4cf98e02cfd7204705b1b8f232121e3fac113 Mon Sep 17 00:00:00 2001 From: Samuel Demirdjian Date: Thu, 6 Feb 2025 15:20:59 -0800 Subject: [PATCH 2/2] test: Remove end of life Node version --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fdf2ed5..5f65ddc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [16.x, 18.x, 20.x, 22.x] + node-version: [18.x, 20.x, 22.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }}