Skip to content

Commit

Permalink
Moving types to peerDependencies and allowing express 5 (#309)
Browse files Browse the repository at this point in the history
* Moving types to peerDependencies, allowing express 5.

* Testing on Node 22 as well.

* Readme: adjusting installation instructions.

* Ref: making those peers optional, only needed for those using TypeScript.
  • Loading branch information
RobinTail authored Oct 4, 2024
1 parent 40e0e75 commit fa4ae25
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
node-version: [16.x, 18.x, 20.x, 22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ This project is available as a

```bash
$ npm install node-mocks-http --save-dev
$ npm install @types/node @types/express --save-dev # when using TypeScript
```

or

```bash
$ yarn add node-mocks-http --dev
$ yarn add @types/node @types/express --dev # when using TypeScript
```

After installing the package include the following in your test files:
Expand Down
44 changes: 33 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@
"node": ">=14"
},
"dependencies": {
"@types/express": "^4.17.21",
"@types/node": "*",
"accepts": "^1.3.7",
"content-disposition": "^0.5.3",
"depd": "^1.1.0",
Expand All @@ -59,6 +57,18 @@
"range-parser": "^1.2.0",
"type-is": "^1.6.18"
},
"peerDependencies": {
"@types/express": "^4.17.21 || ^5.0.0",
"@types/node": "*"
},
"peerDependenciesMeta": {
"@types/express": {
"optional": true
},
"@types/node": {
"optional": true
}
},
"devDependencies": {
"@types/chai": "^4.3.11",
"@types/mocha": "^10.0.6",
Expand Down

0 comments on commit fa4ae25

Please sign in to comment.