Skip to content

Commit

Permalink
fix/ubiquitous-language (#1074)
Browse files Browse the repository at this point in the history
* chore: upgrade from `[email protected]` to `[email protected]`

The `[email protected]` introduces a bug fix where the entry passed to the
`getCollection` filter function did not include the legacy entry fields
(`slug`, principally for EC).

* fix: use the legacy slug field to filter a domain ubiquitousLang

* fix: generate the language page for current versions only

* Create wise-swans-lie.md

---------

Co-authored-by: David Boyne <[email protected]>
  • Loading branch information
carlosallexandre and boyney123 authored Jan 8, 2025
1 parent f4e8985 commit 73b80ae
Show file tree
Hide file tree
Showing 5 changed files with 436 additions and 112 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-swans-lie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@eventcatalog/core": patch
---

fix(core): ubiquitous-language matching by domains, also astro upgrade to 5.1.x
2 changes: 1 addition & 1 deletion eventcatalog/src/pages/docs/[type]/[id]/language.astro
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ViewTransitions } from 'astro:transitions';
import * as LucideIcons from 'lucide-react';
export async function getStaticPaths() {
const domains = await getDomains();
const domains = await getDomains({ getAllVersions: false });
const buildPages = (collection: CollectionEntry<'domains'>[]) => {
return collection.map((item) => ({
Expand Down
3 changes: 1 addition & 2 deletions eventcatalog/src/utils/collections/domains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ export const getDomains = async ({ getAllVersions = true }: Props = {}): Promise

export const getUbiquitousLanguage = async (domain: Domain): Promise<UbiquitousLanguage[]> => {
const ubiquitousLanguages = await getCollection('ubiquitousLanguages', (ubiquitousLanguage: UbiquitousLanguage) => {
const folderPath = ubiquitousLanguage.id.replace('ubiquitous-language', '');
return domain.filePath?.toLowerCase().includes(folderPath.toLowerCase());
return ubiquitousLanguage.slug.startsWith(`${domain.collection}/${domain.slug}`);
});

return ubiquitousLanguages;
Expand Down
Loading

0 comments on commit 73b80ae

Please sign in to comment.