From fa3fc3ae060a5dcab12b722178609dac56c1d8cd Mon Sep 17 00:00:00 2001 From: Tony Xiao Date: Sat, 21 Oct 2023 20:09:39 -0700 Subject: [PATCH] fix: type failure due to trpc-openapi --- package.json | 3 ++- patches/trpc-openapi@1.2.0.patch | 15 +++++++++++++++ pnpm-lock.yaml | 10 +++++++--- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 patches/trpc-openapi@1.2.0.patch diff --git a/package.json b/package.json index d926681c..71759543 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,8 @@ "firebase@9.8.1": "patches/firebase@9.8.1.patch", "micro-memoize@4.0.10": "patches/micro-memoize@4.0.10.patch", "zod@3.21.4": "patches/zod@3.21.4.patch", - "@nangohq/frontend@0.33.8": "patches/@nangohq__frontend@0.33.8.patch" + "@nangohq/frontend@0.33.8": "patches/@nangohq__frontend@0.33.8.patch", + "trpc-openapi@1.2.0": "patches/trpc-openapi@1.2.0.patch" }, "peerDependencyRules": { "allowedVersions": { diff --git a/patches/trpc-openapi@1.2.0.patch b/patches/trpc-openapi@1.2.0.patch new file mode 100644 index 00000000..2014239b --- /dev/null +++ b/patches/trpc-openapi@1.2.0.patch @@ -0,0 +1,15 @@ +diff --git a/dist/types.d.ts b/dist/types.d.ts +index d93e38e020d89bef3e615c44fe687b10c8874417..956b349a0dda132bcdd7c255e8ae9946f41ccffd 100644 +--- a/dist/types.d.ts ++++ b/dist/types.d.ts +@@ -1,7 +1,8 @@ + import { Procedure, ProcedureParams, Router } from '@trpc/server'; + import type { RootConfig } from '@trpc/server/dist/core/internals/config'; +-import { TRPC_ERROR_CODE_KEY } from '@trpc/server/rpc'; +-import type { RouterDef } from '@trpc/server/src/core/router'; ++// PATCH: Courtesy of https://github.com/jlalmes/trpc-openapi/pull/411 ++import type { RouterDef } from '@trpc/server/dist/core/router'; ++import { TRPC_ERROR_CODE_KEY } from '@trpc/server/dist/rpc'; + import { OpenAPIV3 } from 'openapi-types'; + import { ZodIssue } from 'zod'; + export type OpenApiMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 64fea6b8..774f5eec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,6 +33,9 @@ patchedDependencies: micro-memoize@4.0.10: hash: hko3q5jvea7ey3trpjtkqgcale path: patches/micro-memoize@4.0.10.patch + trpc-openapi@1.2.0: + hash: zn3clwvt2tmhqbx7otjqaqekq4 + path: patches/trpc-openapi@1.2.0.patch zod@3.21.4: hash: bzwjzhue3hmpww5lnv24u5k2ru path: patches/zod@3.21.4.patch @@ -589,7 +592,7 @@ importers: version: 7.0.8 trpc-openapi: specifier: 1.2.0 - version: 1.2.0(@trpc/server@10.40.0)(zod@3.21.4) + version: 1.2.0(patch_hash=zn3clwvt2tmhqbx7otjqaqekq4)(@trpc/server@10.40.0)(zod@3.21.4) devDependencies: '@sentry/cli': specifier: 2.13.0 @@ -1325,7 +1328,7 @@ importers: devDependencies: trpc-openapi: specifier: 1.2.0 - version: 1.2.0(@trpc/server@10.40.0)(zod@3.21.4) + version: 1.2.0(patch_hash=zn3clwvt2tmhqbx7otjqaqekq4)(@trpc/server@10.40.0)(zod@3.21.4) packages/engine-frontend: dependencies: @@ -17137,7 +17140,7 @@ packages: resolution: {integrity: sha512-rvuRbTarPXmMb79SmzEp8aqXNKcK+y0XaB298IXueQ8I2PsrATcPBCSPyK/dDNa2iWOhKlfNnOjdAOTBU/nkFA==} dev: false - /trpc-openapi@1.2.0(@trpc/server@10.40.0)(zod@3.21.4): + /trpc-openapi@1.2.0(patch_hash=zn3clwvt2tmhqbx7otjqaqekq4)(@trpc/server@10.40.0)(zod@3.21.4): resolution: {integrity: sha512-pfYoCd/3KYXWXvUPZBKJw455OOwngKN/6SIcj7Yit19OMLJ+8yVZkEvGEeg5wUSwfsiTdRsKuvqkRPXVSwV7ew==} peerDependencies: '@trpc/server': ^10.0.0 @@ -17151,6 +17154,7 @@ packages: openapi-types: 12.1.3 zod: 3.21.4(patch_hash=bzwjzhue3hmpww5lnv24u5k2ru) zod-to-json-schema: 3.21.1(zod@3.21.4) + patched: true /ts-brand@0.0.2: resolution: {integrity: sha512-UhSzWY4On9ZHIj6DKkRYVN/8OaprbLAZ3b/Y2AJwdl6oozSABsQ0PvwDh4vOVdkvOtWQOkIrjctZ1kj8YfF3jA==}