@eventcatalog/core 2.0.6 → 2.0.8

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.0.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 5bde1d4: feat(core): versions now show as a dropdown
8
+
9
+ ## 2.0.7
10
+
11
+ ### Patch Changes
12
+
13
+ - b82d79e: feat(core): Renders names for services side bars and also links to services from domains fixed
14
+
3
15
  ## 2.0.6
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.0.6",
4
+ "version": "2.0.8",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -9,21 +9,27 @@ interface Props {
9
9
 
10
10
  const { versions, collectionItem } = Astro.props;
11
11
  const currentPath = Astro.url.pathname;
12
+
12
13
  ---
13
14
 
14
15
  <div class="space-y-2 my-2 mb-8">
15
16
  <span class="font-light text-black group-data-[hover]:text-black/80 capitalize">Versions ({collectionItem.data.versions?.length})</span>
16
- <ul class="space-x-2 flex">
17
- {versions.map((version) => {
18
- const isCurrent = currentPath.includes(version);
19
- return <li>
20
- <a href={`/docs/${collectionItem.collection}/${collectionItem.data.id}/${version}`} class={`inline-flex items-center rounded-md px-2 py-1 text-xs font-medium text-indigo-700 ring-1 ring-inset ring-indigo-700/10 hover:bg-purple-100 hover:underline ${isCurrent ? 'bg-purple-100 text-purple-500 underline ' : 'bg-white'}`}>
17
+ <select id="version" class="block bg-gray-50 rounded-md border border-gray-200 px-1 py-0.5 text-xs">
18
+ {versions.map((version) => {
19
+ const isCurrent = currentPath.includes(version);
20
+ return <option selected={isCurrent} value={`/docs/${collectionItem.collection}/${collectionItem.data.id}/${version}`} class={`inline-flex items-center rounded-md px-2 py-1 text-xs text-indigo-700 ring-1 ring-inset ring-indigo-700/10 hover:bg-purple-100 hover:underline ${isCurrent ? 'bg-purple-100 text-purple-500 underline ' : 'bg-white'}`}>
21
21
  <span>
22
22
  v{version}
23
23
  {version === collectionItem.data.latestVersion && <span>(latest)</span>}
24
24
  </span>
25
- </a>
26
- </li>
27
- })}
28
- </ul>
29
- </div>
25
+ </option>
26
+ })}
27
+ </select>
28
+ </div>
29
+
30
+ <script>
31
+ document.getElementById('version')?.addEventListener('change', (e: any) => {
32
+ if (!e.target) return
33
+ window.location.href = e.target.value;
34
+ })
35
+ </script>
@@ -19,7 +19,7 @@ const serviceList = services.map((p) => ({
19
19
  label: p.data.id,
20
20
  badge: p.collection,
21
21
  tag: `v${p.data.version}`,
22
- href: `/docs/${p.collection}/${p.data.id}`,
22
+ href: `/docs/${p.collection}/${p.data.id}/${p.data.version}`,
23
23
  }));
24
24
 
25
25
  const ownersList = owners.map((o) => ({
@@ -19,14 +19,14 @@ const ownersRaw = service.data?.owners || [];
19
19
  const owners = await Promise.all(ownersRaw.map((o) => getEntry(o)));
20
20
 
21
21
  const sendsList = sends.map((p) => ({
22
- label: p.data.id,
22
+ label: p.data.name,
23
23
  badge: p.collection,
24
24
  color: p.collection === 'events' ? 'orange' : 'blue',
25
25
  tag: `v${p.data.version}`,
26
26
  href: `/docs/${p.collection}/${p.data.id}/${p.data.version}`,
27
27
  }));
28
28
  const receivesList = receives.map((p) => ({
29
- label: p.data.id,
29
+ label: p.data.name,
30
30
  badge: p.collection,
31
31
  color: p.collection === 'events' ? 'orange' : 'blue',
32
32
  tag: `v${p.data.version}`,