Commit dc01fac
feat: remove @gasket/plugin-middleware and migrate to express/fastify… (#1355)
* feat: remove @gasket/plugin-middleware and migrate to express/fastify hooks
- Delete @gasket/plugin-middleware package entirely
- Migrate @gasket/plugin-morgan from middleware hook to express and fastify lifecycle hooks using native Fastify syntax
- Remove middleware lifecycle metadata and after:middleware ordering from express and fastify plugins
- Remove compression, trustProxy, middlewareInclusionRegex, excludedRoutesRegex config types and docs
- Update README, docs, and examples across the repo to reflect the removal
- Clean up stale test mocks and dead link definitions
Co-authored-by: Cursor <cursoragent@cursor.com>
* revert: restore upgrade-to-7.md to original (immutable historical doc)
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: replace remaining middleware lifecycle references with express hook
- Update parent metadata from 'middleware' to 'express' in gasket-plugin-intl and gasket-plugin-elastic-apm
- Update EXAMPLES.md files across gasket-core, gasket-plugin-nextjs, gasket-plugin-intl, gasket-plugin-elastic-apm, gasket-plugin-data, and gasket-plugin-webpack to use express lifecycle instead of middleware hook
Co-authored-by: Cursor <cursoragent@cursor.com>
* update
* fix: replace app.use() with native Fastify setErrorHandler for errorMiddleware
app.use() on Fastify requires @fastify/express or @fastify/middie which was
previously provided by the removed middleware plugin. Use setErrorHandler with
request.raw/reply.raw to bridge Express-style 4-arg error handlers natively.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: chain errorMiddleware handlers via single setErrorHandler in fastify
Previously each handler would override the last via repeated setErrorHandler
calls. Now all handlers are chained through a single setErrorHandler using
request.raw/reply.raw to bridge the Express 4-arg error signature natively.
Co-authored-by: Cursor <cursoragent@cursor.com>
* fix: update fastify errorMiddleware docs, types, and inline comment
- Fix ErrorHandler type: replace FastifyRequest/FastifyReply with IncomingMessage/ServerResponse to match what request.raw/reply.raw actually provides
- Remove unused FastifyRequest and FastifyReply imports
- Update errorMiddleware README section to describe setErrorHandler chaining approach
- Remove stale @returns JSDoc from fastify hook example
- Add inline comment explaining the single setErrorHandler chaining pattern
Co-authored-by: Cursor <cursoragent@cursor.com>
* docs: simplify errorMiddleware description in fastify README
Co-authored-by: Cursor <cursoragent@cursor.com>
* changeset
* fix: ensure morgan express middleware runs before route handlers via timing
Add timing: { first: true } to the express hook in @gasket/plugin-morgan so
Morgan middleware is always registered before route handlers regardless of
plugin order in gasket.ts. In Express, app.use() and route handlers share the
same stack and are processed in registration order, so without this fix Morgan
would not intercept requests if pluginMorgan appeared after route plugins.
Update tests to reflect the new { timing, handler } hook shape.
Co-authored-by: Cursor <cursoragent@cursor.com>
* update docs
---------
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 28ca134 commit dc01fac
File tree
54 files changed
+311
-1974
lines changed- .changeset
- docs
- packages
- gasket-core
- gasket-data
- gasket-plugin-data
- gasket-plugin-elastic-apm
- lib
- gasket-plugin-express
- docs
- lib
- gasket-plugin-fastify
- lib
- test
- gasket-plugin-intl
- lib
- gasket-plugin-middleware
- lib
- test
- gasket-plugin-morgan
- lib
- test
- gasket-plugin-nextjs
- gasket-plugin-webpack/docs
- gasket-typescript-tests
- test
- scripts/generate-docs-index
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
54 files changed
+311
-1974
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
| |||
392 | 391 | | |
393 | 392 | | |
394 | 393 | | |
395 | | - | |
396 | 394 | | |
397 | 395 | | |
398 | 396 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
54 | | - | |
| 53 | + | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
65 | 65 | | |
66 | | - | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
| 106 | + | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
| |||
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | | - | |
| 115 | + | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
120 | | - | |
| 119 | + | |
121 | 120 | | |
122 | | - | |
123 | 121 | | |
124 | 122 | | |
125 | 123 | | |
| |||
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
139 | | - | |
| 137 | + | |
140 | 138 | | |
141 | 139 | | |
142 | | - | |
143 | | - | |
| 140 | + | |
| 141 | + | |
144 | 142 | | |
145 | 143 | | |
146 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
74 | 70 | | |
75 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
76 | 74 | | |
77 | 75 | | |
78 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | | - | |
203 | | - | |
204 | | - | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | | - | |
| 42 | + | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
224 | | - | |
| 224 | + | |
| 225 | + | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments