@eventcatalog/core 2.0.19 → 2.0.22

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,23 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.0.22
4
+
5
+ ### Patch Changes
6
+
7
+ - 58a02a1: chore(core): removed console logs
8
+
9
+ ## 2.0.21
10
+
11
+ ### Patch Changes
12
+
13
+ - 22e4b6d: fix(core): fixed issues with styling
14
+
15
+ ## 2.0.20
16
+
17
+ ### Patch Changes
18
+
19
+ - 5de772b: fix(core): fixed typescript errors
20
+
3
21
  ## 2.0.19
4
22
 
5
23
  ### 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.22",
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>
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  import AccordionClient from './Accordion'
3
3
  const {...props } = Astro.props;
4
- console.log('props', props )
5
4
  ---
6
5
 
7
6
  <AccordionClient {...props} client:load>
@@ -1,7 +1,4 @@
1
1
  ---
2
- import AccordionClient from './Accordion';
3
- const { ...props } = Astro.props;
4
- console.log('props', props);
5
2
  ---
6
3
 
7
4
  <div class="accordian-group border border-gray-200 rounded-md shadow-sm accordion my-2">
@@ -2,7 +2,6 @@ import { useEffect, useState } from 'react';
2
2
 
3
3
  // @ts-ignore
4
4
  import { JsonSchemaViewer } from '@stoplight/json-schema-viewer';
5
- import styles from './SchemaViewer.module.css';
6
5
 
7
6
  import '@stoplight/mosaic/styles.css';
8
7
  import { createPortal } from 'react-dom';
@@ -49,7 +48,6 @@ const SchemaViewer = ({
49
48
  defaultExpandedDepth={defaultExpandedDepth}
50
49
  renderRootTreeLines={renderRootTreeLines}
51
50
  hideExamples={hideExamples}
52
- className={styles.schemaViewer}
53
51
  />
54
52
  </div>
55
53
  </section>,
@@ -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>
@@ -31,8 +31,6 @@ export async function getStaticPaths() {
31
31
 
32
32
  const props = Astro.props;
33
33
 
34
- console.log('TEST');
35
-
36
34
  const {
37
35
  data: { id },
38
36
  collection,
@@ -11,8 +11,6 @@ import Layout from '../../layouts/VisualiserLayout.astro'
11
11
  // Find the total anchor links
12
12
  const totalAnchorLinks = document.getElementById('visualiser-navigation').querySelectorAll('a');
13
13
 
14
- console.log('totalAnchorLinks.length', totalAnchorLinks.length)
15
-
16
14
  // Show no-items if there are none
17
15
  if(totalAnchorLinks.length === 0) {
18
16
  document.querySelector('.no-items').classList.remove('hidden');
@@ -1,9 +0,0 @@
1
- /* Custom styling for the schema viewer */
2
- .schemaViewer :global(.svg-inline--fa) {
3
- width: 1.25em;
4
- height: 1em;
5
- }
6
-
7
- .schemaViewer p, span {
8
- color: rgb(111, 111, 111) !important;
9
- }