From 3b11f9d3ca60947380c1f80e4615737b0b8dbbdb Mon Sep 17 00:00:00 2001 From: DemchaAV Date: Mon, 13 Jul 2026 11:01:31 +0100 Subject: [PATCH] build: migrate to GraphCompose engine 2.0.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GraphCompose 2.0 splits the monolithic engine into per-concern modules, but the `io.github.demchaav:graph-compose` coordinate stays the drop-in default — it is now a thin aggregator over `graph-compose-core` + `graph-compose-render-pdf`. So this consumer migrates with a single-line version bump and keeps rendering PDF with no dependency change and no change to any public type. What changed: - pom.xml: graphcompose.version 1.9.1 -> 2.0.0 (the sole engine pin; cli/ and examples/ resolve 2.0.0 transitively, fonts/emoji keep their own version lines). - InlineRendererTest: 2.0 removed the deprecated linkOptions() read accessor on the engine's inline runs; the test now reads the surrounding link through linkTarget() / ExternalLinkTarget.options().uri() (and now asserts the preserved URI, not just non-null). Main source is unchanged. - CHANGELOG: [Unreleased] Build entry documenting the bump. - README: refresh the stale "GraphCompose 1.9" sample prose to 2.0. Verification: 188 library tests + the CLI suite pass on 2.0.0, the examples module compiles, and QuickStartExample renders a real PDF end-to-end (proving the render-pdf backend is present transitively — no MissingBackendException). Version-lockstep is untouched (all 0.4.0-SNAPSHOT). --- CHANGELOG.md | 9 +++++++++ README.md | 2 +- pom.xml | 2 +- .../demchaav/markdown/render/InlineRendererTest.java | 12 ++++++++++-- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc5dd50..b66eb7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,15 @@ and the project follows [Semantic Versioning](https://semver.org/). ## [Unreleased] ### Build +- **GraphCompose engine bumped 1.9.1 → 2.0.0.** The 2.0 release splits the monolithic engine + into per-concern modules, but `io.github.demchaav:graph-compose` stays the drop-in default — + it is now a thin aggregator over `graph-compose-core` + `graph-compose-render-pdf`, so this + library keeps rendering PDF with **no dependency change and no change to `MarkdownComposer` + or any public type**. The optional `graph-compose-fonts` / `graph-compose-emoji` add-ons keep + their own version lines and are unchanged. The only source touched was a test: 2.0 removed the + deprecated `linkOptions()` read-accessor on the engine's inline runs, so `InlineRendererTest` + now reads the surrounding link through `linkTarget()` / `ExternalLinkTarget.options().uri()` + (the value it asserts is unchanged). 188 library tests + the CLI suite pass on 2.0.0. - **GraphCompose engine bumped 1.9.0 → 1.9.1.** Long inline-code tokens with no spaces (package coordinates, fully-qualified class names, URLs) now break *within* their table cell or paragraph — at `.` `:` `/` `-` seams, char-splitting only as a last resort — instead diff --git a/README.md b/README.md index 261eae2..da5eb42 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ import java.nio.file.Path; String md = """ # Release notes - GraphCompose **1.9** ships *themeable* Markdown rendering. + GraphCompose **2.0** ships *themeable* Markdown rendering. - Headings, lists and `inline code` - Syntax-highlighted code blocks diff --git a/pom.xml b/pom.xml index 8295557..1e71597 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ 17 - 1.9.1 + 2.0.0 1.0.0 1.0.0 0.64.8 diff --git a/src/test/java/io/github/demchaav/markdown/render/InlineRendererTest.java b/src/test/java/io/github/demchaav/markdown/render/InlineRendererTest.java index 7875bf6..a7fccd2 100644 --- a/src/test/java/io/github/demchaav/markdown/render/InlineRendererTest.java +++ b/src/test/java/io/github/demchaav/markdown/render/InlineRendererTest.java @@ -6,6 +6,7 @@ import com.demcha.compose.document.node.InlineRun; import com.demcha.compose.document.node.InlineShapeRun; import com.demcha.compose.document.node.InlineTextRun; +import com.demcha.compose.document.node.ExternalLinkTarget; import com.demcha.compose.document.node.InternalLinkTarget; import io.github.demchaav.markdown.extension.ImageResolver; import io.github.demchaav.markdown.model.inline.CodeRun; @@ -85,7 +86,10 @@ void inlineImageInsideALinkCarriesTheLinkAnnotation() { InlineImageRun image = (InlineImageRun) rich.runs().stream() .filter(InlineImageRun.class::isInstance).findFirst().orElseThrow(); - assertThat(image.linkOptions()).isNotNull(); // the surrounding link is threaded onto the image + // the surrounding link is threaded onto the image as an external-URI target + assertThat(image.linkTarget()).isInstanceOf(ExternalLinkTarget.class); + assertThat(((ExternalLinkTarget) image.linkTarget()).options().uri()) + .isEqualTo("https://example.com"); } @Test @@ -162,7 +166,11 @@ void externalLinkStillCarriesAUriTarget() { List.of(new LinkRun("https://example.com", null, List.of(new TextRun("site")))), BASE); InlineTextRun run = (InlineTextRun) rich.runs().get(0); - assertThat(run.linkOptions()).as("external link keeps its URI options").isNotNull(); + assertThat(run.linkTarget()) + .as("external link keeps its URI target") + .isInstanceOf(ExternalLinkTarget.class); + assertThat(((ExternalLinkTarget) run.linkTarget()).options().uri()) + .isEqualTo("https://example.com"); } private static byte[] png(int width, int height) {