@eventcatalog/core 2.2.6 → 2.3.0

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.
Files changed (33) hide show
  1. package/.github/workflows/verify-build.yml +2 -0
  2. package/.prettierrc +17 -9
  3. package/CHANGELOG.md +12 -0
  4. package/README.md +11 -7
  5. package/package.json +10 -8
  6. package/scripts/catalog-to-astro-content-directory.js +20 -0
  7. package/scripts/ci/test.js +24 -0
  8. package/scripts/watcher.js +12 -4
  9. package/src/components/DocsNavigation.astro +33 -24
  10. package/src/components/Header.astro +14 -11
  11. package/src/components/Lists/VersionList.astro +29 -17
  12. package/src/components/MDX/Accordion/Accordion.astro +5 -6
  13. package/src/components/MDX/Accordion/AccordionGroup.astro +1 -0
  14. package/src/components/MDX/NodeGraph/NodeGraph.astro +13 -8
  15. package/src/components/MDX/SchemaViewer/SchemaViewer.astro +45 -50
  16. package/src/components/Search.astro +16 -5
  17. package/src/components/Seo.astro +48 -54
  18. package/src/components/SideBars/DomainSideBar.astro +24 -6
  19. package/src/components/SideBars/MessageSideBar.astro +41 -10
  20. package/src/components/SideBars/ServiceSideBar.astro +54 -13
  21. package/src/layouts/CustomDocsPageLayout.astro +70 -23
  22. package/src/layouts/DiscoverLayout.astro +3 -1
  23. package/src/layouts/DocsLayout.astro +4 -4
  24. package/src/layouts/Footer.astro +19 -6
  25. package/src/pages/discover/[type]/index.astro +26 -21
  26. package/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +68 -59
  27. package/src/pages/docs/[type]/[id]/[version]/index.astro +38 -20
  28. package/src/pages/docs/index.astro +13 -16
  29. package/src/pages/docs/teams/[id]/index.astro +24 -7
  30. package/src/pages/docs/users/[id]/index.astro +23 -6
  31. package/src/pages/visualiser/[type]/[id]/[version]/index.astro +12 -1
  32. package/tsconfig.json +3 -1
  33. package/vitest.config.ts +10 -0
@@ -22,5 +22,7 @@ jobs:
22
22
  node-version: '20.x'
23
23
  - name: Installation
24
24
  run: npm i
25
+ - name: Test
26
+ run: npm run test:ci
25
27
  - name: Build
26
28
  run: npm run verify-build:catalog
package/.prettierrc CHANGED
@@ -1,10 +1,18 @@
1
1
  {
2
- "semi": true,
3
- "singleQuote": true,
4
- "printWidth": 130,
5
- "tabWidth": 2,
6
- "useTabs": false,
7
- "trailingComma": "es5",
8
- "bracketSpacing": true
9
- }
10
-
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "printWidth": 130,
5
+ "tabWidth": 2,
6
+ "useTabs": false,
7
+ "trailingComma": "es5",
8
+ "bracketSpacing": true,
9
+ "plugins": ["prettier-plugin-astro"],
10
+ "overrides": [
11
+ {
12
+ "files": "*.astro",
13
+ "options": {
14
+ "parser": "astro"
15
+ }
16
+ }
17
+ ]
18
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @eventcatalog/core
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - d662cb1: feat(core): added custom component support for eventcatalog
8
+
9
+ ## 2.2.7
10
+
11
+ ### Patch Changes
12
+
13
+ - d7148fa: chore(core): fixed long labels on the documentation sidebar
14
+
3
15
  ## 2.2.6
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  <h1>📖 EventCatalog</h1>
4
4
 
5
+ [![MIT License][license-badge]][license]
6
+ [![PRs Welcome][prs-badge]][prs]
7
+ <img src="https://img.shields.io/github/actions/workflow/status/event-catalog/eventcatalog/verify-build.yml"/>
8
+ [![Star on GitHub][github-star-badge]][github-star]
9
+
10
+
5
11
 
6
12
  <!-- [![Star on GitHub][github-star-badge]][github-star] -->
7
13
  <!-- <h3>Bring discoverability to your -->
@@ -10,9 +16,7 @@
10
16
 
11
17
  <!-- [![MIT License][license-badge]][license] -->
12
18
  <!-- [![PRs Welcome][prs-badge]][prs] -->
13
- <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
14
- [![All Contributors](https://img.shields.io/badge/all_contributors-41-orange.svg?style=flat-square)](#contributors-)
15
- <!-- ALL-CONTRIBUTORS-BADGE:END -->
19
+
16
20
 
17
21
  <!-- [![Watch on GitHub][github-watch-badge]][github-watch] -->
18
22
  <!-- [![Star on GitHub][github-star-badge]][github-star] -->
@@ -23,9 +27,9 @@
23
27
 
24
28
  <h4>Features: Documentation generator for Event Driven Architectures, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
25
29
 
26
- [![MIT License][license-badge]][license]
27
- [![PRs Welcome][prs-badge]][prs]
28
- [![All Contributors](https://img.shields.io/badge/all_contributors-37-orange.svg?style=flat-square)](#contributors-)
30
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
31
+ [![All Contributors](https://img.shields.io/badge/all_contributors-41-orange.svg?style=flat-square)](#contributors-)
32
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
29
33
 
30
34
  [Read the Docs](https://eventcatalog.dev/) | [Edit the Docs](https://github.com/event-catalog/docs) | [View Demo](https://demo.eventcatalog.dev/docs)
31
35
 
@@ -216,4 +220,4 @@ You can find more [details on our website](https://eventcatalog.dev/support).
216
220
 
217
221
  # License
218
222
 
219
- MIT.
223
+ MIT.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eventcatalog/core",
3
3
  "type": "module",
4
- "version": "2.2.6",
4
+ "version": "2.3.0",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -13,7 +13,8 @@
13
13
  "dev:local": "concurrently \"node scripts/watcher.js\" \"astro dev\"",
14
14
  "build:bin": "tsup",
15
15
  "prepublishOnly": "npm run build:bin",
16
- "test": "jest --config=$(pwd)/../../jest.config.js",
16
+ "test": "vitest --config vitest.config.ts",
17
+ "test:ci": "node scripts/ci/test.js",
17
18
  "start": "astro dev",
18
19
  "build": "npm run scripts:hydrate-content && astro check --minimumSeverity error && astro build",
19
20
  "build:cd": "node scripts/build-ci.js",
@@ -25,8 +26,8 @@
25
26
  "changeset": "changeset",
26
27
  "generate": "node scripts/generate.js",
27
28
  "release": "changeset publish",
28
- "format": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx,json}\"",
29
- "format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,json}\""
29
+ "format": "prettier --config .prettierrc --write \"**/*.{js,jsx,ts,tsx,json,astro}\"",
30
+ "format:diff": "prettier --config .prettierrc --list-different \"**/*.{js,jsx,ts,tsx,json,astro}\""
30
31
  },
31
32
  "dependencies": {
32
33
  "@astrojs/check": "^0.7.0",
@@ -63,15 +64,16 @@
63
64
  },
64
65
  "devDependencies": {
65
66
  "@parcel/watcher": "^2.4.1",
66
- "@types/jest": "^29.5.12",
67
67
  "@types/react": "^18.3.3",
68
68
  "@types/react-dom": "^18.3.0",
69
69
  "commander": "^12.1.0",
70
70
  "concurrently": "^8.2.2",
71
71
  "cross-env": "^7.0.3",
72
- "jest": "^29.7.0",
73
- "prettier": "^3.3.2",
72
+ "prettier": "^3.3.3",
73
+ "prettier-plugin-astro": "^0.14.1",
74
74
  "rimraf": "^5.0.7",
75
- "tsup": "^8.1.0"
75
+ "tsup": "^8.1.0",
76
+ "vite-tsconfig-paths": "^4.3.2",
77
+ "vitest": "^2.0.5"
76
78
  }
77
79
  }
@@ -97,6 +97,23 @@ const copyFiles = async ({ source, target, catalogFilesDir, pathToMarkdownFiles,
97
97
  }
98
98
  };
99
99
 
100
+ const copyComponents = async ({ source, target }) => {
101
+ const componentsDir = path.join(source, 'components');
102
+ const componentsTarget = path.join(target, '../custom-defined-components');
103
+
104
+ // Clear the component directory before we copy files over
105
+ if (fs.existsSync(componentsTarget)) {
106
+ await fs.rmSync(componentsTarget, { recursive: true });
107
+ }
108
+
109
+ if (!fs.existsSync(componentsDir) || !fs.statSync(componentsDir).isDirectory()) {
110
+ return;
111
+ }
112
+
113
+ // Copy files
114
+ await fs.cpSync(componentsDir, componentsTarget, { recursive: true });
115
+ };
116
+
100
117
  export const catalogToAstro = async (source, astroContentDir, catalogFilesDir) => {
101
118
  // Config file
102
119
  const astroConfigFile = fs.readFileSync(path.join(astroContentDir, 'config.ts'));
@@ -211,6 +228,9 @@ export const catalogToAstro = async (source, astroContentDir, catalogFilesDir) =
211
228
  pathToAllFiles: [],
212
229
  type: 'pages',
213
230
  });
231
+
232
+ // Copy the components if they are defined
233
+ await copyComponents({ source, target: astroContentDir, catalogFilesDir });
214
234
  };
215
235
 
216
236
  if (process.env.NODE_ENV !== 'test') {
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Script for GitHub Actions
5
+ * Sets up the project with required files
6
+ */
7
+
8
+ import { join } from 'node:path';
9
+ import fs from 'fs';
10
+ import { execSync } from 'node:child_process';
11
+
12
+ const args = process.argv.slice(2);
13
+ const catalog = args[0] || 'default';
14
+
15
+ const catalogDir = join(process.cwd());
16
+ const projectDIR = join(process.cwd(), `/examples/${catalog}`);
17
+
18
+ fs.copyFileSync(join(projectDIR, 'eventcatalog.config.js'), join(catalogDir, 'eventcatalog.config.js'));
19
+ fs.copyFileSync(join(projectDIR, 'eventcatalog.styles.css'), join(catalogDir, 'eventcatalog.styles.css'));
20
+
21
+ execSync(`cross-env NODE_ENV=test PROJECT_DIR=${projectDIR} CATALOG_DIR=${catalogDir} npm run test`, {
22
+ cwd: catalogDir,
23
+ stdio: 'inherit',
24
+ });
@@ -2,6 +2,7 @@
2
2
  import watcher from '@parcel/watcher';
3
3
  import path from 'path';
4
4
  import fs from 'fs';
5
+ import os from 'os';
5
6
 
6
7
  // Where the users project is located
7
8
  const projectDirectory = process.env.PROJECT_DIR || process.cwd();
@@ -10,7 +11,7 @@ const catalogDirectory = process.env.CATALOG_DIR;
10
11
 
11
12
  const contentPath = path.join(catalogDirectory, 'src', 'content');
12
13
 
13
- const watchList = ['domains', 'commands', 'events', 'services', 'teams', 'users', 'pages'];
14
+ const watchList = ['domains', 'commands', 'events', 'services', 'teams', 'users', 'pages', 'components'];
14
15
  // const absoluteWatchList = watchList.map((item) => path.join(projectDirectory, item));
15
16
 
16
17
  // confirm folders exist before watching them
@@ -35,20 +36,27 @@ for (let item of [...verifiedWatchList]) {
35
36
  // Check if changlogs, they need to go into their own content folder
36
37
  if (file.includes('changelog.md')) {
37
38
  newPath = newPath.replace('src/content', 'src/content/changelogs');
38
-
39
39
  if (os.platform() == 'win32') {
40
40
  newPath = newPath.replace('src\\content', 'src\\content\\changelogs');
41
41
  }
42
42
  }
43
43
 
44
+ // Check if its a component, need to move to the correct location
45
+ if (newPath.includes('components')) {
46
+ newPath = newPath.replace('src/content/components', 'src/custom-defined-components');
47
+ if (os.platform() == 'win32') {
48
+ newPath = newPath.replace('src\\content\\components', 'src\\custom-defined-components');
49
+ }
50
+ }
51
+
44
52
  // If config files have changes
45
53
  if (eventPath.includes('eventcatalog.config.js') || eventPath.includes('eventcatalog.styles.css')) {
46
54
  fs.cpSync(eventPath, path.join(catalogDirectory, file));
47
55
  return;
48
56
  }
49
57
 
50
- // If markdown files copy file over to the required location
51
- if (eventPath.endsWith('.md') && type === 'update') {
58
+ // If markdown files or astro files copy file over to the required location
59
+ if ((eventPath.endsWith('.md') || eventPath.endsWith('.astro')) && type === 'update') {
52
60
  fs.cpSync(eventPath, newPath);
53
61
  }
54
62
 
@@ -21,13 +21,20 @@ const messages = [...events, ...commands];
21
21
  const allData = [...domains, ...services, ...messages, ...teams, ...users];
22
22
 
23
23
  const eventCatalogConfig = config as CatalogConfig;
24
- const { services: servicesConfig, domains: domainsConfig, messages: messagesConfig, teams: teamsConfig, users: usersConfig, showPageHeadings = true } = eventCatalogConfig?.docs?.sidebar || {};
25
-
26
- const getConfigValue = (obj: any, key:string, defaultValue: any) => {
24
+ const {
25
+ services: servicesConfig,
26
+ domains: domainsConfig,
27
+ messages: messagesConfig,
28
+ teams: teamsConfig,
29
+ users: usersConfig,
30
+ showPageHeadings = true,
31
+ } = eventCatalogConfig?.docs?.sidebar || {};
32
+
33
+ const getConfigValue = (obj: any, key: string, defaultValue: any) => {
27
34
  return obj?.[key] ?? defaultValue;
28
- }
35
+ };
29
36
 
30
- const visibleCollections: {[key:string]: boolean} = {
37
+ const visibleCollections: { [key: string]: boolean } = {
31
38
  events: getConfigValue(messagesConfig, 'visible', true),
32
39
  commands: getConfigValue(messagesConfig, 'visible', true),
33
40
  domains: getConfigValue(domainsConfig, 'visible', true),
@@ -38,20 +45,17 @@ const visibleCollections: {[key:string]: boolean} = {
38
45
 
39
46
  const fetchHeadings = allData.map(async (item) => {
40
47
  const renderHeadings = showPageHeadings;
41
- const headings = renderHeadings ? await item.render() : { headings: []};
48
+ const headings = renderHeadings ? await item.render() : { headings: [] };
42
49
  return {
43
50
  ...item,
44
51
  headings: headings.headings,
45
52
  };
46
53
  });
47
54
 
48
-
49
-
50
- const withHeadings = await Promise.all(fetchHeadings);
55
+ const withHeadings = await Promise.all(fetchHeadings);
51
56
 
52
57
  const sideNav = withHeadings.reduce((acc, item) => {
53
-
54
- const title = (item.collection === 'events' || item.collection === 'commands') ? 'Messages' : item.collection;
58
+ const title = item.collection === 'events' || item.collection === 'commands' ? 'Messages' : item.collection;
55
59
 
56
60
  const group = acc[title] || [];
57
61
 
@@ -61,7 +65,10 @@ const sideNav = withHeadings.reduce((acc, item) => {
61
65
  items: item.collection === 'users' ? [] : item.headings,
62
66
  visible: visibleCollections[item.collection],
63
67
  // @ts-ignore
64
- href: item.data.version ? buildUrl(`/docs/${item.collection}/${item.data.id}/${item.data.version}`) : buildUrl(`/docs/${item.collection}/${item.data.id}`),
68
+ href: item.data.version
69
+ ? // @ts-ignore
70
+ buildUrl(`/docs/${item.collection}/${item.data.id}/${item.data.version}`)
71
+ : buildUrl(`/docs/${item.collection}/${item.data.id}`),
65
72
  };
66
73
 
67
74
  group.push(navigationItem);
@@ -73,23 +80,29 @@ const sideNav = withHeadings.reduce((acc, item) => {
73
80
  }, {} as any);
74
81
 
75
82
  const currentPath = Astro.url.pathname;
76
-
77
83
  ---
78
84
 
79
- <div class="font-light w-full xl:pr-10 pb-20 ">
85
+ <div class="font-light w-full xl:pr-10 pb-20">
80
86
  {
81
87
  Object.keys(sideNav).map((key) => {
82
88
  const collection = sideNav[key];
83
- if(collection[0] && collection[0].visible === false) return null;
89
+ if (collection[0] && collection[0].visible === false) return null;
84
90
  return (
85
91
  <ul class=" w-full space-y-2 pb-8">
86
92
  <li class="font-semibold capitalize ">{key}</li>
87
93
  {collection.map((item: any) => {
88
94
  return (
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} >
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}`}>
91
- <span class="block">{item.label}</span>
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>}
95
+ <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}>
96
+ <a
97
+ 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'}`}
98
+ href={`${item.href}`}
99
+ >
100
+ <span class="block truncate !whitespace-normal">{item.label}</span>
101
+ {item.version && (
102
+ <span class="block text-sm bg-purple-100 p-0.5 px-1 text-gray-600 rounded-md font-light">
103
+ v{item.version}
104
+ </span>
105
+ )}
93
106
  </a>
94
107
  <ul class="hidden xl:block px-4 text-gray-500 text-md space-y-2 ">
95
108
  {item.items.map((heading: any) => {
@@ -121,10 +134,6 @@ const currentPath = Astro.url.pathname;
121
134
  block: 'start',
122
135
  inline: 'start',
123
136
  });
124
-
125
- // currentElement.scrollIntoView({
126
- // behavior: 'auto'
127
- // });
128
137
  }
129
138
  });
130
- </script>
139
+ </script>
@@ -17,16 +17,16 @@ const navItems = [
17
17
  {
18
18
  label: 'Discover',
19
19
  href: buildUrl('/discover/events'),
20
- }
20
+ },
21
21
  ];
22
22
 
23
23
  const logo = {
24
24
  src: ('/' + (catalog?.logo?.src || 'logo.png')).replace(/^\/+/, '/'), // replace the leading slashes with a single one
25
25
  alt: catalog?.logo?.alt || 'Event Catalog',
26
- text: catalog?.logo?.text || "EventCatalog"
27
- }
28
-
26
+ text: catalog?.logo?.text || 'EventCatalog',
27
+ };
29
28
  ---
29
+
30
30
  <nav class="md:fixed top-0 w-full z-20 bg-white border-b border-gray-200 py-4 font-bold text-xl max-w-[70em]">
31
31
  <div class="flex justify-between items-center">
32
32
  <div class="w-1/3 flex space-x-2 items-center">
@@ -57,14 +57,17 @@ const logo = {
57
57
  </div> -->
58
58
  <div class="w-1/3 justify-end text-md">
59
59
  <ul class="text-right flex justify-end space-x-8">
60
- {navItems.map((item) => {
61
- const isActive = currentPath.includes(item.href) ;
62
- return <li class={`font-light ${isActive ? 'border-b-2 border-purple-500': ''}`}>
63
- <a href={item.href}>{item.label}</a>
64
- </li>
65
- })}
60
+ {
61
+ navItems.map((item) => {
62
+ const isActive = currentPath.includes(item.href);
63
+ return (
64
+ <li class={`font-light ${isActive ? 'border-b-2 border-purple-500' : ''}`}>
65
+ <a href={item.href}>{item.label}</a>
66
+ </li>
67
+ );
68
+ })
69
+ }
66
70
  </ul>
67
71
  </div>
68
72
  </div>
69
73
  </nav>
70
-
@@ -4,34 +4,46 @@ import { buildUrl } from '@utils/url-builder';
4
4
  import type { CollectionEntry } from 'astro:content';
5
5
 
6
6
  interface Props {
7
- versions: string[]
8
- collectionItem: CollectionEntry<CollectionTypes>
7
+ versions: string[];
8
+ collectionItem: CollectionEntry<CollectionTypes>;
9
9
  }
10
10
 
11
11
  const { versions, collectionItem } = Astro.props;
12
12
  const currentPath = Astro.url.pathname;
13
-
14
13
  ---
15
14
 
16
15
  <div class="space-y-2 my-2 mb-8">
17
- <span class="font-light text-black group-data-[hover]:text-black/80 capitalize">Versions ({collectionItem.data.versions?.length})</span>
18
- <select id="version" class="block bg-gray-50 rounded-md border border-gray-200 px-1 py-0.5 text-xs">
19
- {versions.map((version) => {
20
- const isCurrent = currentPath.includes(version);
21
- return <option selected={isCurrent} value={buildUrl(`/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'}`}>
22
- <span>
23
- v{version}
24
- {version === collectionItem.data.latestVersion && <span>(latest)</span>}
25
- </span>
26
- </option>
27
- })}
16
+ <span class="font-light text-black group-data-[hover]:text-black/80 capitalize"
17
+ >Versions ({collectionItem.data.versions?.length})</span
18
+ >
19
+ <select id="version" class="block bg-gray-50 rounded-md border border-gray-200 px-1 py-0.5 text-xs">
20
+ {
21
+ versions.map((version) => {
22
+ const isCurrent = currentPath.includes(version);
23
+ return (
24
+ <option
25
+ selected={isCurrent}
26
+ value={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${version}`)}
27
+ 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'}`}
28
+ >
29
+ <span>
30
+ v{version}
31
+ {version === collectionItem.data.latestVersion && <span>(latest)</span>}
32
+ </span>
33
+ </option>
34
+ );
35
+ })
36
+ }
28
37
  </select>
29
- <a href={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${collectionItem.data.latestVersion}/changelog`)} class="text-[10px] text-gray-500">View changelogs</a>
38
+ <a
39
+ href={buildUrl(`/docs/${collectionItem.collection}/${collectionItem.data.id}/${collectionItem.data.latestVersion}/changelog`)}
40
+ class="text-[10px] text-gray-500">View changelogs</a
41
+ >
30
42
  </div>
31
43
 
32
44
  <script>
33
45
  document.getElementById('version')?.addEventListener('change', (e: any) => {
34
- if (!e.target) return
46
+ if (!e.target) return;
35
47
  window.location.href = e.target.value;
36
- })
48
+ });
37
49
  </script>
@@ -1,9 +1,8 @@
1
1
  ---
2
- import AccordionClient from './Accordion'
3
- const {...props } = Astro.props;
2
+ import AccordionClient from './Accordion';
3
+ const { ...props } = Astro.props;
4
4
  ---
5
5
 
6
- <AccordionClient {...props} client:load>
7
- <slot />
8
- </AccordionClient>
9
-
6
+ <AccordionClient {...props} client:load>
7
+ <slot />
8
+ </AccordionClient>
@@ -1,4 +1,5 @@
1
1
  ---
2
+
2
3
  ---
3
4
 
4
5
  <div class="accordian-group border border-gray-200 rounded-md shadow-sm accordion my-2">
@@ -5,7 +5,6 @@ import { getNodesAndEdges as getNodesAndEdgesForEvent } from '@utils/events/node
5
5
  import { getNodesAndEdges as getNodesAndEdgesForCommand } from '@utils/commands/node-graph';
6
6
  import { getNodesAndEdges as getNodesAndEdgesForDomain } from '@utils/domains/node-graph';
7
7
 
8
-
9
8
  interface Props {
10
9
  id: string;
11
10
  collection: string;
@@ -19,7 +18,7 @@ interface Props {
19
18
  };
20
19
  }
21
20
 
22
- const { id, collection, title, mode = 'simple', linkTo='docs', version, href } = Astro.props;
21
+ const { id, collection, title, mode = 'simple', linkTo = 'docs', version, href } = Astro.props;
23
22
  let nodes = [],
24
23
  edges = [];
25
24
 
@@ -56,7 +55,7 @@ if (collection === 'commands') {
56
55
  edges = eventEdges;
57
56
  }
58
57
 
59
- if(collection === 'domains'){
58
+ if (collection === 'domains') {
60
59
  const { nodes: eventNodes, edges: eventEdges } = await getNodesAndEdgesForDomain({
61
60
  id: id,
62
61
  version,
@@ -66,17 +65,23 @@ if(collection === 'domains'){
66
65
  nodes = eventNodes;
67
66
  edges = eventEdges;
68
67
  }
69
-
70
-
71
-
72
68
  ---
73
69
 
74
70
  <div>
75
- <NodeGraphNew id={id} nodes={nodes} edges={edges} title={title} hrefLabel={href.label} href={href.url} linkTo={linkTo} client:load />
71
+ <NodeGraphNew
72
+ id={id}
73
+ nodes={nodes}
74
+ edges={edges}
75
+ title={title}
76
+ hrefLabel={href.label}
77
+ href={href.url}
78
+ linkTo={linkTo}
79
+ client:load
80
+ />
76
81
  </div>
77
82
 
78
83
  <style is:global>
79
84
  .react-flow__attribution {
80
85
  display: none;
81
86
  }
82
- </style>
87
+ </style>