From 0f9319411600ad3494fc81159ae3e43ae859ecc8 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Sun, 21 Jan 2024 00:53:07 +0800 Subject: [PATCH] test: fix ci problem --- package.json | 5 ++ pnpm-lock.yaml | 50 ++++++++++++------- src/client/api/trpc.ts | 2 +- .../components/monitor/MonitorInfoEditor.tsx | 4 +- src/client/package.json | 3 ++ src/client/tsconfig.json | 2 +- src/server/package.json | 2 +- src/server/trpc/index.ts | 2 + src/server/types/prisma.ts | 1 + 9 files changed, 49 insertions(+), 22 deletions(-) create mode 100644 src/server/types/prisma.ts diff --git a/package.json b/package.json index b920cf4..961e5dd 100644 --- a/package.json +++ b/package.json @@ -33,5 +33,10 @@ "dayjs": "^1.11.9", "eventemitter-strict": "^1.0.1", "zod": "^3.22.2" + }, + "pnpm": { + "overrides": { + "dayjs": "1.11.10" + } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index beb0f75..89c688b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,11 +1,14 @@ lockfileVersion: '6.0' +overrides: + dayjs: 1.11.10 + importers: .: dependencies: dayjs: - specifier: ^1.11.9 + specifier: 1.11.10 version: 1.11.10 eventemitter-strict: specifier: ^1.0.1 @@ -81,8 +84,8 @@ importers: specifier: ^3.3.3 version: 3.3.3 dayjs: - specifier: ^1.11.9 - version: 1.11.9 + specifier: 1.11.10 + version: 1.11.10 eventemitter-strict: specifier: ^1.0.1 version: 1.0.1 @@ -138,6 +141,12 @@ importers: specifier: ^4.4.1 version: 4.4.1(@types/react@18.2.21)(react@18.2.0) devDependencies: + '@types/loadable__component': + specifier: ^5.13.8 + version: 5.13.8 + '@types/lodash-es': + specifier: ^4.17.12 + version: 4.17.12 '@types/react': specifier: ^18.2.21 version: 18.2.21 @@ -150,6 +159,9 @@ importers: '@types/react-resizable': specifier: ^3.0.7 version: 3.0.7 + '@types/uuid': + specifier: ^9.0.7 + version: 9.0.7 '@vitejs/plugin-react': specifier: ^4.0.4 version: 4.0.4(vite@5.0.12) @@ -178,8 +190,8 @@ importers: specifier: 5.4.2 version: 5.4.2(prisma@5.4.2) '@trpc/server': - specifier: ^10.38.4 - version: 10.38.4 + specifier: ^10.45.0 + version: 10.45.0 axios: specifier: ^1.5.0 version: 1.5.0 @@ -202,7 +214,7 @@ importers: specifier: ^8.0.0 version: 8.0.0 dayjs: - specifier: ^1.11.9 + specifier: 1.11.10 version: 1.11.10 detect-browser: specifier: ^5.3.0 @@ -272,7 +284,7 @@ importers: version: 0.1.1 trpc-openapi: specifier: ^1.2.0 - version: 1.2.0(@trpc/server@10.38.4)(zod@3.22.2) + version: 1.2.0(@trpc/server@10.45.0)(zod@3.22.2) ts-node: specifier: ^10.9.1 version: 10.9.1(@types/node@18.17.12)(typescript@5.2.2) @@ -6785,10 +6797,6 @@ packages: react-dom: 18.2.0(react@18.2.0) dev: false - /@trpc/server@10.38.4: - resolution: {integrity: sha512-xSMTwnKA/Unxu5fbAkQ7cApHeWj1rTEA3XgrGDcPHn03fmeIidIKxronM46N46ZF4CCexey4JWzu89XxA16uIA==} - dev: false - /@trpc/server@10.45.0: resolution: {integrity: sha512-2Fwzv6nqpE0Ie/G7PeS0EVR89zLm+c1Mw7T+RAGtU807j4oaUx0zGkBXTu5u9AI+j+BYNN2GZxJcuDTAecbr1A==} dev: false @@ -7079,6 +7087,18 @@ packages: '@types/node': 18.17.12 dev: false + /@types/loadable__component@5.13.8: + resolution: {integrity: sha512-0FF/WihuPkR5IFOHiBzC95bSACvgQNUQCuNy1WF8F/lCBBHgS2SxarIk4CTjWM10A72ovpmXZDRcuAXZNS+/kQ==} + dependencies: + '@types/react': 18.2.21 + dev: true + + /@types/lodash-es@4.17.12: + resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} + dependencies: + '@types/lodash': 4.14.198 + dev: true + /@types/lodash@4.14.198: resolution: {integrity: sha512-trNJ/vtMZYMLhfN45uLq4ShQSw0/S7xCTLLVM+WM1rmFpba/VS42jVUgaO3w/NOLiWR/09lnYk0yMaA/atdIsg==} dev: true @@ -9805,10 +9825,6 @@ packages: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} dev: false - /dayjs@1.11.9: - resolution: {integrity: sha512-QvzAURSbQ0pKdIye2txOzNaHmxtUBXerpY0FJsFXUMKbIZeFm5ht1LS/jFsrncjnmtv8HsG0W2g6c0zUjZWmpA==} - dev: false - /debounce@1.2.1: resolution: {integrity: sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==} @@ -19814,13 +19830,13 @@ packages: resolution: {integrity: sha512-AqTiAOLcj85xS7vQ8QkAV41hPDIJ71XJB4RCUrzo/1GM2CQwhkJGaf9Hgr7BOugMRpgGUrqRg/DrBDl4H40+8g==} dev: true - /trpc-openapi@1.2.0(@trpc/server@10.38.4)(zod@3.22.2): + /trpc-openapi@1.2.0(@trpc/server@10.45.0)(zod@3.22.2): resolution: {integrity: sha512-pfYoCd/3KYXWXvUPZBKJw455OOwngKN/6SIcj7Yit19OMLJ+8yVZkEvGEeg5wUSwfsiTdRsKuvqkRPXVSwV7ew==} peerDependencies: '@trpc/server': ^10.0.0 zod: ^3.14.4 dependencies: - '@trpc/server': 10.38.4 + '@trpc/server': 10.45.0 co-body: 6.1.0 h3: 1.8.2 lodash.clonedeep: 4.5.0 diff --git a/src/client/api/trpc.ts b/src/client/api/trpc.ts index 24f3c11..e91111e 100644 --- a/src/client/api/trpc.ts +++ b/src/client/api/trpc.ts @@ -1,9 +1,9 @@ import { createTRPCReact, getQueryKey } from '@trpc/react-query'; +import type { inferRouterInputs, inferRouterOutputs } from '../../server/trpc'; import type { AppRouter } from '../../server/trpc/routers'; import { httpBatchLink, loggerLink, TRPCClientErrorLike } from '@trpc/client'; import { getJWT } from './auth'; import { message } from 'antd'; -import type { inferRouterInputs, inferRouterOutputs } from '@trpc/server'; import { isDev } from '../utils/env'; export { getQueryKey }; diff --git a/src/client/components/monitor/MonitorInfoEditor.tsx b/src/client/components/monitor/MonitorInfoEditor.tsx index bfe5b8b..52ef69a 100644 --- a/src/client/components/monitor/MonitorInfoEditor.tsx +++ b/src/client/components/monitor/MonitorInfoEditor.tsx @@ -1,8 +1,8 @@ import React, { useMemo } from 'react'; -import type { Monitor } from '@prisma/client'; +import type { Monitor } from '../../../server/types/prisma'; import { Button, Form, Input, InputNumber, Select } from 'antd'; import { getMonitorProvider, monitorProviders } from './provider'; -import { useEvent, useEventWithLoading } from '../../hooks/useEvent'; +import { useEventWithLoading } from '../../hooks/useEvent'; import { NotificationPicker } from '../notification/NotificationPicker'; export type MonitorInfoEditorValues = Omit< diff --git a/src/client/package.json b/src/client/package.json index 1bc33a3..1ebffaa 100644 --- a/src/client/package.json +++ b/src/client/package.json @@ -46,10 +46,13 @@ "zustand": "^4.4.1" }, "devDependencies": { + "@types/loadable__component": "^5.13.8", + "@types/lodash-es": "^4.17.12", "@types/react": "^18.2.21", "@types/react-dom": "^18.2.7", "@types/react-grid-layout": "^1.3.5", "@types/react-resizable": "^3.0.7", + "@types/uuid": "^9.0.7", "@vitejs/plugin-react": "^4.0.4", "autoprefixer": "^10.4.16", "postcss": "^8.4.31", diff --git a/src/client/tsconfig.json b/src/client/tsconfig.json index 93e1328..abfb5a5 100644 --- a/src/client/tsconfig.json +++ b/src/client/tsconfig.json @@ -4,5 +4,5 @@ "module": "ESNext", "jsx": "react-jsx" }, - "include": ["./**/*"] + "include": ["./**/*", "../server/**/*"] } diff --git a/src/server/package.json b/src/server/package.json index 16ce1e8..9bfb1a5 100644 --- a/src/server/package.json +++ b/src/server/package.json @@ -18,7 +18,7 @@ "dependencies": { "@paralleldrive/cuid2": "^2.2.2", "@prisma/client": "5.4.2", - "@trpc/server": "^10.38.4", + "@trpc/server": "^10.45.0", "axios": "^1.5.0", "badge-maker": "^3.3.1", "bcryptjs": "^2.4.3", diff --git a/src/server/trpc/index.ts b/src/server/trpc/index.ts index c54cf4a..7eb7710 100644 --- a/src/server/trpc/index.ts +++ b/src/server/trpc/index.ts @@ -7,6 +7,8 @@ import { } from 'trpc-openapi'; import { version } from '../../../package.json'; +export type { inferRouterInputs, inferRouterOutputs } from '@trpc/server'; + export const trpcExpressMiddleware = trpcExpress.createExpressMiddleware({ router: appRouter, createContext, diff --git a/src/server/types/prisma.ts b/src/server/types/prisma.ts new file mode 100644 index 0000000..cb5c960 --- /dev/null +++ b/src/server/types/prisma.ts @@ -0,0 +1 @@ +export type * from '@prisma/client';