@eventcatalog/core 2.0.22 → 2.0.24

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,20 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.0.24
4
+
5
+ ### Patch Changes
6
+
7
+ - db66733: fix(core): favicon having invalid url with default base url configuration
8
+ - 26a4a37: fix perf issues for discover pages in build step
9
+ - f29d718: fix(core): sidebar configuration for section visibility is now optional
10
+ - 3426ea8: fix(core): temp fix for domains for users
11
+
12
+ ## 2.0.23
13
+
14
+ ### Patch Changes
15
+
16
+ - 66a764c: fix(core: fixed additional ts errors)
17
+
3
18
  ## 2.0.22
4
19
 
5
20
  ### Patch Changes
package/global.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ declare global {
2
+ interface Window {
3
+ eventcatalog: any;
4
+ }
5
+ }
6
+
7
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.0.22",
4
+ "version": "2.0.24",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -2,6 +2,7 @@
2
2
  import { SEO } from 'astro-seo';
3
3
  import config from '@config';
4
4
  import defaultImageFile from '../../public/opengraph.png';
5
+ import { buildUrl } from '@utils/url-builder';
5
6
 
6
7
  const {
7
8
  title = config.title,
@@ -30,7 +31,7 @@ if (typeof _image === 'string') {
30
31
  <meta charset="UTF-8" />
31
32
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
32
33
  <meta name="viewport" content="width=device-width" />
33
- <link rel="icon" type="image/svg+xml" href={`${import.meta.env.BASE_URL}/favicon.ico`} />
34
+ <link rel="icon" type="image/svg+xml" href={buildUrl('/favicon.ico')} />
34
35
 
35
36
  <SEO
36
37
  title={title}
@@ -8,6 +8,7 @@ const { title } = Astro.props;
8
8
  import Header from '@components/Header.astro';
9
9
  import SideBar from '@components/DocsNavigation.astro';
10
10
  import catalog from '@eventcatalog';
11
+ import { buildUrl } from '@utils/url-builder';
11
12
  ---
12
13
 
13
14
  <!doctype html>
@@ -16,7 +17,7 @@ import catalog from '@eventcatalog';
16
17
  <meta charset="UTF-8" />
17
18
  <meta name="description" content="Astro description" />
18
19
  <meta name="viewport" content="width=device-width" />
19
- <link rel="icon" type="image/svg+xml" href={`${import.meta.env.BASE_URL}/favicon.ico`} />
20
+ <link rel="icon" type="image/svg+xml" href={buildUrl('/favicon.ico')} />
20
21
  <meta name="generator" content={Astro.generator} />
21
22
  <title>EventCatalog</title>
22
23
  </head>
@@ -8,26 +8,29 @@ import { getServices } from '@utils/services/services';
8
8
  import { getDomains } from '@utils/domains/domains';
9
9
 
10
10
  export async function getStaticPaths() {
11
- const events = await getEvents();
12
- const commands = await getCommands();
13
- const services = await getServices();
14
- const domains = await getDomains();
11
+ const events = await getEvents();
12
+ const commands = await getCommands();
13
+ const services = await getServices();
14
+ const domains = await getDomains();
15
15
 
16
- const buildPages = (collection: CollectionEntry<CollectionTypes>[]) => {
17
- return collection.map((item) => ({
18
- params: {
19
- type: item.collection,
20
- },
21
- props: {
22
- type: item.collection,
23
- data: collection,
24
- },
25
- }));
26
- };
27
-
28
- const pages = [events, commands, services, domains];
29
- return pages.flatMap(buildPages);
16
+ const buildPage = (type: string, collection: CollectionEntry<CollectionTypes>[]) => {
17
+ return {
18
+ params: {
19
+ type,
20
+ },
21
+ props: {
22
+ type,
23
+ data: collection,
24
+ },
25
+ };
26
+ };
30
27
 
28
+ return [
29
+ buildPage('events', events),
30
+ buildPage('commands', commands),
31
+ buildPage('services', services),
32
+ buildPage('domains', domains),
33
+ ];
31
34
  }
32
35
 
33
36
  const { type, data } = Astro.props;
@@ -180,6 +180,7 @@ const badges = [
180
180
  // Fix to pass information to componets that are client side only
181
181
  // and require catalog information
182
182
  window.eventcatalog = {};
183
+ // @ts-ignore
183
184
  window.eventcatalog[`${props.collection}-${props.data.id}`] = props.catalog;
184
185
  </script>
185
186
 
@@ -91,20 +91,20 @@ const associatedTeams = teams.map((o) => ({
91
91
  <div class="border-b border-gray-200">
92
92
  <div class="mx-auto max-w-7xl px-6 lg:px-8">
93
93
  <div class="mx-auto max-w-2xl lg:max-w-none">
94
- <dl class="grid grid-cols-1 gap-0.5 overflow-hidden rounded-2xl text-center sm:grid-cols-2 lg:grid-cols-4">
95
- <div class="flex flex-col bg-gray-400/5 p-8">
94
+ <dl class="hidden lg:grid grid-cols-1 gap-0.5 overflow-hidden rounded-2xl text-center sm:grid-cols-3 lg:grid-cols-3">
95
+ <div class="flex flex-col p-8">
96
96
  <dt class="text-sm font-semibold leading-6 text-gray-600"># owned services</dt>
97
97
  <dd class="order-first text-3xl font-semibold tracking-tight text-gray-900">{ownedServicesList.length}</dd>
98
98
  </div>
99
- <div class="flex flex-col bg-gray-400/5 p-8">
99
+ <div class="flex flex-col p-8">
100
100
  <dt class="text-sm font-semibold leading-6 text-gray-600"># owned messages</dt>
101
101
  <dd class="order-first text-3xl font-semibold tracking-tight text-gray-900">{ownedMessageList.length}</dd>
102
102
  </div>
103
- <div class="flex flex-col bg-gray-400/5 p-8">
103
+ <!-- <div class="flex flex-col p-8">
104
104
  <dt class="text-sm font-semibold leading-6 text-gray-600"># owned domains</dt>
105
105
  <dd class="order-first text-3xl font-semibold tracking-tight text-gray-900">2</dd>
106
- </div>
107
- <div class="flex flex-col bg-gray-400/5 p-8">
106
+ </div> -->
107
+ <div class="flex flex-col p-8">
108
108
  <dt class="text-sm font-semibold leading-6 text-gray-600"># teams joined</dt>
109
109
  <dd class="order-first text-3xl font-semibold tracking-tight text-gray-900">{associatedTeams.length}</dd>
110
110
  </div>
@@ -1,23 +1,30 @@
1
1
  ---
2
- import Layout from '../../layouts/VisualiserLayout.astro'
2
+ import Layout from '../../layouts/VisualiserLayout.astro';
3
3
  ---
4
4
 
5
5
  <Layout>
6
- <div class="hidden no-items py-56 text-center -ml-52 text-gray-400">No data loaded into your catalog. Please add some data to your to see visuals.</div>
6
+ <div class="hidden no-items py-56 text-center -ml-52 text-gray-400">
7
+ No data loaded into your catalog. Please add some data to your to see visuals.
8
+ </div>
7
9
  </Layout>
8
10
 
9
11
  <script is:inline>
12
+ const navigationElem = document.getElementById('visualiser-navigation');
10
13
 
14
+ if (navigationElem) {
11
15
  // Find the total anchor links
12
- const totalAnchorLinks = document.getElementById('visualiser-navigation').querySelectorAll('a');
16
+ const totalAnchorLinks = navigationElem.querySelectorAll('a');
17
+ const link = navigationElem.querySelector('a');
18
+ const noItems = document.querySelector('.no-items');
13
19
 
14
20
  // Show no-items if there are none
15
- if(totalAnchorLinks.length === 0) {
16
- document.querySelector('.no-items').classList.remove('hidden');
21
+ if (totalAnchorLinks.length === 0 && noItems) {
22
+ noItems.classList.remove('hidden');
17
23
  }
18
24
 
19
25
  // Find the element with the id visualiser-navigation and the first a link in there and click it
20
- if(document.getElementById('visualiser-navigation').querySelector('a')){
21
- document.getElementById('visualiser-navigation').querySelector('a').click();
26
+ if (link) {
27
+ link.click();
22
28
  }
23
- </script>
29
+ }
30
+ </script>
@@ -8,11 +8,11 @@ export type CatalogConfig = {
8
8
  docs: {
9
9
  sidebar: {
10
10
  showPageHeadings?: boolean;
11
- domains: SideBarItemConfig;
12
- services: SideBarItemConfig;
13
- messages: SideBarItemConfig;
14
- teams: SideBarItemConfig;
15
- users: SideBarItemConfig;
11
+ domains?: SideBarItemConfig;
12
+ services?: SideBarItemConfig;
13
+ messages?: SideBarItemConfig;
14
+ teams?: SideBarItemConfig;
15
+ users?: SideBarItemConfig;
16
16
  };
17
17
  };
18
18
  };