@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.
- 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-LNIPDPVB.js → chunk-6NJZEWVT.js} +1 -1
- package/dist/{chunk-TERDXO46.js → chunk-GPD6XYQI.js} +1 -1
- package/dist/{chunk-NYVQSLA5.js → chunk-SEJTXM5L.js} +1 -1
- package/dist/{chunk-KWCAGR52.js → chunk-UFOXV4FN.js} +1 -1
- package/dist/{chunk-6NRRWRLT.js → chunk-ZP4JNCSQ.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +75 -11
- package/dist/eventcatalog.js +80 -16
- 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/components/SideNav/NestedSideBar/index.tsx +56 -10
- package/eventcatalog/src/content.config.ts +89 -20
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/_index.data.ts +85 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/[docVersion]/index.astro +195 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/_index.data.ts +86 -0
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/[docType]/[docId]/index.astro +195 -0
- package/eventcatalog/src/stores/sidebar-store/builders/container.ts +9 -0
- package/eventcatalog/src/stores/sidebar-store/builders/data-product.ts +15 -9
- package/eventcatalog/src/stores/sidebar-store/builders/domain.ts +9 -0
- package/eventcatalog/src/stores/sidebar-store/builders/flow.ts +13 -4
- package/eventcatalog/src/stores/sidebar-store/builders/message.ts +9 -0
- package/eventcatalog/src/stores/sidebar-store/builders/service.ts +9 -0
- package/eventcatalog/src/stores/sidebar-store/builders/shared.ts +82 -0
- package/eventcatalog/src/stores/sidebar-store/state.ts +27 -2
- package/eventcatalog/src/utils/collections/data-products.ts +6 -2
- package/eventcatalog/src/utils/collections/resource-docs.ts +601 -0
- package/eventcatalog/src/utils/feature.ts +1 -0
- 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-UFOXV4FN.js";
|
|
4
|
+
import "../chunk-GPD6XYQI.js";
|
|
5
5
|
import "../chunk-4UVFXLPI.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-SEJTXM5L.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
|
@@ -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.
|
|
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
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
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,
|
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-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-
|
|
25
|
+
} from "./chunk-6NJZEWVT.js";
|
|
26
26
|
import {
|
|
27
27
|
logger
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-ZP4JNCSQ.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
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
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
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
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-6NJZEWVT.js";
|
|
4
|
+
import "./chunk-ZP4JNCSQ.js";
|
|
5
|
+
import "./chunk-SEJTXM5L.js";
|
|
6
6
|
import "./chunk-5T63CXKU.js";
|
|
7
7
|
export {
|
|
8
8
|
generate
|
package/dist/utils/cli-logger.js
CHANGED
|
@@ -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
|
|
743
|
-
|
|
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
|
|
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(
|
|
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=
|
|
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=
|
|
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=
|
|
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
|
|
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=
|
|
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>
|