fastify 3.9.2 → 3.12.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/GOVERNANCE.md +1 -1
- package/README.md +12 -8
- package/SECURITY.md +3 -3
- package/docs/ContentTypeParser.md +1 -1
- package/docs/Ecosystem.md +16 -6
- package/docs/Encapsulation.md +5 -2
- package/docs/Fluent-Schema.md +4 -4
- package/docs/Getting-Started.md +1 -1
- package/docs/Hooks.md +28 -1
- package/docs/Lifecycle.md +8 -1
- package/docs/Middleware.md +5 -4
- package/docs/Reply.md +13 -4
- package/docs/Routes.md +4 -3
- package/docs/Server.md +78 -4
- package/docs/Serverless.md +23 -51
- package/docs/TypeScript.md +35 -18
- package/docs/Validation-and-Serialization.md +4 -4
- package/docs/Write-Plugin.md +4 -4
- package/examples/hooks-benchmark.js +12 -12
- package/examples/hooks.js +16 -16
- package/examples/plugin.js +2 -2
- package/examples/route-prefix.js +4 -4
- package/fastify.d.ts +16 -1
- package/fastify.js +33 -16
- package/isolate-0x426d1e0-1227-v8.log +4019 -0
- package/isolate-0x4d4c7e0-1988-v8.log +4081 -0
- package/lib/errors.js +6 -0
- package/lib/headRoute.js +31 -0
- package/lib/pluginOverride.js +5 -5
- package/lib/pluginUtils.js +7 -6
- package/lib/reply.js +14 -2
- package/lib/reqIdGenFactory.js +5 -0
- package/lib/request.js +1 -1
- package/lib/route.js +66 -41
- package/lib/schema-compilers.js +5 -3
- package/lib/schema-controller.js +106 -0
- package/lib/schemas.js +14 -24
- package/lib/server.js +1 -0
- package/lib/symbols.js +1 -3
- package/lib/warnings.js +2 -0
- package/lib/wrapThenable.js +2 -1
- package/package.json +25 -21
- package/test/404s.test.js +120 -120
- package/test/500s.test.js +8 -8
- package/test/async-await.test.js +29 -1
- package/test/close.test.js +8 -8
- package/test/context-config.test.js +52 -0
- package/test/custom-parser.test.js +8 -8
- package/test/decorator.test.js +49 -49
- package/test/default-route.test.js +43 -0
- package/test/fastify-instance.test.js +2 -2
- package/test/fluent-schema.test.js +3 -3
- package/test/handler-context.test.js +2 -2
- package/test/hooks-async.test.js +3 -3
- package/test/hooks.on-ready.test.js +12 -12
- package/test/hooks.test.js +75 -32
- package/test/http2/closing.test.js +23 -1
- package/test/inject.test.js +6 -6
- package/test/input-validation.js +2 -2
- package/test/internals/hookRunner.test.js +50 -50
- package/test/internals/reply.test.js +47 -22
- package/test/internals/request.test.js +3 -9
- package/test/internals/version.test.js +2 -2
- package/test/logger.test.js +30 -30
- package/test/middleware.test.js +4 -4
- package/test/plugin.helper.js +2 -2
- package/test/plugin.test.js +154 -99
- package/test/register.test.js +11 -11
- package/test/request-error.test.js +2 -2
- package/test/route-hooks.test.js +24 -24
- package/test/route-prefix.test.js +81 -52
- package/test/route.test.js +568 -0
- package/test/schema-feature.test.js +168 -38
- package/test/schema-serialization.test.js +4 -4
- package/test/schema-special-usage.test.js +136 -0
- package/test/schema-validation.test.js +7 -7
- package/test/skip-reply-send.test.js +315 -0
- package/test/stream.test.js +6 -6
- package/test/throw.test.js +4 -4
- package/test/types/instance.test-d.ts +5 -3
- package/test/types/plugin.test-d.ts +7 -7
- package/test/types/reply.test-d.ts +1 -0
- package/test/types/schema.test-d.ts +15 -0
- package/test/validation-error-handling.test.js +5 -5
- package/test/versioned-routes.test.js +1 -1
- package/types/content-type-parser.d.ts +1 -1
- package/types/instance.d.ts +6 -3
- package/types/plugin.d.ts +1 -1
- package/types/reply.d.ts +1 -0
- package/types/route.d.ts +8 -2
- package/types/schema.d.ts +3 -0
- package/test/skip-reply-send.js +0 -98
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fastify",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.12.0",
|
|
4
4
|
"description": "Fast and low overhead web framework, for Node.js",
|
|
5
5
|
"main": "fastify.js",
|
|
6
6
|
"type": "commonjs",
|
|
7
7
|
"types": "fastify.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
+
"bench": "branchcmp -r 2 -g -s \"npm run benchmark\"",
|
|
10
|
+
"benchmark": "npx concurrently -k -s first \"node ./examples/simple.js\" \"npx autocannon -c 100 -d 5 -p 10 localhost:3000/\"",
|
|
11
|
+
"coverage": "npm run unit -- --cov --coverage-report=html",
|
|
12
|
+
"license-checker": "license-checker --production --onlyAllow=\"MIT;ISC;BSD-3-Clause;BSD-2-Clause\"",
|
|
9
13
|
"lint": "npm run lint:standard && npm run lint:typescript",
|
|
10
14
|
"lint:fix": "standard --fix",
|
|
11
15
|
"lint:standard": "standard --verbose | snazzy",
|
|
12
16
|
"lint:typescript": "eslint -c types/.eslintrc.json types/**/*.d.ts test/types/**/*.test-d.ts",
|
|
13
|
-
"unit": "tap -J test/*.test.js test/*/*.test.js",
|
|
14
|
-
"unit:report": "tap -J test/*.test.js test/*/*.test.js --cov --coverage-report=html --coverage-report=cobertura | tee out.tap",
|
|
15
|
-
"unit:junit": "tap-mocha-reporter xunit < out.tap > test/junit-testresults.xml",
|
|
16
|
-
"test:typescript": "tsd",
|
|
17
|
-
"test:report": "npm run lint && npm run unit:report && npm run test:typescript",
|
|
18
17
|
"test": "npm run lint && npm run unit && npm run test:typescript",
|
|
19
|
-
"coverage": "npm run unit -- --cov --coverage-report=html",
|
|
20
18
|
"test:ci": "npm run lint && npm run unit -- --cov --coverage-report=lcovonly && npm run test:typescript",
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
19
|
+
"test:report": "npm run lint && npm run unit:report && npm run test:typescript",
|
|
20
|
+
"test:typescript": "tsd",
|
|
21
|
+
"unit": "tap -J test/*.test.js test/*/*.test.js",
|
|
22
|
+
"unit:junit": "tap-mocha-reporter xunit < out.tap > test/junit-testresults.xml",
|
|
23
|
+
"unit:report": "tap -J test/*.test.js test/*/*.test.js --cov --coverage-report=html --coverage-report=cobertura | tee out.tap"
|
|
24
24
|
},
|
|
25
25
|
"repository": {
|
|
26
26
|
"type": "git",
|
|
@@ -55,6 +55,11 @@
|
|
|
55
55
|
"url": "http://starptech.de",
|
|
56
56
|
"email": "deusdustin@gmail.com"
|
|
57
57
|
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Ayoub El Khattabi",
|
|
60
|
+
"url": "https://github.com/AyoubElk",
|
|
61
|
+
"email": "elkhattabi.ayoub@gmail.com"
|
|
62
|
+
},
|
|
58
63
|
{
|
|
59
64
|
"name": "Rafael Gonzaga",
|
|
60
65
|
"email": "rafael.nunu@hotmail.com",
|
|
@@ -114,17 +119,16 @@
|
|
|
114
119
|
},
|
|
115
120
|
"devDependencies": {
|
|
116
121
|
"@hapi/joi": "^17.1.1",
|
|
117
|
-
"@sinonjs/fake-timers": "^
|
|
118
|
-
"@types/pino": "^6.0.1",
|
|
122
|
+
"@sinonjs/fake-timers": "^7.0.0",
|
|
119
123
|
"@types/node": "^14.10.3",
|
|
124
|
+
"@types/pino": "^6.0.1",
|
|
120
125
|
"@typescript-eslint/eslint-plugin": "^4.5.0",
|
|
121
126
|
"@typescript-eslint/parser": "^4.5.0",
|
|
122
|
-
"JSONStream": "^1.3.5",
|
|
123
127
|
"ajv-errors": "^1.0.1",
|
|
124
128
|
"ajv-i18n": "^3.5.0",
|
|
125
129
|
"ajv-merge-patch": "^4.1.0",
|
|
126
130
|
"ajv-pack": "^0.3.1",
|
|
127
|
-
"autocannon": "^
|
|
131
|
+
"autocannon": "^7.0.0",
|
|
128
132
|
"branch-comparer": "^1.0.2",
|
|
129
133
|
"concurrently": "^5.0.2",
|
|
130
134
|
"cors": "^2.8.5",
|
|
@@ -136,19 +140,19 @@
|
|
|
136
140
|
"eslint-plugin-import": "^2.20.2",
|
|
137
141
|
"eslint-plugin-node": "^11.1.0",
|
|
138
142
|
"eslint-plugin-promise": "^4.2.1",
|
|
139
|
-
"eslint-plugin-standard": "^
|
|
140
|
-
"events.once": "^2.0.2",
|
|
143
|
+
"eslint-plugin-standard": "^5.0.0",
|
|
141
144
|
"fast-json-body": "^1.1.0",
|
|
142
145
|
"fastify-plugin": "^3.0.0",
|
|
143
|
-
"fluent-schema": "^
|
|
146
|
+
"fluent-json-schema": "^2.0.1",
|
|
144
147
|
"form-data": "^3.0.0",
|
|
145
|
-
"frameguard": "^
|
|
148
|
+
"frameguard": "^4.0.0",
|
|
146
149
|
"h2url": "^0.2.0",
|
|
147
150
|
"helmet": "^4.0.0",
|
|
148
151
|
"hide-powered-by": "^1.1.0",
|
|
149
152
|
"hsts": "^2.2.0",
|
|
150
153
|
"http-errors": "^1.7.1",
|
|
151
154
|
"ienoopen": "^1.1.0",
|
|
155
|
+
"JSONStream": "^1.3.5",
|
|
152
156
|
"license-checker": "^25.0.1",
|
|
153
157
|
"pre-commit": "^1.2.2",
|
|
154
158
|
"proxyquire": "^2.1.3",
|
|
@@ -164,22 +168,22 @@
|
|
|
164
168
|
"then-sleep": "^1.0.1",
|
|
165
169
|
"tsd": "^0.14.0",
|
|
166
170
|
"typescript": "^4.0.2",
|
|
167
|
-
"undici": "^
|
|
171
|
+
"undici": "^3.0.0",
|
|
168
172
|
"x-xss-protection": "^2.0.0",
|
|
169
173
|
"yup": "^0.32.0"
|
|
170
174
|
},
|
|
171
175
|
"dependencies": {
|
|
176
|
+
"@fastify/proxy-addr": "^3.0.0",
|
|
172
177
|
"abstract-logging": "^2.0.0",
|
|
173
178
|
"ajv": "^6.12.2",
|
|
174
179
|
"avvio": "^7.1.2",
|
|
175
180
|
"fast-json-stringify": "^2.2.1",
|
|
176
|
-
"fastify-error": "^0.
|
|
181
|
+
"fastify-error": "^0.3.0",
|
|
177
182
|
"fastify-warning": "^0.2.0",
|
|
178
183
|
"find-my-way": "^3.0.5",
|
|
179
184
|
"flatstr": "^1.0.12",
|
|
180
185
|
"light-my-request": "^4.2.0",
|
|
181
186
|
"pino": "^6.2.1",
|
|
182
|
-
"proxy-addr": "^2.0.5",
|
|
183
187
|
"readable-stream": "^3.4.0",
|
|
184
188
|
"rfdc": "^1.1.4",
|
|
185
189
|
"secure-json-parse": "^2.0.0",
|