@gasket/plugin-fastify 6.0.5 → 6.14.0
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.
- package/CHANGELOG.md +5 -0
- package/index.d.ts +28 -0
- package/package.json +23 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# `@gasket/plugin-fastify`
|
|
2
2
|
|
|
3
|
+
### 6.10.0
|
|
4
|
+
|
|
5
|
+
- TypeScript definitions for config & lifecycles ([#311])
|
|
6
|
+
|
|
3
7
|
### 6.0.5
|
|
4
8
|
|
|
5
9
|
- Filter falsy middleware ([#255])
|
|
@@ -27,3 +31,4 @@ Enable middleware support ([#172])
|
|
|
27
31
|
[#172]: https://github.com/godaddy/gasket/pull/172
|
|
28
32
|
[#250]: https://github.com/godaddy/gasket/pull/250
|
|
29
33
|
[#255]: https://github.com/godaddy/gasket/pull/255
|
|
34
|
+
[#311]: https://github.com/godaddy/gasket/pull/311
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GasketConfig, HookExecTypes, MaybeAsync, MaybeMultiple } from '@gasket/engine';
|
|
2
|
+
import type { FastifyInstance, FastifyRequest, FastifyReply } from 'fastify';
|
|
3
|
+
|
|
4
|
+
declare module '@gasket/engine' {
|
|
5
|
+
export interface GasketConfig {
|
|
6
|
+
compression?: boolean,
|
|
7
|
+
excludedRoutesRegex?: RegExp
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// The middie middleware is added for express compatibility
|
|
11
|
+
type Handler = (
|
|
12
|
+
req: FastifyRequest,
|
|
13
|
+
res: FastifyReply,
|
|
14
|
+
next: (error?: Error) => void
|
|
15
|
+
) => void;
|
|
16
|
+
type ErrorHandler = (
|
|
17
|
+
error: Error,
|
|
18
|
+
req: FastifyRequest,
|
|
19
|
+
res: FastifyReply,
|
|
20
|
+
next: (error?: Error) => void
|
|
21
|
+
) => void;
|
|
22
|
+
|
|
23
|
+
export interface HookExecTypes {
|
|
24
|
+
middleware(fastify: FastifyInstance): MaybeAsync<MaybeMultiple<Handler>>,
|
|
25
|
+
fastify(fastify: FastifyInstance): MaybeAsync<void>,
|
|
26
|
+
errorMiddleware(fastify: FastifyInstance): MaybeAsync<MaybeMultiple<ErrorHandler>>
|
|
27
|
+
}
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gasket/plugin-fastify",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.14.0",
|
|
4
4
|
"description": "Adds fastify support to your application",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"lint": "eslint index.js test",
|
|
8
9
|
"lint:fix": "npm run lint -- --fix",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"bugs": {
|
|
34
35
|
"url": "https://github.com/godaddy/gasket/issues"
|
|
35
36
|
},
|
|
36
|
-
"homepage": "https://github.com/godaddy/gasket/tree/
|
|
37
|
+
"homepage": "https://github.com/godaddy/gasket/tree/main/packages/gasket-plugin-fastify",
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"compression": "^1.7.2",
|
|
39
40
|
"cookie-parser": "^1.4.3",
|
|
@@ -41,20 +42,33 @@
|
|
|
41
42
|
"middie": "5.1.0"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
45
|
+
"@gasket/engine": "^6.14.0",
|
|
44
46
|
"assume": "^2.3.0",
|
|
45
47
|
"assume-sinon": "^1.1.0",
|
|
46
|
-
"eslint": "^7.
|
|
47
|
-
"eslint-config-godaddy": "^
|
|
48
|
-
"eslint-plugin-json": "^
|
|
49
|
-
"eslint-plugin-mocha": "^
|
|
48
|
+
"eslint": "^8.7.0",
|
|
49
|
+
"eslint-config-godaddy": "^6.0.0",
|
|
50
|
+
"eslint-plugin-json": "^3.1.0",
|
|
51
|
+
"eslint-plugin-mocha": "^10.0.3",
|
|
52
|
+
"eslint-plugin-unicorn": "^40.1.0",
|
|
50
53
|
"fastify": "^3.3.0",
|
|
51
|
-
"mocha": "^
|
|
54
|
+
"mocha": "^9.1.4",
|
|
52
55
|
"nyc": "^15.1.0",
|
|
53
56
|
"proxyquire": "^2.1.3",
|
|
54
|
-
"sinon": "^
|
|
57
|
+
"sinon": "^12.0.1"
|
|
55
58
|
},
|
|
56
59
|
"peerDependencies": {
|
|
57
60
|
"fastify": "^3.0.0"
|
|
58
61
|
},
|
|
59
|
-
"
|
|
62
|
+
"eslintConfig": {
|
|
63
|
+
"extends": [
|
|
64
|
+
"godaddy"
|
|
65
|
+
],
|
|
66
|
+
"plugins": [
|
|
67
|
+
"unicorn"
|
|
68
|
+
],
|
|
69
|
+
"rules": {
|
|
70
|
+
"unicorn/filename-case": "error"
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"gitHead": "b13c1b3ab1c25dff4f7efc67e9685e790c88e38b"
|
|
60
74
|
}
|