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

feat([AsyncApi]): add asyncapi viewer #747

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

XaaXaaX
Copy link
Contributor

@XaaXaaX XaaXaaX commented Aug 31, 2024

Issue : #746

Motivation

Having a comprehensive and standard rendering of asyncapi spec can be useful for users as a used to visualization that they are confortable with

Copy link

changeset-bot bot commented Aug 31, 2024

🦋 Changeset detected

Latest commit: 4540281

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eventcatalog/core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@boyney123 boyney123 marked this pull request as ready for review September 1, 2024 10:26
@boyney123 boyney123 self-requested a review as a code owner September 1, 2024 10:26
@boyney123
Copy link
Collaborator

Thank you @XaaXaaX I have reviewed, looking great!

Actually whilst I was reviewing and fixing some stuff, I had a rethink of some things and actually going to make some changes to the AsyncAPI and OpenAPI components.

Problems

These components both rely on certain hacks and custom JS to get working in EventCataog cost they are MDX components, and it's hard to share the configuration around the application this way. The component itself was just rendering a title with a link.... so given this I have decided to remove them as MDX componnets in favour of frontmatter API.

Why frontmater API

This allows EventCatalog to read all domains, services and messages and check if they have any openapi spec or asyncapi spec on them, benefits we get

  • The openapi and asyncapi pages will only build/render if the resource has them
  • New badges and links have been added to the sidebar.
  • People can now name there asyncapi/openapi files anything they want.

New API looks like this

---
id: OrdersService
version: 0.0.2
name: Orders Service
summary: |
  Service that handles orders
owners:
    - dboyne
receives:
  - id: InventoryAdjusted
    version: 0.0.3
sends:
  - id: AddInventory  
    version: 0.0.3
repository:
  language: JavaScript
  url: https://github.com/boyney123/pretend-shipping-service
schemaPath: "openapi.yml"
specifications:
  asyncapiPath: order-service-asyncapi.yaml
  openapiPath: openapi.yml
---

import Footer from '@catalog/components/footer.astro';

## Overview

The Orders Service is responsible for managing customer orders within the system. It handles order creation, updating, status tracking, and interactions with other services such as Inventory, Payment, and Notification services to ensure smooth order processing and fulfillment.

## Architecture diagram 

<NodeGraph />

<Footer />

Here is a new specifications (optional) frontmatter config, where people can add openapi or asyncapi paths to it.

This is a breaking change, but I think its for the better and cleans up our code!

Thank you for the time for the PR @XaaXaaX !

@boyney123 boyney123 merged commit 76bebd7 into event-catalog:main Sep 5, 2024
3 checks passed
@boyney123
Copy link
Collaborator

@all-contributors add @XaaXaaX for code

Copy link
Contributor

@boyney123

I've put up a pull request to add @XaaXaaX! 🎉

@XaaXaaX XaaXaaX deleted the feat/asyncapi-viewer branch September 9, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants