Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document events directly into domains (without services) #1046

Open
boyney123 opened this issue Dec 18, 2024 · 3 comments
Open

Document events directly into domains (without services) #1046

boyney123 opened this issue Dec 18, 2024 · 3 comments

Comments

@boyney123
Copy link
Collaborator

Use Case

Speaking to a few folks, so capturing this here, and curious if you would find it useful to, if you do upvote this issue.

This feature would let people document events directly inside domains.

At the moment the relationship in EventCatalog is domains > services > messages.

This new proposal would like people do domains > events.

How it would work is simple, a folder domain/MyDomain/events and the events would be rendered in the Catalog.

Similar #545

Proposed Solution

No response

Implementation Notes

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out in the EventCatalog Discord.
@carlosallexandre
Copy link
Contributor

carlosallexandre commented Dec 18, 2024

The mapCatalogToAstro supports this as it resolves the path from right to left. All it needs is find the reserved keywords whenever it is placed, like below:

  • events/MyEvent/index.md turns in events/MyEvent/index.mdx
  • services/MyService/events/MyEvent/index.md turns in events/MyEvent/index.mdx
  • domains/MyDomain/services/MyService/events/MyEvent/index.md turns in events/MyEvent/index.mdx

The image below is an example:
image

But we have a bug...

  1. Run the default example in the development mode npx eventcatalog dev
  2. Add an empty dir domains/Orders/events/.
  3. The watcher will try create a public/generated/events/ overriding the already created from the hydration phase. Throwing an error.

@otbe
Copy link
Contributor

otbe commented Dec 19, 2024

2 things come to my mind:

  1. I think whatever we do here we should avoid breaking old URLs. Lets say when I move MyEvent from /events/MyEvent to domains/MyDomain/events/MyEvent it would be nice if events/MyEvent still works afterwards.
  2. This only provides real value when we also show this relationship to the user. E.g. a dedicated section in the event page sidebar which states what domain this event belongs to, column/filter in discover/events, a section of events in this domain on the domain page, etc.

Both could be accomplished by simply adding a new frontmatter key to the event spec that allows you to define a domain which then creates the relationship 🤔

@XaaXaaX
Copy link
Contributor

XaaXaaX commented Dec 20, 2024

Just something in mind,

Today the messages are under a service spec documentation openapi/asyncapi, etc.
what will happen to that relationship?

I think messages are a collection representing a service contract

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

No branches or pull requests

4 participants