LITE-030: vendor commonmark.js 0.31.2 into lite/mark/ — CommonJS, zero npm deps

Now
OPEN
Sev
MED
Ask
gritzko
Rep
///lite

Normalizing GitHub Markdown into StrictMark needs a real parser, not regexes over source bytes: the input dialect has containers, lazy continuation and reference links, and only an AST survives that. The parser is commonmark.js — John MacFarlane's reference JS implementation, same author as the spec, BSD-2-Clause, 3.3K lines of JS of which only the parse half is wanted. This ticket VENDORS it: lib/ minus the renderers, ESM rewritten to lite's CommonJS, the three npm deps removed, plus the regeneration script that makes re-vendoring a re-run rather than a hand-edit. No StrictMark logic here — see LITE-032; no GitHub extensions — see LITE-031.

Input

Context

Upstream checkout is ~/src/commonmark.js at v0.31.2 (package.json), lib/ is ESM ("type": "module"): blocks.js 1019, inlines.js 1074, node.js 328, common.js 114, from-code-point.js 65 lines. render/, bin/, dingus/, bench/ are out of scope — the emitter is ours and the HTML oracle is the cmark-gfm binary.

Goals

require("mark/blocks.js") parses Markdown inside a lite worktree under quickjab, producing the same AST as upstream node for the ported examples, with nothing reaching out to node_modules.

Constraints

WIP

Design decisions

TODOs

Blockers and bummers

Outcome

Staged in work/LITE-030, 8 files, nothing posted. Verified by the orchestrator: test/mark/run.sh PASS at 66 checks under jab, mark/vendor.sh re-run reproduces all five files byte-identically, no ESM keyword / mdurl / entities / minimist / require("./…") survives, mark/LICENSE in place.