@eventcatalog/core 2.11.1 → 2.11.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.11.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 5442d40: fix(core): counters on homepage only include latest versions
8
+
9
+ ## 2.11.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 48d61f3: feat(core): added repo support for all resources
14
+
3
15
  ## 2.11.1
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/event-catalog/eventcatalog.git"
7
7
  },
8
8
  "type": "module",
9
- "version": "2.11.1",
9
+ "version": "2.11.3",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -0,0 +1,36 @@
1
+ ---
2
+ import { ScrollText, Workflow, FileDownIcon, Code, Link } from 'lucide-react';
3
+
4
+ interface Props {
5
+ repository?: string;
6
+ language?: string;
7
+ }
8
+
9
+ const { repository, language } = Astro.props;
10
+ ---
11
+
12
+ <div class="mx-auto pb-8 w-full max-w-lg divide-y divide-white/5 rounded-xl bg-white/5">
13
+ <span class="text-sm text-black group-data-[hover]:text-black/80 capitalize">Repository </span>
14
+ <ul role="list" class="space-y-2 mt-2">
15
+ {
16
+ repository && (
17
+ <li class="has-tooltip rounded-md text-gray-600 group px-1 w-full hover:bg-gradient-to-l hover:from-purple-500 hover:to-purple-700 hover:text-white hover:font-normal ">
18
+ <a class={`flex items-center space-x-2`} target="_blank" href={repository}>
19
+ <Link className="h-4 w-4 text-gray-800 group-hover:text-white" strokeWidth={1} />
20
+ <span class="font-light text-sm truncate">{repository}</span>
21
+ </a>
22
+ </li>
23
+ )
24
+ }
25
+ {
26
+ language && (
27
+ <li class=" rounded-md text-gray-600 group px-1 w-full ">
28
+ <div class={`flex items-center space-x-2`}>
29
+ <Code className="h-3 w-3 text-gray-800 " strokeWidth={1} />
30
+ <span class="font-light text-sm truncate">{language}</span>
31
+ </div>
32
+ </li>
33
+ )
34
+ }
35
+ </ul>
36
+ </div>
@@ -1,6 +1,7 @@
1
1
  ---
2
2
  import OwnersList from '@components/Lists/OwnersList';
3
3
  import PillListFlat from '@components/Lists/PillListFlat';
4
+ import RepositoryList from '@components/Lists/RepositoryList.astro';
4
5
  import VersionList from '@components/Lists/VersionList.astro';
5
6
  import { buildUrl } from '@utils/url-builder';
6
7
  import { getEntry, type CollectionEntry } from 'astro:content';
@@ -45,6 +46,11 @@ const ownersList = owners.map((o) => ({
45
46
  client:load
46
47
  />
47
48
  {domain.data.versions && <VersionList versions={domain.data.versions} collectionItem={domain} />}
49
+ {
50
+ domain.data.repository && (
51
+ <RepositoryList repository={domain.data.repository?.url} language={domain.data.repository?.language} />
52
+ )
53
+ }
48
54
  <OwnersList
49
55
  title={`Domain owners (${ownersList.length})`}
50
56
  owners={ownersList}
@@ -7,6 +7,7 @@ import * as path from 'path';
7
7
  import VersionList from '@components/Lists/VersionList.astro';
8
8
  import { buildUrl } from '@utils/url-builder';
9
9
  import { FileDownIcon, ScrollText, Workflow } from 'lucide-react';
10
+ import RepositoryList from '@components/Lists/RepositoryList.astro';
10
11
  interface Props {
11
12
  message: CollectionEntry<CollectionMessageTypes>;
12
13
  }
@@ -122,6 +123,12 @@ const schemaURL = path.join(publicPath, schemaFilePath || '');
122
123
  client:load
123
124
  />
124
125
 
126
+ {
127
+ message.data.repository && (
128
+ <RepositoryList repository={message.data.repository?.url} language={message.data.repository?.language} />
129
+ )
130
+ }
131
+
125
132
  <div class="space-y-2">
126
133
  {
127
134
  message?.data?.schemaPath && (
@@ -1,11 +1,12 @@
1
1
  ---
2
2
  import OwnersList from '@components/Lists/OwnersList';
3
3
  import PillListFlat from '@components/Lists/PillListFlat';
4
+ import RepositoryList from '@components/Lists/RepositoryList.astro';
4
5
  import SpecificationsList from '@components/Lists/SpecificationsList.astro';
5
6
  import VersionList from '@components/Lists/VersionList.astro';
6
7
  import { buildUrl } from '@utils/url-builder';
7
8
  import { getEntry, type CollectionEntry } from 'astro:content';
8
- import { ScrollText, Workflow, FileDownIcon } from 'lucide-react';
9
+ import { ScrollText, Workflow, FileDownIcon, Code, Link } from 'lucide-react';
9
10
  import { join } from 'node:path';
10
11
  interface Props {
11
12
  service: CollectionEntry<'services'>;
@@ -79,6 +80,12 @@ const schemaURL = join(publicPath, schemaFilePath || '');
79
80
  client:load
80
81
  />
81
82
 
83
+ {
84
+ service.data.repository && (
85
+ <RepositoryList repository={service.data.repository?.url} language={service.data.repository?.language} />
86
+ )
87
+ }
88
+
82
89
  <div class="space-y-2">
83
90
  {
84
91
  service?.data?.schemaPath && (
@@ -51,6 +51,12 @@ const baseSchema = z.object({
51
51
  badges: z.array(badge).optional(),
52
52
  owners: z.array(ownerReference).optional(),
53
53
  schemaPath: z.string().optional(),
54
+ repository: z
55
+ .object({
56
+ language: z.string().optional(),
57
+ url: z.string().optional(),
58
+ })
59
+ .optional(),
54
60
  specifications: z
55
61
  .object({
56
62
  openapiPath: z.string().optional(),
@@ -17,10 +17,10 @@ import DiscoverInsight from '@components/DiscoverInsight.astro';
17
17
  import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
18
18
  import { BookOpen, BookOpenText, TableProperties, Workflow } from 'lucide-react';
19
19
 
20
- const { commands = [], events = [], queries = [] } = await getMessages();
21
- const domains = await getDomains();
22
- const services = await getServices();
23
- const flows = await getFlows();
20
+ const { commands = [], events = [], queries = [] } = await getMessages({ getAllVersions: false });
21
+ const domains = await getDomains({ getAllVersions: false });
22
+ const services = await getServices({ getAllVersions: false });
23
+ const flows = await getFlows({ getAllVersions: false });
24
24
 
25
25
  const getDefaultUrl = (route: string, defaultValue: string) => {
26
26
  if (domains.length > 0) return buildUrl(`/${route}/domains/${domains[0].data.id}/${domains[0].data.latestVersion}`);
@@ -2,14 +2,28 @@
2
2
  import { getCommands } from '@utils/commands';
3
3
  import { getEvents } from '@utils/events';
4
4
  import { getQueries } from './queries';
5
+ import type { CollectionEntry } from 'astro:content';
5
6
  export { getCommands } from '@utils/commands';
6
7
  export { getEvents } from '@utils/events';
7
8
 
9
+ interface Props {
10
+ getAllVersions?: boolean;
11
+ }
12
+
13
+ type Messages = {
14
+ commands: CollectionEntry<'commands'>[];
15
+ events: CollectionEntry<'events'>[];
16
+ queries: CollectionEntry<'queries'>[];
17
+ };
8
18
  // Main function that uses the imported functions
9
- export const getMessages = async () => {
10
- const commands = await getCommands();
11
- const events = await getEvents();
12
- const queries = await getQueries();
19
+ export const getMessages = async ({ getAllVersions = true }: Props = {}): Promise<Messages> => {
20
+ const commands = await getCommands({ getAllVersions });
21
+ const events = await getEvents({ getAllVersions });
22
+ const queries = await getQueries({ getAllVersions });
13
23
 
14
- return { commands, events, queries };
24
+ return {
25
+ commands: commands as CollectionEntry<'commands'>[],
26
+ events: events as CollectionEntry<'events'>[],
27
+ queries: queries as CollectionEntry<'queries'>[],
28
+ } satisfies Messages;
15
29
  };