Skip to content
This repository was archived by the owner on Feb 11, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in the readme](https://github.com/changesets/changesets/blob/main/packages/changesets-cli/README.md)

For more information about this folder, you can read about it [here](https://github.com/changesets/changesets/blob/main/docs/common-questions.md#not-sure-what-the-changeset-folder-is-for).
5 changes: 5 additions & 0 deletions .changeset/all-flowers-mix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@multiverse-io/editor': minor
---

Use forked lexical version with support for shadow DOM
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
25 changes: 25 additions & 0 deletions .github/workflows/publish-lexical.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Publish Lexical Packages

on:
workflow_dispatch:
pull_request:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Configure npm for GitHub Packages
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
echo "@multiverse-io:registry=https://npm.pkg.github.com" >> ~/.npmrc

- name: Publish lexical packages
run: bash scripts/publish-lexical-packages.sh
61 changes: 27 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,52 @@
name: Release
name: Release Github Package

on:
push:
branches:
- main
- alpha
- beta

permissions:
contents: read # for checkout
concurrency: ${{ github.workflow }}-${{ github.ref }}

env:
GITHUB_READ_PACKAGES_TOKEN: ${{secrets.GITHUB_TOKEN}}

jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
actions: write
packages: write
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v3
- name: Checkout Repo
uses: actions/checkout@v4

- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
node-version: 20.x

- name: Install dependencies
- name: Install Dependencies
run: npm install

- name: Lint
run: npm run lint
- name: Build
run: npm run build

- name: Typecheck
run: npm run typecheck

- name: Test
run: npm run test
run: npm run test:once

- name: Build
run: npm run build
- name: Configure npm for publishing GitHub Packages
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
echo "@multiverse-io:registry=https://npm.pkg.github.com" >> ~/.npmrc

- name: Release
- name: Create Release Pull Request or Publish
uses: changesets/action@v1
with:
publish: npm run publish-packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release

- name: Publish website
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release.yml
ref: master
token: ${{ secrets.SITE_GH_TOKEN }}
repo: mdx-editor/site
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules/
.DS_Store
**/dist
**.tgz
!vendor/lexical/*.tgz
docs/api
temp
etc
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
legacy-peer-deps=true
//npm.pkg.github.com/:_authToken=${GITHUB_READ_PACKAGES_TOKEN}
@multiverse-io:registry=https://npm.pkg.github.com
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,66 @@ export default function App() {

The best place to get started using the component is the [documentation](https://mdxeditor.dev/editor/docs/getting-started).

## Lexical Fork (Shadow DOM Support)

This project uses a [fork of Lexical](https://github.com/aleksandr-konovalov/lexical/tree/add-shadow-dom-support)
that adds Shadow DOM support. Pre-built tarballs (`.tgz` files) of the fork are checked into the
repository under `vendor/lexical/` and referenced directly from `package.json` via `file:` dependencies.
No special setup is needed beyond `npm install`.

**Current fork commit:** [`cd99328`](https://github.com/aleksandr-konovalov/lexical/commit/cd993281c19f665f90756b3bb0a32302d71b5dd2) (lexical 0.38.2)

### Updating the Lexical fork tarballs

If you need to update the fork (e.g. to pick up new Shadow DOM fixes or upgrade the lexical version):

1. Clone the fork and checkout the desired commit:
```bash
git clone https://github.com/aleksandr-konovalov/lexical.git /tmp/lexical-fork
cd /tmp/lexical-fork
git checkout <commit-sha>
```

2. Install dependencies and build:
```bash
npm install
npm run build
```

3. Generate type declarations (errors in unrelated packages can be ignored — declarations still emit):
```bash
npx tsc -p ./tsconfig.build.json || true
```

4. Prepare release packages (copies built files into `npm/` directories):
```bash
node scripts/npm/prepare-release.js
```

5. Copy type declarations from `.ts-temp` into each package's `npm/` directory:
```bash
# For each package, copy .d.ts files from .ts-temp/packages/<pkg>/src/ to packages/<pkg>/npm/
```

6. Strip `development`, `production`, and `node` export conditions from each package's `npm/package.json`
(the fork's build only produces a single bundle, not separate dev/prod builds).

7. Pack tarballs and copy them into this repo:
```bash
for pkg in packages/*/npm; do npm pack --pack-destination /tmp/tarballs "$pkg"; done
cp /tmp/tarballs/*.tgz vendor/lexical/
```

8. Update `package.json` if the version number changed (the `file:` paths include the version).

9. Clean install and verify:
```bash
npm cache clean --force
rm -rf node_modules package-lock.json
npm install
npm run build && npm run typecheck && npm run test:once
```

## Help and support

If you find a bug, check if something similar is not reported already in the [issues](https://github.com/mdx-editor/editor/issues). If not, [create a new issue](https://github.com/mdx-editor/editor/issues/new?assignees=&labels=bug&projects=&template=1.bug.md&title=%5BBUG%5D).
Expand Down
Loading