From e2b02e4a67c04818e4fcfed0c39ce7ac88a24df1 Mon Sep 17 00:00:00 2001 From: nadhifikbarw Date: Fri, 28 Apr 2023 06:11:05 +0700 Subject: [PATCH 1/3] build(deps): revert to peerDependency, refer to #73 --- package.json | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index c398648..e86591a 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,8 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "peerDependencies": { - "fastify": "^4.0.0" - }, - "dependencies": { - "@sinclair/typebox": "^0.28.5" + "fastify": "^4.0.0", + "@sinclair/typebox": "^0.28.7" }, "scripts": { "build": "rimraf ./dist && mkdir dist && tsc --outDir dist", @@ -41,8 +39,8 @@ "eslint-plugin-import": "^2.26.0", "eslint-plugin-n": "^15.2.4", "eslint-plugin-promise": "^6.0.0", - "fastify": "^4.2.0", - "fastify-plugin": "^4.2.0", + "fastify": "^4.17.0", + "fastify-plugin": "^4.5.0", "fastify-tsconfig": "^1.0.1", "rimraf": "^5.0.0", "tap": "^16.3.0", From 3e7c297bd611e8f85ed9f7902067a093a043a158 Mon Sep 17 00:00:00 2001 From: nadhifikbarw Date: Sat, 29 Apr 2023 22:35:38 +0700 Subject: [PATCH 2/3] docs: mention peer dependency requirement and provide direct import example --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 640e318..147a210 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ A Type Provider for [Typebox](https://github.com/sinclairzx81/typebox) ## Installation ```sh +npm i @sinclair/typebox # Required as peer dependency npm i @fastify/type-provider-typebox ``` @@ -36,7 +37,13 @@ fastify.withTypeProvider() ```ts import Fastify from 'fastify' -import { Type, TypeBoxTypeProvider } from '@fastify/type-provider-typebox' +import { TypeBoxTypeProvider } from '@fastify/type-provider-typebox' + +// This package re-export Typebox package +// but you can also use any builders imported +// directly from @sinclair/typebox +import { Type } from '@sinclair/typebox' + const fastify = Fastify().withTypeProvider() From 3fc3d5962c3a6706c76f93df9206591e3f7e57cc Mon Sep 17 00:00:00 2001 From: nadhifikbarw Date: Sun, 30 Apr 2023 14:59:31 +0700 Subject: [PATCH 3/3] build: widen patch version range and remove fastify from peer dependency --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index e86591a..9b6254c 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "peerDependencies": { - "fastify": "^4.0.0", - "@sinclair/typebox": "^0.28.7" + "@sinclair/typebox": "^0.28.0" }, "scripts": { "build": "rimraf ./dist && mkdir dist && tsc --outDir dist",