@eventcatalog/core 2.11.2 → 2.11.4
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 +12 -0
- package/astro.config.mjs +1 -1
- package/package.json +1 -1
- package/src/pages/index.astro +4 -4
- package/src/utils/messages.ts +19 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @eventcatalog/core
|
|
2
2
|
|
|
3
|
+
## 2.11.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7749acd: feat(core): added support for outDir
|
|
8
|
+
|
|
9
|
+
## 2.11.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 5442d40: fix(core): counters on homepage only include latest versions
|
|
14
|
+
|
|
3
15
|
## 2.11.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/astro.config.mjs
CHANGED
|
@@ -18,7 +18,7 @@ export default defineConfig({
|
|
|
18
18
|
base,
|
|
19
19
|
server: { port: config.port || 3000 },
|
|
20
20
|
|
|
21
|
-
outDir: join(coreDirectory, 'dist'),
|
|
21
|
+
outDir: config.outDir ? join(coreDirectory, config.outDir) : join(coreDirectory, 'dist'),
|
|
22
22
|
|
|
23
23
|
// https://docs.astro.build/en/reference/configuration-reference/#site
|
|
24
24
|
site: config.homepageLink || 'https://eventcatalog.dev/',
|
package/package.json
CHANGED
package/src/pages/index.astro
CHANGED
|
@@ -17,10 +17,10 @@ import DiscoverInsight from '@components/DiscoverInsight.astro';
|
|
|
17
17
|
import VerticalSideBarLayout from '@layouts/VerticalSideBarLayout.astro';
|
|
18
18
|
import { BookOpen, BookOpenText, TableProperties, Workflow } from 'lucide-react';
|
|
19
19
|
|
|
20
|
-
const { commands = [], events = [], queries = [] } = await getMessages();
|
|
21
|
-
const domains = await getDomains();
|
|
22
|
-
const services = await getServices();
|
|
23
|
-
const flows = await getFlows();
|
|
20
|
+
const { commands = [], events = [], queries = [] } = await getMessages({ getAllVersions: false });
|
|
21
|
+
const domains = await getDomains({ getAllVersions: false });
|
|
22
|
+
const services = await getServices({ getAllVersions: false });
|
|
23
|
+
const flows = await getFlows({ getAllVersions: false });
|
|
24
24
|
|
|
25
25
|
const getDefaultUrl = (route: string, defaultValue: string) => {
|
|
26
26
|
if (domains.length > 0) return buildUrl(`/${route}/domains/${domains[0].data.id}/${domains[0].data.latestVersion}`);
|
package/src/utils/messages.ts
CHANGED
|
@@ -2,14 +2,28 @@
|
|
|
2
2
|
import { getCommands } from '@utils/commands';
|
|
3
3
|
import { getEvents } from '@utils/events';
|
|
4
4
|
import { getQueries } from './queries';
|
|
5
|
+
import type { CollectionEntry } from 'astro:content';
|
|
5
6
|
export { getCommands } from '@utils/commands';
|
|
6
7
|
export { getEvents } from '@utils/events';
|
|
7
8
|
|
|
9
|
+
interface Props {
|
|
10
|
+
getAllVersions?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type Messages = {
|
|
14
|
+
commands: CollectionEntry<'commands'>[];
|
|
15
|
+
events: CollectionEntry<'events'>[];
|
|
16
|
+
queries: CollectionEntry<'queries'>[];
|
|
17
|
+
};
|
|
8
18
|
// Main function that uses the imported functions
|
|
9
|
-
export const getMessages = async () => {
|
|
10
|
-
const commands = await getCommands();
|
|
11
|
-
const events = await getEvents();
|
|
12
|
-
const queries = await getQueries();
|
|
19
|
+
export const getMessages = async ({ getAllVersions = true }: Props = {}): Promise<Messages> => {
|
|
20
|
+
const commands = await getCommands({ getAllVersions });
|
|
21
|
+
const events = await getEvents({ getAllVersions });
|
|
22
|
+
const queries = await getQueries({ getAllVersions });
|
|
13
23
|
|
|
14
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
commands: commands as CollectionEntry<'commands'>[],
|
|
26
|
+
events: events as CollectionEntry<'events'>[],
|
|
27
|
+
queries: queries as CollectionEntry<'queries'>[],
|
|
28
|
+
} satisfies Messages;
|
|
15
29
|
};
|