From 785fde8c19e5fc5256d411fa7e80b347763af3f9 Mon Sep 17 00:00:00 2001 From: Ali Ghorbani Date: Mon, 9 Sep 2024 17:04:30 +0330 Subject: [PATCH 1/2] @feathersjs/typebox upgraded @sinclair/typebox@^0.25.0 -> ^0.33.9 --- package-lock.json | 8 ++++---- packages/typebox/package.json | 4 ++-- packages/typebox/src/index.ts | 27 +++++++++++---------------- packages/typebox/test/index.test.ts | 2 +- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1b794868d..b3f898c373 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25059,7 +25059,7 @@ "license": "MIT", "dependencies": { "@feathersjs/schema": "^5.0.30", - "@sinclair/typebox": "^0.25.0" + "@sinclair/typebox": "^0.33.9" }, "devDependencies": { "@types/mocha": "^10.0.7", @@ -25077,9 +25077,9 @@ } }, "packages/typebox/node_modules/@sinclair/typebox": { - "version": "0.25.24", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.25.24.tgz", - "integrity": "sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==" + "version": "0.33.9", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.33.9.tgz", + "integrity": "sha512-agK7y8hO5Gz4Thu5kxTtLiZudNRflR1rTwmnWW5skxMd/+aqQ9XQene8HyyBsiajs5HV6ZQ/pCd3IKsqIfu4Kw==" } } } diff --git a/packages/typebox/package.json b/packages/typebox/package.json index 2b97de9893..f33a717a58 100644 --- a/packages/typebox/package.json +++ b/packages/typebox/package.json @@ -55,7 +55,7 @@ }, "dependencies": { "@feathersjs/schema": "^5.0.30", - "@sinclair/typebox": "^0.25.0" + "@sinclair/typebox": "^0.33.9" }, "devDependencies": { "@types/mocha": "^10.0.7", @@ -65,4 +65,4 @@ "typescript": "^5.5.4" }, "gitHead": "90caf635aec850550b9d37bea2762af959d9e8d5" -} +} \ No newline at end of file diff --git a/packages/typebox/src/index.ts b/packages/typebox/src/index.ts index 098cf22a90..7ea48fd251 100644 --- a/packages/typebox/src/index.ts +++ b/packages/typebox/src/index.ts @@ -103,21 +103,16 @@ export const queryProperty = { }) it('defaultAppConfiguration', async () => { - const configSchema = Type.Intersect([ + const configSchema = Type.Composite([ defaultAppConfiguration, Type.Object({ host: Type.String(), From 5e466e4ed9f63387080ad6babea155fe40d4ea5d Mon Sep 17 00:00:00 2001 From: Ali Ghorbani Date: Mon, 9 Sep 2024 17:05:48 +0330 Subject: [PATCH 2/2] replace using Type.Intersect with Type.Composite in templates --- packages/generators/src/app/templates/configuration.tpl.ts | 2 +- packages/generators/src/service/templates/schema.typebox.tpl.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/generators/src/app/templates/configuration.tpl.ts b/packages/generators/src/app/templates/configuration.tpl.ts index 85eed1dd49..aee9cb0353 100644 --- a/packages/generators/src/app/templates/configuration.tpl.ts +++ b/packages/generators/src/app/templates/configuration.tpl.ts @@ -58,7 +58,7 @@ import type { Static } from '@feathersjs/typebox' import { dataValidator } from './validators' -export const configurationSchema = Type.Intersect([ +export const configurationSchema = Type.Composite([ defaultAppConfiguration, Type.Object({ host: Type.String(), diff --git a/packages/generators/src/service/templates/schema.typebox.tpl.ts b/packages/generators/src/service/templates/schema.typebox.tpl.ts index 3f7203f5c3..9ca5b0457e 100644 --- a/packages/generators/src/service/templates/schema.typebox.tpl.ts +++ b/packages/generators/src/service/templates/schema.typebox.tpl.ts @@ -90,7 +90,7 @@ export const ${camelName}QueryProperties = Type.Pick(${camelName}Schema, [ : `'text'` } ]) -export const ${camelName}QuerySchema = Type.Intersect([ +export const ${camelName}QuerySchema = Type.Composite([ querySyntax(${camelName}QueryProperties), // Add additional query properties here Type.Object({}, { additionalProperties: false })