@eventcatalog/core 3.17.2 → 3.17.5

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.
@@ -37,7 +37,7 @@ var import_axios = __toESM(require("axios"), 1);
37
37
  var import_os = __toESM(require("os"), 1);
38
38
 
39
39
  // package.json
40
- var version = "3.17.2";
40
+ var version = "3.17.5";
41
41
 
42
42
  // src/constants.ts
43
43
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "../chunk-T6TXEL4Z.js";
4
- import "../chunk-Q6LH4FMV.js";
3
+ } from "../chunk-VWSQYMKF.js";
4
+ import "../chunk-6LCHHROP.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -111,7 +111,7 @@ var import_axios = __toESM(require("axios"), 1);
111
111
  var import_os = __toESM(require("os"), 1);
112
112
 
113
113
  // package.json
114
- var version = "3.17.2";
114
+ var version = "3.17.5";
115
115
 
116
116
  // src/constants.ts
117
117
  var VERSION = version;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-JEXVK2M2.js";
4
- import "../chunk-T6TXEL4Z.js";
3
+ } from "../chunk-MJVOXKKM.js";
4
+ import "../chunk-VWSQYMKF.js";
5
5
  import "../chunk-4UVFXLPI.js";
6
- import "../chunk-Q6LH4FMV.js";
6
+ import "../chunk-6LCHHROP.js";
7
7
  import "../chunk-5T63CXKU.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.17.2";
2
+ var version = "3.17.5";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-XAGKJF5Y.js";
3
+ } from "./chunk-O6SVMZR3.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-T6TXEL4Z.js";
3
+ } from "./chunk-VWSQYMKF.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-Q6LH4FMV.js";
3
+ } from "./chunk-6LCHHROP.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-Q6LH4FMV.js";
3
+ } from "./chunk-6LCHHROP.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.17.2";
28
+ var version = "3.17.5";
29
29
 
30
30
  // src/constants.ts
31
31
  var VERSION = version;
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-Q6LH4FMV.js";
3
+ } from "./chunk-6LCHHROP.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -114,7 +114,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
114
114
  var import_picocolors = __toESM(require("picocolors"), 1);
115
115
 
116
116
  // package.json
117
- var version = "3.17.2";
117
+ var version = "3.17.5";
118
118
 
119
119
  // src/constants.ts
120
120
  var VERSION = version;
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-JEXVK2M2.js";
10
- import "./chunk-T6TXEL4Z.js";
9
+ } from "./chunk-MJVOXKKM.js";
10
+ import "./chunk-VWSQYMKF.js";
11
11
  import "./chunk-4UVFXLPI.js";
12
12
  import {
13
13
  runMigrations
@@ -22,13 +22,13 @@ import {
22
22
  } from "./chunk-3KXCGYET.js";
23
23
  import {
24
24
  generate
25
- } from "./chunk-AS7IMS3G.js";
25
+ } from "./chunk-LLGEQ4MZ.js";
26
26
  import {
27
27
  logger
28
- } from "./chunk-XAGKJF5Y.js";
28
+ } from "./chunk-O6SVMZR3.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-Q6LH4FMV.js";
31
+ } from "./chunk-6LCHHROP.js";
32
32
  import {
33
33
  getEventCatalogConfigFile,
34
34
  verifyRequiredFieldsAreInCatalogConfigFile
package/dist/generate.cjs CHANGED
@@ -78,7 +78,7 @@ var getEventCatalogConfigFile = async (projectDirectory) => {
78
78
  var import_picocolors = __toESM(require("picocolors"), 1);
79
79
 
80
80
  // package.json
81
- var version = "3.17.2";
81
+ var version = "3.17.5";
82
82
 
83
83
  // src/constants.ts
84
84
  var VERSION = version;
package/dist/generate.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  generate
3
- } from "./chunk-AS7IMS3G.js";
4
- import "./chunk-XAGKJF5Y.js";
5
- import "./chunk-Q6LH4FMV.js";
3
+ } from "./chunk-LLGEQ4MZ.js";
4
+ import "./chunk-O6SVMZR3.js";
5
+ import "./chunk-6LCHHROP.js";
6
6
  import "./chunk-5T63CXKU.js";
7
7
  export {
8
8
  generate
@@ -36,7 +36,7 @@ module.exports = __toCommonJS(cli_logger_exports);
36
36
  var import_picocolors = __toESM(require("picocolors"), 1);
37
37
 
38
38
  // package.json
39
- var version = "3.17.2";
39
+ var version = "3.17.5";
40
40
 
41
41
  // src/constants.ts
42
42
  var VERSION = version;
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  logger
3
- } from "../chunk-XAGKJF5Y.js";
4
- import "../chunk-Q6LH4FMV.js";
3
+ } from "../chunk-O6SVMZR3.js";
4
+ import "../chunk-6LCHHROP.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -1,4 +1,5 @@
1
1
  import { getCollection, type CollectionEntry } from 'astro:content';
2
+ import path from 'node:path';
2
3
  import { sortVersioned } from './util';
3
4
  import { isResourceDocsEnabled } from '@utils/feature';
4
5
 
@@ -52,6 +53,7 @@ export type ResourceDocGroup = {
52
53
  type ResourceLookup = {
53
54
  latestById: Map<string, string>;
54
55
  versionsById: Map<string, Set<string>>;
56
+ folderToId: Map<string, string>;
55
57
  };
56
58
 
57
59
  type InferredResource = {
@@ -200,12 +202,27 @@ const inferResourceFromFilePath = (filePath: string): InferredResource | null =>
200
202
  };
201
203
  };
202
204
 
205
+ const getResourceFolderFromFilePath = (filePath: string): string | undefined => {
206
+ const normalized = normalizePath(filePath);
207
+ const versionedIndex = normalized.indexOf('/versioned/');
208
+ if (versionedIndex !== -1) {
209
+ // e.g. "domains/BoxOffice/versioned/1.0.0/index.mdx" → "domains/BoxOffice"
210
+ const beforeVersioned = normalized.slice(0, versionedIndex);
211
+ return path.basename(beforeVersioned) || undefined;
212
+ }
213
+ // e.g. "domains/BoxOffice/index.mdx" → "BoxOffice"
214
+ const dir = path.dirname(normalized);
215
+ return dir ? path.basename(dir) : undefined;
216
+ };
217
+
203
218
  const buildLookup = (
204
219
  resources: Array<{
205
220
  data: { id: string; version: string; hidden?: boolean };
221
+ filePath?: string;
206
222
  }>
207
223
  ): ResourceLookup => {
208
224
  const groupedById = new Map<string, string[]>();
225
+ const folderToId = new Map<string, string>();
209
226
 
210
227
  for (const resource of resources) {
211
228
  if (resource.data.hidden === true) {
@@ -214,6 +231,13 @@ const buildLookup = (
214
231
  const list = groupedById.get(resource.data.id) || [];
215
232
  list.push(resource.data.version);
216
233
  groupedById.set(resource.data.id, list);
234
+
235
+ if (resource.filePath) {
236
+ const folderName = getResourceFolderFromFilePath(resource.filePath);
237
+ if (folderName && folderName !== resource.data.id) {
238
+ folderToId.set(folderName, resource.data.id);
239
+ }
240
+ }
217
241
  }
218
242
 
219
243
  const latestById = new Map<string, string>();
@@ -227,7 +251,7 @@ const buildLookup = (
227
251
  }
228
252
  }
229
253
 
230
- return { latestById, versionsById };
254
+ return { latestById, versionsById, folderToId };
231
255
  };
232
256
 
233
257
  const getResourceLookups = async (): Promise<Record<ResourceCollection, ResourceLookup>> => {
@@ -295,15 +319,21 @@ const resolveResourceFromPath = (
295
319
  return null;
296
320
  }
297
321
 
298
- const { resourceCollection, resourceId, resourceVersion } = inferredResource;
322
+ const { resourceCollection, resourceVersion } = inferredResource;
299
323
  const lookup = lookups[resourceCollection];
300
- const knownVersions = lookup.versionsById.get(resourceId);
324
+
325
+ // The inferred resourceId is the folder name from the file path. It may differ
326
+ // from the actual frontmatter id, so fall back to the folderToId mapping.
327
+ const folderName = inferredResource.resourceId;
328
+ const resolvedId = lookup.versionsById.has(folderName) ? folderName : (lookup.folderToId.get(folderName) ?? folderName);
329
+
330
+ const knownVersions = lookup.versionsById.get(resolvedId);
301
331
 
302
332
  if (!knownVersions || knownVersions.size === 0) {
303
333
  return null;
304
334
  }
305
335
 
306
- const resolvedResourceVersion = resourceVersion === 'latest' ? (lookup.latestById.get(resourceId) ?? null) : resourceVersion;
336
+ const resolvedResourceVersion = resourceVersion === 'latest' ? (lookup.latestById.get(resolvedId) ?? null) : resourceVersion;
307
337
 
308
338
  if (!resolvedResourceVersion || !knownVersions.has(resolvedResourceVersion)) {
309
339
  return null;
@@ -311,7 +341,7 @@ const resolveResourceFromPath = (
311
341
 
312
342
  return {
313
343
  resourceCollection,
314
- resourceId,
344
+ resourceId: resolvedId,
315
345
  resourceVersion: resolvedResourceVersion,
316
346
  };
317
347
  };
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": "3.17.2",
9
+ "version": "3.17.5",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
@@ -23,7 +23,7 @@
23
23
  "@ai-sdk/react": "^3.0.17",
24
24
  "@astrojs/markdown-remark": "^6.3.10",
25
25
  "@astrojs/mdx": "^4.3.13",
26
- "@astrojs/node": "^9.5.3",
26
+ "@astrojs/node": "^9.5.4",
27
27
  "@astrojs/react": "^4.4.2",
28
28
  "@astrojs/rss": "^4.0.15",
29
29
  "@astrojs/tailwind": "^6.0.2",
@@ -50,7 +50,7 @@
50
50
  "@tanstack/react-table": "^8.17.3",
51
51
  "@xyflow/react": "^12.3.6",
52
52
  "ai": "^6.0.17",
53
- "astro": "^5.17.2",
53
+ "astro": "^5.17.3",
54
54
  "astro-compress": "^2.3.8",
55
55
  "astro-expressive-code": "^0.41.3",
56
56
  "astro-seo": "^0.8.4",
@@ -101,9 +101,9 @@
101
101
  "update-notifier": "^7.3.1",
102
102
  "uuid": "^10.0.0",
103
103
  "zod": "^3.25.0",
104
- "@eventcatalog/linter": "1.0.7",
105
- "@eventcatalog/sdk": "2.14.3",
106
- "@eventcatalog/visualiser": "^3.14.0"
104
+ "@eventcatalog/linter": "1.0.8",
105
+ "@eventcatalog/sdk": "2.15.0",
106
+ "@eventcatalog/visualiser": "^3.14.1"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@astrojs/check": "^0.9.6",