Skip to content

refactor(templates): extract the text layer to templates.core.text#249

Merged
DemchaAV merged 1 commit into
2.0-devfrom
feat/templates-core-text
Jun 27, 2026
Merged

refactor(templates): extract the text layer to templates.core.text#249
DemchaAV merged 1 commit into
2.0-devfrom
feat/templates-core-text

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

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 invoice
and proposal could only reach them through cv or the Gen-2 surface. Moving them to a
family-neutral templates.core.text lets every family share one text layer. Renaming a
public type is a binary break, so this lands on the 2.0 line.

What changed

  • Moved to templates.core.text: MarkdownText (from templates.components); and
    CvTextStylesTextStyles, MarkdownInline, RichParagraphRenderer, TextOrnaments
    (from cv.v2.components). Added core/text/package-info.java.
  • Stayed in cv.v2.components: ParagraphPrimitive (package-private) and
    ParagraphRenderer — CV-section plumbing used only by the CV section renderers
    (Entry / Row / Skills / Paragraph), not cross-family.
  • Repointed all callers: cv.v2, coverletter.v2, the Gen-2 cv / coverletter
    presets, and the active invoice / proposal builders (which already used MarkdownText).
    Relocated MarkdownInlineTestcore.text.
  • Import note: several presets already use a wildcard cv.v2.components.*; the move
    adds 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.components
text 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 runs
    report-only and its report documents the move (core.text.* added; cv/coverletter
    signatures repointed).
  • examples test-compile + GenerateAllExamples → every example PDF regenerates.

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.
@DemchaAV DemchaAV force-pushed the feat/templates-core-text branch from f01a3c1 to d831f43 Compare June 27, 2026 22:51
@DemchaAV DemchaAV merged commit dfcae82 into 2.0-dev Jun 27, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/templates-core-text branch June 27, 2026 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant