init commit for iPAL-kit plugin

This commit is contained in:
2026-07-18 20:30:23 +02:00
parent 10638127a9
commit 5733a9c8bf
119 changed files with 6892 additions and 411 deletions
+21 -10
View File
@@ -1,9 +1,9 @@
import { mongooseAdapter } from '@payloadcms/db-mongodb'
import { sqliteAdapter } from '@payloadcms/db-sqlite'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { ipalKit } from 'ipal-kit'
import { MongoMemoryReplSet } from 'mongodb-memory-server'
import path from 'path'
import { buildConfig } from 'payload'
import { ipalKit } from 'ipal-kit'
import sharp from 'sharp'
import { fileURLToPath } from 'url'
@@ -36,6 +36,11 @@ const buildConfigWithMemoryDB = async () => {
},
},
collections: [
{
slug: 'users',
auth: true,
fields: [],
},
{
slug: 'posts',
fields: [],
@@ -43,14 +48,14 @@ const buildConfigWithMemoryDB = async () => {
{
slug: 'media',
fields: [],
upload: {
staticDir: path.resolve(dirname, 'media'),
},
upload: { staticDir: path.resolve(dirname, 'media') },
},
],
db: mongooseAdapter({
ensureIndexes: true,
url: process.env.DATABASE_URL || '',
db: sqliteAdapter({
client: {
url: process.env.DATABASE_URI || 'file:./payload.db',
},
}),
editor: lexicalEditor(),
email: testEmailAdapter,
@@ -59,9 +64,15 @@ const buildConfigWithMemoryDB = async () => {
},
plugins: [
ipalKit({
collections: {
posts: true,
access: { authCollection: 'users' },
i18n: {
defaultLocale: 'pl',
locales: [
{ code: 'pl', label: 'Polski' },
{ code: 'en', label: 'English' },
],
},
seo: { collections: ['posts', 'pages'] },
}),
],
secret: process.env.PAYLOAD_SECRET || 'test-secret_key',