feat(cms-core): add Payload config with postgres adapter and lexical editor
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
// @repo/cms-core — Payload CMS config, collections, hooks, globals
|
||||
export {};
|
||||
export { Users } from "./collections/users/index.js";
|
||||
export { Articles } from "./collections/articles/index.js";
|
||||
export { Media } from "./collections/media/index.js";
|
||||
export { SiteSettings } from "./globals/site-settings.js";
|
||||
export { default as config } from "./payload.config.js";
|
||||
|
||||
30
packages/cms-core/src/payload.config.ts
Normal file
30
packages/cms-core/src/payload.config.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { buildConfig } from "payload";
|
||||
import { postgresAdapter } from "@payloadcms/db-postgres";
|
||||
import { lexicalEditor } from "@payloadcms/richtext-lexical";
|
||||
import path from "node:path";
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
import { Users } from "./collections/users/index.js";
|
||||
import { Articles } from "./collections/articles/index.js";
|
||||
import { Media } from "./collections/media/index.js";
|
||||
import { SiteSettings } from "./globals/site-settings.js";
|
||||
|
||||
const filename = fileURLToPath(import.meta.url);
|
||||
const dirname = path.dirname(filename);
|
||||
|
||||
export default buildConfig({
|
||||
editor: lexicalEditor(),
|
||||
collections: [Users, Articles, Media],
|
||||
globals: [SiteSettings],
|
||||
secret: process.env.PAYLOAD_SECRET || "default-secret-change-me",
|
||||
db: postgresAdapter({
|
||||
pool: {
|
||||
connectionString:
|
||||
process.env.DATABASE_URL ||
|
||||
"postgresql://postgres:postgres@localhost:5432/template",
|
||||
},
|
||||
}),
|
||||
typescript: {
|
||||
outputFile: path.resolve(dirname, "payload-types.ts"),
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user