Update README, switch to SQLite, and adjust ESLint/perfectionist rules

- Simplified and clarified README structure and content.
- Replaced `mongooseAdapter` with `sqliteAdapter` for database configuration.
- Disabled all `perfectionist` ESLint rules for consistency.
- Updated `billingPlugin` import path in dev config.
This commit is contained in:
2025-09-14 23:21:43 +02:00
parent 6a49e00e7a
commit 74f2c99c7c
3 changed files with 80 additions and 147 deletions

View File

@@ -1,9 +1,8 @@
import { mongooseAdapter } from '@payloadcms/db-mongodb'
import { sqliteAdapter } from '@payloadcms/db-sqlite'
import { lexicalEditor } from '@payloadcms/richtext-lexical'
import { MongoMemoryReplSet } from 'mongodb-memory-server'
import path from 'path'
import { buildConfig } from 'payload'
import { billingPlugin } from '../src/index.js'
import { billingPlugin } from '../dist/index.js'
import sharp from 'sharp'
import { fileURLToPath } from 'url'
@@ -17,18 +16,7 @@ if (!process.env.ROOT_DIR) {
process.env.ROOT_DIR = dirname
}
const buildConfigWithMemoryDB = async () => {
if (process.env.NODE_ENV === 'test') {
const memoryDB = await MongoMemoryReplSet.create({
replSet: {
count: 3,
dbName: 'payloadmemory',
},
})
process.env.DATABASE_URI = `${memoryDB.getUri()}&retryWrites=true`
}
const buildConfigWithSQLite = () => {
return buildConfig({
admin: {
importMap: {
@@ -48,9 +36,10 @@ const buildConfigWithMemoryDB = async () => {
},
},
],
db: mongooseAdapter({
ensureIndexes: true,
url: process.env.DATABASE_URI || '',
db: sqliteAdapter({
client: {
url: `file:${path.resolve(dirname, 'payload.sqlite')}`,
},
}),
editor: lexicalEditor(),
email: testEmailAdapter,
@@ -81,4 +70,4 @@ const buildConfigWithMemoryDB = async () => {
})
}
export default buildConfigWithMemoryDB()
export default buildConfigWithSQLite()