@eventcatalog/core 3.0.0-beta.2 → 3.0.0-beta.20
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 +10 -0
- 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-JSONCD7V.js → chunk-7ANM33NO.js} +1 -1
- package/dist/{chunk-H4QHE5YZ.js → chunk-BLIEWBVS.js} +1 -1
- package/dist/{chunk-PQL6O5YA.js → chunk-IZGKMOOO.js} +1 -1
- package/dist/chunk-SUPFYBDY.js +44 -0
- package/dist/{chunk-3W6JYTHP.js → chunk-VDAAJC4X.js} +6 -2
- package/dist/constants.cjs +1 -1
- package/dist/constants.js +1 -1
- package/dist/eventcatalog.cjs +84 -65
- package/dist/eventcatalog.config.d.cts +4 -0
- package/dist/eventcatalog.config.d.ts +4 -0
- package/dist/eventcatalog.js +45 -57
- package/dist/generate.cjs +48 -2
- package/dist/generate.js +3 -1
- package/dist/utils/cli-logger.cjs +82 -0
- package/dist/utils/cli-logger.d.cts +10 -0
- package/dist/utils/cli-logger.d.ts +10 -0
- package/dist/utils/cli-logger.js +7 -0
- package/eventcatalog/astro.config.mjs +4 -1
- package/eventcatalog/integrations/ecstudio-watcher.mjs +1 -1
- package/eventcatalog/integrations/eventcatalog-features.ts +69 -0
- package/eventcatalog/public/icons/asyncapi-black.svg +2 -0
- package/eventcatalog/public/icons/graphql-black.svg +1 -0
- package/eventcatalog/public/icons/openapi-black.svg +1 -0
- package/eventcatalog/src/components/ChatPanel/ChatPanel.tsx +821 -0
- package/eventcatalog/src/components/ChatPanel/ChatPanelButton.tsx +24 -0
- package/eventcatalog/src/components/Grids/DomainGrid.tsx +1 -3
- package/eventcatalog/src/components/Grids/MessageGrid.tsx +8 -8
- package/eventcatalog/src/components/Header.astro +25 -5
- package/eventcatalog/src/components/MDX/NodeGraph/NodeGraph.tsx +14 -3
- package/eventcatalog/src/components/Search/Search.astro +2 -2
- package/eventcatalog/src/components/Search/SearchModal.tsx +16 -7
- package/eventcatalog/src/components/SideNav/NestedSideBar/SearchBar.tsx +9 -2
- package/eventcatalog/src/components/SideNav/NestedSideBar/builders/domain.ts +7 -6
- package/eventcatalog/src/components/SideNav/NestedSideBar/builders/service.ts +6 -3
- package/eventcatalog/src/components/SideNav/NestedSideBar/builders/shared.ts +1 -0
- package/eventcatalog/src/components/SideNav/NestedSideBar/index.tsx +23 -8
- package/eventcatalog/src/components/SideNav/NestedSideBar/sidebar-builder.ts +57 -11
- package/eventcatalog/src/content.config.ts +1 -10
- package/eventcatalog/src/enterprise/ai/chat-api.ts +262 -0
- package/eventcatalog/src/enterprise/auth/[...auth].ts +3 -0
- package/eventcatalog/src/enterprise/auth/login.astro +420 -0
- package/eventcatalog/src/enterprise/collections/index.ts +0 -1
- package/eventcatalog/src/layouts/Footer.astro +8 -5
- package/eventcatalog/src/layouts/VerticalSideBarLayout.astro +30 -19
- package/eventcatalog/src/pages/_index.astro +8 -9
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/asyncapi/[filename].astro +19 -3
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/changelog/index.astro +7 -7
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/graphql/[filename].astro +1 -1
- package/eventcatalog/src/pages/docs/[type]/[id]/[version]/index.astro +5 -5
- package/eventcatalog/src/pages/docs/teams/[id].mdx.ts +36 -0
- package/eventcatalog/src/pages/docs/users/[id].mdx.ts +36 -0
- package/eventcatalog/src/pages/schemas/explorer/_index.data.ts +178 -0
- package/eventcatalog/src/pages/schemas/explorer/index.astro +5 -155
- package/eventcatalog/src/remark-plugins/directives.ts +30 -9
- package/eventcatalog/src/utils/collections/schemas.ts +31 -7
- package/eventcatalog/src/utils/feature.ts +8 -4
- package/eventcatalog/src/utils/resource-files.ts +86 -0
- package/package.json +11 -11
- package/eventcatalog/src/enterprise/collections/chat-prompts.ts +0 -32
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/Chat.tsx +0 -60
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatMessage.tsx +0 -414
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/ChatSidebar.tsx +0 -169
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/InputModal.tsx +0 -244
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/MentionInput.tsx +0 -211
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/WelcomePromptArea.tsx +0 -176
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/default-prompts.ts +0 -93
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/hooks/ChatProvider.tsx +0 -143
- package/eventcatalog/src/enterprise/eventcatalog-chat/components/windows/ChatWindow.server.tsx +0 -387
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/api/chat.ts +0 -59
- package/eventcatalog/src/enterprise/eventcatalog-chat/pages/chat/index.astro +0 -104
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/ai-provider.ts +0 -140
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/anthropic.ts +0 -28
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/google.ts +0 -41
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/index.ts +0 -26
- package/eventcatalog/src/enterprise/eventcatalog-chat/providers/openai.ts +0 -61
- package/eventcatalog/src/enterprise/eventcatalog-chat/utils/chat-prompts.ts +0 -50
- package/eventcatalog/src/pages/auth/login.astro +0 -280
- package/eventcatalog/src/pages/chat/feature.astro +0 -179
- package/eventcatalog/src/pages/chat/index.astro +0 -10
- package/eventcatalog/src/pages/nav-index.json.ts +0 -30
- /package/eventcatalog/src/{pages → enterprise}/auth/error.astro +0 -0
- /package/eventcatalog/src/{middleware-auth.ts → enterprise/auth/middleware/middleware-auth.ts} +0 -0
- /package/eventcatalog/src/{middleware.ts → enterprise/auth/middleware/middleware.ts} +0 -0
- /package/eventcatalog/src/{pages/unauthorized/index.astro → enterprise/auth/unauthorized.astro} +0 -0
- /package/eventcatalog/src/{pages → enterprise}/plans/index.astro +0 -0
package/README.md
CHANGED
|
@@ -123,6 +123,16 @@ Interested in collaborating with us? Our offerings include dedicated support, pr
|
|
|
123
123
|
|
|
124
124
|
Find more details on our [services page](https://eventcatalog.dev/services).
|
|
125
125
|
|
|
126
|
+
# Looking for v2?
|
|
127
|
+
|
|
128
|
+
You can find v2 on our [release/v2 branch](https://github.com/event-catalog/eventcatalog/tree/release/v2).
|
|
129
|
+
|
|
130
|
+
We are currently working on `main` which is the current major version of EventCatalog.
|
|
131
|
+
|
|
132
|
+
We are only applying patch fixes and security updates to `v2.x.x` going forward.
|
|
133
|
+
|
|
134
|
+
If you would like to make a change to v2, please raise a pull request against the `release/v2` branch.
|
|
135
|
+
|
|
126
136
|
# Looking for v1?
|
|
127
137
|
|
|
128
138
|
- Documentation: https://v1.eventcatalog.dev
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
log_build_default
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-IZGKMOOO.js";
|
|
4
|
+
import "../chunk-7ANM33NO.js";
|
|
5
|
+
import "../chunk-BLIEWBVS.js";
|
|
6
6
|
import "../chunk-UPONRQSN.js";
|
|
7
7
|
export {
|
|
8
8
|
log_build_default as default
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
VERSION
|
|
3
|
+
} from "./chunk-BLIEWBVS.js";
|
|
4
|
+
|
|
5
|
+
// src/utils/cli-logger.ts
|
|
6
|
+
import pc from "picocolors";
|
|
7
|
+
var getTimestamp = () => {
|
|
8
|
+
const now = /* @__PURE__ */ new Date();
|
|
9
|
+
return now.toLocaleTimeString("en-US", { hour12: false });
|
|
10
|
+
};
|
|
11
|
+
var formatMessage = (tag, message, tagColor) => {
|
|
12
|
+
return `${pc.dim(getTimestamp())} ${tagColor(`[${tag}]`)} ${message}`;
|
|
13
|
+
};
|
|
14
|
+
var logger = {
|
|
15
|
+
welcome: () => {
|
|
16
|
+
console.log();
|
|
17
|
+
console.log(pc.magenta(pc.bold("\u{1F680} EventCatalog")) + pc.dim(` (v${VERSION})`));
|
|
18
|
+
console.log(pc.dim("https://eventcatalog.dev"));
|
|
19
|
+
console.log();
|
|
20
|
+
console.log(
|
|
21
|
+
pc.dim("If you like the project, we would appreciate a star on GitHub \u2764\uFE0F - ") + pc.bold("https://github.com/event-catalog/eventcatalog/stargazers")
|
|
22
|
+
);
|
|
23
|
+
console.log();
|
|
24
|
+
},
|
|
25
|
+
info: (message, tag = "info") => {
|
|
26
|
+
console.log(formatMessage(tag, message, pc.blue));
|
|
27
|
+
},
|
|
28
|
+
success: (message, tag = "success") => {
|
|
29
|
+
console.log(formatMessage(tag, message, pc.green));
|
|
30
|
+
},
|
|
31
|
+
error: (message, tag = "error") => {
|
|
32
|
+
console.log(formatMessage(tag, message, pc.red));
|
|
33
|
+
},
|
|
34
|
+
warning: (message, tag = "warn") => {
|
|
35
|
+
console.log(formatMessage(tag, message, pc.yellow));
|
|
36
|
+
},
|
|
37
|
+
dim: (message) => {
|
|
38
|
+
console.log(pc.dim(message));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
logger
|
|
44
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
logger
|
|
3
|
+
} from "./chunk-SUPFYBDY.js";
|
|
1
4
|
import {
|
|
2
5
|
cleanup,
|
|
3
6
|
getEventCatalogConfigFile
|
|
@@ -22,7 +25,7 @@ var generate = async (PROJECT_DIRECTORY) => {
|
|
|
22
25
|
const config = await getEventCatalogConfigFile(PROJECT_DIRECTORY);
|
|
23
26
|
const { generators = [] } = config;
|
|
24
27
|
if (!generators.length) {
|
|
25
|
-
|
|
28
|
+
logger.info("No configured generators found, skipping generation", "generator");
|
|
26
29
|
return;
|
|
27
30
|
}
|
|
28
31
|
for (const generator of generators) {
|
|
@@ -39,7 +42,8 @@ var generate = async (PROJECT_DIRECTORY) => {
|
|
|
39
42
|
const generator2 = getDefaultExport(importedGenerator);
|
|
40
43
|
await generator2({ eventCatalogConfig: {} }, pluginConfig);
|
|
41
44
|
} catch (error) {
|
|
42
|
-
|
|
45
|
+
logger.error("Error loading plugin:", "generator");
|
|
46
|
+
console.error(error);
|
|
43
47
|
await cleanup(PROJECT_DIRECTORY);
|
|
44
48
|
return;
|
|
45
49
|
}
|
package/dist/constants.cjs
CHANGED
package/dist/constants.js
CHANGED
package/dist/eventcatalog.cjs
CHANGED
|
@@ -105,6 +105,51 @@ var verifyRequiredFieldsAreInCatalogConfigFile = async (projectDirectory) => {
|
|
|
105
105
|
}
|
|
106
106
|
};
|
|
107
107
|
|
|
108
|
+
// src/utils/cli-logger.ts
|
|
109
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
110
|
+
|
|
111
|
+
// package.json
|
|
112
|
+
var version = "3.0.0-beta.20";
|
|
113
|
+
|
|
114
|
+
// src/constants.ts
|
|
115
|
+
var VERSION = version;
|
|
116
|
+
|
|
117
|
+
// src/utils/cli-logger.ts
|
|
118
|
+
var getTimestamp = () => {
|
|
119
|
+
const now = /* @__PURE__ */ new Date();
|
|
120
|
+
return now.toLocaleTimeString("en-US", { hour12: false });
|
|
121
|
+
};
|
|
122
|
+
var formatMessage = (tag, message, tagColor) => {
|
|
123
|
+
return `${import_picocolors.default.dim(getTimestamp())} ${tagColor(`[${tag}]`)} ${message}`;
|
|
124
|
+
};
|
|
125
|
+
var logger = {
|
|
126
|
+
welcome: () => {
|
|
127
|
+
console.log();
|
|
128
|
+
console.log(import_picocolors.default.magenta(import_picocolors.default.bold("\u{1F680} EventCatalog")) + import_picocolors.default.dim(` (v${VERSION})`));
|
|
129
|
+
console.log(import_picocolors.default.dim("https://eventcatalog.dev"));
|
|
130
|
+
console.log();
|
|
131
|
+
console.log(
|
|
132
|
+
import_picocolors.default.dim("If you like the project, we would appreciate a star on GitHub \u2764\uFE0F - ") + import_picocolors.default.bold("https://github.com/event-catalog/eventcatalog/stargazers")
|
|
133
|
+
);
|
|
134
|
+
console.log();
|
|
135
|
+
},
|
|
136
|
+
info: (message, tag = "info") => {
|
|
137
|
+
console.log(formatMessage(tag, message, import_picocolors.default.blue));
|
|
138
|
+
},
|
|
139
|
+
success: (message, tag = "success") => {
|
|
140
|
+
console.log(formatMessage(tag, message, import_picocolors.default.green));
|
|
141
|
+
},
|
|
142
|
+
error: (message, tag = "error") => {
|
|
143
|
+
console.log(formatMessage(tag, message, import_picocolors.default.red));
|
|
144
|
+
},
|
|
145
|
+
warning: (message, tag = "warn") => {
|
|
146
|
+
console.log(formatMessage(tag, message, import_picocolors.default.yellow));
|
|
147
|
+
},
|
|
148
|
+
dim: (message) => {
|
|
149
|
+
console.log(import_picocolors.default.dim(message));
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
108
153
|
// src/generate.js
|
|
109
154
|
function getDefaultExport(importedModule) {
|
|
110
155
|
if (importedModule === null || typeof importedModule !== "object") {
|
|
@@ -123,7 +168,7 @@ var generate = async (PROJECT_DIRECTORY) => {
|
|
|
123
168
|
const config = await getEventCatalogConfigFile(PROJECT_DIRECTORY);
|
|
124
169
|
const { generators = [] } = config;
|
|
125
170
|
if (!generators.length) {
|
|
126
|
-
|
|
171
|
+
logger.info("No configured generators found, skipping generation", "generator");
|
|
127
172
|
return;
|
|
128
173
|
}
|
|
129
174
|
for (const generator of generators) {
|
|
@@ -140,7 +185,8 @@ var generate = async (PROJECT_DIRECTORY) => {
|
|
|
140
185
|
const generator2 = getDefaultExport(importedGenerator);
|
|
141
186
|
await generator2({ eventCatalogConfig: {} }, pluginConfig);
|
|
142
187
|
} catch (error) {
|
|
143
|
-
|
|
188
|
+
logger.error("Error loading plugin:", "generator");
|
|
189
|
+
console.error(error);
|
|
144
190
|
await cleanup(PROJECT_DIRECTORY);
|
|
145
191
|
return;
|
|
146
192
|
}
|
|
@@ -155,14 +201,6 @@ var generate = async (PROJECT_DIRECTORY) => {
|
|
|
155
201
|
// src/analytics/analytics.js
|
|
156
202
|
var import_axios = __toESM(require("axios"), 1);
|
|
157
203
|
var import_os = __toESM(require("os"), 1);
|
|
158
|
-
|
|
159
|
-
// package.json
|
|
160
|
-
var version = "3.0.0-beta.2";
|
|
161
|
-
|
|
162
|
-
// src/constants.ts
|
|
163
|
-
var VERSION = version;
|
|
164
|
-
|
|
165
|
-
// src/analytics/analytics.js
|
|
166
204
|
async function raiseEvent(eventData) {
|
|
167
205
|
const url = "https://queue.simpleanalyticscdn.com/events";
|
|
168
206
|
const userAgent = `@eventcatalog/eventcatalog@${VERSION} (${import_os.default.platform()}; ${import_os.default.arch()}; Node/${process.version})`;
|
|
@@ -509,11 +547,6 @@ var isOutputServer = async () => {
|
|
|
509
547
|
const config = await getEventCatalogConfigFile(process.env.PROJECT_DIR || "");
|
|
510
548
|
return config?.output === "server";
|
|
511
549
|
};
|
|
512
|
-
var isAuthEnabled = async () => {
|
|
513
|
-
const directory = process.env.PROJECT_DIR || process.cwd();
|
|
514
|
-
const hasAuthConfig = import_node_fs4.default.existsSync((0, import_node_path5.join)(directory, "eventcatalog.auth.js"));
|
|
515
|
-
return hasAuthConfig;
|
|
516
|
-
};
|
|
517
550
|
|
|
518
551
|
// src/eventcatalog.ts
|
|
519
552
|
var import_update_notifier = __toESM(require("update-notifier"), 1);
|
|
@@ -664,47 +697,31 @@ var copyCore = () => {
|
|
|
664
697
|
}
|
|
665
698
|
});
|
|
666
699
|
};
|
|
667
|
-
var copyServerFiles = async () => {
|
|
668
|
-
const isServerOutput = await isOutputServer();
|
|
669
|
-
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/server"))) {
|
|
670
|
-
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/server"), { recursive: true });
|
|
671
|
-
}
|
|
672
|
-
if (!isServerOutput) {
|
|
673
|
-
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"))) {
|
|
674
|
-
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/chat.ts"));
|
|
675
|
-
}
|
|
676
|
-
if (import_fs2.default.existsSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"))) {
|
|
677
|
-
import_fs2.default.rmSync((0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"));
|
|
678
|
-
}
|
|
679
|
-
return;
|
|
680
|
-
}
|
|
681
|
-
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"), {
|
|
682
|
-
recursive: true
|
|
683
|
-
});
|
|
684
|
-
};
|
|
685
|
-
var createAuthFileIfNotExists = async (hasRequiredLicense) => {
|
|
686
|
-
const authEnabled = await isAuthEnabled();
|
|
687
|
-
const isSRR = await isOutputServer();
|
|
688
|
-
try {
|
|
689
|
-
if (authEnabled && hasRequiredLicense && isSRR) {
|
|
690
|
-
console.log("Creating auth file");
|
|
691
|
-
import_fs2.default.writeFileSync(
|
|
692
|
-
(0, import_node_path7.join)(core, "src/pages/api/[...auth].ts"),
|
|
693
|
-
`import { AstroAuth } from 'auth-astro/server';
|
|
694
|
-
export const prerender = false;
|
|
695
|
-
export const { GET, POST } = AstroAuth();
|
|
696
|
-
`
|
|
697
|
-
);
|
|
698
|
-
}
|
|
699
|
-
} catch (error) {
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
700
|
var clearCore = () => {
|
|
703
701
|
if (import_fs2.default.existsSync(core)) import_fs2.default.rmSync(core, { recursive: true });
|
|
704
702
|
};
|
|
705
703
|
var checkForUpdate = () => {
|
|
706
704
|
const installedVersion = getInstalledEventCatalogVersion();
|
|
707
705
|
if (!installedVersion) return;
|
|
706
|
+
const majorVersion = parseInt(installedVersion.replace(/[^0-9.]/g, "").split(".")[0], 10);
|
|
707
|
+
if (majorVersion < 3) {
|
|
708
|
+
const v3Message = `\u{1F680} EventCatalog V3 is now available in beta!
|
|
709
|
+
|
|
710
|
+
You are currently on version ${installedVersion}.
|
|
711
|
+
V3 brings exciting new features and improvements.
|
|
712
|
+
|
|
713
|
+
Upgrade now: npm i @eventcatalog/core@beta`;
|
|
714
|
+
console.log(
|
|
715
|
+
(0, import_boxen.default)(v3Message, {
|
|
716
|
+
padding: 1,
|
|
717
|
+
margin: 1,
|
|
718
|
+
align: "center",
|
|
719
|
+
borderColor: "magenta",
|
|
720
|
+
borderStyle: "round"
|
|
721
|
+
})
|
|
722
|
+
);
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
708
725
|
const pkg = { name: "@eventcatalog/core", version: installedVersion };
|
|
709
726
|
const notifier = (0, import_update_notifier.default)({ pkg, updateCheckInterval: 0 });
|
|
710
727
|
if (notifier.update) {
|
|
@@ -731,14 +748,17 @@ Run npm i @eventcatalog/core to update`;
|
|
|
731
748
|
}
|
|
732
749
|
};
|
|
733
750
|
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) => {
|
|
734
|
-
|
|
751
|
+
logger.welcome();
|
|
752
|
+
logger.info("Setting up EventCatalog...", "eventcatalog");
|
|
753
|
+
const isServer = await isOutputServer();
|
|
754
|
+
logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
|
|
735
755
|
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
736
756
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
737
757
|
}
|
|
738
758
|
if (options.debug) {
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
759
|
+
logger.info("Debug mode enabled", "debug");
|
|
760
|
+
logger.info(`PROJECT_DIR: ${dir}`, "debug");
|
|
761
|
+
logger.info(`CATALOG_DIR: ${core}`, "debug");
|
|
742
762
|
}
|
|
743
763
|
if (options.forceRecreate) clearCore();
|
|
744
764
|
copyCore();
|
|
@@ -746,14 +766,12 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
746
766
|
await checkAndConvertMdToMdx(dir, core);
|
|
747
767
|
await runMigrations(dir);
|
|
748
768
|
await catalogToAstro(dir, core);
|
|
749
|
-
await copyServerFiles();
|
|
750
769
|
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
751
770
|
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
752
771
|
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
753
772
|
);
|
|
754
773
|
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
755
774
|
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
756
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
757
775
|
checkForUpdate();
|
|
758
776
|
let watchUnsub;
|
|
759
777
|
try {
|
|
@@ -786,20 +804,21 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
786
804
|
}
|
|
787
805
|
});
|
|
788
806
|
program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
|
|
789
|
-
|
|
807
|
+
logger.welcome();
|
|
808
|
+
logger.info("Building EventCatalog...", "build");
|
|
809
|
+
const isServer = await isOutputServer();
|
|
810
|
+
logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
|
|
790
811
|
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
791
812
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
792
813
|
}
|
|
793
814
|
copyCore();
|
|
794
|
-
await
|
|
795
|
-
const canEmbedPages = await (0, import_license.isFeatureEnabled)(
|
|
815
|
+
const isBackstagePluginEnabled = await (0, import_license.isFeatureEnabled)(
|
|
796
816
|
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
797
817
|
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
798
818
|
);
|
|
799
819
|
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
800
820
|
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
801
|
-
const
|
|
802
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
821
|
+
const canEmbedPages = isBackstagePluginEnabled || isEventCatalogScale;
|
|
803
822
|
await log_build_default(dir, {
|
|
804
823
|
isEventCatalogStarterEnabled: isEventCatalogStarter,
|
|
805
824
|
isEventCatalogScaleEnabled: isEventCatalogScale,
|
|
@@ -850,7 +869,8 @@ var startServerCatalog = ({
|
|
|
850
869
|
);
|
|
851
870
|
};
|
|
852
871
|
program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
853
|
-
|
|
872
|
+
logger.welcome();
|
|
873
|
+
logger.info("Starting preview of your build...", "preview");
|
|
854
874
|
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
855
875
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
856
876
|
}
|
|
@@ -860,12 +880,11 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
860
880
|
);
|
|
861
881
|
const isEventCatalogStarter = await (0, import_license.isEventCatalogStarterEnabled)();
|
|
862
882
|
const isEventCatalogScale = await (0, import_license.isEventCatalogScaleEnabled)();
|
|
863
|
-
await copyServerFiles();
|
|
864
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
865
883
|
previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
|
|
866
884
|
});
|
|
867
885
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
868
|
-
|
|
886
|
+
logger.welcome();
|
|
887
|
+
logger.info("Starting preview of your build...", "preview");
|
|
869
888
|
if (import_fs2.default.existsSync(import_node_path8.default.join(dir, ".env"))) {
|
|
870
889
|
import_dotenv.default.config({ path: import_node_path8.default.join(dir, ".env") });
|
|
871
890
|
}
|
|
@@ -44,6 +44,9 @@ type PagesConfiguration = {
|
|
|
44
44
|
icon?: string;
|
|
45
45
|
pages?: string[];
|
|
46
46
|
};
|
|
47
|
+
type AuthConfig = {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
};
|
|
47
50
|
interface Config {
|
|
48
51
|
title: string;
|
|
49
52
|
tagline: false;
|
|
@@ -57,6 +60,7 @@ interface Config {
|
|
|
57
60
|
host?: string;
|
|
58
61
|
trailingSlash?: boolean;
|
|
59
62
|
output?: 'server' | 'static';
|
|
63
|
+
auth?: AuthConfig;
|
|
60
64
|
rss?: {
|
|
61
65
|
enabled: boolean;
|
|
62
66
|
limit: number;
|
|
@@ -44,6 +44,9 @@ type PagesConfiguration = {
|
|
|
44
44
|
icon?: string;
|
|
45
45
|
pages?: string[];
|
|
46
46
|
};
|
|
47
|
+
type AuthConfig = {
|
|
48
|
+
enabled: boolean;
|
|
49
|
+
};
|
|
47
50
|
interface Config {
|
|
48
51
|
title: string;
|
|
49
52
|
tagline: false;
|
|
@@ -57,6 +60,7 @@ interface Config {
|
|
|
57
60
|
host?: string;
|
|
58
61
|
trailingSlash?: boolean;
|
|
59
62
|
output?: 'server' | 'static';
|
|
63
|
+
auth?: AuthConfig;
|
|
60
64
|
rss?: {
|
|
61
65
|
enabled: boolean;
|
|
62
66
|
limit: number;
|
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-IZGKMOOO.js";
|
|
10
|
+
import "./chunk-7ANM33NO.js";
|
|
11
11
|
import {
|
|
12
12
|
runMigrations
|
|
13
13
|
} from "./chunk-BH3JMNAV.js";
|
|
@@ -18,15 +18,17 @@ import {
|
|
|
18
18
|
} from "./chunk-R2BJ7MJG.js";
|
|
19
19
|
import "./chunk-55D645EH.js";
|
|
20
20
|
import {
|
|
21
|
-
VERSION
|
|
22
|
-
} from "./chunk-H4QHE5YZ.js";
|
|
23
|
-
import {
|
|
24
|
-
isAuthEnabled,
|
|
25
21
|
isOutputServer
|
|
26
22
|
} from "./chunk-5VBIXL6C.js";
|
|
27
23
|
import {
|
|
28
24
|
generate
|
|
29
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-VDAAJC4X.js";
|
|
26
|
+
import {
|
|
27
|
+
logger
|
|
28
|
+
} from "./chunk-SUPFYBDY.js";
|
|
29
|
+
import {
|
|
30
|
+
VERSION
|
|
31
|
+
} from "./chunk-BLIEWBVS.js";
|
|
30
32
|
import "./chunk-UPONRQSN.js";
|
|
31
33
|
|
|
32
34
|
// src/eventcatalog.ts
|
|
@@ -73,47 +75,31 @@ var copyCore = () => {
|
|
|
73
75
|
}
|
|
74
76
|
});
|
|
75
77
|
};
|
|
76
|
-
var copyServerFiles = async () => {
|
|
77
|
-
const isServerOutput = await isOutputServer();
|
|
78
|
-
if (fs.existsSync(join(core, "src/pages/api/server"))) {
|
|
79
|
-
fs.rmSync(join(core, "src/pages/api/server"), { recursive: true });
|
|
80
|
-
}
|
|
81
|
-
if (!isServerOutput) {
|
|
82
|
-
if (fs.existsSync(join(core, "src/pages/api/chat.ts"))) {
|
|
83
|
-
fs.rmSync(join(core, "src/pages/api/chat.ts"));
|
|
84
|
-
}
|
|
85
|
-
if (fs.existsSync(join(core, "src/pages/api/[...auth].ts"))) {
|
|
86
|
-
fs.rmSync(join(core, "src/pages/api/[...auth].ts"));
|
|
87
|
-
}
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
fs.cpSync(join(eventCatalogDir, "src/enterprise/eventcatalog-chat/pages/api"), join(core, "src/pages/api"), {
|
|
91
|
-
recursive: true
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
var createAuthFileIfNotExists = async (hasRequiredLicense) => {
|
|
95
|
-
const authEnabled = await isAuthEnabled();
|
|
96
|
-
const isSRR = await isOutputServer();
|
|
97
|
-
try {
|
|
98
|
-
if (authEnabled && hasRequiredLicense && isSRR) {
|
|
99
|
-
console.log("Creating auth file");
|
|
100
|
-
fs.writeFileSync(
|
|
101
|
-
join(core, "src/pages/api/[...auth].ts"),
|
|
102
|
-
`import { AstroAuth } from 'auth-astro/server';
|
|
103
|
-
export const prerender = false;
|
|
104
|
-
export const { GET, POST } = AstroAuth();
|
|
105
|
-
`
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
} catch (error) {
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
78
|
var clearCore = () => {
|
|
112
79
|
if (fs.existsSync(core)) fs.rmSync(core, { recursive: true });
|
|
113
80
|
};
|
|
114
81
|
var checkForUpdate = () => {
|
|
115
82
|
const installedVersion = getInstalledEventCatalogVersion();
|
|
116
83
|
if (!installedVersion) return;
|
|
84
|
+
const majorVersion = parseInt(installedVersion.replace(/[^0-9.]/g, "").split(".")[0], 10);
|
|
85
|
+
if (majorVersion < 3) {
|
|
86
|
+
const v3Message = `\u{1F680} EventCatalog V3 is now available in beta!
|
|
87
|
+
|
|
88
|
+
You are currently on version ${installedVersion}.
|
|
89
|
+
V3 brings exciting new features and improvements.
|
|
90
|
+
|
|
91
|
+
Upgrade now: npm i @eventcatalog/core@beta`;
|
|
92
|
+
console.log(
|
|
93
|
+
boxen(v3Message, {
|
|
94
|
+
padding: 1,
|
|
95
|
+
margin: 1,
|
|
96
|
+
align: "center",
|
|
97
|
+
borderColor: "magenta",
|
|
98
|
+
borderStyle: "round"
|
|
99
|
+
})
|
|
100
|
+
);
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
117
103
|
const pkg = { name: "@eventcatalog/core", version: installedVersion };
|
|
118
104
|
const notifier = updateNotifier({ pkg, updateCheckInterval: 0 });
|
|
119
105
|
if (notifier.update) {
|
|
@@ -140,14 +126,17 @@ Run npm i @eventcatalog/core to update`;
|
|
|
140
126
|
}
|
|
141
127
|
};
|
|
142
128
|
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) => {
|
|
143
|
-
|
|
129
|
+
logger.welcome();
|
|
130
|
+
logger.info("Setting up EventCatalog...", "eventcatalog");
|
|
131
|
+
const isServer = await isOutputServer();
|
|
132
|
+
logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
|
|
144
133
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
145
134
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
146
135
|
}
|
|
147
136
|
if (options.debug) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
137
|
+
logger.info("Debug mode enabled", "debug");
|
|
138
|
+
logger.info(`PROJECT_DIR: ${dir}`, "debug");
|
|
139
|
+
logger.info(`CATALOG_DIR: ${core}`, "debug");
|
|
151
140
|
}
|
|
152
141
|
if (options.forceRecreate) clearCore();
|
|
153
142
|
copyCore();
|
|
@@ -155,14 +144,12 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
155
144
|
await checkAndConvertMdToMdx(dir, core);
|
|
156
145
|
await runMigrations(dir);
|
|
157
146
|
await catalogToAstro(dir, core);
|
|
158
|
-
await copyServerFiles();
|
|
159
147
|
const canEmbedPages = await isFeatureEnabled(
|
|
160
148
|
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
161
149
|
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
162
150
|
);
|
|
163
151
|
const isEventCatalogStarter = await isEventCatalogStarterEnabled();
|
|
164
152
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
165
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
166
153
|
checkForUpdate();
|
|
167
154
|
let watchUnsub;
|
|
168
155
|
try {
|
|
@@ -195,20 +182,21 @@ program.command("dev").description("Run development server of EventCatalog").opt
|
|
|
195
182
|
}
|
|
196
183
|
});
|
|
197
184
|
program.command("build").description("Run build of EventCatalog").action(async (options, command) => {
|
|
198
|
-
|
|
185
|
+
logger.welcome();
|
|
186
|
+
logger.info("Building EventCatalog...", "build");
|
|
187
|
+
const isServer = await isOutputServer();
|
|
188
|
+
logger.info(isServer ? "EventCatalog is running in Server Mode" : "EventCatalog is running in Static Mode", "config");
|
|
199
189
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
200
190
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
201
191
|
}
|
|
202
192
|
copyCore();
|
|
203
|
-
await
|
|
204
|
-
const canEmbedPages = await isFeatureEnabled(
|
|
193
|
+
const isBackstagePluginEnabled = await isFeatureEnabled(
|
|
205
194
|
"@eventcatalog/backstage-plugin-eventcatalog",
|
|
206
195
|
process.env.EVENTCATALOG_LICENSE_KEY_BACKSTAGE
|
|
207
196
|
);
|
|
208
197
|
const isEventCatalogStarter = await isEventCatalogStarterEnabled();
|
|
209
198
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
210
|
-
const
|
|
211
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
199
|
+
const canEmbedPages = isBackstagePluginEnabled || isEventCatalogScale;
|
|
212
200
|
await log_build_default(dir, {
|
|
213
201
|
isEventCatalogStarterEnabled: isEventCatalogStarter,
|
|
214
202
|
isEventCatalogScaleEnabled: isEventCatalogScale,
|
|
@@ -259,7 +247,8 @@ var startServerCatalog = ({
|
|
|
259
247
|
);
|
|
260
248
|
};
|
|
261
249
|
program.command("preview").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
262
|
-
|
|
250
|
+
logger.welcome();
|
|
251
|
+
logger.info("Starting preview of your build...", "preview");
|
|
263
252
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
264
253
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
265
254
|
}
|
|
@@ -269,12 +258,11 @@ program.command("preview").description("Serves the contents of your eventcatalog
|
|
|
269
258
|
);
|
|
270
259
|
const isEventCatalogStarter = await isEventCatalogStarterEnabled();
|
|
271
260
|
const isEventCatalogScale = await isEventCatalogScaleEnabled();
|
|
272
|
-
await copyServerFiles();
|
|
273
|
-
await createAuthFileIfNotExists(isEventCatalogScale);
|
|
274
261
|
previewCatalog({ command, canEmbedPages: canEmbedPages || isEventCatalogScale, isEventCatalogStarter, isEventCatalogScale });
|
|
275
262
|
});
|
|
276
263
|
program.command("start").description("Serves the contents of your eventcatalog build directory").action(async (options, command) => {
|
|
277
|
-
|
|
264
|
+
logger.welcome();
|
|
265
|
+
logger.info("Starting preview of your build...", "preview");
|
|
278
266
|
if (fs.existsSync(path.join(dir, ".env"))) {
|
|
279
267
|
dotenv.config({ path: path.join(dir, ".env") });
|
|
280
268
|
}
|