@eventcatalog/core 2.17.2 → 2.18.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.
@@ -43,7 +43,7 @@
43
43
  "lodash.debounce": "^4.0.8",
44
44
  "lodash.merge": "4.6.2",
45
45
  "lucide-react": "^0.453.0",
46
- "mermaid": "^10.9.1",
46
+ "mermaid": "^11.4.1",
47
47
  "prismjs": "^1.29.0",
48
48
  "rapidoc": "^9.3.4",
49
49
  "react": "^18.3.1",
@@ -11,12 +11,18 @@ interface Props {
11
11
  getAllVersions?: boolean;
12
12
  }
13
13
 
14
- // Cache for build time
15
- let cachedDomains: Domain[] = [];
14
+ // Update cache to store both versions
15
+ let cachedDomains: Record<string, Domain[]> = {
16
+ allVersions: [],
17
+ currentVersions: [],
18
+ };
16
19
 
17
20
  export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise<Domain[]> => {
18
- if (cachedDomains.length > 0) {
19
- return cachedDomains;
21
+ const cacheKey = getAllVersions ? 'allVersions' : 'currentVersions';
22
+
23
+ // Check if we have cached domains for this specific getAllVersions value
24
+ if (cachedDomains[cacheKey].length > 0) {
25
+ return cachedDomains[cacheKey];
20
26
  }
21
27
 
22
28
  // Get all the domains that are not versioned
@@ -28,7 +34,7 @@ export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise
28
34
  const servicesCollection = await getCollection('services');
29
35
 
30
36
  // @ts-ignore // TODO: Fix this type
31
- cachedDomains = domains.map((domain) => {
37
+ cachedDomains[cacheKey] = domains.map((domain) => {
32
38
  const { latestVersion, versions } = getVersionForCollectionItem(domain, domains);
33
39
 
34
40
  // const receives = service.data.receives || [];
@@ -59,7 +65,7 @@ export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise
59
65
  };
60
66
  });
61
67
 
62
- return cachedDomains;
68
+ return cachedDomains[cacheKey];
63
69
  };
64
70
 
65
71
  export const getUbiquitousLanguage = async (domain: Domain): Promise<UbiquitousLanguage[]> => {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "https://github.com/event-catalog/eventcatalog.git"
7
7
  },
8
8
  "type": "module",
9
- "version": "2.17.2",
9
+ "version": "2.18.0",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -45,7 +45,6 @@
45
45
  "@astrojs/mdx": "^4.0.2",
46
46
  "@astrojs/react": "^4.1.0",
47
47
  "@astrojs/tailwind": "^5.1.3",
48
- "remark-comment": "^1.0.0",
49
48
  "@asyncapi/avro-schema-parser": "^3.0.24",
50
49
  "@asyncapi/react-component": "^2.4.3",
51
50
  "@headlessui/react": "^2.0.3",
@@ -74,11 +73,12 @@
74
73
  "lodash.debounce": "^4.0.8",
75
74
  "lodash.merge": "4.6.2",
76
75
  "lucide-react": "^0.453.0",
77
- "mermaid": "^10.9.1",
76
+ "mermaid": "^11.4.1",
78
77
  "rapidoc": "^9.3.4",
79
78
  "react": "^18.3.1",
80
79
  "react-dom": "^18.3.1",
81
80
  "rehype-slug": "^6.0.0",
81
+ "remark-comment": "^1.0.0",
82
82
  "remark-directive": "^3.0.0",
83
83
  "remark-gfm": "^3.0.1",
84
84
  "rimraf": "^5.0.7",