Skip to content

feat(blog): add blog app with loaders and commerce factory#75

Merged
guitavano merged 4 commits into
mainfrom
feat/blog-app
Jun 5, 2026
Merged

feat(blog): add blog app with loaders and commerce factory#75
guitavano merged 4 commits into
mainfrom
feat/blog-app

Conversation

@guitavano

@guitavano guitavano commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Create reusable blog/ app for TanStack Start sites with types, CMS record access, post filtering/sorting/pagination, and 8 data loaders
  • Add createBlogCommerceLoaders() factory following the same pattern as createVtexCommerceLoaders()
  • Register blog app in registry.ts and add ./blog exports to package.json

Test plan

  • Verify createBlogCommerceLoaders() registers all expected loader keys
  • Test getRecordsByPath reads blog collections from CMS blocks
  • Test BlogPostItem loader resolves a post by slug
  • Test BlogpostListing loader with category/search/sort filtering
  • Verify npm run build passes with no type errors

🤖 Generated with Claude Code


Summary by cubic

Adds a reusable blog app with CMS-backed types, sorting/filtering/pagination utils, and eight loaders (post page, single post, listings, related posts, categories, authors). Registers deco-blog, exports ./blog entry points, provides a createBlogLoaders() factory (alias createBlogCommerceLoaders), and renames the internal loader map to loaderMap.ts. Adds unit tests for core utilities, CMS records access, loaders, and the module.

  • New Features

    • getRecordsByPath() reads CMS collections via loadBlocks() from @decocms/start/cms.
    • Loaders for BlogPostPage, BlogPostItem, BlogpostListing, BlogRelatedPosts, GetCategories, Blogpost, Category, and Author.
    • Unit tests cover post handling (sort/filter/paginate), record retrieval, all loaders, and configure().
  • Migration

    • Spread createBlogLoaders() into your COMMERCE_LOADERS map (alias createBlogCommerceLoaders() kept).
    • If you imported ./blog/commerceLoaders, switch to createBlogLoaders from @decocms/apps-start/blog.
    • Use the manifest loader keys in CMS blocks to resolve blog content.

Written for commit 55759cf. Summary will update on new commits.

Review in cubic

@guitavano guitavano requested a review from a team June 5, 2026 13:50
…tory

Create reusable blog app for TanStack Start sites with:
- Blog types (BlogPost, Author, Category, BlogPostPage, BlogPostListingPage)
- CMS records access via loadBlocks() from @decocms/start/cms
- Post filtering, sorting, and pagination utilities
- 8 loaders (BlogPostPage, BlogPostItem, BlogpostListing, BlogRelatedPosts, GetCategories, Blogpost, Category, Author)
- Commerce loader factory (createBlogCommerceLoaders) following the VTEX pattern
- App module with manifest and registry entry

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
guitavano and others added 2 commits June 5, 2026 11:02
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Blog loaders are not commerce-specific — the file name was misleading.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JonasJesus42
JonasJesus42 previously approved these changes Jun 5, 2026
…module

Cover handlePosts pure functions, getRecordsByPath CMS access,
all 5 loaders, and the blog app configure() entry point (60 tests).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@guitavano guitavano merged commit 60ed247 into main Jun 5, 2026
1 of 2 checks passed
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 4.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants