@eventcatalog/core 2.0.19 → 2.0.20

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,11 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.0.20
4
+
5
+ ### Patch Changes
6
+
7
+ - 5de772b: fix(core): fixed typescript errors
8
+
3
9
  ## 2.0.19
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.0.19",
4
+ "version": "2.0.20",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -17,7 +17,8 @@ const users = await getUsers();
17
17
 
18
18
  const messages = [...events, ...commands];
19
19
 
20
- const allData = [ ...domains, ...services, ...messages, ...teams, ...users];
20
+ // @ts-ignore for large catalogs https://github.com/event-catalog/eventcatalog/issues/552
21
+ const allData = [...domains, ...services, ...messages, ...teams, ...users];
21
22
 
22
23
  const eventCatalogConfig = config as CatalogConfig;
23
24
  const { services: servicesConfig, domains: domainsConfig, messages: messagesConfig, teams: teamsConfig, users: usersConfig, showPageHeadings = true } = eventCatalogConfig?.docs?.sidebar || {};
@@ -26,7 +27,7 @@ const getConfigValue = (obj: any, key:string, defaultValue: any) => {
26
27
  return obj?.[key] ?? defaultValue;
27
28
  }
28
29
 
29
- const visibleCollections = {
30
+ const visibleCollections: {[key:string]: boolean} = {
30
31
  events: getConfigValue(messagesConfig, 'visible', true),
31
32
  commands: getConfigValue(messagesConfig, 'visible', true),
32
33
  domains: getConfigValue(domainsConfig, 'visible', true),
@@ -76,36 +77,36 @@ const currentPath = Astro.url.pathname;
76
77
  ---
77
78
 
78
79
  <div class="font-light w-full xl:pr-10 pb-20 ">
79
- {
80
- Object.keys(sideNav).map((key) => {
81
- const collection = sideNav[key];
82
- if(collection[0] && collection[0].visible === false) return null;
83
- return (
84
- <ul class=" w-full space-y-2 pb-8">
85
- <li class="font-semibold capitalize ">{key}</li>
86
- {collection.map((item: any) => {
87
- return (
80
+ {
81
+ Object.keys(sideNav).map((key) => {
82
+ const collection = sideNav[key];
83
+ if(collection[0] && collection[0].visible === false) return null;
84
+ return (
85
+ <ul class=" w-full space-y-2 pb-8">
86
+ <li class="font-semibold capitalize ">{key}</li>
87
+ {collection.map((item: any) => {
88
+ return (
88
89
  <li class="px-2 w-full text-md xl:text-lg border-l border-gray-200 space-y-2 scroll-m-20" id={item.href} >
89
90
  <a class={`flex justify-between items-center w-full px-2 rounded-md font-normal ${currentPath.includes(item.href) ? 'bg-purple-200 text-purple-800 ' : 'font-thin'}`} href={`${item.href}`}>
90
- <span class="block">{item.label}</span>
91
+ <span class="block">{item.label}</span>
91
92
  {item.version && <span class="block text-sm bg-purple-100 p-0.5 px-1 text-gray-600 rounded-md font-light">v{item.version}</span>}
92
- </a>
93
- <ul class="hidden xl:block px-4 text-gray-500 text-md space-y-2 ">
94
- {item.items.map((heading: any) => {
95
- return (
96
- <li class="text-xs">
97
- <a href={`${item.href}/#${heading.slug}`}>{heading.text}</a>
98
- </li>
99
- );
100
- })}
101
- </ul>
102
- </li>
103
- );
104
- })}
105
- </ul>
106
- );
107
- })
108
- }
93
+ </a>
94
+ <ul class="hidden xl:block px-4 text-gray-500 text-md space-y-2 ">
95
+ {item.items.map((heading: any) => {
96
+ return (
97
+ <li class="text-xs">
98
+ <a href={`${item.href}/#${heading.slug}`}>{heading.text}</a>
99
+ </li>
100
+ );
101
+ })}
102
+ </ul>
103
+ </li>
104
+ );
105
+ })}
106
+ </ul>
107
+ );
108
+ })
109
+ }
109
110
  </div>
110
111
 
111
112
  <script>
@@ -11,8 +11,9 @@ import type { CollectionEntry } from 'astro:content';
11
11
  import { ViewTransitions } from 'astro:transitions';
12
12
 
13
13
  const [services, events, commands, domains] = await Promise.all([getServices(), getEvents(), getCommands(), getDomains()]);
14
- const navItems = [...domains, ...services, ...events, ...commands];
15
14
 
15
+ // @ts-ignore for large catalogs https://github.com/event-catalog/eventcatalog/issues/552
16
+ const navItems = [...domains, ...services, ...events, ...commands];
16
17
 
17
18
  const navigation = navItems.reduce((acc, item) => {
18
19
  // @ts-ignore
@@ -41,13 +42,15 @@ const getColor = (collection: string) => {
41
42
  return 'gray';
42
43
  }
43
44
  };
44
-
45
45
  ---
46
46
 
47
47
  <PlainPage title={title} description={description}>
48
48
  <div class="flex min-h-full flex-row md:flex-col">
49
49
  <div class="mx-auto flex flex-col-reverse md:flex-row w-full items-start">
50
- <aside class="md:sticky mt-14 md:mt-0 top-0 w-full md:w-60 xl:w-[19em] shrink-0 lg:block font-light pr-10" id="visualiser-navigation">
50
+ <aside
51
+ class="md:sticky mt-14 md:mt-0 top-0 w-full md:w-60 xl:w-[19em] shrink-0 lg:block font-light pr-10"
52
+ id="visualiser-navigation"
53
+ >
51
54
  {
52
55
  Object.keys(navigation).map((key: any) => {
53
56
  const items = navigation[key].map((item: any) => {
@@ -57,15 +60,23 @@ const getColor = (collection: string) => {
57
60
  version: item.data.version,
58
61
  color: getColor(item.collection),
59
62
  href: buildUrl(`/visualiser/${item.collection}/${item.data.id}/${item.data.version}`),
60
- active: isCurrent
61
- }
63
+ active: isCurrent,
64
+ };
62
65
  });
63
- return <BasicList title={`${key} (${navigation[key].length})`} items={items} emptyMessage='Nothing to show' color="gray" client:load />
66
+ return (
67
+ <BasicList
68
+ title={`${key} (${navigation[key].length})`}
69
+ items={items}
70
+ emptyMessage="Nothing to show"
71
+ color="gray"
72
+ client:load
73
+ />
74
+ );
64
75
  })
65
76
  }
66
77
  </aside>
67
78
 
68
- <main class="flex-1 h-full w-full " >
79
+ <main class="flex-1 h-full w-full">
69
80
  <slot />
70
81
  </main>
71
82
  </div>