mirror of
https://github.com/xtr-dev/payload-feature-flags.git
synced 2025-12-10 10:53:24 +00:00
Bump version to 0.0.5
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -47,3 +47,4 @@ yarn-error.log*
|
|||||||
/playwright-report/
|
/playwright-report/
|
||||||
/blob-report/
|
/blob-report/
|
||||||
/playwright/.cache/
|
/playwright/.cache/
|
||||||
|
/dev.db
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { mongooseAdapter } from '@payloadcms/db-mongodb'
|
|
||||||
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
import { lexicalEditor } from '@payloadcms/richtext-lexical'
|
||||||
import { MongoMemoryReplSet } from 'mongodb-memory-server'
|
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { buildConfig } from 'payload'
|
import { buildConfig } from 'payload'
|
||||||
import { payloadFeatureFlags } from '../src/index.js'
|
import { payloadFeatureFlags } from '../src/index.js'
|
||||||
@@ -9,6 +8,7 @@ import { fileURLToPath } from 'url'
|
|||||||
|
|
||||||
import { testEmailAdapter } from './helpers/testEmailAdapter.js'
|
import { testEmailAdapter } from './helpers/testEmailAdapter.js'
|
||||||
import { seed } from './seed.js'
|
import { seed } from './seed.js'
|
||||||
|
import {sqliteAdapter} from "@payloadcms/db-sqlite"
|
||||||
|
|
||||||
const filename = fileURLToPath(import.meta.url)
|
const filename = fileURLToPath(import.meta.url)
|
||||||
const dirname = path.dirname(filename)
|
const dirname = path.dirname(filename)
|
||||||
@@ -17,23 +17,7 @@ if (!process.env.ROOT_DIR) {
|
|||||||
process.env.ROOT_DIR = dirname
|
process.env.ROOT_DIR = dirname
|
||||||
}
|
}
|
||||||
|
|
||||||
const buildConfigWithMemoryDB = async () => {
|
export default buildConfig({
|
||||||
// Use in-memory MongoDB for both test and development
|
|
||||||
if (process.env.NODE_ENV === 'test' || process.env.NODE_ENV !== 'production') {
|
|
||||||
console.log('🗃️ Starting MongoDB Memory Server...')
|
|
||||||
const memoryDB = await MongoMemoryReplSet.create({
|
|
||||||
replSet: {
|
|
||||||
count: 1,
|
|
||||||
dbName: 'payload-feature-flags-dev',
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
const uri = memoryDB.getUri()
|
|
||||||
process.env.DATABASE_URI = `${uri}&retryWrites=true`
|
|
||||||
console.log('✅ MongoDB Memory Server started successfully')
|
|
||||||
}
|
|
||||||
|
|
||||||
return buildConfig({
|
|
||||||
admin: {
|
admin: {
|
||||||
importMap: {
|
importMap: {
|
||||||
baseDir: path.resolve(dirname),
|
baseDir: path.resolve(dirname),
|
||||||
@@ -128,9 +112,10 @@ const buildConfigWithMemoryDB = async () => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
db: mongooseAdapter({
|
db: sqliteAdapter({
|
||||||
ensureIndexes: true,
|
client: {
|
||||||
url: process.env.DATABASE_URI || 'mongodb://localhost/payload-feature-flags-dev',
|
url: process.env.DATABASE_URI || 'file:./dev.db',
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
editor: lexicalEditor(),
|
editor: lexicalEditor(),
|
||||||
email: testEmailAdapter,
|
email: testEmailAdapter,
|
||||||
@@ -231,7 +216,4 @@ const buildConfigWithMemoryDB = async () => {
|
|||||||
typescript: {
|
typescript: {
|
||||||
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
outputFile: path.resolve(dirname, 'payload-types.ts'),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
export default buildConfigWithMemoryDB()
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@xtr-dev/payload-feature-flags",
|
"name": "@xtr-dev/payload-feature-flags",
|
||||||
"version": "0.0.4",
|
"version": "0.0.5",
|
||||||
"description": "Feature flags plugin for Payload CMS - manage feature toggles, A/B tests, and gradual rollouts",
|
"description": "Feature flags plugin for Payload CMS - manage feature toggles, A/B tests, and gradual rollouts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
Reference in New Issue
Block a user