Repository navigation
refactor(posts): map frontmatter DTOs and share the date formatter - #32
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
helderberto
force-pushed
the
refactor/structure-5-lint
branch
from
October 24, 2026 10:55
4b8afb3 to
e504986
Compare
Post frontmatter is external data: type it as PostFrontmatterDto at the parse boundary (parseMarkdown in the gray-matter wrapper) and turn it into a Post with toPostSummary and toPost. Output is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DZqAJbwwPeQSQFaPLDDSfr
PostCard and PostHeader each formatted the frontmatter date in UTC; both now call formatPostDate with a short or long style. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DZqAJbwwPeQSQFaPLDDSfr
helderberto
force-pushed
the
refactor/structure-6-posts
branch
from
October 24, 2026 10:55
c225430 to
d41fec6
Compare
This branch was successfully deployed
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.
Context
Part 6 of 7, based on part 5. Post frontmatter is external data and was read as
any; two components formatted dates separately.Summary
parseMarkdown<T>()inlib/gray-matteris the one place the untyped frontmatter gets a type.PostFrontmatterDto/PostFileDtointypes/post.ts;toPostSummaryandtoPostinfeatures/posts/post-mapper.tsmap them toPost. Same fields, same order, same defaults.features/posts/format-post-date.ts(short/long, always UTC) replaces the formatting in PostCard and PostHeader. It stays in the feature: only posts use it.Evidence
fsmocks.posts.test.tskeeps the file-reading integration. Changing words per minute, the tags default or the lastModified fallback each fails a test. The formatter is tested inAmerica/Sao_Paulo, and droppingtimeZone: 'UTC'fails it.Merge danger
Door: two-way
Blast radius: posts
Generated by Claude Code