Update payload to 2.18.3
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
tobias 2024-05-27 11:24:42 +02:00
parent d62e7d788e
commit f37a1719b7
5 changed files with 2680 additions and 1712 deletions

View File

@ -14,10 +14,14 @@
"generate:types:listen": "nodemon --watch src --ext ts --exec 'npm run generate:types'"
},
"dependencies": {
"@payloadcms/bundler-webpack": "^1.0.6",
"@payloadcms/db-mongodb": "^1.5.1",
"@payloadcms/plugin-cloud": "^3.0.1",
"@payloadcms/richtext-slate": "^1.5.2",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"express": "^4.17.1",
"payload": "^1.15.6",
"payload": "^2.18.3",
"tsconfig-paths": "^4.2.0"
},
"devDependencies": {

View File

@ -3,6 +3,7 @@ import { isAdmin } from "@/access/isAdmin";
import { isEditor } from "@/access/isEditor";
import { isSSG } from "@/access/isSSG";
import { isUser } from "@/access/isUser";
import { slateEditor } from '@payloadcms/richtext-slate'
const Posts: CollectionConfig = {
slug: "posts",
@ -68,26 +69,28 @@ const Posts: CollectionConfig = {
required: true,
},
{
name: "content",
type: "richText",
admin: {
elements: ["h2", "h3", "h4", "link", "ol", "ul", "upload", "blockquote", "indent"],
leaves: ["bold", "italic", "underline"],
upload: {
collections: {
media: {
fields: [
{
name: "image",
type: "upload",
relationTo: "media",
required: true,
},
],
name: 'content',
type: 'richText',
editor: slateEditor({
admin: {
elements: ["h2", "h3", "h4", "link", "ol", "ul", "upload", "blockquote", "indent"],
leaves: ["bold", "italic", "underline", "strikethrough"],
upload: {
collections: {
media: {
fields: [
{
name: "image",
type: "upload",
relationTo: "media",
required: true,
},
],
},
},
},
},
},
})
},
{
name: "author",

View File

@ -5,10 +5,16 @@ import Users from "@/collections/Users";
import Authors from "./collections/Authors";
import Media from "@/collections/Media";
import { payloadCloud } from '@payloadcms/plugin-cloud'
import { mongooseAdapter } from '@payloadcms/db-mongodb'
import { webpackBundler } from '@payloadcms/bundler-webpack'
import { slateEditor } from '@payloadcms/richtext-slate'
export default buildConfig({
serverURL: process.env.PAYLOAD_URL,
admin: {
user: Users.slug,
bundler: webpackBundler(),
webpack: (config) => ({
...config,
resolve: {
@ -24,4 +30,9 @@ export default buildConfig({
typescript: {
outputFile: path.resolve("../", "payload-types.ts"),
},
});
plugins: [payloadCloud()],
editor: slateEditor({}),
db: mongooseAdapter({
url: process.env.MONGODB_URI,
}),
});

View File

@ -10,7 +10,7 @@ app.get("/", (_, res) => {
payload.init({
secret: process.env.PAYLOAD_SECRET,
mongoURL: process.env.MONGODB_URI,
//mongoURL: process.env.MONGODB_URI,
express: app,
onInit: () => {
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`);

File diff suppressed because it is too large Load Diff