@gasket/plugin-fastify 6.0.12 → 6.15.2

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 (3) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/index.d.ts +28 -0
  3. 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.12",
3
+ "version": "6.15.2",
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/master/packages/gasket-plugin-fastify",
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.15.2",
44
46
  "assume": "^2.3.0",
45
47
  "assume-sinon": "^1.1.0",
46
- "eslint": "^7.17.0",
47
- "eslint-config-godaddy": "^4.0.1",
48
- "eslint-plugin-json": "^2.1.2",
49
- "eslint-plugin-mocha": "^8.0.0",
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": "^8.2.1",
54
+ "mocha": "^9.1.4",
52
55
  "nyc": "^15.1.0",
53
56
  "proxyquire": "^2.1.3",
54
- "sinon": "^9.2.3"
57
+ "sinon": "^12.0.1"
55
58
  },
56
59
  "peerDependencies": {
57
60
  "fastify": "^3.0.0"
58
61
  },
59
- "gitHead": "ae1e28cf31d8e15de7e0c4fe92dbdf577efcfbd3"
62
+ "eslintConfig": {
63
+ "extends": [
64
+ "godaddy"
65
+ ],
66
+ "plugins": [
67
+ "unicorn"
68
+ ],
69
+ "rules": {
70
+ "unicorn/filename-case": "error"
71
+ }
72
+ },
73
+ "gitHead": "6b4a3ad6b1f2e3a4b9085fb6b1090d7a9add1b38"
60
74
  }