Goals judged in order, Goal 7 names no runtime dependencies, file the isAdfDocument result
CI / gate (push) Successful in 41s
CI / publish (push) Successful in 5s

This commit was merged in pull request #152.
This commit is contained in:
2026-10-02 21:57:03 +02:00
parent 4d3231c86b
commit 2252232fd6
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ represent.
## Goals ## Goals
The most useful ADF conversion library available, by these goals in priority order: The most useful ADF conversion library available, judged by these goals, in priority order:
1. **Lossless, and every call returns a result, never a throw.** 1. **Lossless, and every call returns a result, never a throw.**
2. **ADF is the hub.** 2. **ADF is the hub.**
@@ -31,7 +31,7 @@ The most useful ADF conversion library available, by these goals in priority ord
4. **Our markdown is CommonMark, extended only where CommonMark has no spelling.** 4. **Our markdown is CommonMark, extended only where CommonMark has no spelling.**
5. **No surprises: output reads and edits the way its audience expects.** 5. **No surprises: output reads and edits the way its audience expects.**
6. **Lossy conversion drops form, never content.** 6. **Lossy conversion drops form, never content.**
7. **Runs in any JavaScript engine, with nothing to install, configure or connect.** 7. **Runs in any JavaScript engine, with no runtime dependencies and nothing to configure or connect.**
8. **Fast, and linear in the document's size.** 8. **Fast, and linear in the document's size.**
9. **Easy to find, and clear at a glance what it does.** 9. **Easy to find, and clear at a glance what it does.**
+4
View File
@@ -8,6 +8,10 @@
(Goals 3 and 4). A caller names the markdown it hands in: CommonMark, read as its spec says, or (Goals 3 and 4). A caller names the markdown it hands in: CommonMark, read as its spec says, or
the lossless flavour, read as `spec/flavour.md` says. Breaking: `MIGRATION.md` says which call a the lossless flavour, read as `spec/flavour.md` says. Breaking: `MIGRATION.md` says which call a
caller takes. caller takes.
- **45 — Replace `isAdfDocument` with a reader returning `Result<AdfDocument>`.** Goal 1 has every
call return a result; the boolean guard is the one export that does not, and it cannot say which
branch refused, where `not-an-adf-document`'s message already does. Breaking: `MIGRATION.md`
shows the guard's replacement.
- **40 — Make `markdownToAdf(adfToMarkdown(doc))` deep-equal `doc` for every document it takes.** - **40 — Make `markdownToAdf(adfToMarkdown(doc))` deep-equal `doc` for every document it takes.**
Today it holds for editor-normal documents only: two adjacent text nodes with the same marks Today it holds for editor-normal documents only: two adjacent text nodes with the same marks
merge, an empty `attrs`, `marks` or `content` drops, and `-0` reads back `0` — shapes pipelines merge, an empty `attrs`, `marks` or `content` drops, and `-0` reads back `0` — shapes pipelines