SPREADSHEET SUITE

Three engines, one vision 三引擎,一体系

A clean-room TypeScript front-end engine, its Rust twin for headless back-end work, and a headless-Excel protocol shell on top. One function library, verified byte-identical across languages — if a cell can be drawn, it can be clicked back. clean-room TypeScript 前端引擎、同功能 Rust 无头后端引擎,以及建在其上的无头 Excel 协议壳。同一套函数库,跨语言实测 byte-identical——画得出来,就一定点得回去。

📊
TYPESCRIPT · FRONT-ENDTYPESCRIPT · 前端
cmx-megasheet

A zero-dependency, clean-room spreadsheet engine shipped as the <cmx-megasheet> custom element. Grid rendering, the formula engine, merges, named ranges, whole-column A:A refs, and {1,2;3,4} array literals — 26 milestones (M0–M26) of shared-geometry "draw = click-back" invariants, all in the browser with nothing to install. 零依赖、clean-room 的电子表格引擎,以 <cmx-megasheet> 自定义元素交付。网格渲染、公式引擎、合并、命名区域、整列 A:A 引用与 {1,2;3,4} 数组字面量——26 个里程碑(M0–M26)贯穿「画=点」共享几何不变式,全在浏览器里,无需安装。

0 deps 335 functions 945 tests v7.5.2
Live docs & demos在线文档与演示 →
🦀
RUST · HEADLESSRUST · 无头
cmx-rust-sheet

The Rust twin — every non-rendering layer of megasheet reforged as a pure library (RS-M0→M26 full parity). Same 335 functions, verified byte-identical against the TS engine on cross-engine cases. Unlike the browser build it embraces mature crates — serde, zip, flate2, quick-xml, printpdf, rayon — for server-side XLSX / PDF work. Rust 孪生体——把 megasheet 的所有非渲染层用 Rust 重铸为纯库(RS-M0→M26 全对等)。同样 335 函数,跨引擎实测与 TS byte-identical。与浏览器构建不同,它拥抱成熟 crate——serde、zip、flate2、quick-xml、printpdf、rayon——服务端 XLSX / PDF 由此而来。

335 functions 513 tests clippy clean
Pure library纯库形态
🎛️
RUST · HEADLESS EXCELRUST · 无头 EXCEL
cmx-sheetwright

A protocol-and-transport shell around cmx-rust-sheet that turns it into headless Excel — drive a spreadsheet over CLI or HTTP the way a headless browser drives headless Chrome. Neutral-JSON verbs (setValue, setFormula, recalc, export); every engine call is quarantined in spawn_blocking so the !Send core never crosses a thread boundary. 套在 cmx-rust-sheet 外的「协议 + 传输」壳,把它变成无头 Excel——像无头浏览器驱动无头 Chrome 那样,用 CLI 或 HTTP 远程驱动电子表格。中性 JSON 动词(setValue、setFormula、recalc、export);每次引擎调用都关进 spawn_blocking,让 !Send 内核绝不跨线程边界。

CLI HTTP protocol.rs spawn_blocking
Playwright → SheetwrightPlaywright → Sheetwright
SHARED INVARIANTS共享不变式

What holds across all three三者共同遵守

Hard constraints carried from M0 to M26 — the reason a TS front-end and a Rust back-end can share one function library and produce identical cells. 从 M0 贯穿到 M26 的硬约束——正是它们让 TS 前端与 Rust 后端能共享同一套函数库、算出同一格值。

Zero runtime deps (browser)零运行时依赖(浏览器)
The src/ tree of cmx-megasheet stays browser-pure — no Node types, no third-party runtime. The Rust side is free to pull mature crates because it never ships to a browser. cmx-megasheet 的 src/ 保持浏览器纯净——无 Node 类型、无第三方运行时。Rust 侧因永不进浏览器,可自由引入成熟 crate。
Draw = click-back画 = 点
Rendering and hit-testing share the exact same pure geometry. If a cell, merge, or overlay can be drawn at a coordinate, a click at that coordinate resolves back to it — no divergent math. 渲染与命中检测共用同一份纯几何。任何格子、合并或浮层能画在某坐标,点击该坐标就一定能解析回它——绝无两套算法。
Undoable = command pattern可撤销 = 命令模式
Every mutating operation is a command, so undo/redo is uniform and total. No edit escapes the history. 每个改动操作都是命令,撤销/重做因而统一且完备。没有任何编辑能逃出历史栈。
Cross-engine byte-identical跨引擎 byte-identical
The 335-function library is mirrored function-for-function between TypeScript and Rust, with cross-engine cases asserting identical output down to the byte — engineering (base/bitwise/ERF/Bessel/CONVERT/complex) and date families included. 335 函数库在 TypeScript 与 Rust 间逐个对等,跨引擎用例断言输出精确到字节一致——含工程族(进制/位运算/ERF/贝塞尔/CONVERT/复数)与日期族。
Consumer-zero-change消费方零改
Every milestone lands without breaking existing tests and without forcing consumers to touch their code — the public surface only grows, never churns. 每个里程碑落地都不破坏既有测试、不迫使消费方改代码——公开面只增不折腾。
QUICK START快速上手

Front-end element · headless CLI前端元素 · 无头 CLI

Drop the custom element in a page在页面里放入自定义元素

<!-- registers <cmx-megasheet> -->
import 'cmx-megasheet'

<!-- then, anywhere in your HTML -->
<cmx-megasheet></cmx-megasheet>
# 335 functions · 0 runtime deps

Drive it headless over CLI / HTTP用 CLI / HTTP 无头驱动

# start the HTTP server (localhost)
sheetwright serve

# or pipe neutral-JSON verbs via CLI
sheetwright run ops.json --export xlsx
# setValue · setFormula · recalc · export

Open the live megasheet docs打开在线 Megasheet 文档

Twenty-five real demo pages, the full function reference, and the M0–M26 milestone story — every cell you can draw, you can click back. 25 个真机演示页、完整函数参考,以及 M0–M26 里程碑全程——每一格能画出来,就一定能点回去。