@foodsy-app/fastify-typebox
Advanced tools
Comparing version 2.0.0 to 3.0.0
{ | ||
"name": "@foodsy-app/fastify-typebox", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Plugin for Fastify to prevent having to write duplicate type definitions for schemas", | ||
@@ -33,3 +33,2 @@ "keywords": [ | ||
"clean": "rimraf index.js index.d.ts", | ||
"postinstall": "patch-package", | ||
"prepublishOnly": "npm run clean && npm run build" | ||
@@ -40,4 +39,2 @@ }, | ||
"fastify-plugin": "^2.0.1", | ||
"patch-package": "^6.2.2", | ||
"postinstall-postinstall": "^2.1.0", | ||
"rimraf": "^3.0.2" | ||
@@ -44,0 +41,0 @@ }, |
@@ -7,6 +7,47 @@ # @foodsy-app/fastify-typebox | ||
**Important!** | ||
**Important note before using this plugin!** | ||
This plugin uses [patch-package](https://www.npmjs.com/package/patch-package) to comment existing type declarations for request methods in `node_modules/fastify/types/instance.d.ts` since TypeScript does not allow to overwrite declarations. If you notice any problems, please post a issue. | ||
This plugin requires [patch-package](https://www.npmjs.com/package/patch-package) to comment existing type declarations for request methods in `node_modules/fastify/types/instance.d.ts` since TypeScript does not allow to overwrite declarations. | ||
Create a `fastify+3.1.1.patch` file (edit the version based on the Fastify version you have installed) and paste the block below inside: | ||
```diff | ||
diff --git a/node_modules/fastify/types/instance.d.ts b/node_modules/fastify/types/instance.d.ts | ||
index 06380bd..558338d 100644 | ||
--- a/node_modules/fastify/types/instance.d.ts | ||
+++ b/node_modules/fastify/types/instance.d.ts | ||
@@ -66,14 +66,14 @@ export interface FastifyInstance< | ||
ContextConfig = ContextConfigDefault | ||
>(opts: RouteOptions<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig>): FastifyInstance<RawServer, RawRequest, RawReply, Logger>; | ||
- get: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
- head: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
- post: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
- put: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
- delete: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
- options: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
- patch: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
- all: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
+ // get: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
+ // head: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
+ // post: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
+ // put: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
+ // delete: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
+ // options: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
+ // patch: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
+ // all: RouteShorthandMethod<RawServer, RawRequest, RawReply>; | ||
// addHook: overloads | ||
``` | ||
After this, run the following command: | ||
```bash | ||
npx patch-package --patch-dir . | ||
``` | ||
Run the same command using the `--reverse` flag if you notice any problems. | ||
## Install | ||
@@ -13,0 +54,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
19399
3
108
0
- Removedpatch-package@^6.2.2
- Removedpostinstall-postinstall@^2.1.0
- Removed@yarnpkg/lockfile@1.1.0(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedat-least-node@1.0.0(transitive)
- Removedbraces@3.0.3(transitive)
- Removedchalk@4.1.2(transitive)
- Removedci-info@2.0.0(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removedcross-spawn@6.0.6(transitive)
- Removedfill-range@7.1.1(transitive)
- Removedfind-yarn-workspace-root@2.0.0(transitive)
- Removedfs-extra@9.1.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedis-ci@2.0.0(transitive)
- Removedis-docker@2.2.1(transitive)
- Removedis-number@7.0.0(transitive)
- Removedis-wsl@2.2.0(transitive)
- Removedisexe@2.0.0(transitive)
- Removedjsonfile@6.1.0(transitive)
- Removedklaw-sync@6.0.0(transitive)
- Removedmicromatch@4.0.8(transitive)
- Removedminimist@1.2.8(transitive)
- Removednice-try@1.0.5(transitive)
- Removedopen@7.4.2(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedpatch-package@6.5.1(transitive)
- Removedpath-key@2.0.1(transitive)
- Removedpicomatch@2.3.1(transitive)
- Removedpostinstall-postinstall@2.1.0(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedsemver@5.7.2(transitive)
- Removedshebang-command@1.2.0(transitive)
- Removedshebang-regex@1.0.0(transitive)
- Removedslash@2.0.0(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedtmp@0.0.33(transitive)
- Removedto-regex-range@5.0.1(transitive)
- Removeduniversalify@2.0.1(transitive)
- Removedwhich@1.3.1(transitive)
- Removedyaml@1.10.2(transitive)