@eventcatalog/core 3.14.6 → 3.15.0-beta.1

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 (35) hide show
  1. package/dist/analytics/analytics.cjs +1 -1
  2. package/dist/analytics/analytics.js +2 -2
  3. package/dist/analytics/log-build.cjs +1 -1
  4. package/dist/analytics/log-build.js +3 -3
  5. package/dist/{chunk-LNIPDPVB.js → chunk-6NJZEWVT.js} +1 -1
  6. package/dist/{chunk-TERDXO46.js → chunk-GPD6XYQI.js} +1 -1
  7. package/dist/{chunk-NYVQSLA5.js → chunk-SEJTXM5L.js} +1 -1
  8. package/dist/{chunk-KWCAGR52.js → chunk-UFOXV4FN.js} +1 -1
  9. package/dist/{chunk-6NRRWRLT.js → chunk-ZP4JNCSQ.js} +1 -1
  10. package/dist/constants.cjs +1 -1
  11. package/dist/constants.js +1 -1
  12. package/dist/eventcatalog.cjs +75 -11
  13. package/dist/eventcatalog.js +80 -16
  14. package/dist/generate.cjs +1 -1
  15. package/dist/generate.js +3 -3
  16. package/dist/utils/cli-logger.cjs +1 -1
  17. package/dist/utils/cli-logger.js +2 -2
  18. package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +56 -10
  19. package/eventcatalog/src/content.config.ts +89 -20
  20. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/_index.data.ts +85 -0
  21. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +195 -0
  22. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/_index.data.ts +86 -0
  23. package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +195 -0
  24. package/eventcatalog/src/stores/sidebar-store/builders/container.ts +9 -0
  25. package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +15 -9
  26. package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +9 -0
  27. package/eventcatalog/src/stores/sidebar-store/builders/flow.ts +13 -4
  28. package/eventcatalog/src/stores/sidebar-store/builders/message.ts +9 -0
  29. package/eventcatalog/src/stores/sidebar-store/builders/service.ts +9 -0
  30. package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +82 -0
  31. package/eventcatalog/src/stores/sidebar-store/state.ts +27 -2
  32. package/eventcatalog/src/utils/collections/data-products.ts +6 -2
  33. package/eventcatalog/src/utils/collections/resource-docs.ts +601 -0
  34. package/eventcatalog/src/utils/feature.ts +1 -0
  35. package/package.json +1 -1
@@ -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.14.6";
40
+ var version = "3.15.0-beta.1";
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-TERDXO46.js";
4
- import "../chunk-NYVQSLA5.js";
3
+ } from "../chunk-GPD6XYQI.js";
4
+ import "../chunk-SEJTXM5L.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.14.6";
114
+ var version = "3.15.0-beta.1";
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-KWCAGR52.js";
4
- import "../chunk-TERDXO46.js";
3
+ } from "../chunk-UFOXV4FN.js";
4
+ import "../chunk-GPD6XYQI.js";
5
5
  import "../chunk-4UVFXLPI.js";
6
- import "../chunk-NYVQSLA5.js";
6
+ import "../chunk-SEJTXM5L.js";
7
7
  import "../chunk-5T63CXKU.js";
8
8
  export {
9
9
  log_build_default as default
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  logger
3
- } from "./chunk-6NRRWRLT.js";
3
+ } from "./chunk-ZP4JNCSQ.js";
4
4
  import {
5
5
  cleanup,
6
6
  getEventCatalogConfigFile
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-NYVQSLA5.js";
3
+ } from "./chunk-SEJTXM5L.js";
4
4
 
5
5
  // src/analytics/analytics.js
6
6
  import axios from "axios";
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "3.14.6";
2
+ var version = "3.15.0-beta.1";
3
3
 
4
4
  // src/constants.ts
5
5
  var VERSION = version;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  raiseEvent
3
- } from "./chunk-TERDXO46.js";
3
+ } from "./chunk-GPD6XYQI.js";
4
4
  import {
5
5
  countResources,
6
6
  serializeCounts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-NYVQSLA5.js";
3
+ } from "./chunk-SEJTXM5L.js";
4
4
 
5
5
  // src/utils/cli-logger.ts
6
6
  import pc from "picocolors";
@@ -25,7 +25,7 @@ __export(constants_exports, {
25
25
  module.exports = __toCommonJS(constants_exports);
26
26
 
27
27
  // package.json
28
- var version = "3.14.6";
28
+ var version = "3.15.0-beta.1";
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-NYVQSLA5.js";
3
+ } from "./chunk-SEJTXM5L.js";
4
4
  export {
5
5
  VERSION
6
6
  };
@@ -115,7 +115,7 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
115
115
  var import_picocolors = __toESM(require("picocolors"), 1);
116
116
 
117
117
  // package.json
118
- var version = "3.14.6";
118
+ var version = "3.15.0-beta.1";
119
119
 
120
120
  // src/constants.ts
121
121
  var VERSION = version;
@@ -766,6 +766,67 @@ var startDevPrewarm = ({
766
766
  };
767
767
  setTimeout(tick, initialDelayMs);
768
768
  };
769
+ var createAstroLineFilter = () => {
770
+ return (line) => {
771
+ return line.includes("[glob-loader]") || /The collection.*does not exist/.test(line);
772
+ };
773
+ };
774
+ var runCommandWithFilteredOutput = async ({
775
+ command,
776
+ cwd,
777
+ env,
778
+ shouldFilterLine
779
+ }) => {
780
+ await new Promise((resolve2, reject) => {
781
+ const child = (0, import_node_child_process.spawn)(command, {
782
+ cwd,
783
+ env: {
784
+ ...process.env,
785
+ ...env
786
+ },
787
+ shell: true,
788
+ stdio: ["inherit", "pipe", "pipe"]
789
+ });
790
+ let stdoutBuffer = "";
791
+ let stderrBuffer = "";
792
+ const flush = (buffer, writer, isFinal = false) => {
793
+ const lines = buffer.split("\n");
794
+ const remaining = isFinal ? "" : lines.pop() ?? "";
795
+ for (const rawLine of lines) {
796
+ const line = rawLine.replace(/\r/g, "");
797
+ if (line.length === 0) {
798
+ writer.write("\n");
799
+ continue;
800
+ }
801
+ if (!shouldFilterLine(line)) {
802
+ writer.write(`${rawLine}
803
+ `);
804
+ }
805
+ }
806
+ return remaining;
807
+ };
808
+ child.stdout.on("data", (chunk) => {
809
+ stdoutBuffer += chunk.toString();
810
+ stdoutBuffer = flush(stdoutBuffer, process.stdout);
811
+ });
812
+ child.stderr.on("data", (chunk) => {
813
+ stderrBuffer += chunk.toString();
814
+ stderrBuffer = flush(stderrBuffer, process.stderr);
815
+ });
816
+ child.on("error", (error) => {
817
+ reject(error);
818
+ });
819
+ child.on("close", (code) => {
820
+ stdoutBuffer = flush(stdoutBuffer, process.stdout, true);
821
+ stderrBuffer = flush(stderrBuffer, process.stderr, true);
822
+ if (code === 0) {
823
+ resolve2();
824
+ return;
825
+ }
826
+ reject(new Error(`Command failed with exit code ${code}: ${command}`));
827
+ });
828
+ });
829
+ };
769
830
  var copyCore = () => {
770
831
  ensureDir(core);
771
832
  if (eventCatalogDir === core) {
@@ -922,16 +983,19 @@ program.command("build").description("Run build of EventCatalog").action(async (
922
983
  await runMigrations(dir);
923
984
  await catalogToAstro(dir, core);
924
985
  checkForUpdate();
925
- const windowsCommand = `npx astro build ${command.args.join(" ").trim()} | findstr /V "The collection"`;
926
- const unixCommand = `bash -c "set -o pipefail; npx astro build ${command.args.join(" ").trim()} 2>&1 | grep -v -e \\"\\\\[router\\\\]\\" -e \\"The collection.*does not exist\\""`;
927
- const buildCommand = process.platform === "win32" ? windowsCommand : unixCommand;
928
- (0, import_node_child_process.execSync)(
929
- `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} ${buildCommand}`,
930
- {
931
- cwd: core,
932
- stdio: "inherit"
933
- }
934
- );
986
+ const args = command.args.join(" ").trim();
987
+ await runCommandWithFilteredOutput({
988
+ command: `npx astro build ${args}`,
989
+ cwd: core,
990
+ env: {
991
+ PROJECT_DIR: dir,
992
+ CATALOG_DIR: core,
993
+ ENABLE_EMBED: String(canEmbedPages),
994
+ EVENTCATALOG_STARTER: String(isEventCatalogStarter),
995
+ EVENTCATALOG_SCALE: String(isEventCatalogScale)
996
+ },
997
+ shouldFilterLine: createAstroLineFilter()
998
+ });
935
999
  });
936
1000
  var previewCatalog = ({
937
1001
  command,
@@ -6,8 +6,8 @@ import {
6
6
  } from "./chunk-PLNJC7NZ.js";
7
7
  import {
8
8
  log_build_default
9
- } from "./chunk-KWCAGR52.js";
10
- import "./chunk-TERDXO46.js";
9
+ } from "./chunk-UFOXV4FN.js";
10
+ import "./chunk-GPD6XYQI.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-LNIPDPVB.js";
25
+ } from "./chunk-6NJZEWVT.js";
26
26
  import {
27
27
  logger
28
- } from "./chunk-6NRRWRLT.js";
28
+ } from "./chunk-ZP4JNCSQ.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-NYVQSLA5.js";
31
+ } from "./chunk-SEJTXM5L.js";
32
32
  import {
33
33
  getEventCatalogConfigFile,
34
34
  verifyRequiredFieldsAreInCatalogConfigFile
@@ -36,7 +36,7 @@ import {
36
36
 
37
37
  // src/eventcatalog.ts
38
38
  import { Command } from "commander";
39
- import { execSync } from "child_process";
39
+ import { execSync, spawn } from "child_process";
40
40
  import { join } from "path";
41
41
  import http from "http";
42
42
  import fs from "fs";
@@ -117,6 +117,67 @@ var startDevPrewarm = ({
117
117
  };
118
118
  setTimeout(tick, initialDelayMs);
119
119
  };
120
+ var createAstroLineFilter = () => {
121
+ return (line) => {
122
+ return line.includes("[glob-loader]") || /The collection.*does not exist/.test(line);
123
+ };
124
+ };
125
+ var runCommandWithFilteredOutput = async ({
126
+ command,
127
+ cwd,
128
+ env,
129
+ shouldFilterLine
130
+ }) => {
131
+ await new Promise((resolve, reject) => {
132
+ const child = spawn(command, {
133
+ cwd,
134
+ env: {
135
+ ...process.env,
136
+ ...env
137
+ },
138
+ shell: true,
139
+ stdio: ["inherit", "pipe", "pipe"]
140
+ });
141
+ let stdoutBuffer = "";
142
+ let stderrBuffer = "";
143
+ const flush = (buffer, writer, isFinal = false) => {
144
+ const lines = buffer.split("\n");
145
+ const remaining = isFinal ? "" : lines.pop() ?? "";
146
+ for (const rawLine of lines) {
147
+ const line = rawLine.replace(/\r/g, "");
148
+ if (line.length === 0) {
149
+ writer.write("\n");
150
+ continue;
151
+ }
152
+ if (!shouldFilterLine(line)) {
153
+ writer.write(`${rawLine}
154
+ `);
155
+ }
156
+ }
157
+ return remaining;
158
+ };
159
+ child.stdout.on("data", (chunk) => {
160
+ stdoutBuffer += chunk.toString();
161
+ stdoutBuffer = flush(stdoutBuffer, process.stdout);
162
+ });
163
+ child.stderr.on("data", (chunk) => {
164
+ stderrBuffer += chunk.toString();
165
+ stderrBuffer = flush(stderrBuffer, process.stderr);
166
+ });
167
+ child.on("error", (error) => {
168
+ reject(error);
169
+ });
170
+ child.on("close", (code) => {
171
+ stdoutBuffer = flush(stdoutBuffer, process.stdout, true);
172
+ stderrBuffer = flush(stderrBuffer, process.stderr, true);
173
+ if (code === 0) {
174
+ resolve();
175
+ return;
176
+ }
177
+ reject(new Error(`Command failed with exit code ${code}: ${command}`));
178
+ });
179
+ });
180
+ };
120
181
  var copyCore = () => {
121
182
  ensureDir(core);
122
183
  if (eventCatalogDir === core) {
@@ -273,16 +334,19 @@ program.command("build").description("Run build of EventCatalog").action(async (
273
334
  await runMigrations(dir);
274
335
  await catalogToAstro(dir, core);
275
336
  checkForUpdate();
276
- const windowsCommand = `npx astro build ${command.args.join(" ").trim()} | findstr /V "The collection"`;
277
- const unixCommand = `bash -c "set -o pipefail; npx astro build ${command.args.join(" ").trim()} 2>&1 | grep -v -e \\"\\\\[router\\\\]\\" -e \\"The collection.*does not exist\\""`;
278
- const buildCommand = process.platform === "win32" ? windowsCommand : unixCommand;
279
- execSync(
280
- `cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' ENABLE_EMBED=${canEmbedPages} EVENTCATALOG_STARTER=${isEventCatalogStarter} EVENTCATALOG_SCALE=${isEventCatalogScale} ${buildCommand}`,
281
- {
282
- cwd: core,
283
- stdio: "inherit"
284
- }
285
- );
337
+ const args = command.args.join(" ").trim();
338
+ await runCommandWithFilteredOutput({
339
+ command: `npx astro build ${args}`,
340
+ cwd: core,
341
+ env: {
342
+ PROJECT_DIR: dir,
343
+ CATALOG_DIR: core,
344
+ ENABLE_EMBED: String(canEmbedPages),
345
+ EVENTCATALOG_STARTER: String(isEventCatalogStarter),
346
+ EVENTCATALOG_SCALE: String(isEventCatalogScale)
347
+ },
348
+ shouldFilterLine: createAstroLineFilter()
349
+ });
286
350
  });
287
351
  var previewCatalog = ({
288
352
  command,
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.14.6";
81
+ var version = "3.15.0-beta.1";
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-LNIPDPVB.js";
4
- import "./chunk-6NRRWRLT.js";
5
- import "./chunk-NYVQSLA5.js";
3
+ } from "./chunk-6NJZEWVT.js";
4
+ import "./chunk-ZP4JNCSQ.js";
5
+ import "./chunk-SEJTXM5L.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.14.6";
39
+ var version = "3.15.0-beta.1";
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-6NRRWRLT.js";
4
- import "../chunk-NYVQSLA5.js";
3
+ } from "../chunk-ZP4JNCSQ.js";
4
+ import "../chunk-SEJTXM5L.js";
5
5
  export {
6
6
  logger
7
7
  };
@@ -723,6 +723,7 @@ export default function NestedSideBar() {
723
723
  const renderGroup = (group: NavNode, groupKey: string | null, index: number) => {
724
724
  // Get optional icon for group
725
725
  const GroupIcon = group.icon ? (LucideIcons as unknown as Record<string, LucideIcons.LucideIcon>)[group.icon] : null;
726
+ const isSubtleGroup = group.subtle === true;
726
727
 
727
728
  // Get visible children
728
729
  const visibleChildren =
@@ -730,43 +731,82 @@ export default function NestedSideBar() {
730
731
  const child = resolveRef(childRef);
731
732
  return child && isVisible(child);
732
733
  }) ?? [];
734
+ const shouldFlattenSubtleChildren =
735
+ !isSubtleGroup &&
736
+ visibleChildren.length > 0 &&
737
+ visibleChildren.every((childRef) => {
738
+ const child = resolveRef(childRef);
739
+ return !!child && isGroup(child) && child.subtle === true;
740
+ });
733
741
 
734
742
  const groupId = groupKey || `group-${index}`;
735
- const isCollapsed = collapsedSections.has(groupId);
736
743
  const canCollapse = visibleChildren.length > 3;
744
+ const isCollapsed = collapsedSections.has(groupId);
737
745
 
738
746
  const headerContent = (
739
747
  <>
740
748
  <div className="flex items-center gap-2">
741
749
  {GroupIcon && (
742
- <span className="flex items-center justify-center w-5 h-5 rounded bg-[rgb(var(--ec-group-icon-bg))] text-[rgb(var(--ec-group-icon-text))]">
743
- <GroupIcon className="w-3 h-3" />
750
+ <span
751
+ className={cn(
752
+ 'flex items-center justify-center',
753
+ isSubtleGroup
754
+ ? 'w-4 h-4 text-[rgb(var(--ec-content-text-muted))]'
755
+ : 'w-5 h-5 rounded bg-[rgb(var(--ec-group-icon-bg))] text-[rgb(var(--ec-group-icon-text))]'
756
+ )}
757
+ >
758
+ <GroupIcon className={cn(isSubtleGroup ? 'w-3 h-3' : 'w-3 h-3')} />
744
759
  </span>
745
760
  )}
746
- <span className="text-[13px] text-[rgb(var(--ec-content-text))] font-semibold tracking-tight">{group.title}</span>
761
+ <span
762
+ className={cn(
763
+ 'tracking-tight',
764
+ isSubtleGroup
765
+ ? 'text-[12px] text-[rgb(var(--ec-content-text-muted))] font-medium'
766
+ : 'text-[13px] text-[rgb(var(--ec-content-text))] font-semibold'
767
+ )}
768
+ >
769
+ {group.title}
770
+ </span>
747
771
  </div>
748
772
  {canCollapse && (
749
773
  <ChevronDown
750
- className={cn('w-4 h-4 text-[rgb(var(--ec-icon-color))] transition-transform', isCollapsed && '-rotate-90')}
774
+ className={cn(
775
+ isSubtleGroup ? 'w-3.5 h-3.5' : 'w-4 h-4',
776
+ 'text-[rgb(var(--ec-icon-color))] transition-transform',
777
+ isCollapsed && '-rotate-90'
778
+ )}
751
779
  />
752
780
  )}
753
781
  </>
754
782
  );
755
783
 
756
784
  return (
757
- <div key={`group-${groupKey || index}`} className="mb-5 last:mb-2">
785
+ <div key={`group-${groupKey || index}`} className={cn(isSubtleGroup ? 'mb-3 last:mb-1' : 'mb-5 last:mb-2')}>
758
786
  {canCollapse ? (
759
787
  <button
760
788
  onClick={() => toggleSectionCollapse(groupId)}
761
- className="flex items-center justify-between w-full px-2 py-1.5 hover:bg-[rgb(var(--ec-content-hover))] rounded-md transition-colors cursor-pointer"
789
+ className={cn(
790
+ 'flex items-center justify-between w-full rounded-md transition-colors cursor-pointer',
791
+ isSubtleGroup
792
+ ? 'px-1.5 py-1 hover:bg-[rgb(var(--ec-content-hover))]/60'
793
+ : 'px-2 py-1.5 hover:bg-[rgb(var(--ec-content-hover))]'
794
+ )}
762
795
  >
763
796
  {headerContent}
764
797
  </button>
765
798
  ) : (
766
- <div className="flex items-center justify-between px-2 py-1.5">{headerContent}</div>
799
+ <div className={cn('flex items-center justify-between', isSubtleGroup ? 'px-1.5 py-1' : 'px-2 py-1.5')}>
800
+ {headerContent}
801
+ </div>
767
802
  )}
768
803
  {!isCollapsed && (
769
- <div className="flex flex-col gap-0.5 border-l ml-4 mt-1 border-[rgb(var(--ec-content-border))]">
804
+ <div
805
+ className={cn(
806
+ 'flex flex-col gap-0.5 border-[rgb(var(--ec-content-border))]',
807
+ isSubtleGroup ? 'border-l ml-3 mt-0.5' : shouldFlattenSubtleChildren ? 'mt-1' : 'border-l ml-4 mt-1'
808
+ )}
809
+ >
770
810
  {visibleChildren.map((childRef, childIndex) => {
771
811
  const child = resolveRef(childRef);
772
812
  if (!child) return null;
@@ -780,7 +820,13 @@ export default function NestedSideBar() {
780
820
  return (
781
821
  <div
782
822
  key={`nested-group-${childKey || childIndex}`}
783
- className="ml-3 mt-1.5 pl-3 border-l border-[rgb(var(--ec-content-border))]"
823
+ className={cn(
824
+ child.subtle
825
+ ? shouldFlattenSubtleChildren
826
+ ? 'ml-5 mt-0.5'
827
+ : 'ml-1.5 mt-1 pl-1.5'
828
+ : 'ml-3 mt-1.5 pl-3 border-l border-[rgb(var(--ec-content-border))]'
829
+ )}
784
830
  >
785
831
  {renderGroup(child, childKey, childIndex)}
786
832
  </div>