refactor(templates): extract the identity layer to templates.core.identity (PartyIdentity)#250
Merged
Merged
Conversation
1cdb588 to
00572ac
Compare
…ntity Introduce a family-neutral PartyIdentity contract (displayName / tagline / contact / links) in com.demcha.compose.document.templates.core.identity and move the shared header widgets (Headline, ContactLine, Masthead, Subheadline, SvgGlyph) plus the Contact (was CvContact) and Link (was CvLink) records there. Headline now renders a String name and ContactLine / Masthead accept a PartyIdentity, so any family can reuse them. CvName and CvIdentity stay in cv.v2.data, with CvIdentity implementing PartyIdentity, so most call sites are unchanged (a CvIdentity is a PartyIdentity); Headline callers pass name().full(). Render is byte-identical (1607 tests, 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.
00572ac to
995d4ca
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
A masthead is the same shape in every document family — a name, an optional
tagline, a contact block, and a set of links — but the contract and the widgets
that draw it lived in
cv.v2and were person-shaped (CvName,CvIdentity).Extracting a family-neutral
PartyIdentitycontract plus the header widgets intotemplates.core.identitylets invoice / proposal reuse them with their own orgrecord. Retyping public widgets is a binary break, so this lands on the 2.0 line.
What changed
core.identity.PartyIdentity—displayName()/tagline()/contact()/links().core.identity: the header widgetsHeadline,ContactLine,Masthead,Subheadline,SvgGlyph, plus theContact(wasCvContact) andLink(wasCvLink) records. Addedcore/identity/package-info.java.Headlinenow renders aStringname (it only ever renderedname.full());ContactLine/Mastheadaccept aPartyIdentityand readdisplayName()/tagline()/contact()/links().cv.v2.data:CvName(person first/middle/last) andCvIdentity— now
implements PartyIdentity(displayName() = name().full(),tagline() = jobTitle()).CvIdentityis-aPartyIdentity, soContactLine/Mastheadcallers don't change;Headlinecallers passname().full(). The Gen-2cvpresets that reached intocv.v2.widgets.SvgGlyphare repointed to
core.identity.SvgGlyph.Naming note:
core.identity.Linkcoexists with the internalengine.components.renderable.Link— different layers, no single file importsboth, so there is no clash.
Lane: templates (canonical). Target:
2.0-dev. Pure move/rename/extract —no behavioural change.
Deferred to the docs refresh:
.mdmentions of the old FQNs.Verification
./mvnw test -pl .→Tests run: 1607, Failures: 0, Errors: 0— zero snapshotupdates → render is byte-identical.
./mvnw -P japicmp verify -pl .→ BUILD SUCCESS; javadoc gate clean; japicmpruns report-only and its report documents the move.
examplestest-compile +GenerateAllExamples→ every example PDF regenerates.