templates: bump payload versions, upgrade next.js to 15.2.0, fix eslint errors (#11486)
- Ensures website templates build without eslint errors - Upgrades all templates from Next.js 15.1.5 to 15.2.0 - Bumps all payload versions, updates all lockfiles to reference latest payload versions. The blank template was still installing 3.17.1 and the website template was installing 3.18.0 - Simplifies defaultLexical.ts
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
"@payloadcms/richtext-lexical": "latest",
|
||||
"cross-env": "^7.0.3",
|
||||
"graphql": "^16.8.1",
|
||||
"next": "15.1.5",
|
||||
"next": "15.2.0",
|
||||
"payload": "latest",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
@@ -30,10 +30,10 @@
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@types/node": "^22.5.4",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react": "19.0.10",
|
||||
"@types/react-dom": "19.0.4",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-config-next": "15.2.0",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
"@payloadcms/richtext-lexical": "latest",
|
||||
"cross-env": "^7.0.3",
|
||||
"graphql": "^16.8.1",
|
||||
"next": "15.1.5",
|
||||
"next": "15.2.0",
|
||||
"payload": "latest",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
@@ -30,10 +30,10 @@
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@types/node": "^22.5.4",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react": "19.0.10",
|
||||
"@types/react-dom": "19.0.4",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-config-next": "15.2.0",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
|
||||
7117
templates/blank/pnpm-lock.yaml
generated
7117
templates/blank/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -40,13 +40,13 @@
|
||||
"geist": "^1.3.0",
|
||||
"graphql": "^16.8.2",
|
||||
"lucide-react": "^0.378.0",
|
||||
"next": "^15.1.5",
|
||||
"next": "15.2.0",
|
||||
"next-sitemap": "^4.2.3",
|
||||
"payload": "latest",
|
||||
"payload-admin-bar": "^1.0.6",
|
||||
"prism-react-renderer": "^2.3.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
"react-hook-form": "7.45.4",
|
||||
"sharp": "0.32.6",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
@@ -57,12 +57,12 @@
|
||||
"@tailwindcss/typography": "^0.5.13",
|
||||
"@types/escape-html": "^1.0.2",
|
||||
"@types/node": "22.5.4",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react": "19.0.10",
|
||||
"@types/react-dom": "19.0.4",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"copyfiles": "^2.4.1",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-config-next": "15.2.0",
|
||||
"postcss": "^8.4.38",
|
||||
"prettier": "^3.4.2",
|
||||
"tailwindcss": "^3.4.3",
|
||||
|
||||
2273
templates/website/pnpm-lock.yaml
generated
2273
templates/website/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,7 @@ const columnFields: Field[] = [
|
||||
overrides: {
|
||||
admin: {
|
||||
condition: (_data, siblingData) => {
|
||||
return Boolean(siblingData?.enableLink);
|
||||
return Boolean(siblingData?.enableLink)
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -32,7 +32,7 @@ export const FormBlock: React.FC<
|
||||
} = props
|
||||
|
||||
const formMethods = useForm({
|
||||
defaultValues: formFromProps.fields as any,
|
||||
defaultValues: formFromProps.fields,
|
||||
})
|
||||
const {
|
||||
control,
|
||||
|
||||
@@ -95,16 +95,7 @@ export const seed = async ({
|
||||
),
|
||||
])
|
||||
|
||||
const [
|
||||
demoAuthor,
|
||||
image1Doc,
|
||||
image2Doc,
|
||||
image3Doc,
|
||||
imageHomeDoc,
|
||||
technologyCategory,
|
||||
newsCategory,
|
||||
financeCategory,
|
||||
] = await Promise.all([
|
||||
const [demoAuthor, image1Doc, image2Doc, image3Doc, imageHomeDoc] = await Promise.all([
|
||||
payload.create({
|
||||
collection: 'users',
|
||||
data: {
|
||||
@@ -212,21 +203,6 @@ export const seed = async ({
|
||||
}),
|
||||
])
|
||||
|
||||
let demoAuthorID: number | string = demoAuthor.id
|
||||
|
||||
let image1ID: number | string = image1Doc.id
|
||||
let image2ID: number | string = image2Doc.id
|
||||
let image3ID: number | string = image3Doc.id
|
||||
let imageHomeID: number | string = imageHomeDoc.id
|
||||
|
||||
if (payload.db.defaultIDType === 'text') {
|
||||
image1ID = `"${image1Doc.id}"`
|
||||
image2ID = `"${image2Doc.id}"`
|
||||
image3ID = `"${image3Doc.id}"`
|
||||
imageHomeID = `"${imageHomeDoc.id}"`
|
||||
demoAuthorID = `"${demoAuthorID}"`
|
||||
}
|
||||
|
||||
payload.logger.info(`— Seeding posts...`)
|
||||
|
||||
// Do not create posts with `Promise.all` because we want the posts to be created in order
|
||||
@@ -289,12 +265,6 @@ export const seed = async ({
|
||||
data: contactFormData,
|
||||
})
|
||||
|
||||
let contactFormID: number | string = contactForm.id
|
||||
|
||||
if (payload.db.defaultIDType === 'text') {
|
||||
contactFormID = `"${contactFormID}"`
|
||||
}
|
||||
|
||||
payload.logger.info(`— Seeding pages...`)
|
||||
|
||||
const [_, contactPage] = await Promise.all([
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Config, type TextFieldSingleValidation } from 'payload'
|
||||
import type { TextFieldSingleValidation } from 'payload'
|
||||
import {
|
||||
BoldFeature,
|
||||
ItalicFeature,
|
||||
@@ -9,41 +9,39 @@ import {
|
||||
type LinkFields,
|
||||
} from '@payloadcms/richtext-lexical'
|
||||
|
||||
export const defaultLexical: Config['editor'] = lexicalEditor({
|
||||
features: () => {
|
||||
return [
|
||||
ParagraphFeature(),
|
||||
UnderlineFeature(),
|
||||
BoldFeature(),
|
||||
ItalicFeature(),
|
||||
LinkFeature({
|
||||
enabledCollections: ['pages', 'posts'],
|
||||
fields: ({ defaultFields }) => {
|
||||
const defaultFieldsWithoutUrl = defaultFields.filter((field) => {
|
||||
if ('name' in field && field.name === 'url') return false
|
||||
return true
|
||||
})
|
||||
export const defaultLexical = lexicalEditor({
|
||||
features: [
|
||||
ParagraphFeature(),
|
||||
UnderlineFeature(),
|
||||
BoldFeature(),
|
||||
ItalicFeature(),
|
||||
LinkFeature({
|
||||
enabledCollections: ['pages', 'posts'],
|
||||
fields: ({ defaultFields }) => {
|
||||
const defaultFieldsWithoutUrl = defaultFields.filter((field) => {
|
||||
if ('name' in field && field.name === 'url') return false
|
||||
return true
|
||||
})
|
||||
|
||||
return [
|
||||
...defaultFieldsWithoutUrl,
|
||||
{
|
||||
name: 'url',
|
||||
type: 'text',
|
||||
admin: {
|
||||
condition: (_data, siblingData) => siblingData?.linkType !== 'internal',
|
||||
},
|
||||
label: ({ t }) => t('fields:enterURL'),
|
||||
required: true,
|
||||
validate: ((value, options) => {
|
||||
if ((options?.siblingData as LinkFields)?.linkType === 'internal') {
|
||||
return true // no validation needed, as no url should exist for internal links
|
||||
}
|
||||
return value ? true : 'URL is required'
|
||||
}) as TextFieldSingleValidation,
|
||||
return [
|
||||
...defaultFieldsWithoutUrl,
|
||||
{
|
||||
name: 'url',
|
||||
type: 'text',
|
||||
admin: {
|
||||
condition: (_data, siblingData) => siblingData?.linkType !== 'internal',
|
||||
},
|
||||
]
|
||||
},
|
||||
}),
|
||||
]
|
||||
},
|
||||
label: ({ t }) => t('fields:enterURL'),
|
||||
required: true,
|
||||
validate: ((value, options) => {
|
||||
if ((options?.siblingData as LinkFields)?.linkType === 'internal') {
|
||||
return true // no validation needed, as no url should exist for internal links
|
||||
}
|
||||
return value ? true : 'URL is required'
|
||||
}) as TextFieldSingleValidation,
|
||||
},
|
||||
]
|
||||
},
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
||||
@@ -6,10 +6,65 @@
|
||||
* and re-run `payload generate:types` to regenerate this file.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Supported timezones in IANA format.
|
||||
*
|
||||
* This interface was referenced by `Config`'s JSON-Schema
|
||||
* via the `definition` "supportedTimezones".
|
||||
*/
|
||||
export type SupportedTimezones =
|
||||
| 'Pacific/Midway'
|
||||
| 'Pacific/Niue'
|
||||
| 'Pacific/Honolulu'
|
||||
| 'Pacific/Rarotonga'
|
||||
| 'America/Anchorage'
|
||||
| 'Pacific/Gambier'
|
||||
| 'America/Los_Angeles'
|
||||
| 'America/Tijuana'
|
||||
| 'America/Denver'
|
||||
| 'America/Phoenix'
|
||||
| 'America/Chicago'
|
||||
| 'America/Guatemala'
|
||||
| 'America/New_York'
|
||||
| 'America/Bogota'
|
||||
| 'America/Caracas'
|
||||
| 'America/Santiago'
|
||||
| 'America/Buenos_Aires'
|
||||
| 'America/Sao_Paulo'
|
||||
| 'Atlantic/South_Georgia'
|
||||
| 'Atlantic/Azores'
|
||||
| 'Atlantic/Cape_Verde'
|
||||
| 'Europe/London'
|
||||
| 'Europe/Berlin'
|
||||
| 'Africa/Lagos'
|
||||
| 'Europe/Athens'
|
||||
| 'Africa/Cairo'
|
||||
| 'Europe/Moscow'
|
||||
| 'Asia/Riyadh'
|
||||
| 'Asia/Dubai'
|
||||
| 'Asia/Baku'
|
||||
| 'Asia/Karachi'
|
||||
| 'Asia/Tashkent'
|
||||
| 'Asia/Calcutta'
|
||||
| 'Asia/Dhaka'
|
||||
| 'Asia/Almaty'
|
||||
| 'Asia/Jakarta'
|
||||
| 'Asia/Bangkok'
|
||||
| 'Asia/Shanghai'
|
||||
| 'Asia/Singapore'
|
||||
| 'Asia/Tokyo'
|
||||
| 'Asia/Seoul'
|
||||
| 'Australia/Sydney'
|
||||
| 'Pacific/Guam'
|
||||
| 'Pacific/Noumea'
|
||||
| 'Pacific/Auckland'
|
||||
| 'Pacific/Fiji';
|
||||
|
||||
export interface Config {
|
||||
auth: {
|
||||
users: UserAuthOperations;
|
||||
};
|
||||
blocks: {};
|
||||
collections: {
|
||||
pages: Page;
|
||||
posts: Post;
|
||||
@@ -1645,4 +1700,4 @@ export interface Auth {
|
||||
|
||||
declare module 'payload' {
|
||||
export interface GeneratedTypes extends Config {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,14 +15,14 @@
|
||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
|
||||
},
|
||||
"dependencies": {
|
||||
"@payloadcms/db-mongodb": "3.9.0",
|
||||
"@payloadcms/next": "3.9.0",
|
||||
"@payloadcms/payload-cloud": "3.9.0",
|
||||
"@payloadcms/richtext-lexical": "3.9.0",
|
||||
"@payloadcms/db-mongodb": "3.25.0",
|
||||
"@payloadcms/next": "3.25.0",
|
||||
"@payloadcms/payload-cloud": "3.25.0",
|
||||
"@payloadcms/richtext-lexical": "3.25.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"graphql": "^16.8.1",
|
||||
"next": "15.1.5",
|
||||
"payload": "3.9.0",
|
||||
"next": "15.2.0",
|
||||
"payload": "3.25.0",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
"sharp": "0.32.6"
|
||||
@@ -30,10 +30,10 @@
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@types/node": "^22.5.4",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react": "19.0.10",
|
||||
"@types/react-dom": "19.0.4",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-config-next": "15.2.0",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
|
||||
@@ -6,35 +6,35 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "cross-env NODE_OPTIONS=--no-deprecation next build",
|
||||
"ci": "payload migrate && pnpm build",
|
||||
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev",
|
||||
"devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
|
||||
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
|
||||
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types",
|
||||
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
|
||||
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
|
||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
|
||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start",
|
||||
"ci": "payload migrate && pnpm build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@payloadcms/db-postgres": "latest",
|
||||
"@payloadcms/next": "latest",
|
||||
"@payloadcms/payload-cloud": "latest",
|
||||
"@payloadcms/richtext-lexical": "latest",
|
||||
"cross-env": "^7.0.3",
|
||||
"graphql": "^16.8.1",
|
||||
"next": "15.1.5",
|
||||
"next": "15.2.0",
|
||||
"payload": "latest",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
"sharp": "0.32.6"
|
||||
"sharp": "0.32.6",
|
||||
"@payloadcms/db-postgres": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@types/node": "^22.5.4",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react": "19.0.10",
|
||||
"@types/react-dom": "19.0.4",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-config-next": "15.2.0",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "68ffc268-6144-4470-8258-65a7d4d4bac6",
|
||||
"id": "4d0dd218-d96c-4cf1-9ccf-0fbc54bb2798",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as migration_20250227_171503_initial from './20250227_171503_initial'
|
||||
import * as migration_20250303_013923_initial from './20250303_013923_initial'
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
up: migration_20250227_171503_initial.up,
|
||||
down: migration_20250227_171503_initial.down,
|
||||
name: '20250227_171503_initial',
|
||||
up: migration_20250303_013923_initial.up,
|
||||
down: migration_20250303_013923_initial.down,
|
||||
name: '20250303_013923_initial',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -19,21 +19,21 @@
|
||||
"@payloadcms/next": "latest",
|
||||
"@payloadcms/payload-cloud": "latest",
|
||||
"@payloadcms/richtext-lexical": "latest",
|
||||
"@payloadcms/storage-vercel-blob": "latest",
|
||||
"cross-env": "^7.0.3",
|
||||
"graphql": "^16.8.1",
|
||||
"next": "15.1.5",
|
||||
"next": "15.2.0",
|
||||
"payload": "latest",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0"
|
||||
"react-dom": "19.0.0",
|
||||
"@payloadcms/storage-vercel-blob": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@types/node": "^22.5.4",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react": "19.0.10",
|
||||
"@types/react-dom": "19.0.4",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-config-next": "15.2.0",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
|
||||
@@ -6,35 +6,35 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "cross-env NODE_OPTIONS=--no-deprecation next build",
|
||||
"ci": "payload migrate && pnpm build",
|
||||
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev",
|
||||
"devsafe": "rm -rf .next && cross-env NODE_OPTIONS=--no-deprecation next dev",
|
||||
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
|
||||
"generate:types": "cross-env NODE_OPTIONS=--no-deprecation payload generate:types",
|
||||
"lint": "cross-env NODE_OPTIONS=--no-deprecation next lint",
|
||||
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
|
||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
|
||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start",
|
||||
"ci": "payload migrate && pnpm build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@payloadcms/db-vercel-postgres": "latest",
|
||||
"@payloadcms/next": "latest",
|
||||
"@payloadcms/payload-cloud": "latest",
|
||||
"@payloadcms/richtext-lexical": "latest",
|
||||
"@payloadcms/storage-vercel-blob": "latest",
|
||||
"cross-env": "^7.0.3",
|
||||
"graphql": "^16.8.1",
|
||||
"next": "15.1.5",
|
||||
"next": "15.2.0",
|
||||
"payload": "latest",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0"
|
||||
"react-dom": "19.0.0",
|
||||
"@payloadcms/db-vercel-postgres": "latest",
|
||||
"@payloadcms/storage-vercel-blob": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@types/node": "^22.5.4",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react": "19.0.10",
|
||||
"@types/react-dom": "19.0.4",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-config-next": "15.2.0",
|
||||
"prettier": "^3.4.2",
|
||||
"typescript": "5.7.3"
|
||||
},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "9507702f-2302-45e9-ac4d-bd33b5d64a5a",
|
||||
"id": "60ec4acc-9dd1-42f7-be06-3f5dd7ba95cc",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as migration_20250227_171438_initial from './20250227_171438_initial'
|
||||
import * as migration_20250303_013913_initial from './20250303_013913_initial'
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
up: migration_20250227_171438_initial.up,
|
||||
down: migration_20250227_171438_initial.down,
|
||||
name: '20250227_171438_initial',
|
||||
up: migration_20250303_013913_initial.up,
|
||||
down: migration_20250303_013913_initial.down,
|
||||
name: '20250303_013913_initial',
|
||||
},
|
||||
]
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
"scripts": {
|
||||
"build": "cross-env NODE_OPTIONS=--no-deprecation next build",
|
||||
"postbuild": "next-sitemap --config next-sitemap.config.cjs",
|
||||
"ci": "payload migrate && pnpm build",
|
||||
"dev": "cross-env NODE_OPTIONS=--no-deprecation next dev",
|
||||
"dev:prod": "cross-env NODE_OPTIONS=--no-deprecation rm -rf .next && pnpm build && pnpm start",
|
||||
"generate:importmap": "cross-env NODE_OPTIONS=--no-deprecation payload generate:importmap",
|
||||
@@ -17,10 +16,10 @@
|
||||
"lint:fix": "cross-env NODE_OPTIONS=--no-deprecation next lint --fix",
|
||||
"payload": "cross-env NODE_OPTIONS=--no-deprecation payload",
|
||||
"reinstall": "cross-env NODE_OPTIONS=--no-deprecation rm -rf node_modules && rm pnpm-lock.yaml && pnpm --ignore-workspace install",
|
||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start"
|
||||
"start": "cross-env NODE_OPTIONS=--no-deprecation next start",
|
||||
"ci": "payload migrate && pnpm build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@payloadcms/db-vercel-postgres": "latest",
|
||||
"@payloadcms/live-preview-react": "latest",
|
||||
"@payloadcms/next": "latest",
|
||||
"@payloadcms/payload-cloud": "latest",
|
||||
@@ -30,7 +29,6 @@
|
||||
"@payloadcms/plugin-search": "latest",
|
||||
"@payloadcms/plugin-seo": "latest",
|
||||
"@payloadcms/richtext-lexical": "latest",
|
||||
"@payloadcms/storage-vercel-blob": "latest",
|
||||
"@payloadcms/ui": "latest",
|
||||
"@radix-ui/react-checkbox": "^1.0.4",
|
||||
"@radix-ui/react-label": "^2.0.2",
|
||||
@@ -42,29 +40,31 @@
|
||||
"geist": "^1.3.0",
|
||||
"graphql": "^16.8.2",
|
||||
"lucide-react": "^0.378.0",
|
||||
"next": "^15.1.5",
|
||||
"next": "15.2.0",
|
||||
"next-sitemap": "^4.2.3",
|
||||
"payload": "latest",
|
||||
"payload-admin-bar": "^1.0.6",
|
||||
"prism-react-renderer": "^2.3.1",
|
||||
"react": "^19.0.0",
|
||||
"react-dom": "^19.0.0",
|
||||
"react": "19.0.0",
|
||||
"react-dom": "19.0.0",
|
||||
"react-hook-form": "7.45.4",
|
||||
"sharp": "0.32.6",
|
||||
"tailwind-merge": "^2.3.0",
|
||||
"tailwindcss-animate": "^1.0.7"
|
||||
"tailwindcss-animate": "^1.0.7",
|
||||
"@payloadcms/db-vercel-postgres": "latest",
|
||||
"@payloadcms/storage-vercel-blob": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.2.0",
|
||||
"@tailwindcss/typography": "^0.5.13",
|
||||
"@types/escape-html": "^1.0.2",
|
||||
"@types/node": "22.5.4",
|
||||
"@types/react": "19.0.7",
|
||||
"@types/react-dom": "19.0.3",
|
||||
"@types/react": "19.0.10",
|
||||
"@types/react-dom": "19.0.4",
|
||||
"autoprefixer": "^10.4.19",
|
||||
"copyfiles": "^2.4.1",
|
||||
"eslint": "^9.16.0",
|
||||
"eslint-config-next": "15.1.5",
|
||||
"eslint-config-next": "15.2.0",
|
||||
"postcss": "^8.4.38",
|
||||
"prettier": "^3.4.2",
|
||||
"tailwindcss": "^3.4.3",
|
||||
|
||||
@@ -55,7 +55,9 @@ const columnFields: Field[] = [
|
||||
link({
|
||||
overrides: {
|
||||
admin: {
|
||||
condition: (_, { enableLink }) => Boolean(enableLink),
|
||||
condition: (_data, siblingData) => {
|
||||
return Boolean(siblingData?.enableLink)
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
@@ -32,7 +32,7 @@ export const FormBlock: React.FC<
|
||||
} = props
|
||||
|
||||
const formMethods = useForm({
|
||||
defaultValues: formFromProps.fields as any,
|
||||
defaultValues: formFromProps.fields,
|
||||
})
|
||||
const {
|
||||
control,
|
||||
|
||||
@@ -95,16 +95,7 @@ export const seed = async ({
|
||||
),
|
||||
])
|
||||
|
||||
const [
|
||||
demoAuthor,
|
||||
image1Doc,
|
||||
image2Doc,
|
||||
image3Doc,
|
||||
imageHomeDoc,
|
||||
technologyCategory,
|
||||
newsCategory,
|
||||
financeCategory,
|
||||
] = await Promise.all([
|
||||
const [demoAuthor, image1Doc, image2Doc, image3Doc, imageHomeDoc] = await Promise.all([
|
||||
payload.create({
|
||||
collection: 'users',
|
||||
data: {
|
||||
@@ -212,21 +203,6 @@ export const seed = async ({
|
||||
}),
|
||||
])
|
||||
|
||||
let demoAuthorID: number | string = demoAuthor.id
|
||||
|
||||
let image1ID: number | string = image1Doc.id
|
||||
let image2ID: number | string = image2Doc.id
|
||||
let image3ID: number | string = image3Doc.id
|
||||
let imageHomeID: number | string = imageHomeDoc.id
|
||||
|
||||
if (payload.db.defaultIDType === 'text') {
|
||||
image1ID = `"${image1Doc.id}"`
|
||||
image2ID = `"${image2Doc.id}"`
|
||||
image3ID = `"${image3Doc.id}"`
|
||||
imageHomeID = `"${imageHomeDoc.id}"`
|
||||
demoAuthorID = `"${demoAuthorID}"`
|
||||
}
|
||||
|
||||
payload.logger.info(`— Seeding posts...`)
|
||||
|
||||
// Do not create posts with `Promise.all` because we want the posts to be created in order
|
||||
@@ -289,12 +265,6 @@ export const seed = async ({
|
||||
data: contactFormData,
|
||||
})
|
||||
|
||||
let contactFormID: number | string = contactForm.id
|
||||
|
||||
if (payload.db.defaultIDType === 'text') {
|
||||
contactFormID = `"${contactFormID}"`
|
||||
}
|
||||
|
||||
payload.logger.info(`— Seeding pages...`)
|
||||
|
||||
const [_, contactPage] = await Promise.all([
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Config, type TextFieldSingleValidation } from 'payload'
|
||||
import type { TextFieldSingleValidation } from 'payload'
|
||||
import {
|
||||
BoldFeature,
|
||||
ItalicFeature,
|
||||
@@ -9,41 +9,39 @@ import {
|
||||
type LinkFields,
|
||||
} from '@payloadcms/richtext-lexical'
|
||||
|
||||
export const defaultLexical: Config['editor'] = lexicalEditor({
|
||||
features: () => {
|
||||
return [
|
||||
ParagraphFeature(),
|
||||
UnderlineFeature(),
|
||||
BoldFeature(),
|
||||
ItalicFeature(),
|
||||
LinkFeature({
|
||||
enabledCollections: ['pages', 'posts'],
|
||||
fields: ({ defaultFields }) => {
|
||||
const defaultFieldsWithoutUrl = defaultFields.filter((field) => {
|
||||
if ('name' in field && field.name === 'url') return false
|
||||
return true
|
||||
})
|
||||
export const defaultLexical = lexicalEditor({
|
||||
features: [
|
||||
ParagraphFeature(),
|
||||
UnderlineFeature(),
|
||||
BoldFeature(),
|
||||
ItalicFeature(),
|
||||
LinkFeature({
|
||||
enabledCollections: ['pages', 'posts'],
|
||||
fields: ({ defaultFields }) => {
|
||||
const defaultFieldsWithoutUrl = defaultFields.filter((field) => {
|
||||
if ('name' in field && field.name === 'url') return false
|
||||
return true
|
||||
})
|
||||
|
||||
return [
|
||||
...defaultFieldsWithoutUrl,
|
||||
{
|
||||
name: 'url',
|
||||
type: 'text',
|
||||
admin: {
|
||||
condition: (_data, siblingData) => siblingData?.linkType !== 'internal',
|
||||
},
|
||||
label: ({ t }) => t('fields:enterURL'),
|
||||
required: true,
|
||||
validate: ((value, options) => {
|
||||
if ((options?.siblingData as LinkFields)?.linkType === 'internal') {
|
||||
return true // no validation needed, as no url should exist for internal links
|
||||
}
|
||||
return value ? true : 'URL is required'
|
||||
}) as TextFieldSingleValidation,
|
||||
return [
|
||||
...defaultFieldsWithoutUrl,
|
||||
{
|
||||
name: 'url',
|
||||
type: 'text',
|
||||
admin: {
|
||||
condition: (_data, siblingData) => siblingData?.linkType !== 'internal',
|
||||
},
|
||||
]
|
||||
},
|
||||
}),
|
||||
]
|
||||
},
|
||||
label: ({ t }) => t('fields:enterURL'),
|
||||
required: true,
|
||||
validate: ((value, options) => {
|
||||
if ((options?.siblingData as LinkFields)?.linkType === 'internal') {
|
||||
return true // no validation needed, as no url should exist for internal links
|
||||
}
|
||||
return value ? true : 'URL is required'
|
||||
}) as TextFieldSingleValidation,
|
||||
},
|
||||
]
|
||||
},
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"id": "090f3356-1c23-4749-bf86-2191f58b85b4",
|
||||
"id": "4013ab14-2e86-4a03-a7a7-5cc3f55915ac",
|
||||
"prevId": "00000000-0000-0000-0000-000000000000",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
@@ -1,9 +1,9 @@
|
||||
import * as migration_20250227_171453_initial from './20250227_171453_initial'
|
||||
import * as migration_20250303_013917_initial from './20250303_013917_initial'
|
||||
|
||||
export const migrations = [
|
||||
{
|
||||
up: migration_20250227_171453_initial.up,
|
||||
down: migration_20250227_171453_initial.down,
|
||||
name: '20250227_171453_initial',
|
||||
up: migration_20250303_013917_initial.up,
|
||||
down: migration_20250303_013917_initial.down,
|
||||
name: '20250303_013917_initial',
|
||||
},
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user