@eventcatalog/core 3.17.1 → 3.17.3
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/dist/analytics/analytics.cjs +1 -1
- package/dist/analytics/analytics.js +2 -2
- package/dist/analytics/log-build.cjs +1 -1
- package/dist/analytics/log-build.js +3 -3
- package/dist/{chunk-SR6JHVN3.js → chunk-3NDVIDOJ.js} +1 -1
- package/dist/{chunk-K6E76BU7.js → chunk-43IDYZCH.js} +1 -1
- package/dist/{chunk-7PAFE3DL.js → chunk-EZ23DY3F.js} +1 -1
- package/dist/{chunk-AMNLO3F4.js → chunk-PO2MP3RE.js} +1 -1
- package/dist/{chunk-Q3ZRPTSY.js → chunk-Y42PMQ5L.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +1 -1
- package/dist/eventcatalog.js +5 -5
- package/dist/generate.cjs +1 -1
- package/dist/generate.js +3 -3
- package/dist/utils/cli-logger.cjs +1 -1
- package/dist/utils/cli-logger.js +2 -2
- package/eventcatalog/src/content.config.ts +8 -12
- package/eventcatalog/src/utils/collections/resource-docs.ts +35 -5
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-PO2MP3RE.js";
|
|
4
|
+
import "../chunk-Y42PMQ5L.js";
|
|
5
5
|
import "../chunk-4UVFXLPI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-3NDVIDOJ.js";
|
|
7
7
|
import "../chunk-5T63CXKU.js";
|
|
8
8
|
export {
|
|
9
9
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -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.
|
|
117
|
+
var version = "3.17.3";
|
|
118
118
|
|
|
119
119
|
// src/constants.ts
|
|
120
120
|
var VERSION = version;
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-PO2MP3RE.js";
|
|
10
|
+
import "./chunk-Y42PMQ5L.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-
|
|
25
|
+
} from "./chunk-EZ23DY3F.js";
|
|
26
26
|
import {
|
|
27
27
|
logger
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-43IDYZCH.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-3NDVIDOJ.js";
|
|
32
32
|
import {
|
|
33
33
|
getEventCatalogConfigFile,
|
|
34
34
|
verifyRequiredFieldsAreInCatalogConfigFile
|
package/dist/generate.cjs
CHANGED
package/dist/generate.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
generate
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-EZ23DY3F.js";
|
|
4
|
+
import "./chunk-43IDYZCH.js";
|
|
5
|
+
import "./chunk-3NDVIDOJ.js";
|
|
6
6
|
import "./chunk-5T63CXKU.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -548,18 +548,14 @@ const resourceDocs = defineCollection({
|
|
|
548
548
|
const resourceDocCategories = defineCollection({
|
|
549
549
|
loader: glob({
|
|
550
550
|
pattern: withIgnoredBuildArtifacts([
|
|
551
|
-
'{events,commands,queries,services,flows,containers,channels,entities,data-products}
|
|
552
|
-
'{events,commands,queries,services,flows,containers,channels,entities,data-products}
|
|
553
|
-
'{events,commands,queries,services,flows,containers,channels,entities,data-products}
|
|
554
|
-
'{events,commands,queries,services,flows,containers,channels,entities,data-products}
|
|
555
|
-
'domains
|
|
556
|
-
'domains
|
|
557
|
-
'domains
|
|
558
|
-
'domains
|
|
559
|
-
'domains/*/subdomains/*/docs/**/category.json',
|
|
560
|
-
'domains/*/subdomains/*/docs/**/_category_.json',
|
|
561
|
-
'domains/*/subdomains/*/versioned/*/docs/**/category.json',
|
|
562
|
-
'domains/*/subdomains/*/versioned/*/docs/**/_category_.json',
|
|
551
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/**/docs/**/category.json',
|
|
552
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/**/docs/**/_category_.json',
|
|
553
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/**/versioned/*/docs/**/category.json',
|
|
554
|
+
'{events,commands,queries,services,flows,containers,channels,entities,data-products}/**/versioned/*/docs/**/_category_.json',
|
|
555
|
+
'domains/**/docs/**/category.json',
|
|
556
|
+
'domains/**/docs/**/_category_.json',
|
|
557
|
+
'domains/**/docs/category.json',
|
|
558
|
+
'domains/**/docs/_category_.json',
|
|
563
559
|
]),
|
|
564
560
|
base: projectDirBase,
|
|
565
561
|
}),
|
|
@@ -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,
|
|
322
|
+
const { resourceCollection, resourceVersion } = inferredResource;
|
|
299
323
|
const lookup = lookups[resourceCollection];
|
|
300
|
-
|
|
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(
|
|
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
|
};
|