refactor(templates): extract the text layer to templates.core.text#249
Merged
Conversation
Move the neutral text-rendering primitives into com.demcha.compose.document.templates.core.text so every template family shares them without depending on cv: MarkdownText (from templates.components), plus CvTextStyles -> TextStyles, MarkdownInline, RichParagraphRenderer, and TextOrnaments (from cv.v2.components). ParagraphPrimitive and ParagraphRenderer stay in cv.v2.components — they are CV-section plumbing used only by the CV section renderers. Repoint all callers (cv.v2, coverletter.v2, the Gen-2 cv/coverletter presets, and the invoice/proposal builders that already used MarkdownText); relocate MarkdownInlineTest to core.text. Render is byte-identical (1607 tests green, zero snapshot updates); the move is a deliberate binary break on the 2.0 line (japicmp report-only). Markdown docs follow in the docs refresh.
f01a3c1 to
d831f43
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The neutral text-rendering primitives — inline markdown parsing, rich-paragraph
rendering, text-style factories, small string ornaments — lived in
cv.v2.components(and one in the Gen-2
templates.components). They carry no CV data model, yet invoiceand proposal could only reach them through
cvor the Gen-2 surface. Moving them to afamily-neutral
templates.core.textlets every family share one text layer. Renaming apublic type is a binary break, so this lands on the 2.0 line.
What changed
templates.core.text:MarkdownText(fromtemplates.components); andCvTextStyles→TextStyles,MarkdownInline,RichParagraphRenderer,TextOrnaments(from
cv.v2.components). Addedcore/text/package-info.java.cv.v2.components:ParagraphPrimitive(package-private) andParagraphRenderer— CV-section plumbing used only by the CV section renderers(Entry / Row / Skills / Paragraph), not cross-family.
cv.v2,coverletter.v2, the Gen-2cv/coverletterpresets, and the active invoice / proposal builders (which already used
MarkdownText).Relocated
MarkdownInlineTest→core.text.cv.v2.components.*; the moveadds a matching wildcard
core.text.*to the files that referenced the moved classes(consistent with that existing idiom). Can convert to specific imports on request.
Lane: templates (canonical). Target:
2.0-dev. Pure move / rename — no logic change.Deferred to the docs refresh: markdown docs that still name the old
cv.v2.componentstext types.
Verification
./mvnw test -pl .→Tests run: 1607, Failures: 0, Errors: 0— zero snapshot updates→ render is byte-identical.
./mvnw -P japicmp verify -pl .→ BUILD SUCCESS; javadoc gate clean; japicmp runsreport-only and its report documents the move (
core.text.*added; cv/coverlettersignatures repointed).
examplestest-compile +GenerateAllExamples→ every example PDF regenerates.