Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…moryFeedAdapter, and system objects - Add IFeedService contract to @objectstack/spec/contracts - Create @objectstack/service-feed with InMemoryFeedAdapter - Define sys_feed_item, sys_feed_reaction, sys_record_subscription objects - Add FeedServicePlugin for kernel registration - 40 tests for InMemoryFeedAdapter + 4 contract tests - Update ROADMAP.md with service-feed progress Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR implements the @objectstack/service-feed package, providing a complete Feed/Chatter service following the Plugin + Adapter pattern established by other service packages like service-i18n and service-realtime. The implementation includes the IFeedService contract, system object metadata definitions with sys_ prefix per #738, an in-memory adapter with comprehensive features, and extensive test coverage.
Changes:
- Added IFeedService contract in
@objectstack/specwith 9 methods covering feed CRUD, reactions, and subscriptions - Implemented 3 system objects (
sys_feed_item,sys_feed_reaction,sys_record_subscription) with proper indexes and field definitions - Created InMemoryFeedAdapter with cursor-based pagination, filtering modes, threading support, reaction management, and subscription upsert semantics
- Added FeedServicePlugin following
com.objectstack.service.*naming convention - Included 44 comprehensive tests (4 contract, 40 adapter unit tests)
- Updated ROADMAP.md to reflect implementation status
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/spec/src/contracts/feed-service.ts |
IFeedService contract definition with feed CRUD, reactions, and subscriptions methods |
packages/spec/src/contracts/feed-service.test.ts |
Contract compliance tests verifying interface implementation |
packages/spec/src/contracts/index.ts |
Export for feed-service contract |
packages/services/service-feed/src/objects/feed-item.object.ts |
System object definition for sys_feed_item with 13 activity types and threading support |
packages/services/service-feed/src/objects/feed-reaction.object.ts |
System object definition for sys_feed_reaction with unique constraint per user/emoji |
packages/services/service-feed/src/objects/record-subscription.object.ts |
System object definition for sys_record_subscription with event/channel arrays |
packages/services/service-feed/src/objects/index.ts |
Object metadata exports |
packages/services/service-feed/src/in-memory-feed-adapter.ts |
InMemoryFeedAdapter implementing IFeedService with full feature set |
packages/services/service-feed/src/in-memory-feed-adapter.test.ts |
40 comprehensive unit tests covering all adapter functionality |
packages/services/service-feed/src/feed-service-plugin.ts |
FeedServicePlugin for kernel integration |
packages/services/service-feed/src/index.ts |
Package exports |
packages/services/service-feed/package.json |
Package configuration with dependencies and scripts |
packages/services/service-feed/tsconfig.json |
TypeScript configuration |
pnpm-lock.yaml |
Dependency lockfile update for new package |
ROADMAP.md |
Updated Phase 4c table, implementation tracker (row 15→576), package registry (row 618), and summary count (14 implemented) |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
| * Follows Dependency Inversion Principle - plugins depend on this interface, | ||
| * not on concrete feed service implementations. | ||
| * | ||
| * Aligned with CoreServiceName 'feed' in core-services.zod.ts. |
There was a problem hiding this comment.
The comment on line 14 states "Aligned with CoreServiceName 'feed' in core-services.zod.ts", but 'feed' is not actually present in the CoreServiceName enum (packages/spec/src/system/core-services.zod.ts). Other similar services like 'realtime' and 'i18n' are included in CoreServiceName. The 'feed' service name should be added to the CoreServiceName enum to maintain consistency with the established pattern and to enable proper service registration validation.
| * Aligned with CoreServiceName 'feed' in core-services.zod.ts. | |
| * Service contract for the feed/chatter core service within the ObjectStack runtime. |
Feed/Chatter protocol layer exists (
feed.zod.ts,feed-api.zod.ts,subscription.zod.ts) but lacks a service implementation and persistent object definitions. This adds@objectstack/service-feedfollowing the Plugin + Adapter pattern established byservice-i18nandservice-realtime.IFeedService Contract (
packages/spec/src/contracts/feed-service.ts)listFeed,createFeedItem,updateFeedItem,deleteFeedItem,getFeedItemaddReaction,removeReactionsubscribe,unsubscribe,getSubscriptionSystem Object Metadata (
packages/services/service-feed/src/objects/)sys_feed_item— 13 activity types, threading viaparent_id/reply_count, visibility levelssys_feed_reaction— Unique constraint on(feed_item_id, emoji, user_id)sys_record_subscription— Event type + channel arrays, unique per(object, record_id, user_id)All use
sys_prefix per #738 naming convention. Objects live in the service package, not in spec/core.InMemoryFeedAdapter
all,comments_only,changes_only,tasks_onlyFeedServicePlugin
com.objectstack.service.feed, registers as'feed'serviceTests
InMemoryFeedAdapter(CRUD, filtering, pagination, threading, reactions, subscriptions, edge cases)IFeedServiceROADMAP
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.