@eventcatalog/core 2.3.1 → 2.3.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.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - dad4df7: fix(core): visualiser now truncates labels on sidebar
8
+
9
+ ## 2.3.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 90c9219: feat(core): added page redirect to latest version when going to /{resource/{id}
14
+
3
15
  ## 2.3.1
4
16
 
5
17
  ### Patch Changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.3.1",
4
+ "version": "2.3.3",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -33,7 +33,7 @@ const BasicList = ({ title, items, emptyMessage, color = 'gray' }: Props) => {
33
33
  className={`flex justify-between items-center w-full px-2 rounded-md font-normal ${item.active ? 'bg-purple-200 text-purple-800 ' : 'font-thin'}`}
34
34
  href={item.href}
35
35
  >
36
- <span className="block">{item.label}</span>
36
+ <span className="block truncate !whitespace-normal">{item.label}</span>
37
37
  {item.version && (
38
38
  <span className="block text-sm bg-purple-100 p-0.5 px-1 text-gray-600 rounded-md font-light">
39
39
  v{item.version}
@@ -0,0 +1,46 @@
1
+ ---
2
+ import Seo from '@components/Seo.astro';
3
+ import { buildUrl } from '@utils/url-builder';
4
+ import { getEvents } from '@utils/events';
5
+ import { getCommands } from '@utils/commands';
6
+ import { getServices } from '@utils/services/services';
7
+ import { getDomains } from '@utils/domains/domains';
8
+ import type { CollectionEntry } from 'astro:content';
9
+ import type { CollectionTypes } from '@types';
10
+
11
+ export async function getStaticPaths() {
12
+ const [events, commands, services, domains] = await Promise.all([getEvents(), getCommands(), getServices(), getDomains()]);
13
+
14
+ const buildPages = (collection: CollectionEntry<CollectionTypes>[]) => {
15
+ return collection.map((item) => ({
16
+ params: {
17
+ type: item.collection,
18
+ id: item.data.id,
19
+ },
20
+ props: {
21
+ type: item.collection,
22
+ ...item,
23
+ },
24
+ }));
25
+ };
26
+
27
+ return [...buildPages(domains), ...buildPages(events), ...buildPages(services), ...buildPages(commands)];
28
+ }
29
+
30
+ const props = Astro.props;
31
+ const pageTitle = `${props.collection} | ${props.data.name}`.replace(/^\w/, (c) => c.toUpperCase());
32
+
33
+ const { pathname } = Astro.url;
34
+ const redirectUrl = buildUrl(pathname + '/' + props.data.latestVersion);
35
+ ---
36
+
37
+ <!doctype html>
38
+ <html lang="en">
39
+ <head>
40
+ <meta http-equiv="refresh" content={`0; url=${redirectUrl}`} />
41
+ <Seo title={`EventCatalog | ${pageTitle}`} ogTitle={pageTitle} />
42
+ </head>
43
+ <body>
44
+ <p>You are being redirected to <a href={redirectUrl}>{redirectUrl}</a></p>
45
+ </body>
46
+ </html>