Skip to content

Commit

Permalink
Merge branch 'main' into refactor/setup-workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosallexandre committed Dec 10, 2024
2 parents 3f561a0 + bc098da commit c903ccd
Show file tree
Hide file tree
Showing 45 changed files with 690 additions and 361 deletions.
2 changes: 1 addition & 1 deletion examples/default/domains/Orders/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ services:
- id: NotificationService
version: 0.0.2
- id: OrdersService
version: 0.0.2
version: 0.0.3
badges:
- content: New domain
backgroundColor: blue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ receives:
- id: InventoryAdjusted
version: 0.0.3
- id: GetOrder
- id: UserSubscriptionCancelled
sends:
- id: OrderAmended
- id: OrderCancelled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ receives:
- id: PaymentInitiated
version: 0.0.1
- id: GetPaymentStatus
- id: UserSubscriptionStarted
- id: InventoryAdjusted
sends:
- id: PaymentProcessed
version: 0.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ receives:
- id: CancelSubscription
version: 0.0.1
- id: GetSubscriptionStatus
- id: PaymentProcessed
version: 0.0.1
sends:
- id: UserSubscriptionStarted
version: 0.0.1
Expand Down
335 changes: 42 additions & 293 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @eventcatalog/core

## 2.16.3

### Patch Changes

- 9c84f9c: feat(core): added inital version of the domain map to visualizer

## 2.16.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/core/eventcatalog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@stoplight/mosaic": "^1.53.2",
"@tailwindcss/typography": "^0.5.13",
"@tanstack/react-table": "^8.17.3",
"@xyflow/react": "^12.3.6",
"astro": "^4.16.5",
"astro-expressive-code": "^0.36.1",
"astro-pagefind": "^1.6.0",
Expand All @@ -47,7 +48,6 @@
"rapidoc": "^9.3.4",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"reactflow": "^11.11.4",
"rehype-slug": "^6.0.0",
"remark-gfm": "^3.0.1",
"semver": "7.6.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function Example({ title, children }: any) {
<div className="border border-gray-200 rounded-md px-4 shadow-sm py-2 accordion">
<Disclosure as="div" key={title} className="">
{({ open }) => (
<>
<div>
<DisclosureButton className="flex w-full items-start justify-between text-left text-gray-900">
<span className="text-base font-semibold leading-7">{title}</span>
<span className="ml-6 flex h-7 items-center">
Expand All @@ -21,7 +21,7 @@ export default function Example({ title, children }: any) {
<DisclosurePanel as="dd" className="pr-12 not-prose py-4">
<p className="text-base leading-7 text-gray-600">{children}</p>
</DisclosurePanel>
</>
</div>
)}
</Disclosure>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import Admonition from '../Admonition';

<div class="mb-4">
<Admonition type="warning">
<>
<div>
<span class="block font-bold">{`<AsyncAPI/>`} component now deprecated</span>
<span class="block"
>Use the new specifications frontmatter api. <a href="https://www.eventcatalog.dev/docs/api/service-api"
>Read more here.</a
></span
>
</>
</div>
</Admonition>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ const ChannelParameters = (data: CollectionEntry<'channels'>['data']) => {
<div>
<p className="text-md">
{data.address && (
<>
<div>
<span className="font-semibold">Address:</span> <code className="bg-gray-100 p-1 rounded">{data.address}</code>
</>
</div>
)}
{data.protocols && data.protocols.length > 0 && (
<div className="mt-2 flex items-center space-x-1">
Expand Down
4 changes: 2 additions & 2 deletions packages/core/eventcatalog/src/components/MDX/Flow/Flow.astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ const { nodes, edges } = await getNodesAndEdges({
{
!flow && (
<Admonition type="warning">
<>
<div>
<span class="block font-bold">{`<Flow/>`} failed to load</span>
<span class="block">
Tried to load flow id: {id} with version {version}. Make sure you have this flow defined in your project.
</span>
</>
</div>
</Admonition>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Panel, useReactFlow, getNodesBounds, getViewportForBounds } from 'reactflow';
import { Panel, useReactFlow, getNodesBounds, getViewportForBounds } from '@xyflow/react';
import { toPng } from 'html-to-image';
import { DocumentArrowDownIcon } from '@heroicons/react/24/outline';

Expand All @@ -19,7 +19,7 @@ function DownloadButton({ filename, addPadding = true }: { filename?: string; ad
const nodesBounds = getNodesBounds(getNodes());
const width = imageWidth > nodesBounds.width ? imageWidth : nodesBounds.width;
const height = imageHeight > nodesBounds.height ? imageHeight : nodesBounds.height;
const viewport = getViewportForBounds(nodesBounds, width, height, 0.5, 2);
const viewport = getViewportForBounds(nodesBounds, width, height, 0.5, 2, 0);

// Hide the button
// @ts-ignore
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { BaseEdge, getBezierPath } from 'reactflow';
import { BaseEdge, getBezierPath } from '@xyflow/react';

const AnimatedMessageEdge = ({
id,
Expand Down Expand Up @@ -44,6 +44,7 @@ const AnimatedMessageEdge = ({
const randomDelay = useMemo(() => Math.random() * 1, []);

return (
// @ts-ignore
<>
<BaseEdge id={id} path={edgePath} markerEnd={markerEnd} />
{/* Circle Icon */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import {
getNodesAndEdgesForEvents,
getNodesAndEdgesForQueries,
} from '@utils/node-graphs/message-node-graph';
import { getNodesAndEdges as getNodesAndEdgesForDomain } from '@utils/node-graphs/domains-node-graph';
import {
getNodesAndEdges as getNodesAndEdgesForDomain,
getNodesAndEdgesForDomainContextMap,
} from '@utils/node-graphs/domains-node-graph';
import { getNodesAndEdges as getNodesAndEdgesForFlows } from '@utils/node-graphs/flows-node-graph';
interface Props {
Expand All @@ -24,8 +27,10 @@ interface Props {
}
const { id, collection, title, mode = 'simple', linkTo = 'docs', version, href, linksToVisualiser } = Astro.props;
let nodes = [],
edges = [];
const getNodesAndEdgesFunctions = {
services: getNodesAndEdgesForService,
events: getNodesAndEdgesForEvents,
Expand All @@ -47,6 +52,12 @@ if (collection in getNodesAndEdgesFunctions) {
nodes = fetchedNodes;
edges = fetchedEdges;
}
if (collection === 'domain-context-map') {
const { nodes: fetchedNodes, edges: fetchedEdges } = await getNodesAndEdgesForDomainContextMap({});
nodes = fetchedNodes;
edges = fetchedEdges;
}
---

<div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useMemo, useState, useCallback, useRef } from 'react';
import { createPortal } from 'react-dom';
import ReactFlow, {
import {
ReactFlow,
Background,
ConnectionLineType,
Controls,
Expand All @@ -11,8 +12,8 @@ import ReactFlow, {
type Edge,
type Node,
useReactFlow,
} from 'reactflow';
import 'reactflow/dist/style.css';
} from '@xyflow/react';
import '@xyflow/react/dist/style.css';

// Nodes and edges
import ServiceNode from './Nodes/Service';
Expand Down Expand Up @@ -105,10 +106,10 @@ const NodeGraphBuilder = ({
(_: any, node: Node) => {
if (linksToVisualiser) {
if (node.type === 'events' || node.type === 'commands') {
navigate(getVisualiserUrlForCollection(node.data.message));
navigate(getVisualiserUrlForCollection(node.data.message as CollectionEntry<CollectionTypes>));
}
if (node.type === 'services') {
navigate(getVisualiserUrlForCollection(node.data.service));
navigate(getVisualiserUrlForCollection(node.data.service as CollectionEntry<'services'>));
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { BoltIcon } from '@heroicons/react/16/solid';
import { ArrowsRightLeftIcon } from '@heroicons/react/20/solid';
import type { CollectionMessageTypes, CollectionTypes } from '@types';
import type { CollectionEntry } from 'astro:content';
import { Handle } from 'reactflow';
import { Handle } from '@xyflow/react';

interface Data {
title: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ChatBubbleLeftIcon } from '@heroicons/react/16/solid';
import type { CollectionEntry } from 'astro:content';
import { Handle } from 'reactflow';
import { Handle } from '@xyflow/react';

interface Data {
title: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BoltIcon } from '@heroicons/react/16/solid';
import type { CollectionEntry } from 'astro:content';
import { Handle } from 'reactflow';
import { Handle } from '@xyflow/react';

interface Data {
title: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ServerIcon } from '@heroicons/react/16/solid';
import { GlobeAmericasIcon } from '@heroicons/react/20/solid';
import type { CollectionEntry } from 'astro:content';
import { Handle } from 'reactflow';
import { Handle } from '@xyflow/react';

interface Data {
label: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { MagnifyingGlassIcon } from '@heroicons/react/16/solid';
import type { CollectionEntry } from 'astro:content';
import { Handle } from 'reactflow';
import { Handle } from '@xyflow/react';

interface Data {
title: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ServerIcon } from '@heroicons/react/16/solid';
import type { CollectionEntry } from 'astro:content';
import { Handle } from 'reactflow';
import { Handle } from '@xyflow/react';

interface Data {
label: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Handle } from 'reactflow';
import { Handle } from '@xyflow/react';

interface Data {
title: string;
Expand Down Expand Up @@ -45,7 +45,7 @@ export default function StepNode({ data, sourcePosition, targetPosition }: any)
)}

{summary && (
<>
<div>
<div className={classNames(mode === 'full' ? `border-b border-gray-200` : '')}>
<span className="text-xs font-bold block pb-0.5">{title}</span>
</div>
Expand All @@ -56,7 +56,7 @@ export default function StepNode({ data, sourcePosition, targetPosition }: any)
</div>
</div>
)}
</>
</div>
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { UserIcon } from '@heroicons/react/20/solid';
import { Handle } from 'reactflow';
import { Handle } from '@xyflow/react';

interface Data {
title: string;
Expand Down Expand Up @@ -57,7 +57,7 @@ export default function UserNode({ data, sourcePosition, targetPosition }: any)
)}

{summary && mode === 'full' && (
<>
<div>
<div className={classNames(mode === 'full' ? `border-b border-gray-200` : '')}>
<span className="text-xs font-bold block pb-0.5">{name}</span>
</div>
Expand All @@ -68,7 +68,7 @@ export default function UserNode({ data, sourcePosition, targetPosition }: any)
</div>
</div>
)}
</>
</div>
)}
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import Admonition from '../Admonition';

<div class="mb-4">
<Admonition type="warning">
<>
<div>
<span class="block font-bold">{`<OpenAPI/>`} component now deprecated</span>
<span class="block"
>Use the new specifications frontmatter api. <a href="https://www.eventcatalog.dev/docs/api/service-api"
>Read more here.</a
></span
>
</>
</div>
</Admonition>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ try {
{/* User has tried to load the schema, but it was not found on file system */}
{!schema.exists && (
<Admonition type="warning">
<>
<div>
<span class="block font-bold">{`<SchemaViewer/>`} failed to load</span>
<span class="block">Tried to load schema from {schema.schemaPath}, but no schema can be found</span>
</>
</div>
</Admonition>
)}
</div>
Expand Down
8 changes: 4 additions & 4 deletions packages/core/eventcatalog/src/components/Tables/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const Table = ({
});

return (
<>
<div>
{/* <div className='text-right text-gray-400'>{table.getPrePaginationRowModel().rows.length} results</div> */}
<div className=" bg-gray-100/20 rounded-md border-2 border-gray-200 shadow-sm ">
<table className="min-w-full divide-y divide-gray-200 rounded-md ">
Expand Down Expand Up @@ -171,7 +171,7 @@ export const Table = ({
</select>
</div>
</div>
</>
</div>
);
};

Expand Down Expand Up @@ -225,7 +225,7 @@ function Filter({ column }: { column: Column<any, unknown> }) {
}, [column.getFacetedUniqueValues(), filterVariant]);

return (
<>
<div>
{/* Autocomplete suggestions from faceted values feature */}
<datalist id={column.id + 'list'}>
{sortedUniqueValues.map((value: any, index) => (
Expand All @@ -241,6 +241,6 @@ function Filter({ column }: { column: Column<any, unknown> }) {
list={column.id + 'list'}
/>
<div className="h-1" />
</>
</div>
);
}
Loading

0 comments on commit c903ccd

Please sign in to comment.