@eventcatalog/core 2.64.4 → 2.65.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/README.md +2 -1
- 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-622JYJWG.js +109 -0
- package/dist/{chunk-MDWC22V7.js → chunk-B2DX6NNM.js} +1 -1
- package/dist/chunk-BH3JMNAV.js +12 -0
- package/dist/{chunk-BXXJNRMA.js → chunk-KGYO3DWA.js} +1 -1
- package/dist/{chunk-KEEW2PJ4.js → chunk-WHI74T3R.js} +1 -1
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +145 -24
- package/dist/eventcatalog.js +15 -3
- package/dist/migrations/index.cjs +150 -0
- package/dist/migrations/index.d.cts +3 -0
- package/dist/migrations/index.d.ts +3 -0
- package/dist/migrations/index.js +7 -0
- package/dist/migrations/message-channels-to-service-channels.cjs +139 -0
- package/dist/migrations/message-channels-to-service-channels.d.cts +6 -0
- package/dist/migrations/message-channels-to-service-channels.d.ts +6 -0
- package/dist/migrations/message-channels-to-service-channels.js +6 -0
- package/eventcatalog/src/components/MDX/NodeGraph/Edges/AnimatedMessageEdge.tsx +42 -28
- package/eventcatalog/src/components/SideNav/ListViewSideBar/index.tsx +41 -35
- package/eventcatalog/src/content.config.ts +31 -3
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/ai-provider.ts +0 -4
- package/eventcatalog/src/hooks/eventcatalog-visualizer.ts +35 -15
- package/eventcatalog/src/utils/channels.ts +73 -1
- package/eventcatalog/src/utils/collections/util.ts +7 -0
- package/eventcatalog/src/utils/node-graphs/channel-node-graph.ts +75 -0
- package/eventcatalog/src/utils/node-graphs/message-node-graph.ts +856 -61
- package/eventcatalog/src/utils/node-graphs/services-node-graph.ts +46 -70
- package/eventcatalog/src/utils/node-graphs/utils/utils.ts +26 -80
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
<h4>Features: Documentation for Event Driven Architectures, Integration with any broker, Generator from your OpenAPI and AsyncAPI documents, Docs and Code, Markdown driven, Document Domains/Services/Messages/Schemas and more, Content versioning, Assign Owners, Schemas, OpenAPI, MDX Components and more...</h4>
|
|
35
35
|
|
|
36
36
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
37
|
-
[](#contributors-)
|
|
38
38
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
39
39
|
|
|
40
40
|
[Read the Docs](https://www.eventcatalog.dev/docs/development/getting-started/introduction) | [View Demo](https://demo.eventcatalog.dev)
|
|
@@ -272,6 +272,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
272
272
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/reisingerf"><img src="https://avatars.githubusercontent.com/u/31906163?v=4?s=100" width="100px;" alt="reisingerf"/><br /><sub><b>reisingerf</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=reisingerf" title="Documentation">📖</a></td>
|
|
273
273
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jbarette-rossel"><img src="https://avatars.githubusercontent.com/u/162966566?v=4?s=100" width="100px;" alt="Jonathan Barette"/><br /><sub><b>Jonathan Barette</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=jbarette-rossel" title="Code">💻</a></td>
|
|
274
274
|
<td align="center" valign="top" width="14.28%"><a href="https://github.com/mumundum"><img src="https://avatars.githubusercontent.com/u/196062898?v=4?s=100" width="100px;" alt="mumundum"/><br /><sub><b>mumundum</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/commits?author=mumundum" title="Code">💻</a></td>
|
|
275
|
+
<td align="center" valign="top" width="14.28%"><a href="https://www.argonus.tech"><img src="https://avatars.githubusercontent.com/u/9743549?v=4?s=100" width="100px;" alt="Piotr Rybarczyk"/><br /><sub><b>Piotr Rybarczyk</b></sub></a><br /><a href="https://github.com/event-catalog/eventcatalog/issues?q=author%3AArgonus" title="Bug reports">🐛</a></td>
|
|
275
276
|
</tr>
|
|
276
277
|
</tbody>
|
|
277
278
|
</table>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-KGYO3DWA.js";
|
|
4
|
+
import "../chunk-B2DX6NNM.js";
|
|
5
|
+
import "../chunk-WHI74T3R.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// src/migrations/message-channels-to-service-channels.ts
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import { glob } from "glob";
|
|
4
|
+
import os from "os";
|
|
5
|
+
import matter from "gray-matter";
|
|
6
|
+
import path from "path";
|
|
7
|
+
var message_channels_to_service_channels_default = async (dir) => {
|
|
8
|
+
const PROJECT_DIR = path.join(dir || process.env.PROJECT_DIR);
|
|
9
|
+
const messages = await glob(
|
|
10
|
+
[
|
|
11
|
+
"**/events/*/index.mdx",
|
|
12
|
+
"**/events/*/index.md",
|
|
13
|
+
"**/events/*/versioned/*/index.mdx",
|
|
14
|
+
"**/events/*/versioned/*/index.md",
|
|
15
|
+
// commands
|
|
16
|
+
"**/commands/*/index.mdx",
|
|
17
|
+
"**/commands/*/index.md",
|
|
18
|
+
"**/commands/*/versioned/*/index.mdx",
|
|
19
|
+
"**/commands/*/versioned/*/index.md",
|
|
20
|
+
// queries
|
|
21
|
+
"**/queries/*/index.mdx",
|
|
22
|
+
"**/queries/*/index.md",
|
|
23
|
+
"**/queries/*/versioned/*/index.mdx",
|
|
24
|
+
"**/queries/*/versioned/*/index.md"
|
|
25
|
+
],
|
|
26
|
+
{
|
|
27
|
+
// const events = await glob(['**/events/*/index.(md|mdx)', '**/events/*/versioned/*/index.(md|mdx)'], {
|
|
28
|
+
cwd: PROJECT_DIR,
|
|
29
|
+
absolute: true,
|
|
30
|
+
nodir: true,
|
|
31
|
+
windowsPathsNoEscape: os.platform() == "win32",
|
|
32
|
+
ignore: ["node_modules/**", "**/dist/**", "**/teams", "**/users", "**/package.json", "**/Dockerfile"]
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
const services = await glob(
|
|
36
|
+
[
|
|
37
|
+
"**/services/*/index.mdx",
|
|
38
|
+
"**/services/*/index.md",
|
|
39
|
+
"**/services/*/versioned/*/index.mdx",
|
|
40
|
+
"**/services/*/versioned/*/index.md"
|
|
41
|
+
],
|
|
42
|
+
{
|
|
43
|
+
cwd: PROJECT_DIR,
|
|
44
|
+
absolute: true
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
const messagesWithChannels = messages.reduce((acc, message) => {
|
|
48
|
+
const file = fs.readFileSync(message, "utf8");
|
|
49
|
+
const { data } = matter(file);
|
|
50
|
+
if (data.channels?.length > 0) {
|
|
51
|
+
acc.push({
|
|
52
|
+
...data,
|
|
53
|
+
path: message
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return acc;
|
|
57
|
+
}, []);
|
|
58
|
+
if (messagesWithChannels.length === 0) {
|
|
59
|
+
return { status: "success", message: "No messages with channels found in the catalog" };
|
|
60
|
+
}
|
|
61
|
+
const servicesWithChannels = services.reduce((acc, service) => {
|
|
62
|
+
const file = fs.readFileSync(service, "utf8");
|
|
63
|
+
const { data } = matter(file);
|
|
64
|
+
const isSending = data.sends?.some((send) => messagesWithChannels.some((message) => message.id === send.id));
|
|
65
|
+
const isReceiving = data.receives?.some(
|
|
66
|
+
(receive) => messagesWithChannels.some((message) => message.id === receive.id)
|
|
67
|
+
);
|
|
68
|
+
if (isSending || isReceiving) {
|
|
69
|
+
acc.push({
|
|
70
|
+
...data,
|
|
71
|
+
path: service
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
return acc;
|
|
75
|
+
}, []);
|
|
76
|
+
for (const service of servicesWithChannels) {
|
|
77
|
+
const file = fs.readFileSync(service.path, "utf8");
|
|
78
|
+
const { data } = matter(file);
|
|
79
|
+
const messagesTheServiceSendsThatNeedUpdating = data.sends?.filter((send) => messagesWithChannels.some((message) => message.id === send.id)) ?? [];
|
|
80
|
+
const messagesTheServiceReceivesThatNeedUpdating = data.receives?.filter((receive) => messagesWithChannels.some((message) => message.id === receive.id)) ?? [];
|
|
81
|
+
if (messagesTheServiceSendsThatNeedUpdating.length > 0 || messagesTheServiceReceivesThatNeedUpdating.length > 0) {
|
|
82
|
+
const newSends = messagesTheServiceSendsThatNeedUpdating.map((send) => ({
|
|
83
|
+
...send,
|
|
84
|
+
to: messagesWithChannels.map((message) => message.id === send.id ? message.channels : []).flat().filter((channel) => channel !== null)
|
|
85
|
+
}));
|
|
86
|
+
const newReceives = messagesTheServiceReceivesThatNeedUpdating.map((receive) => ({
|
|
87
|
+
...receive,
|
|
88
|
+
from: messagesWithChannels.map((message) => message.id === receive.id ? message.channels : []).flat().filter((channel) => channel !== null)
|
|
89
|
+
}));
|
|
90
|
+
const newData = {
|
|
91
|
+
...data,
|
|
92
|
+
...newSends.length > 0 ? { sends: newSends } : {},
|
|
93
|
+
...newReceives.length > 0 ? { receives: newReceives } : {}
|
|
94
|
+
};
|
|
95
|
+
fs.writeFileSync(service.path, matter.stringify(file, newData));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
for (const message of messagesWithChannels) {
|
|
99
|
+
const file = fs.readFileSync(message.path, "utf8");
|
|
100
|
+
const parsed = matter(file);
|
|
101
|
+
const { channels, ...newData } = parsed.data;
|
|
102
|
+
fs.writeFileSync(message.path, matter.stringify(parsed.content, newData));
|
|
103
|
+
}
|
|
104
|
+
console.log("\u2714 Channels migrated to new services API");
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
export {
|
|
108
|
+
message_channels_to_service_channels_default
|
|
109
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
message_channels_to_service_channels_default
|
|
3
|
+
} from "./chunk-622JYJWG.js";
|
|
4
|
+
|
|
5
|
+
// src/migrations/index.ts
|
|
6
|
+
var runMigrations = async (dir) => {
|
|
7
|
+
await message_channels_to_service_channels_default(dir);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
runMigrations
|
|
12
|
+
};
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -29,9 +29,9 @@ var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
|
29
29
|
// src/eventcatalog.ts
|
|
30
30
|
var import_commander = require("commander");
|
|
31
31
|
var import_node_child_process = require("child_process");
|
|
32
|
-
var
|
|
32
|
+
var import_node_path7 = require("path");
|
|
33
33
|
var import_fs2 = __toESM(require("fs"), 1);
|
|
34
|
-
var
|
|
34
|
+
var import_node_path8 = __toESM(require("path"), 1);
|
|
35
35
|
var import_node_url = require("url");
|
|
36
36
|
var import_concurrently = __toESM(require("concurrently"), 1);
|
|
37
37
|
|
|
@@ -157,7 +157,7 @@ var import_axios = __toESM(require("axios"), 1);
|
|
|
157
157
|
var import_os = __toESM(require("os"), 1);
|
|
158
158
|
|
|
159
159
|
// package.json
|
|
160
|
-
var version = "2.
|
|
160
|
+
var version = "2.65.0-beta.1";
|
|
161
161
|
|
|
162
162
|
// src/constants.ts
|
|
163
163
|
var VERSION = version;
|
|
@@ -522,15 +522,128 @@ var isAuthEnabled = async () => {
|
|
|
522
522
|
// src/eventcatalog.ts
|
|
523
523
|
var import_update_notifier = __toESM(require("update-notifier"), 1);
|
|
524
524
|
var import_dotenv = __toESM(require("dotenv"), 1);
|
|
525
|
+
|
|
526
|
+
// src/migrations/message-channels-to-service-channels.ts
|
|
527
|
+
var import_node_fs5 = __toESM(require("fs"), 1);
|
|
528
|
+
var import_glob2 = require("glob");
|
|
529
|
+
var import_node_os2 = __toESM(require("os"), 1);
|
|
530
|
+
var import_gray_matter3 = __toESM(require("gray-matter"), 1);
|
|
531
|
+
var import_node_path6 = __toESM(require("path"), 1);
|
|
532
|
+
var message_channels_to_service_channels_default = async (dir2) => {
|
|
533
|
+
const PROJECT_DIR = import_node_path6.default.join(dir2 || process.env.PROJECT_DIR);
|
|
534
|
+
const messages = await (0, import_glob2.glob)(
|
|
535
|
+
[
|
|
536
|
+
"**/events/*/index.mdx",
|
|
537
|
+
"**/events/*/index.md",
|
|
538
|
+
"**/events/*/versioned/*/index.mdx",
|
|
539
|
+
"**/events/*/versioned/*/index.md",
|
|
540
|
+
// commands
|
|
541
|
+
"**/commands/*/index.mdx",
|
|
542
|
+
"**/commands/*/index.md",
|
|
543
|
+
"**/commands/*/versioned/*/index.mdx",
|
|
544
|
+
"**/commands/*/versioned/*/index.md",
|
|
545
|
+
// queries
|
|
546
|
+
"**/queries/*/index.mdx",
|
|
547
|
+
"**/queries/*/index.md",
|
|
548
|
+
"**/queries/*/versioned/*/index.mdx",
|
|
549
|
+
"**/queries/*/versioned/*/index.md"
|
|
550
|
+
],
|
|
551
|
+
{
|
|
552
|
+
// const events = await glob(['**/events/*/index.(md|mdx)', '**/events/*/versioned/*/index.(md|mdx)'], {
|
|
553
|
+
cwd: PROJECT_DIR,
|
|
554
|
+
absolute: true,
|
|
555
|
+
nodir: true,
|
|
556
|
+
windowsPathsNoEscape: import_node_os2.default.platform() == "win32",
|
|
557
|
+
ignore: ["node_modules/**", "**/dist/**", "**/teams", "**/users", "**/package.json", "**/Dockerfile"]
|
|
558
|
+
}
|
|
559
|
+
);
|
|
560
|
+
const services = await (0, import_glob2.glob)(
|
|
561
|
+
[
|
|
562
|
+
"**/services/*/index.mdx",
|
|
563
|
+
"**/services/*/index.md",
|
|
564
|
+
"**/services/*/versioned/*/index.mdx",
|
|
565
|
+
"**/services/*/versioned/*/index.md"
|
|
566
|
+
],
|
|
567
|
+
{
|
|
568
|
+
cwd: PROJECT_DIR,
|
|
569
|
+
absolute: true
|
|
570
|
+
}
|
|
571
|
+
);
|
|
572
|
+
const messagesWithChannels = messages.reduce((acc, message) => {
|
|
573
|
+
const file = import_node_fs5.default.readFileSync(message, "utf8");
|
|
574
|
+
const { data } = (0, import_gray_matter3.default)(file);
|
|
575
|
+
if (data.channels?.length > 0) {
|
|
576
|
+
acc.push({
|
|
577
|
+
...data,
|
|
578
|
+
path: message
|
|
579
|
+
});
|
|
580
|
+
}
|
|
581
|
+
return acc;
|
|
582
|
+
}, []);
|
|
583
|
+
if (messagesWithChannels.length === 0) {
|
|
584
|
+
return { status: "success", message: "No messages with channels found in the catalog" };
|
|
585
|
+
}
|
|
586
|
+
const servicesWithChannels = services.reduce((acc, service) => {
|
|
587
|
+
const file = import_node_fs5.default.readFileSync(service, "utf8");
|
|
588
|
+
const { data } = (0, import_gray_matter3.default)(file);
|
|
589
|
+
const isSending = data.sends?.some((send) => messagesWithChannels.some((message) => message.id === send.id));
|
|
590
|
+
const isReceiving = data.receives?.some(
|
|
591
|
+
(receive) => messagesWithChannels.some((message) => message.id === receive.id)
|
|
592
|
+
);
|
|
593
|
+
if (isSending || isReceiving) {
|
|
594
|
+
acc.push({
|
|
595
|
+
...data,
|
|
596
|
+
path: service
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
return acc;
|
|
600
|
+
}, []);
|
|
601
|
+
for (const service of servicesWithChannels) {
|
|
602
|
+
const file = import_node_fs5.default.readFileSync(service.path, "utf8");
|
|
603
|
+
const { data } = (0, import_gray_matter3.default)(file);
|
|
604
|
+
const messagesTheServiceSendsThatNeedUpdating = data.sends?.filter((send) => messagesWithChannels.some((message) => message.id === send.id)) ?? [];
|
|
605
|
+
const messagesTheServiceReceivesThatNeedUpdating = data.receives?.filter((receive) => messagesWithChannels.some((message) => message.id === receive.id)) ?? [];
|
|
606
|
+
if (messagesTheServiceSendsThatNeedUpdating.length > 0 || messagesTheServiceReceivesThatNeedUpdating.length > 0) {
|
|
607
|
+
const newSends = messagesTheServiceSendsThatNeedUpdating.map((send) => ({
|
|
608
|
+
...send,
|
|
609
|
+
to: messagesWithChannels.map((message) => message.id === send.id ? message.channels : []).flat().filter((channel) => channel !== null)
|
|
610
|
+
}));
|
|
611
|
+
const newReceives = messagesTheServiceReceivesThatNeedUpdating.map((receive) => ({
|
|
612
|
+
...receive,
|
|
613
|
+
from: messagesWithChannels.map((message) => message.id === receive.id ? message.channels : []).flat().filter((channel) => channel !== null)
|
|
614
|
+
}));
|
|
615
|
+
const newData = {
|
|
616
|
+
...data,
|
|
617
|
+
...newSends.length > 0 ? { sends: newSends } : {},
|
|
618
|
+
...newReceives.length > 0 ? { receives: newReceives } : {}
|
|
619
|
+
};
|
|
620
|
+
import_node_fs5.default.writeFileSync(service.path, import_gray_matter3.default.stringify(file, newData));
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
for (const message of messagesWithChannels) {
|
|
624
|
+
const file = import_node_fs5.default.readFileSync(message.path, "utf8");
|
|
625
|
+
const parsed = (0, import_gray_matter3.default)(file);
|
|
626
|
+
const { channels, ...newData } = parsed.data;
|
|
627
|
+
import_node_fs5.default.writeFileSync(message.path, import_gray_matter3.default.stringify(parsed.content, newData));
|
|
628
|
+
}
|
|
629
|
+
console.log("\u2714 Channels migrated to new services API");
|
|
630
|
+
};
|
|
631
|
+
|
|
632
|
+
// src/migrations/index.ts
|
|
633
|
+
var runMigrations = async (dir2) => {
|
|
634
|
+
await message_channels_to_service_channels_default(dir2);
|
|
635
|
+
};
|
|
636
|
+
|
|
637
|
+
// src/eventcatalog.ts
|
|
525
638
|
var import_license = require("@eventcatalog/license");
|
|
526
|
-
var currentDir =
|
|
639
|
+
var currentDir = import_node_path8.default.dirname((0, import_node_url.fileURLToPath)(importMetaUrl));
|
|
527
640
|
var program = new import_commander.Command().version(VERSION);
|
|
528
|
-
var dir =
|
|
529
|
-
var core =
|
|
530
|
-
var eventCatalogDir =
|
|
641
|
+
var dir = import_node_path8.default.resolve(process.env.PROJECT_DIR || process.cwd());
|
|
642
|
+
var core = import_node_path8.default.resolve(process.env.CATALOG_DIR || (0, import_node_path7.join)(dir, ".eventcatalog-core"));
|
|
643
|
+
var eventCatalogDir = import_node_path8.default.resolve((0, import_node_path7.join)(currentDir, "../eventcatalog/"));
|
|
531
644
|
var getInstalledEventCatalogVersion = () => {
|
|
532
645
|
try {
|
|
533
|
-
const pkg = import_fs2.default.readFileSync((0,
|
|
646
|
+
const pkg = import_fs2.default.readFileSync((0, import_node_path7.join)(dir, "package.json"), "utf8");
|
|
534
647
|
const json = JSON.parse(pkg);
|
|
535
648
|
return json.dependencies["@eventcatalog/core"];
|
|
536
649
|
} catch (error) {
|
|
@@ -557,13 +670,19 @@ var copyCore = () => {
|
|
|
557
670
|
};
|
|
558
671
|
var copyServerFiles = async () => {
|
|
559
672
|
const isServerOutput = await isOutputServer();
|
|
560
|
-
if (import_fs2.default.existsSync((0,
|
|
561
|
-
import_fs2.default.rmSync((0,
|
|
673
|
+
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/server"))) {
|
|
674
|
+
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/server"), { recursive: true });
|
|
562
675
|
}
|
|
563
676
|
if (!isServerOutput) {
|
|
677
|
+
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"))) {
|
|
678
|
+
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"));
|
|
679
|
+
}
|
|
680
|
+
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"))) {
|
|
681
|
+
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"));
|
|
682
|
+
}
|
|
564
683
|
return;
|
|
565
684
|
}
|
|
566
|
-
import_fs2.default.cpSync((0,
|
|
685
|
+
import_fs2.default.cpSync((0, import_node_path7.join)(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), (0, import_node_path7.join)(core, "src/pages/api"), {
|
|
567
686
|
recursive: true
|
|
568
687
|
});
|
|
569
688
|
};
|
|
@@ -574,7 +693,7 @@ var createAuthFileIfNotExists = async (hasRequiredLicense) => {
|
|
|
574
693
|
if (authEnabled && hasRequiredLicense && isSRR) {
|
|
575
694
|
console.log("Creating auth file");
|
|
576
695
|
import_fs2.default.writeFileSync(
|
|
577
|
-
(0,
|
|
696
|
+
(0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"),
|
|
578
697
|
`import { AstroAuth } from 'auth-astro/server';
|
|
579
698
|
export const prerender = false;
|
|
580
699
|
export const { GET, POST } = AstroAuth();
|
|
@@ -617,8 +736,8 @@ Run npm i @eventcatalog/core to update`;
|
|
|
617
736
|
};
|
|
618
737
|
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) => {
|
|
619
738
|
console.log("Setting up EventCatalog....");
|
|
620
|
-
if (import_fs2.default.existsSync(
|
|
621
|
-
import_dotenv.default.config({ path:
|
|
739
|
+
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
740
|
+
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
622
741
|
}
|
|
623
742
|
if (options.debug) {
|
|
624
743
|
console.log("Debug mode enabled");
|
|
@@ -629,6 +748,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
629
748
|
copyCore();
|
|
630
749
|
await resolve_catalog_dependencies_default(dir, core);
|
|
631
750
|
await checkAndConvertMdToMdx(dir, core);
|
|
751
|
+
await runMigrations(dir);
|
|
632
752
|
await catalogToAstro(dir, core);
|
|
633
753
|
await copyServerFiles();
|
|
634
754
|
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
@@ -671,8 +791,8 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
671
791
|
});
|
|
672
792
|
program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
|
|
673
793
|
console.log("Building EventCatalog...");
|
|
674
|
-
if (import_fs2.default.existsSync(
|
|
675
|
-
import_dotenv.default.config({ path:
|
|
794
|
+
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
795
|
+
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
676
796
|
}
|
|
677
797
|
copyCore();
|
|
678
798
|
await copyServerFiles();
|
|
@@ -691,6 +811,7 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
691
811
|
});
|
|
692
812
|
await resolve_catalog_dependencies_default(dir, core);
|
|
693
813
|
await checkAndConvertMdToMdx(dir, core);
|
|
814
|
+
await runMigrations(dir);
|
|
694
815
|
await catalogToAstro(dir, core);
|
|
695
816
|
checkForUpdate();
|
|
696
817
|
const windowsCommand = `npx astro build ${command.args.join(" ").trim()} | findstr /V "The collection"`;
|
|
@@ -715,8 +836,8 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
715
836
|
stdio: "inherit"
|
|
716
837
|
}
|
|
717
838
|
);
|
|
718
|
-
if (import_fs2.default.existsSync((0,
|
|
719
|
-
import_fs2.default.cpSync((0,
|
|
839
|
+
if (import_fs2.default.existsSync((0, import_node_path7.join)(dir, outDir, "pagefind"))) {
|
|
840
|
+
import_fs2.default.cpSync((0, import_node_path7.join)(dir, outDir, "pagefind"), (0, import_node_path7.join)(dir, "public", "pagefind"), { recursive: true });
|
|
720
841
|
}
|
|
721
842
|
}
|
|
722
843
|
});
|
|
@@ -750,8 +871,8 @@ var startServerCatalog = ({
|
|
|
750
871
|
};
|
|
751
872
|
program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
752
873
|
console.log("Starting preview of your build...");
|
|
753
|
-
if (import_fs2.default.existsSync(
|
|
754
|
-
import_dotenv.default.config({ path:
|
|
874
|
+
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
875
|
+
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
755
876
|
}
|
|
756
877
|
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
757
878
|
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
@@ -765,8 +886,8 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
765
886
|
});
|
|
766
887
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
767
888
|
console.log("Starting preview of your build...");
|
|
768
|
-
if (import_fs2.default.existsSync(
|
|
769
|
-
import_dotenv.default.config({ path:
|
|
889
|
+
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
890
|
+
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
770
891
|
}
|
|
771
892
|
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
772
893
|
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
@@ -792,8 +913,8 @@ program.command("start").description("Serves the contents of your eventcatalog b
|
|
|
792
913
|
}
|
|
793
914
|
});
|
|
794
915
|
program.command("generate [siteDir]").description("Start the generator scripts.").action(async () => {
|
|
795
|
-
if (import_fs2.default.existsSync(
|
|
796
|
-
import_dotenv.default.config({ path:
|
|
916
|
+
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
917
|
+
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
797
918
|
}
|
|
798
919
|
await generate(dir);
|
|
799
920
|
});
|
package/dist/eventcatalog.js
CHANGED
|
@@ -6,8 +6,12 @@ import {
|
|
|
6
6
|
} from "./chunk-PLNJC7NZ.js";
|
|
7
7
|
import {
|
|
8
8
|
log_build_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-KGYO3DWA.js";
|
|
10
|
+
import "./chunk-B2DX6NNM.js";
|
|
11
|
+
import {
|
|
12
|
+
runMigrations
|
|
13
|
+
} from "./chunk-BH3JMNAV.js";
|
|
14
|
+
import "./chunk-622JYJWG.js";
|
|
11
15
|
import {
|
|
12
16
|
catalogToAstro,
|
|
13
17
|
checkAndConvertMdToMdx
|
|
@@ -15,7 +19,7 @@ import {
|
|
|
15
19
|
import "./chunk-55D645EH.js";
|
|
16
20
|
import {
|
|
17
21
|
VERSION
|
|
18
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-WHI74T3R.js";
|
|
19
23
|
import {
|
|
20
24
|
getProjectOutDir,
|
|
21
25
|
isAuthEnabled,
|
|
@@ -76,6 +80,12 @@ var copyServerFiles = async () => {
|
|
|
76
80
|
fs.rmSync(join(core, "src/pages/api/server"), { recursive: true });
|
|
77
81
|
}
|
|
78
82
|
if (!isServerOutput) {
|
|
83
|
+
if (fs.existsSync(join(core, "src/pages/api/chat.ts"))) {
|
|
84
|
+
fs.rmSync(join(core, "src/pages/api/chat.ts"));
|
|
85
|
+
}
|
|
86
|
+
if (fs.existsSync(join(core, "src/pages/api/[...auth].ts"))) {
|
|
87
|
+
fs.rmSync(join(core, "src/pages/api/[...auth].ts"));
|
|
88
|
+
}
|
|
79
89
|
return;
|
|
80
90
|
}
|
|
81
91
|
fs.cpSync(join(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), join(core, "src/pages/api"), {
|
|
@@ -144,6 +154,7 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
144
154
|
copyCore();
|
|
145
155
|
await resolve_catalog_dependencies_default(dir, core);
|
|
146
156
|
await checkAndConvertMdToMdx(dir, core);
|
|
157
|
+
await runMigrations(dir);
|
|
147
158
|
await catalogToAstro(dir, core);
|
|
148
159
|
await copyServerFiles();
|
|
149
160
|
const canEmbedPages = await isFeatureEnabled(
|
|
@@ -206,6 +217,7 @@ program.command("build").description("Run build of EventCatalog").action(async (
|
|
|
206
217
|
});
|
|
207
218
|
await resolve_catalog_dependencies_default(dir, core);
|
|
208
219
|
await checkAndConvertMdToMdx(dir, core);
|
|
220
|
+
await runMigrations(dir);
|
|
209
221
|
await catalogToAstro(dir, core);
|
|
210
222
|
checkForUpdate();
|
|
211
223
|
const windowsCommand = `npx astro build ${command.args.join(" ").trim()} | findstr /V "The collection"`;
|