Skip to content

refactor(templates): extract the theme layer to templates.core (CvTheme → BrandTheme)#248

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

refactor(templates): extract the theme layer to templates.core (CvTheme → BrandTheme)#248
DemchaAV merged 1 commit into
2.0-devfrom
feat/templates-core-theme

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

The shared theme layer (palette / typography / spacing / decoration) lives inside
cv.v2, and coverletter.v2 reaches into it — so CV is the de-facto owner of tokens
that are not CV-specific. To let invoice, proposal, and any future family build on the
same theme without depending on cv, the theme records move to a family-neutral
templates.core. Renaming public records is a binary break, so this lands on the 2.0
line.

What changed

  • Moved cv.v2.theme.{CvTheme, CvPalette, CvTypography, CvSpacing, CvDecoration}
    templates.core.theme.{BrandTheme, Palette, Typography, Spacing, Decoration}.
  • Repointed every caller across cv.v2, coverletter.v2, examples and tests (82 files).
  • Moved the theme test mirror to core.theme.DecorationTest.
  • Pure rename / move — no behavioural change.

Lane: templates (canonical). Target: 2.0-dev.

Deferred to the Stage-1 docs refresh: markdown docs that still name CvTheme
(api-stability §4, package-map, cv/v2/AUTHORS.md, ADR-0015, recipes) are updated in a
follow-up doc pass — kept out of this diff so the rename stays reviewable. Import order
in repointed files is not re-sorted (no import-order gate; avoids noise here).

Verification

  • ./mvnw test -pl .Tests run: 1607, Failures: 0, Errors: 0. All snapshot and
    visual-parity tests pass with zero snapshot updates → render is byte-identical.
  • ./mvnw -P japicmp verify -pl . → BUILD SUCCESS; javadoc gate clean. japicmp runs
    report-only on the 2.0 line and its report documents the intended break
    (core.theme.* added; CV preset / LetterBody signatures change CvThemeBrandTheme).
  • examples test-compile + GenerateAllExamples → every example PDF regenerates.

Comment on lines +39 to +42
BrandTheme theme = new BrandTheme(
Palette.classic(),
Typography.classic(),
Spacing.classic());
…me -> BrandTheme)

Move the cv.v2 theme records — CvTheme, CvPalette, CvTypography, CvSpacing,
CvDecoration — into a family-neutral com.demcha.compose.document.templates.core.theme
package, renamed BrandTheme / Palette / Typography / Spacing / Decoration, so no
template family owns the shared theme layer. Repoint every cv.v2 / coverletter.v2
caller. Render is byte-identical (1607 tests green, zero snapshot updates); the
rename is a deliberate binary break on the 2.0 line (japicmp is report-only here),
captured in the japicmp report. Markdown docs still naming CvTheme are updated in
the Stage-1 docs refresh.
@DemchaAV DemchaAV force-pushed the feat/templates-core-theme branch from afd13a2 to b115afc Compare June 27, 2026 22:12
@DemchaAV DemchaAV merged commit 5dc5475 into 2.0-dev Jun 27, 2026
11 checks passed
@DemchaAV DemchaAV deleted the feat/templates-core-theme branch June 27, 2026 22:18
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.

2 participants