tibber-express-utils 4.0.23 → 4.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/readme.md +21 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tibber-express-utils",
3
- "version": "4.0.23",
3
+ "version": "4.1.1",
4
4
  "description": "",
5
5
  "main": "./dist/src/index.js",
6
6
  "scripts": {
@@ -48,12 +48,12 @@
48
48
  "yarn-upgrade-all": "^0.7.1"
49
49
  },
50
50
  "resolutions": {
51
- "undici": "^7.29.0",
51
+ "undici": "^7.29.1",
52
52
  "flatted": "^3.4.0",
53
53
  "glob": "^10.5.0",
54
54
  "minimatch": "10.2.4",
55
55
  "picomatch": "^4.0.4",
56
- "brace-expansion": "^5.0.8",
56
+ "brace-expansion": "^5.0.12",
57
57
  "yaml": "^2.8.3",
58
58
  "path-to-regexp": "^8.4.0",
59
59
  "postcss": "^8.5.22",
@@ -63,7 +63,7 @@
63
63
  "es6-error": "^4.1.1"
64
64
  },
65
65
  "peerDependencies": {
66
- "express": "^5.0.0"
66
+ "express": "^4.17.0 || ^5.0.0"
67
67
  },
68
68
  "engines": {
69
69
  "node": ">=18.0.0"
package/readme.md CHANGED
@@ -50,19 +50,25 @@ green while shipping a broken package. It asserts:
50
50
  relies on tsc's `main` → `<main>.d.ts` fallback — this probe is what keeps that
51
51
  working.
52
52
 
53
- It runs against both ends of the Express peer range (the `5.0.0` floor and the
54
- newest `^5`), and CI runs it **before** `yarn release`, so none of the above can
55
- publish.
53
+ It runs against both ends of both supported Express majors (the `4.17.0` and
54
+ `5.0.0` floors, plus the newest `^4` and `^5`), with `@types/express` paired to
55
+ the express major under test. CI runs it **before** `yarn release`, so none of
56
+ the above can publish.
56
57
 
57
58
  ## Requirements
58
59
 
59
60
  - **Node.js**: 18 or higher
60
- - **Express**: 5.x (peer dependency)
61
+ - **Express**: 4.17+ or 5.x (peer dependency)
62
+
63
+ The library imports Express only as a type — nothing in the emitted JavaScript
64
+ references it, and `jsonRouting` decorates whichever `Router` instance you pass
65
+ in. So a single build serves both majors, and the shipped declarations resolve
66
+ `express` types from *your* `@types/express`, whichever major that is.
61
67
 
62
68
  ## Install
63
69
 
64
70
  ```
65
- $ yarn add tibber-express-utils express@5
71
+ $ yarn add tibber-express-utils express
66
72
  ```
67
73
 
68
74
  ## Usage
@@ -139,18 +145,24 @@ Breaking changes in `4.0.0` include:
139
145
  - **Express 5 Support**: This version now supports Express 5.x as a peer dependency.
140
146
  - **Node.js Requirement**: Minimum Node.js version is now 18.0.0 (required by Express 5).
141
147
 
148
+ **Since the peer range widened to `^4.17.0 || ^5.0.0`, Express 5 is no longer
149
+ required to be on 4.x** — the Node 18 floor still applies. Express 4 consumers
150
+ stranded on `3.5.0` can move to 4.x without touching Express.
151
+
142
152
  ### Migration from 3.x.x to 4.0.0
143
153
 
144
154
  To migrate to `4.0.0`:
145
155
 
146
156
  1. **Update Node.js**: Ensure you're running Node.js 18 or higher.
147
- 2. **Update Express**: Install Express 5.x:
157
+ 2. **Update your package**: Update tibber-express-utils to 4.x:
148
158
  ```bash
149
- yarn add express@5
159
+ yarn add tibber-express-utils@4
150
160
  ```
151
- 3. **Update your package**: Update tibber-express-utils to 4.x:
161
+ 3. **Express is optional**: staying on Express 4.17+ is supported. To also move to
162
+ Express 5, see its
163
+ [migration guide](https://expressjs.com/en/guide/migrating-5.html):
152
164
  ```bash
153
- yarn add tibber-express-utils@4
165
+ yarn add express@5
154
166
  ```
155
167
 
156
168
  **Note**: This library maintains the same API and doesn't use any deprecated Express features, so no code changes should be required in most cases.