feat(richtext-lexical): mdx support (#9160)

Supports bi-directional import/export between MDX <=> Lexical. JSX will
be mapped to lexical blocks back and forth.

This will allow editing our mdx docs in payload while keeping mdx as the
source of truth

---------

Co-authored-by: Germán Jabloñski <43938777+GermanJablo@users.noreply.github.com>
This commit is contained in:
Alessio Gravili
2024-11-17 15:03:45 -07:00
committed by GitHub
parent 324af8a5f9
commit d4f1add2ab
79 changed files with 7540 additions and 304 deletions

View File

@@ -12,11 +12,17 @@ import { NextRESTClient } from './NextRESTClient.js'
export async function initPayloadInt(
dirname: string,
testSuiteNameOverride?: string,
): Promise<{ config: SanitizedConfig; payload: Payload; restClient: NextRESTClient }> {
initializePayload = true,
): Promise<{ config: SanitizedConfig; payload?: Payload; restClient?: NextRESTClient }> {
const testSuiteName = testSuiteNameOverride ?? path.basename(dirname)
await runInit(testSuiteName, false, true)
console.log('importing config', path.resolve(dirname, 'config.ts'))
const { default: config } = await import(path.resolve(dirname, 'config.ts'))
if (!initializePayload) {
return { config: await config }
}
console.log('starting payload')
const payload = await getPayload({ config })