From cb0a2f77a8fe7ae94133930a9b470d66cc31b3f7 Mon Sep 17 00:00:00 2001 From: tobias Date: Mon, 24 Jun 2024 17:34:40 +0200 Subject: [PATCH] fix build errors --- package.json | 11 +++++++---- pnpm-lock.yaml | 15 +++++++++++--- src/app/(payload)/fields/icon.ts | 26 ------------------------- src/components/LexicalContent/index.tsx | 4 ++-- src/lib/payload/actions.ts | 3 ++- src/lib/payload/index.ts | 2 +- tsconfig.json | 2 +- 7 files changed, 25 insertions(+), 38 deletions(-) delete mode 100644 src/app/(payload)/fields/icon.ts diff --git a/package.json b/package.json index 0df79f8..2941f31 100644 --- a/package.json +++ b/package.json @@ -22,13 +22,14 @@ }, "dependencies": { "@payloadcms/db-mongodb": "3.0.0-beta.40", + "@payloadcms/live-preview": "3.0.0-beta.35", + "@payloadcms/live-preview-react": "3.0.0-beta.35", "@payloadcms/next": "3.0.0-beta.40", "@payloadcms/plugin-nested-docs": "3.0.0-beta.35", "@payloadcms/richtext-lexical": "3.0.0-beta.40", "@payloadcms/ui": "3.0.0-beta.40", - "@payloadcms/live-preview": "3.0.0-beta.35", - "@payloadcms/live-preview-react": "3.0.0-beta.35", "babel-plugin-react-compiler": "^0.0.0-experimental-592953e-20240517", + "clsx": "^2.1.1", "cross-env": "^7.0.3", "deepmerge": "^4.3.1", "graphql": "^16.8.1", @@ -37,7 +38,8 @@ "react": "19.0.0-rc-f994737d14-20240522", "react-dom": "19.0.0-rc-f994737d14-20240522", "sharp": "0.32.6", - "tailwind-merge": "^2.3.0" + "tailwind-merge": "^2.3.0", + "lodash": "^4.17.21" }, "devDependencies": { "@types/node": "^20.12.12", @@ -48,7 +50,8 @@ "eslint-config-next": "14.2.3", "postcss": "^8.4.38", "tailwindcss": "^3.4.4", - "typescript": "^5.4.5" + "typescript": "^5.4.5", + "@types/lodash": "^4.17.4" }, "pnpm": { "overrides": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f53ada4..132294a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,6 +36,9 @@ importers: babel-plugin-react-compiler: specifier: ^0.0.0-experimental-592953e-20240517 version: 0.0.0-experimental-938cd9a-20240601 + clsx: + specifier: ^2.1.1 + version: 2.1.1 cross-env: specifier: ^7.0.3 version: 7.0.3 @@ -45,6 +48,9 @@ importers: graphql: specifier: ^16.8.1 version: 16.8.1 + lodash: + specifier: ^4.17.21 + version: 4.17.21 next: specifier: 15.0.0-rc.0 version: 15.0.0-rc.0(babel-plugin-react-compiler@0.0.0-experimental-938cd9a-20240601)(react-dom@19.0.0-rc-f994737d14-20240522(react@19.0.0-rc-f994737d14-20240522))(react@19.0.0-rc-f994737d14-20240522)(sass@1.77.4) @@ -64,6 +70,9 @@ importers: specifier: ^2.3.0 version: 2.3.0 devDependencies: + '@types/lodash': + specifier: ^4.17.4 + version: 4.17.4 '@types/node': specifier: ^20.12.12 version: 20.14.1 @@ -5767,7 +5776,7 @@ snapshots: eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-react: 7.34.2(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) @@ -5791,7 +5800,7 @@ snapshots: enhanced-resolve: 5.16.1 eslint: 8.57.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -5813,7 +5822,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 diff --git a/src/app/(payload)/fields/icon.ts b/src/app/(payload)/fields/icon.ts deleted file mode 100644 index 4987339..0000000 --- a/src/app/(payload)/fields/icon.ts +++ /dev/null @@ -1,26 +0,0 @@ -import deepMerge from 'deepmerge' -import type { Field } from 'payload/types' -import * as HiIcons from 'react-icons/hi2' - -const iconOptions = Object.entries(HiIcons) - .filter(([key, value]) => typeof value === 'function') - .map(([key]) => ({ - value: key, - label: key.replace(/([a-z])([A-Z])/g, '$1 $2') - })) - -type IconField = (overrides?: Partial) => Field - -const iconField: IconField = (overrides = {}) => { - return deepMerge>( - { - type: 'select', - name: 'icon', - label: 'Icon', - options: iconOptions - }, - overrides - ) -} - -export default iconField diff --git a/src/components/LexicalContent/index.tsx b/src/components/LexicalContent/index.tsx index 8f00218..08c6b3a 100644 --- a/src/components/LexicalContent/index.tsx +++ b/src/components/LexicalContent/index.tsx @@ -74,7 +74,7 @@ const TextComponent: FC = ({ children, format }) => { const SerializedLink: React.FC<{ node: SerializedLexicalNode locale: string - children: JSX.Element | null + children: React.JSX.Element | null }> = ({ node, locale, children }) => { const { doc, url, newTab, linkType } = node.fields as any const document = doc?.value @@ -164,7 +164,7 @@ const LexicalContent: React.FC<{ ) case 'heading': - const HeadingTag = node.tag as keyof JSX.IntrinsicElements + const HeadingTag = node.tag as keyof React.JSX.IntrinsicElements return ( {serializedChildren} diff --git a/src/lib/payload/actions.ts b/src/lib/payload/actions.ts index b1bb1d7..7a4f499 100644 --- a/src/lib/payload/actions.ts +++ b/src/lib/payload/actions.ts @@ -1,4 +1,4 @@ -'use server' +/* 'use server' import { SESSION_STRATEGY } from '@/lib/auth/config' import { COLLECTION_SLUG_SESSIONS } from '@/payload/collections/config' @@ -16,3 +16,4 @@ export const revalidateUser = async (user: User, payload: Payload) => { }) } } + */ diff --git a/src/lib/payload/index.ts b/src/lib/payload/index.ts index 6042df5..f70b229 100644 --- a/src/lib/payload/index.ts +++ b/src/lib/payload/index.ts @@ -1,7 +1,7 @@ import configPromise from '@payload-config' import { getPayloadHMR as getPayloadInstance } from '@payloadcms/next/utilities' import { headers as getHeaders } from 'next/headers' -import type { User } from '~/payload-types' +import type { User } from 'types/payload-types' export async function getPayload(): ReturnType { return getPayloadInstance({ config: await configPromise }) diff --git a/tsconfig.json b/tsconfig.json index c31d9dc..07c8479 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "moduleResolution": "bundler", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "preserve", + "jsx": "react-jsx", "incremental": true, "plugins": [ {