| name | sync-upstream |
| description | Use when upstream @lexical/code has new releases, when user asks to sync/merge/update from facebook/lexical, or when checking if this fork is behind upstream |
Sync Upstream @lexical/code
Overview
This repo is a minimal fork of @lexical/code with Prism.js removed. Only FacadePrism.ts differs from upstream. All other source files are byte-identical. This constraint makes merges predictable.
Architecture
src/
index.ts # byte-identical to upstream
CodeNode.ts # byte-identical to upstream
CodeHighlightNode.ts # byte-identical to upstream
CodeExtension.ts # byte-identical to upstream
CodeHighlighterPrism.ts # byte-identical to upstream
FlatStructureUtils.ts # byte-identical to upstream
FacadePrism.ts # ★ ONLY modified file — Prism stubbed out
shared/invariant.ts # shim for monorepo-internal import
.upstream/
VERSION # last synced upstream version
FacadePrism.ts.base # upstream FacadePrism.ts at last sync (for 3-way merge)
When to Use
- User says "sync", "update", "merge upstream", "new lexical version"
- Checking if fork is behind: compare
.upstream/VERSION with latest @lexical/code npm version
- After upstream releases a new version
Sync Process
Option A: Automated Script
./scripts/sync-upstream.sh
./scripts/sync-upstream.sh v0.42.0
The script handles everything: clone, copy identical files, 3-way merge FacadePrism.ts, rebuild, verify.
Option B: Manual (when script fails or structural changes detected)
-