3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-12 11:48:29 +01:00

Answer stability round 1: 0 🔴, 3 🟡; pin the comparison's dependency tree by date, print what reads back, let Renovate watch its image

This commit is contained in:
2026-10-14 20:00:04 +02:00
committed by Lillem4n
parent fb0bc45060
commit 63494c5657
6 changed files with 19 additions and 16 deletions
-1
View File
@@ -10,7 +10,6 @@
cannot take as `!adf:carry{json="…"}`. `MIGRATION.md` says how to convert stored markdown.
- `losslessMarkdownToAdf` names the CommonMark spelling to write when it refuses a directive whose
node CommonMark spells, such as `[![alt](url)](href)` for a linked `!adf:mediaSingle`.
- The README compares the package with seven other ADF converters, each checked against its
published version.
+5 -4
View File
@@ -194,15 +194,16 @@ UI. They know markdown and not ADF, and rely on every spelling saying what it me
## Other ADF converters
Serves [Goals](#goals) 3. Each package at the version named, checked 2026-10-14 by running its
published code on one document holding marks, a link, a mention, a status, a panel and a list, and
Serves [Goals](#goals) 3. Every npm package converting ADF to or from markdown with over 1,000
downloads a week, at the version named, checked 2026-10-14 by running its published code with its
default options on one document holding marks, a link, a mention, a status, a panel and a list, and
on one holding a node type it cannot know:
[`converter-comparison/`](https://github.com/larvit/adf-codec/tree/main/converter-comparison).
| Package | Converts | ADF to markdown to ADF | A node type it does not know | Formats | Runtime dependencies |
| Package | Converts | ADF to markdown to ADF | A node type it does not know | Formats | Direct runtime dependencies |
| --- | --- | --- | --- | --- | --- |
| `@larvit/adf-codec` 0.2.0 | both ways | the same document | kept | markdown: lossless, portable, CommonMark | 0 |
| `@atlaskit/editor-markdown-transformer` 6.3.1 | markdown to ADF, through `@atlaskit/editor-json-transformer`; ADF to markdown throws "not implemented" | – | – | markdown | 5 |
| `@atlaskit/editor-markdown-transformer` 6.3.1 | markdown to ADF, through `@atlaskit/editor-json-transformer` 10.0.0; ADF to markdown throws "This is not implemented yet" | – | – | markdown | 5 |
| `adf-to-markdown` 1.0.1 | ADF to markdown | – | dropped with its text | markdown | 0 |
| `adf-to-md` 1.2.1 | ADF to markdown | – | dropped with its text, as are mentions, statuses and panels | markdown | 1 |
| `adf2markdown` 1.2.0 | ADF to markdown | – | its text kept | markdown | 0 |
+8 -7
View File
@@ -1,15 +1,15 @@
import { createRequire } from "node:module";
import { readFileSync } from "node:fs";
import { isDeepStrictEqual } from "node:util";
import * as atlaskitJson from "@atlaskit/editor-json-transformer";
import * as atlaskitMarkdown from "@atlaskit/editor-markdown-transformer";
import * as adf2markdown from "adf2markdown";
import * as adfCodec from "@larvit/adf-codec";
import * as adfToMarkdown from "adf-to-markdown";
import adfToMd from "adf-to-md";
import * as adf2markdown from "adf2markdown";
import * as atlaskitJson from "@atlaskit/editor-json-transformer";
import * as atlaskitMarkdown from "@atlaskit/editor-markdown-transformer";
import { createRequire } from "node:module";
import * as extendedParser from "extended-markdown-adf-parser";
import { isDeepStrictEqual } from "node:util";
import * as marklassian from "marklassian";
import mdToAdf from "md-to-adf";
import { readFileSync } from "node:fs";
const { defaultSchema } = createRequire(import.meta.url)("@atlaskit/adf-schema/schema-default");
@@ -78,7 +78,8 @@ for (const [name, { toAdf, toMarkdown }] of Object.entries(converters)) {
console.log("runtime dependencies:", Object.keys(manifest.dependencies ?? {}).length);
const written = toMarkdown && show("ADF to markdown", () => toMarkdown(roundTripDoc));
if (written !== undefined) {
if (toAdf) show("round-trip deep-equal", () => isDeepStrictEqual(toAdf(written), roundTripDoc));
const readBack = toAdf && show("read back", () => toAdf(written));
if (readBack !== undefined) console.log("round-trip deep-equal:", isDeepStrictEqual(readBack, roundTripDoc));
const unknown = show("unknown node to markdown", () => toMarkdown(unknownNodeDoc));
if (toAdf && unknown !== undefined) show("unknown node read back", () => toAdf(unknown));
}
+3 -2
View File
@@ -2,9 +2,10 @@
# Re-checks the README's comparison table against each package's published version.
set -eu
here=$(cd "$(dirname "$0")" && pwd)
node_image=node:24.21.0-alpine3.24
docker run --rm --ulimit core=0 -u "$(id -u):$(id -g)" -e HOME=/tmp -v "$here:/comparison:ro" -w /tmp \
node:24.21.0-alpine3.24 sh -c '
npm install --ignore-scripts --no-audit --no-fund --silent \
"$node_image" sh -c '
npm install --before=2026-10-15 --ignore-scripts --no-audit --no-fund --silent \
@atlaskit/editor-json-transformer@10.0.0 \
@atlaskit/editor-markdown-transformer@6.3.1 \
@larvit/adf-codec@0.2.0 \
+1 -1
View File
@@ -16,7 +16,7 @@
"datasourceTemplate": "docker",
"depNameTemplate": "node",
"description": "Pin the node image the gate runs",
"managerFilePatterns": ["docker-runner.sh"],
"managerFilePatterns": ["converter-comparison/run.sh", "docker-runner.sh"],
"matchStrings": ["node_image=node:(?<currentValue>[0-9][^\\s\"']*)"],
"versioningTemplate": "docker"
},
+2 -1
View File
@@ -71,7 +71,8 @@
### 73. Announce the package where someone needing an ADF converter already reads: JRACLOUD-77436, the Atlassian developer community and Stack Overflow's ADF-to-markdown questions.
Each post links the GitHub repository, the README's comparison table and a README that opens with
what the package is. We draft each post for the place it goes; the maintainer posts them once
what the package is. Before posting, `converter-comparison/run.sh` checks the table again with
`0.3.0` and today's date in `--before`. We draft each post for the place it goes; the maintainer posts them once
`0.3.0` is published. Found while planning discoverability, 2026-10-04.
### 114. Build code-marked text holding no mark besides `link` and `annotation`, in every reader, and have `adfToLosslessMarkdown` carry code text holding any other mark.