@eventcatalog/core 2.16.4 → 2.16.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.
- 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-CV37NPK3.js → chunk-AUXNC7PZ.js} +1 -1
- package/dist/{chunk-X7R2UJHK.js → chunk-EXL47VH2.js} +1 -1
- package/dist/{chunk-YHWKWHZA.js → chunk-SSON27NB.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +25 -14
- package/dist/eventcatalog.js +27 -16
- package/eventcatalog/src/components/MDX/Tabs/TabItem.astro +10 -0
- package/eventcatalog/src/components/MDX/Tabs/Tabs.astro +100 -0
- package/eventcatalog/src/components/MDX/components.tsx +4 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-AUXNC7PZ.js";
|
|
4
|
+
import "../chunk-SSON27NB.js";
|
|
5
|
+
import "../chunk-EXL47VH2.js";
|
|
6
6
|
import "../chunk-E7TXTI7G.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -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.
|
|
164
|
+
var version = "2.16.5";
|
|
165
165
|
|
|
166
166
|
// src/constants.ts
|
|
167
167
|
var VERSION = version;
|
|
@@ -492,7 +492,7 @@ var copyCore = () => {
|
|
|
492
492
|
var clearCore = () => {
|
|
493
493
|
if (import_fs2.default.existsSync(core)) import_fs2.default.rmSync(core, { recursive: true });
|
|
494
494
|
};
|
|
495
|
-
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) => {
|
|
495
|
+
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, command) => {
|
|
496
496
|
console.log("Setting up EventCatalog....");
|
|
497
497
|
if (options.debug) {
|
|
498
498
|
console.log("Debug mode enabled");
|
|
@@ -509,7 +509,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
509
509
|
const { result } = (0, import_concurrently.default)([
|
|
510
510
|
{
|
|
511
511
|
name: "astro",
|
|
512
|
-
command:
|
|
512
|
+
command: `npx astro dev ${command.args.join(" ").trim()}`,
|
|
513
513
|
cwd: core,
|
|
514
514
|
env: {
|
|
515
515
|
PROJECT_DIR: dir,
|
|
@@ -524,33 +524,44 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
524
524
|
await watchUnsub?.();
|
|
525
525
|
}
|
|
526
526
|
});
|
|
527
|
-
program.command("build").description("Run build of EventCatalog").action(async (options) => {
|
|
527
|
+
program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
|
|
528
528
|
console.log("Building EventCatalog...");
|
|
529
529
|
copyCore();
|
|
530
530
|
await log_build_default(dir);
|
|
531
531
|
await catalogToAstro(dir, core);
|
|
532
|
-
(0, import_node_child_process.execSync)(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build`, {
|
|
532
|
+
(0, import_node_child_process.execSync)(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build ${command.args.join(" ").trim()}`, {
|
|
533
533
|
cwd: core,
|
|
534
534
|
stdio: "inherit"
|
|
535
535
|
});
|
|
536
536
|
});
|
|
537
|
-
var previewCatalog = () => {
|
|
538
|
-
(0, import_node_child_process.execSync)(
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
537
|
+
var previewCatalog = ({ command }) => {
|
|
538
|
+
(0, import_node_child_process.execSync)(
|
|
539
|
+
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview --root ${dir} --port 3000 ${command.args.join(" ").trim()}`,
|
|
540
|
+
{
|
|
541
|
+
cwd: core,
|
|
542
|
+
stdio: "inherit"
|
|
543
|
+
}
|
|
544
|
+
);
|
|
542
545
|
};
|
|
543
|
-
program.command("preview").description("Serves the contents of your eventcatalog build directory").action((options) => {
|
|
546
|
+
program.command("preview").description("Serves the contents of your eventcatalog build directory").action((options, command) => {
|
|
544
547
|
console.log("Starting preview of your build...");
|
|
545
|
-
previewCatalog();
|
|
548
|
+
previewCatalog({ command });
|
|
546
549
|
});
|
|
547
|
-
program.command("start").description("Serves the contents of your eventcatalog build directory").action((options) => {
|
|
550
|
+
program.command("start").description("Serves the contents of your eventcatalog build directory").action((options, command) => {
|
|
548
551
|
console.log("Starting preview of your build...");
|
|
549
|
-
previewCatalog();
|
|
552
|
+
previewCatalog({ command });
|
|
550
553
|
});
|
|
551
554
|
program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
|
|
552
555
|
await generate(dir);
|
|
553
556
|
});
|
|
557
|
+
program.addHelpText(
|
|
558
|
+
"after",
|
|
559
|
+
`
|
|
560
|
+
Passing Extra Arguments:
|
|
561
|
+
Use the -- delimiter to forward arguments to the underlying process.
|
|
562
|
+
Example: npx eventcatalog dev --debug -- --env=production --port=3000
|
|
563
|
+
`
|
|
564
|
+
);
|
|
554
565
|
program.parseAsync().then(() => process.exit(0)).catch((err) => {
|
|
555
566
|
console.error(err);
|
|
556
567
|
process.exit(1);
|
package/dist/eventcatalog.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-AUXNC7PZ.js";
|
|
4
|
+
import "./chunk-SSON27NB.js";
|
|
5
5
|
import {
|
|
6
6
|
catalogToAstro
|
|
7
7
|
} from "./chunk-55YPRY5U.js";
|
|
8
8
|
import {
|
|
9
9
|
VERSION
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EXL47VH2.js";
|
|
11
11
|
import {
|
|
12
12
|
generate
|
|
13
13
|
} from "./chunk-YEQVKHST.js";
|
|
@@ -51,7 +51,7 @@ var copyCore = () => {
|
|
|
51
51
|
var clearCore = () => {
|
|
52
52
|
if (fs.existsSync(core)) fs.rmSync(core, { recursive: true });
|
|
53
53
|
};
|
|
54
|
-
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) => {
|
|
54
|
+
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, command) => {
|
|
55
55
|
console.log("Setting up EventCatalog....");
|
|
56
56
|
if (options.debug) {
|
|
57
57
|
console.log("Debug mode enabled");
|
|
@@ -68,7 +68,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
68
68
|
const { result } = concurrently([
|
|
69
69
|
{
|
|
70
70
|
name: "astro",
|
|
71
|
-
command:
|
|
71
|
+
command: `npx astro dev ${command.args.join(" ").trim()}`,
|
|
72
72
|
cwd: core,
|
|
73
73
|
env: {
|
|
74
74
|
PROJECT_DIR: dir,
|
|
@@ -83,33 +83,44 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
83
83
|
await watchUnsub?.();
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
|
-
program.command("build").description("Run build of EventCatalog").action(async (options) => {
|
|
86
|
+
program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
|
|
87
87
|
console.log("Building EventCatalog...");
|
|
88
88
|
copyCore();
|
|
89
89
|
await log_build_default(dir);
|
|
90
90
|
await catalogToAstro(dir, core);
|
|
91
|
-
execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build`, {
|
|
91
|
+
execSync(`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro build ${command.args.join(" ").trim()}`, {
|
|
92
92
|
cwd: core,
|
|
93
93
|
stdio: "inherit"
|
|
94
94
|
});
|
|
95
95
|
});
|
|
96
|
-
var previewCatalog = () => {
|
|
97
|
-
execSync(
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
96
|
+
var previewCatalog = ({ command }) => {
|
|
97
|
+
execSync(
|
|
98
|
+
`cross-env PROJECT_DIR='${dir}' CATALOG_DIR='${core}' npx astro preview --root ${dir} --port 3000 ${command.args.join(" ").trim()}`,
|
|
99
|
+
{
|
|
100
|
+
cwd: core,
|
|
101
|
+
stdio: "inherit"
|
|
102
|
+
}
|
|
103
|
+
);
|
|
101
104
|
};
|
|
102
|
-
program.command("preview").description("Serves the contents of your eventcatalog build directory").action((options) => {
|
|
105
|
+
program.command("preview").description("Serves the contents of your eventcatalog build directory").action((options, command) => {
|
|
103
106
|
console.log("Starting preview of your build...");
|
|
104
|
-
previewCatalog();
|
|
107
|
+
previewCatalog({ command });
|
|
105
108
|
});
|
|
106
|
-
program.command("start").description("Serves the contents of your eventcatalog build directory").action((options) => {
|
|
109
|
+
program.command("start").description("Serves the contents of your eventcatalog build directory").action((options, command) => {
|
|
107
110
|
console.log("Starting preview of your build...");
|
|
108
|
-
previewCatalog();
|
|
111
|
+
previewCatalog({ command });
|
|
109
112
|
});
|
|
110
113
|
program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
|
|
111
114
|
await generate(dir);
|
|
112
115
|
});
|
|
116
|
+
program.addHelpText(
|
|
117
|
+
"after",
|
|
118
|
+
`
|
|
119
|
+
Passing Extra Arguments:
|
|
120
|
+
Use the -- delimiter to forward arguments to the underlying process.
|
|
121
|
+
Example: npx eventcatalog dev --debug -- --env=production --port=3000
|
|
122
|
+
`
|
|
123
|
+
);
|
|
113
124
|
program.parseAsync().then(() => process.exit(0)).catch((err) => {
|
|
114
125
|
console.error(err);
|
|
115
126
|
process.exit(1);
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
interface TabItem {
|
|
3
|
+
title: string;
|
|
4
|
+
content: string;
|
|
5
|
+
id: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface Props {
|
|
9
|
+
title?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const { title } = Astro.props;
|
|
13
|
+
|
|
14
|
+
const tabItems: TabItem[] = await Promise.all(
|
|
15
|
+
(await Astro.slots.render('default'))
|
|
16
|
+
.split('</li>')
|
|
17
|
+
.filter((item: string) => item.trim())
|
|
18
|
+
.map(async (item: string, index: number) => {
|
|
19
|
+
const titleMatch = item.match(/button>([^<]+)</);
|
|
20
|
+
const title = titleMatch ? titleMatch[1].trim() : `Tab ${index + 1}`;
|
|
21
|
+
const content = item.replace(/<button>[^<]+<\/button>/, '');
|
|
22
|
+
return {
|
|
23
|
+
title,
|
|
24
|
+
content,
|
|
25
|
+
id: index + 1,
|
|
26
|
+
};
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
// Generate a unique ID for this tabs instance
|
|
31
|
+
const tabsId = Math.random().toString(36).substring(2, 9);
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<div class="bg-white text-gray-800 pb-10 not-prose" data-tabs-container={tabsId}>
|
|
35
|
+
{title && <h2 class="text-2xl font-bold text-gray-800 mb-6">{title}</h2>}
|
|
36
|
+
|
|
37
|
+
{/* Tab List */}
|
|
38
|
+
<div class="">
|
|
39
|
+
<nav class="-mb-px flex" aria-label="Tabs">
|
|
40
|
+
{
|
|
41
|
+
tabItems.map((item) => (
|
|
42
|
+
<button
|
|
43
|
+
class="whitespace-nowrap py-4 px-1 border-b-2 px-6 font-bold text-sm border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300 hover:bg-gray-100 focus:outline-none"
|
|
44
|
+
data-tab={item.id}
|
|
45
|
+
aria-selected="false"
|
|
46
|
+
>
|
|
47
|
+
{item.title}
|
|
48
|
+
</button>
|
|
49
|
+
))
|
|
50
|
+
}
|
|
51
|
+
</nav>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
{/* Tab Panels */}
|
|
55
|
+
<div class="mt-4">
|
|
56
|
+
{
|
|
57
|
+
tabItems.map((item) => (
|
|
58
|
+
<div class="hidden tab-content" data-tab-content={item.id} role="tabpanel">
|
|
59
|
+
<Fragment set:html={item.content} />
|
|
60
|
+
</div>
|
|
61
|
+
))
|
|
62
|
+
}
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<script>
|
|
67
|
+
function initTabs(container: HTMLElement): void {
|
|
68
|
+
const tabs: NodeListOf<HTMLButtonElement> = container.querySelectorAll('[data-tab]');
|
|
69
|
+
const panels: NodeListOf<HTMLElement> = container.querySelectorAll('[data-tab-content]');
|
|
70
|
+
|
|
71
|
+
// Show first tab by default
|
|
72
|
+
tabs[0]?.classList.add('text-purple-600', 'border-purple-600');
|
|
73
|
+
tabs[0]?.classList.remove('text-gray-500', 'border-transparent');
|
|
74
|
+
panels[0]?.classList.remove('hidden');
|
|
75
|
+
|
|
76
|
+
tabs.forEach((tab: HTMLButtonElement) => {
|
|
77
|
+
tab.addEventListener('click', () => {
|
|
78
|
+
// Remove active states
|
|
79
|
+
tabs.forEach((t: HTMLButtonElement) => {
|
|
80
|
+
t.classList.remove('text-purple-600', 'border-purple-600');
|
|
81
|
+
t.classList.add('text-gray-500', 'border-transparent');
|
|
82
|
+
});
|
|
83
|
+
panels.forEach((p: HTMLElement) => p.classList.add('hidden'));
|
|
84
|
+
|
|
85
|
+
// Set active states
|
|
86
|
+
tab.classList.remove('text-gray-500', 'border-transparent');
|
|
87
|
+
tab.classList.add('text-purple-600', 'border-purple-600');
|
|
88
|
+
|
|
89
|
+
// Show corresponding panel
|
|
90
|
+
const tabId = tab.getAttribute('data-tab');
|
|
91
|
+
container.querySelector(`[data-tab-content="${tabId}"]`)?.classList.remove('hidden');
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Initialize all tab containers
|
|
97
|
+
document.querySelectorAll('[data-tabs-container]').forEach((container: Element) => {
|
|
98
|
+
initTabs(container as HTMLElement);
|
|
99
|
+
});
|
|
100
|
+
</script>
|
|
@@ -12,6 +12,8 @@ import Admonition from '@components/MDX/Admonition';
|
|
|
12
12
|
import OpenAPI from '@components/MDX/OpenAPI/OpenAPI.astro';
|
|
13
13
|
import AsyncAPI from '@components/MDX/AsyncAPI/AsyncAPI.astro';
|
|
14
14
|
import ChannelInformation from '@components/MDX/ChannelInformation/ChannelInformation';
|
|
15
|
+
import Tabs from '@components/MDX/Tabs/Tabs.astro';
|
|
16
|
+
import TabItem from '@components/MDX/Tabs/TabItem.astro';
|
|
15
17
|
|
|
16
18
|
// Portals: required for server/client components
|
|
17
19
|
import NodeGraphPortal from '@components/MDX/NodeGraph/NodeGraphPortal';
|
|
@@ -29,6 +31,8 @@ const components = (props: any) => {
|
|
|
29
31
|
Tiles,
|
|
30
32
|
Step,
|
|
31
33
|
Steps,
|
|
34
|
+
Tabs,
|
|
35
|
+
TabItem,
|
|
32
36
|
Admonition: (mdxProp: any) => <Admonition {...mdxProp} {...props} />,
|
|
33
37
|
File: (mdxProp: any) => File({ ...props, ...mdxProp }),
|
|
34
38
|
NodeGraph: (mdxProp: any) => NodeGraphPortal({ ...props.data, ...mdxProp }),
|