Files
supabase/apps/cms/src/payload.config.ts
T
Francesco SansalvadoreandIvan Vasilov f7d90bbc30 feat: new cms app (#35999)
* add cms turbo app

* add cms scripts to package.json

* update README

* update README

* update files

* fix formatting

* fix populateAuthors

* sync dependencies

* update launch week field

* update lint config

* Coordinate the deps to be the same as the other apps.

* Remove extra files.

* Run prettier on the CMS files.

* Add commands for cleaning and typechecking.

* Fix weird version of @types/react in docs.

* run pnpm install

* fix pnpm-lock

* fix cms lint

---------

Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
2025-06-03 14:26:43 +03:00

67 lines
1.7 KiB
TypeScript

import { postgresAdapter } from '@payloadcms/db-postgres'
import path from 'path'
import { buildConfig } from 'payload'
import { fileURLToPath } from 'url'
import sharp from 'sharp'
import { plugins } from './plugins'
import { defaultLexical } from '@/fields/defaultLexical'
import { getServerSideURL } from './utilities/getURL'
import { Authors } from './collections/Authors'
import { Categories } from './collections/Categories'
import { Customers } from './collections/Customers'
import { Events } from './collections/Events'
import { Media } from './collections/Media'
import { Posts } from './collections/Posts'
import { Tags } from './collections/Tags'
import { Users } from './collections/Users'
const filename = fileURLToPath(import.meta.url)
const dirname = path.dirname(filename)
export default buildConfig({
admin: {
user: Users.slug,
importMap: {
baseDir: path.resolve(dirname),
},
livePreview: {
breakpoints: [
{
label: 'Mobile',
name: 'mobile',
width: 375,
height: 667,
},
{
label: 'Tablet',
name: 'tablet',
width: 768,
height: 1024,
},
{
label: 'Desktop',
name: 'desktop',
width: 1440,
height: 900,
},
],
},
},
collections: [Authors, Categories, Customers, Events, Media, Posts, Tags, Users],
editor: defaultLexical,
secret: process.env.PAYLOAD_SECRET,
typescript: {
outputFile: path.resolve(dirname, 'payload-types.ts'),
},
cors: [getServerSideURL()].filter(Boolean),
db: postgresAdapter({
pool: {
connectionString: process.env.DATABASE_URI || '',
},
schemaName: 'cms-payload',
}),
sharp,
plugins,
})