@eventcatalog/core 2.16.1 → 2.16.2

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.
Files changed (29) hide show
  1. package/bin/dist/eventcatalog.cjs +558 -0
  2. package/bin/dist/eventcatalog.config.cjs +18 -0
  3. package/bin/dist/eventcatalog.config.d.cts +35 -0
  4. package/bin/dist/eventcatalog.config.d.ts +35 -0
  5. package/bin/dist/eventcatalog.config.js +0 -0
  6. package/bin/dist/eventcatalog.d.cts +1 -0
  7. package/bin/dist/eventcatalog.d.ts +1 -0
  8. package/bin/dist/eventcatalog.js +531 -0
  9. package/dist/analytics/analytics.cjs +1 -1
  10. package/dist/analytics/analytics.js +2 -2
  11. package/dist/analytics/log-build.cjs +1 -1
  12. package/dist/analytics/log-build.js +3 -3
  13. package/dist/{chunk-GEPV3ACK.js → chunk-5K2SMJL6.js} +1 -1
  14. package/dist/{chunk-J5H7ICLD.js → chunk-7V6DXP63.js} +1 -1
  15. package/dist/{chunk-A3QFF66M.js → chunk-D5BKFMHD.js} +1 -1
  16. package/dist/constants.cjs +1 -1
  17. package/dist/constants.js +1 -1
  18. package/dist/eventcatalog.cjs +1 -1
  19. package/dist/eventcatalog.js +3 -3
  20. package/eventcatalog/src/components/SideBars/CatalogResourcesSideBar/index.tsx +1 -10
  21. package/eventcatalog/src/components/Tables/Table.tsx +1 -11
  22. package/eventcatalog/src/components/Tables/columns/DomainTableColumns.tsx +10 -4
  23. package/eventcatalog/src/components/Tables/columns/FlowTableColumns.tsx +3 -3
  24. package/eventcatalog/src/components/Tables/columns/MessageTableColumns.tsx +2 -5
  25. package/eventcatalog/src/components/Tables/columns/ServiceTableColumns.tsx +8 -2
  26. package/eventcatalog/src/components/Tables/filters/custom-filters.ts +0 -5
  27. package/eventcatalog/src/layouts/DiscoverLayout.astro +1 -1
  28. package/package.json +1 -1
  29. package/eventcatalog/src/components/Tables/columns/SharedColumns.tsx +0 -44
@@ -0,0 +1,531 @@
1
+ #!/usr/bin/env node
2
+
3
+ // bin/eventcatalog.ts
4
+ import { Command } from "commander";
5
+ import { execSync } from "node:child_process";
6
+ import { join as join2 } from "node:path";
7
+ import fs3 from "fs";
8
+ import path5 from "node:path";
9
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
10
+ import concurrently from "concurrently";
11
+
12
+ // scripts/generate.js
13
+ import path2 from "node:path";
14
+
15
+ // scripts/eventcatalog-config-file-utils.js
16
+ import { readFile, writeFile, rm } from "node:fs/promises";
17
+ import { existsSync } from "node:fs";
18
+ import { copyFile } from "node:fs/promises";
19
+ import path from "node:path";
20
+ import { v4 as uuidV4 } from "uuid";
21
+ import { pathToFileURL } from "url";
22
+ import matter from "gray-matter";
23
+ async function cleanup(projectDirectory) {
24
+ const filePath = path.join(projectDirectory, "eventcatalog.config.mjs");
25
+ if (existsSync(filePath)) {
26
+ await rm(filePath);
27
+ }
28
+ }
29
+ var getEventCatalogConfigFile = async (projectDirectory) => {
30
+ try {
31
+ let configFilePath = path.join(projectDirectory, "eventcatalog.config.js");
32
+ const filePath = path.join(projectDirectory, "package.json");
33
+ const packageJson = JSON.parse(await readFile(filePath, "utf-8"));
34
+ if (packageJson?.type !== "module") {
35
+ await copyFile(configFilePath, path.join(projectDirectory, "eventcatalog.config.mjs"));
36
+ configFilePath = path.join(projectDirectory, "eventcatalog.config.mjs");
37
+ }
38
+ const configFileURL = pathToFileURL(configFilePath).href;
39
+ const config = await import(
40
+ /* @vite-ignore */
41
+ configFileURL
42
+ );
43
+ return config.default;
44
+ } finally {
45
+ await cleanup(projectDirectory);
46
+ }
47
+ };
48
+ var writeEventCatalogConfigFile = async (projectDirectory, newConfig) => {
49
+ try {
50
+ const configFilePath = path.join(projectDirectory, "eventcatalog.config.js");
51
+ let content = await readFile(configFilePath, "utf8");
52
+ const startIndex = content.indexOf("export default {");
53
+ if (startIndex === -1) {
54
+ return;
55
+ }
56
+ Object.entries(newConfig).forEach(([key, value]) => {
57
+ const valueString = JSON.stringify(value, null, 2).replace(/"/g, "'").replace(/\n/g, "\n ");
58
+ const keyRegex = new RegExp(`(${key}\\s*:)([^,}]+)`, "g");
59
+ if (content.match(keyRegex)) {
60
+ content = content.replace(keyRegex, `$1 ${valueString}`);
61
+ } else {
62
+ const insertPosition = content.indexOf("{", startIndex) + 1;
63
+ content = content.slice(0, insertPosition) + `
64
+ ${key}: ${valueString},` + content.slice(insertPosition);
65
+ }
66
+ });
67
+ await writeFile(configFilePath, content);
68
+ } finally {
69
+ await cleanup(projectDirectory);
70
+ }
71
+ };
72
+ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
73
+ try {
74
+ const config = await getEventCatalogConfigFile(projectDirectory);
75
+ if (!config.cId) {
76
+ await writeEventCatalogConfigFile(projectDirectory, { cId: uuidV4() });
77
+ }
78
+ } catch (error) {
79
+ }
80
+ };
81
+ function addPropertyToFrontMatter(input, newProperty, newValue) {
82
+ const file = matter(input);
83
+ return matter.stringify(file.content, { ...file.data, [newProperty]: newValue });
84
+ }
85
+
86
+ // scripts/generate.js
87
+ function getDefaultExport(importedModule) {
88
+ if (importedModule === null || typeof importedModule !== "object") {
89
+ throw new Error("Invalid module");
90
+ }
91
+ if (typeof importedModule.default === "object" && importedModule.default !== null) {
92
+ return importedModule.default.default || importedModule.default;
93
+ }
94
+ if (typeof importedModule.default !== "undefined") {
95
+ return importedModule.default;
96
+ }
97
+ return importedModule;
98
+ }
99
+ var generate = async (PROJECT_DIRECTORY) => {
100
+ try {
101
+ const config = await getEventCatalogConfigFile(PROJECT_DIRECTORY);
102
+ const { generators = [] } = config;
103
+ if (!generators.length) {
104
+ console.log("No configured generators found, skipping generation");
105
+ return;
106
+ }
107
+ for (const generator of generators) {
108
+ let plugin = generator[0];
109
+ const pluginConfig = generator[1];
110
+ if (plugin.startsWith("./")) {
111
+ plugin = path2.join(PROJECT_DIRECTORY, plugin);
112
+ }
113
+ if (plugin.includes("<rootDir>")) {
114
+ plugin = plugin.replace("<rootDir>", PROJECT_DIRECTORY);
115
+ }
116
+ try {
117
+ const importedGenerator = await import(plugin);
118
+ const generator2 = getDefaultExport(importedGenerator);
119
+ await generator2({ eventCatalogConfig: {} }, pluginConfig);
120
+ } catch (error) {
121
+ console.error("Error loading plugin:", error);
122
+ await cleanup(PROJECT_DIRECTORY);
123
+ return;
124
+ }
125
+ }
126
+ await cleanup(PROJECT_DIRECTORY);
127
+ } catch (error) {
128
+ console.error(error);
129
+ await cleanup(PROJECT_DIRECTORY);
130
+ }
131
+ };
132
+
133
+ // scripts/analytics/analytics.js
134
+ import axios from "axios";
135
+ import os from "os";
136
+
137
+ // package.json
138
+ var version = "2.14.3";
139
+
140
+ // scripts/constants.ts
141
+ var VERSION = version;
142
+
143
+ // scripts/analytics/analytics.js
144
+ async function raiseEvent(eventData) {
145
+ const url = "https://queue.simpleanalyticscdn.com/events";
146
+ const userAgent = `@eventcatalog/eventcatalog@${VERSION} (${os.platform()}; ${os.arch()}; Node/${process.version})`;
147
+ const headers = {
148
+ "Content-Type": "application/json"
149
+ };
150
+ const payload = {
151
+ type: "event",
152
+ hostname: "eventcatalog.dev",
153
+ event: "@eventcatalog/eventcatalog",
154
+ metadata: {
155
+ ...eventData,
156
+ t: `t;${(/* @__PURE__ */ new Date()).toISOString()}`,
157
+ ua: userAgent
158
+ },
159
+ ua: userAgent
160
+ };
161
+ try {
162
+ await axios.post(url, payload, { headers });
163
+ } catch (error) {
164
+ }
165
+ }
166
+
167
+ // scripts/analytics/log-build.js
168
+ var main = async (projectDir) => {
169
+ if (process.env.NODE_ENV === "CI") return;
170
+ try {
171
+ await verifyRequiredFieldsAreInCatalogConfigFile(projectDir);
172
+ const configFile = await getEventCatalogConfigFile(projectDir);
173
+ const { cId, organizationName, generators = [] } = configFile;
174
+ const generatorNames = generators.length > 0 ? generators.map((generator) => generator[0]) : ["none"];
175
+ await raiseEvent({
176
+ command: "build",
177
+ org: organizationName,
178
+ cId,
179
+ generators: generatorNames.toString()
180
+ });
181
+ } catch (error) {
182
+ }
183
+ };
184
+ var log_build_default = main;
185
+
186
+ // scripts/watcher.js
187
+ import watcher from "@parcel/watcher";
188
+ import fs from "node:fs";
189
+
190
+ // scripts/map-catalog-to-astro.js
191
+ import path3 from "node:path";
192
+ var COLLECTION_KEYS = [
193
+ "events",
194
+ "commands",
195
+ "services",
196
+ "users",
197
+ "teams",
198
+ "domains",
199
+ "flows",
200
+ "pages",
201
+ "changelogs",
202
+ "queries",
203
+ "channels"
204
+ ];
205
+ function mapCatalogToAstro({ filePath, astroDir, projectDir }) {
206
+ const relativeFilePath = removeBasePath(filePath, projectDir);
207
+ if (!isCatalogRelated(relativeFilePath)) {
208
+ return [];
209
+ }
210
+ const baseTargetPaths = getBaseTargetPaths(relativeFilePath);
211
+ const relativeTargetPath = getRelativeTargetPath(relativeFilePath);
212
+ return baseTargetPaths.map(
213
+ (base) => path3.join(astroDir, base, relativeTargetPath.replace("index.md", "index.mdx").replace("changelog.md", "changelog.mdx"))
214
+ );
215
+ }
216
+ function removeBasePath(fullPath, basePath) {
217
+ const relativePath = path3.relative(basePath, fullPath);
218
+ return relativePath.startsWith("..") ? fullPath : relativePath;
219
+ }
220
+ function isCollectionKey(key) {
221
+ return COLLECTION_KEYS.includes(key);
222
+ }
223
+ function isCatalogRelated(filePath) {
224
+ const filePathArr = filePath.split(path3.sep).filter(Boolean);
225
+ if ([
226
+ "eventcatalog.config.js",
227
+ // config file at root
228
+ "eventcatalog.styles.css",
229
+ // custom styles file at root
230
+ "components",
231
+ // custom components
232
+ "public",
233
+ // public assets
234
+ ...COLLECTION_KEYS
235
+ ].includes(filePathArr[0])) {
236
+ return true;
237
+ }
238
+ return false;
239
+ }
240
+ function getBaseTargetPaths(filePath) {
241
+ const filePathArr = filePath.split(path3.sep).filter(Boolean);
242
+ if (isCollectionKey(filePathArr[0])) {
243
+ if (filePathArr[filePathArr.length - 1] == "changelog.md") {
244
+ return [path3.join("src", "content", "changelogs")];
245
+ }
246
+ if (filePathArr[filePathArr.length - 1].match(/\.md$/)) {
247
+ return [path3.join("src", "content")];
248
+ }
249
+ const hasExtension = (str) => /\.[a-zA-Z0-9]{2,}$/.test(str);
250
+ if (hasExtension(filePath)) {
251
+ return [path3.join("public", "generated"), path3.join("src", "catalog-files")];
252
+ }
253
+ return [path3.join("public", "generated"), path3.join("src", "catalog-files"), path3.join("src", "content")];
254
+ }
255
+ if (filePathArr[0] == "components") {
256
+ return [path3.join("src", "custom-defined-components")];
257
+ }
258
+ if (filePathArr[0] == "public") {
259
+ return [path3.join("public")];
260
+ }
261
+ return [path3.join("/")];
262
+ }
263
+ function getRelativeTargetPath(filePath) {
264
+ const filePathArr = filePath.split(path3.sep).filter(Boolean);
265
+ if (filePathArr[0] == "public" || filePathArr[0] == "components") {
266
+ filePathArr.shift();
267
+ }
268
+ const relativePath = [];
269
+ for (let i = filePathArr.length - 1; i >= 0; i--) {
270
+ relativePath.unshift(filePathArr[i]);
271
+ if (isCollectionKey(filePathArr[i])) break;
272
+ }
273
+ return path3.join(...relativePath);
274
+ }
275
+
276
+ // scripts/watcher.js
277
+ import { rimrafSync } from "rimraf";
278
+ async function watch(projectDirectory, catalogDirectory, callback = void 0) {
279
+ const subscription = await watcher.subscribe(
280
+ projectDirectory,
281
+ compose(
282
+ /**
283
+ * @param {Error|null} err
284
+ * @param {Event[]} events
285
+ * @returns {unknown}
286
+ */
287
+ (err, events) => {
288
+ if (err) {
289
+ return;
290
+ }
291
+ for (let event of events) {
292
+ const { path: filePath, type } = event;
293
+ const astroPaths = mapCatalogToAstro({
294
+ filePath,
295
+ astroDir: catalogDirectory,
296
+ projectDir: projectDirectory
297
+ });
298
+ for (const astroPath of astroPaths) {
299
+ switch (type) {
300
+ case "create":
301
+ case "update":
302
+ try {
303
+ if (astroPath.endsWith(".mdx")) {
304
+ const content = fs.readFileSync(astroPath, "utf-8");
305
+ const frontmatter = addPropertyToFrontMatter(content, "pathToFile", filePath);
306
+ fs.writeFileSync(astroPath, frontmatter);
307
+ }
308
+ } catch (error) {
309
+ }
310
+ if (fs.statSync(filePath).isDirectory()) fs.mkdirSync(astroPath, { recursive: true });
311
+ else retryEPERM(fs.cpSync)(filePath, astroPath);
312
+ break;
313
+ case "delete":
314
+ retryEPERM(rimrafSync)(astroPath);
315
+ break;
316
+ }
317
+ }
318
+ }
319
+ },
320
+ callback
321
+ ),
322
+ {
323
+ ignore: [`**/${catalogDirectory}/!(${projectDirectory})**`]
324
+ }
325
+ );
326
+ return () => subscription.unsubscribe();
327
+ }
328
+ function compose(...fns) {
329
+ return function(err, events) {
330
+ fns.filter(Boolean).forEach((fn, i) => {
331
+ try {
332
+ fn(err, events);
333
+ } catch (error) {
334
+ console.error({ error });
335
+ throw error;
336
+ }
337
+ });
338
+ };
339
+ }
340
+ var MAX_RETRIES = 5;
341
+ var DELAY_MS = 100;
342
+ function retryEPERM(fn) {
343
+ return (...args) => {
344
+ let retries = 0;
345
+ while (retries < MAX_RETRIES) {
346
+ try {
347
+ return fn(...args);
348
+ } catch (err) {
349
+ if (err.code !== "EPERM") throw err;
350
+ setTimeout(() => {
351
+ }, DELAY_MS);
352
+ retries += 1;
353
+ }
354
+ }
355
+ };
356
+ }
357
+
358
+ // scripts/catalog-to-astro-content-directory.js
359
+ import { glob } from "glob";
360
+ import * as path4 from "node:path";
361
+ import fs2 from "fs";
362
+ import { fileURLToPath } from "url";
363
+ import os2 from "node:os";
364
+ var __filename2 = fileURLToPath(import.meta.url);
365
+ var rootPkg = path4.resolve(
366
+ path4.dirname(__filename2),
367
+ /**
368
+ * TODO: fix me =0
369
+ *
370
+ * The following is a workaround until organize the structure to have the correct path
371
+ * for any value of NODE_ENV
372
+ *
373
+ * @author carlosallexandre
374
+ */
375
+ process.env.NODE_ENV === "test" ? "../" : "../../"
376
+ );
377
+ var copyFiles = async (source, target) => {
378
+ const files = await glob(path4.join(source, "**"), {
379
+ nodir: true,
380
+ windowsPathsNoEscape: os2.platform() == "win32"
381
+ });
382
+ for (const file of files) {
383
+ mapCatalogToAstro({
384
+ filePath: file,
385
+ astroDir: target,
386
+ projectDir: source
387
+ }).map((astroPath) => {
388
+ fs2.cpSync(file, astroPath);
389
+ return { oldPath: file, newPath: astroPath };
390
+ }).map(({ oldPath, newPath }) => {
391
+ if (!oldPath.endsWith(".md") && !oldPath.endsWith(".mdx")) return;
392
+ try {
393
+ const content = fs2.readFileSync(newPath, "utf-8");
394
+ const frontmatter = addPropertyToFrontMatter(content, "pathToFile", oldPath);
395
+ fs2.writeFileSync(newPath, frontmatter);
396
+ } catch (error) {
397
+ }
398
+ });
399
+ }
400
+ };
401
+ var ensureAstroCollectionNotEmpty = async (astroDir) => {
402
+ const COLLECTIONS = [
403
+ "events",
404
+ "commands",
405
+ "services",
406
+ "users",
407
+ "teams",
408
+ "domains",
409
+ "flows",
410
+ "pages",
411
+ "changelogs",
412
+ "queries",
413
+ "channels"
414
+ ];
415
+ const emptyCollections = [];
416
+ for (const collection of COLLECTIONS) {
417
+ const markdownFiles = await glob(path4.join(astroDir, "src/content/", collection, "**"), {
418
+ nodir: true,
419
+ windowsPathsNoEscape: os2.platform() == "win32"
420
+ });
421
+ if (markdownFiles.length === 0) emptyCollections.push(collection);
422
+ }
423
+ const defaultCollectionFilesDir = path4.join(rootPkg, "default-files-for-collections");
424
+ for (const collection of emptyCollections) {
425
+ const defaultFile = path4.join(defaultCollectionFilesDir, `${collection}.md`);
426
+ const targetDir = path4.join(astroDir, "src/content/", collection);
427
+ if (!fs2.existsSync(targetDir)) {
428
+ fs2.mkdirSync(targetDir, { recursive: true });
429
+ }
430
+ fs2.cpSync(defaultFile, path4.join(targetDir, `${collection}.md`));
431
+ }
432
+ };
433
+ var catalogToAstro = async (source, astroDir) => {
434
+ const astroContentDir = path4.join(astroDir, "src/content/");
435
+ const astroConfigFile = fs2.readFileSync(path4.join(astroContentDir, "config.ts"));
436
+ fs2.rmSync(astroContentDir, { recursive: true });
437
+ fs2.mkdirSync(astroContentDir);
438
+ fs2.writeFileSync(path4.join(astroContentDir, "config.ts"), astroConfigFile);
439
+ await verifyRequiredFieldsAreInCatalogConfigFile(source);
440
+ await copyFiles(source, astroDir);
441
+ await ensureAstroCollectionNotEmpty(astroDir);
442
+ };
443
+
444
+ // bin/eventcatalog.ts
445
+ var currentDir = path5.dirname(fileURLToPath2(import.meta.url));
446
+ var program = new Command().version(VERSION);
447
+ var dir = path5.resolve(process.env.PROJECT_DIR || process.cwd());
448
+ var core = path5.resolve(process.env.CATALOG_DIR || join2(dir, ".eventcatalog-core"));
449
+ var eventCatalogDir = path5.resolve(join2(currentDir, "../../eventcatalog/"));
450
+ program.name("eventcatalog").description("Documentation tool for event-driven architectures");
451
+ var ensureDir = (dir2) => {
452
+ if (!fs3.existsSync(dir2)) {
453
+ fs3.mkdirSync(dir2);
454
+ }
455
+ };
456
+ var copyCore = () => {
457
+ ensureDir(core);
458
+ if (eventCatalogDir === core) {
459
+ return;
460
+ }
461
+ fs3.cpSync(eventCatalogDir, core, {
462
+ recursive: true,
463
+ filter: (src) => {
464
+ return true;
465
+ }
466
+ });
467
+ };
468
+ var clearCore = () => {
469
+ if (fs3.existsSync(core)) fs3.rmSync(core, { recursive: true });
470
+ };
471
+ program.command("dev").description("Run development server of EventCatalog").option("-d, --debug", "Output EventCatalog application information into your terminal").option("--force-recreate", "Recreate the eventcatalog-core directory", false).action(async (options) => {
472
+ console.log("Setting up EventCatalog....");
473
+ if (options.debug) {
474
+ console.log("Debug mode enabled");
475
+ console.log("PROJECT_DIR", dir);
476
+ console.log("CATALOG_DIR", core);
477
+ }
478
+ if (options.forceRecreate) clearCore();
479
+ copyCore();
480
+ console.log("EventCatalog is starting at http://localhost:3000/docs");
481
+ await catalogToAstro(dir, core);
482
+ let watchUnsub;
483
+ try {
484
+ watchUnsub = await watch(dir, core);
485
+ const { result } = concurrently([
486
+ {
487
+ name: "astro",
488
+ command: "npx astro dev",
489
+ cwd: core,
490
+ env: {
491
+ PROJECT_DIR: dir,
492
+ CATALOG_DIR: core
493
+ }
494
+ }
495
+ ]);
496
+ await result;
497
+ } catch (err) {
498
+ console.error(err);
499
+ } finally {
500
+ await watchUnsub?.();
501
+ }
502
+ });
503
+ program.command("build").description("Run build of EventCatalog").action(async (options) => {
504
+ console.log("Building EventCatalog...");
505
+ copyCore();
506
+ await log_build_default(dir);
507
+ await catalogToAstro(dir, core);
508
+ execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build`, {
509
+ cwd: core,
510
+ stdio: "inherit"
511
+ });
512
+ });
513
+ var previewCatalog = () => {
514
+ copyCore();
515
+ execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview --root ${dir} --port 3000`, {
516
+ cwd: core,
517
+ stdio: "inherit"
518
+ });
519
+ };
520
+ program.command("preview").description("Serves the contents of your eventcatalog build directory").action((options) => {
521
+ console.log("Starting preview of your build...");
522
+ previewCatalog();
523
+ });
524
+ program.command("start").description("Serves the contents of your eventcatalog build directory").action((options) => {
525
+ console.log("Starting preview of your build...");
526
+ previewCatalog();
527
+ });
528
+ program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
529
+ await generate(dir);
530
+ });
531
+ program.parseAsync();
@@ -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 = "2.16.1";
40
+ var version = "2.16.2";
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-J5H7ICLD.js";
4
- import "../chunk-GEPV3ACK.js";
3
+ } from "../chunk-7V6DXP63.js";
4
+ import "../chunk-5K2SMJL6.js";
5
5
  export {
6
6
  raiseEvent
7
7
  };
@@ -106,7 +106,7 @@ var import_axios = __toESM(require("axios"), 1);
106
106
  var import_os = __toESM(require("os"), 1);
107
107
 
108
108
  // package.json
109
- var version = "2.16.1";
109
+ var version = "2.16.2";
110
110
 
111
111
  // src/constants.ts
112
112
  var VERSION = version;
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  log_build_default
3
- } from "../chunk-A3QFF66M.js";
4
- import "../chunk-J5H7ICLD.js";
5
- import "../chunk-GEPV3ACK.js";
3
+ } from "../chunk-D5BKFMHD.js";
4
+ import "../chunk-7V6DXP63.js";
5
+ import "../chunk-5K2SMJL6.js";
6
6
  import "../chunk-E7TXTI7G.js";
7
7
  export {
8
8
  log_build_default as default
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.16.1";
2
+ var version = "2.16.2";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-GEPV3ACK.js";
3
+ } from "./chunk-5K2SMJL6.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-J5H7ICLD.js";
3
+ } from "./chunk-7V6DXP63.js";
4
4
  import {
5
5
  getEventCatalogConfigFile,
6
6
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "2.16.1";
28
+ var version = "2.16.2";
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-GEPV3ACK.js";
3
+ } from "./chunk-5K2SMJL6.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -161,7 +161,7 @@ var import_axios = __toESM(require("axios"), 1);
161
161
  var import_os = __toESM(require("os"), 1);
162
162
 
163
163
  // package.json
164
- var version = "2.16.1";
164
+ var version = "2.16.2";
165
165
 
166
166
  // src/constants.ts
167
167
  var VERSION = version;
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  log_build_default
3
- } from "./chunk-A3QFF66M.js";
4
- import "./chunk-J5H7ICLD.js";
3
+ } from "./chunk-D5BKFMHD.js";
4
+ import "./chunk-7V6DXP63.js";
5
5
  import {
6
6
  catalogToAstro
7
7
  } from "./chunk-55YPRY5U.js";
8
8
  import {
9
9
  VERSION
10
- } from "./chunk-GEPV3ACK.js";
10
+ } from "./chunk-5K2SMJL6.js";
11
11
  import {
12
12
  generate
13
13
  } from "./chunk-YEQVKHST.js";
@@ -6,16 +6,7 @@ import { getIconForCollection as getIconForCollectionOriginal } from '@utils/col
6
6
 
7
7
  const STORAGE_KEY = 'EventCatalog:catalogSidebarCollapsedGroups';
8
8
 
9
- interface CatalogResourcesSideBarProps {
10
- resources: any;
11
- currentPath: string;
12
- }
13
-
14
- const CatalogResourcesSideBar: React.FC<CatalogResourcesSideBarProps> = ({ resources, currentPath }) => {
15
- if (typeof window === 'undefined') {
16
- return null;
17
- }
18
-
9
+ const CatalogResourcesSideBar = ({ resources, currentPath }: any) => {
19
10
  const [data, setData] = useState(resources);
20
11
  const [searchQuery, setSearchQuery] = useState('');
21
12
  const [isInitialized, setIsInitialized] = useState(false);
@@ -21,7 +21,7 @@ import type { CollectionTypes } from '@types';
21
21
  declare module '@tanstack/react-table' {
22
22
  // @ts-ignore
23
23
  interface ColumnMeta<TData extends RowData, TValue> {
24
- filterVariant?: 'collection' | 'name' | 'badges';
24
+ filterVariant?: 'collection' | 'name';
25
25
  collectionFilterKey?: string;
26
26
  showFilter?: boolean;
27
27
  className?: string;
@@ -211,16 +211,6 @@ function Filter({ column }: { column: Column<any, unknown> }) {
211
211
 
212
212
  return uniqueItemsInList.sort().slice(0, 2000);
213
213
  }
214
- if (filterVariant === 'badges') {
215
- const allBadges = column.getFacetedUniqueValues().keys();
216
- // join all badges into a single array
217
- const allBadgesArray = Array.from(allBadges)
218
- .flat()
219
- .filter((b) => !!b);
220
- const allBadgesString = allBadgesArray.map((badge) => badge.content);
221
- const uniqueBadges = Array.from(new Set(allBadgesString));
222
- return uniqueBadges.sort().slice(0, 2000);
223
- }
224
214
  return Array.from(column.getFacetedUniqueValues().keys()).sort().slice(0, 2000);
225
215
  }, [column.getFacetedUniqueValues(), filterVariant]);
226
216